/* Restless Seas Online: dark pirate-sea theme. */
:root {
	--bg: #08141c;
	--bg-2: #0d1f2b;
	--panel: #11293a;
	--panel-2: #17364b;
	--line: #25506b;
	--text: #e8f1f5;
	--muted: #96b1bf;
	--gold: #f2c25b;
	--gold-2: #c98f2a;
	--sea: #2fb4d6;
	--red: #e5584d;
	--ok: #5ccb8a;
	--radius: 14px;
	--shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: "Prompt", "Kanit", system-ui, -apple-system, "Segoe UI", sans-serif;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--sea); }
h1, h2, h3 { font-family: "Kanit", "Prompt", system-ui, sans-serif; line-height: 1.2; margin: 0; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.top {
	position: sticky; top: 0; z-index: 30;
	background: rgba(8, 20, 28, .86);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(37, 80, 107, .6);
}
.top .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: "Kanit", sans-serif; font-weight: 700; letter-spacing: .5px; }
.brand img { height: 40px; width: auto; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--text); }
.tools { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button { background: transparent; border: 0; color: var(--muted); padding: 5px 11px; font: inherit; font-size: .82rem; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--panel-2); color: var(--gold); }

/* ---------- buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 22px; border-radius: 10px; border: 1px solid var(--line);
	background: var(--panel); color: var(--text); font: 600 1rem "Prompt", sans-serif;
	text-decoration: none; cursor: pointer; transition: transform .12s, background .12s, border-color .12s;
}
.btn:hover { background: var(--panel-2); border-color: var(--sea); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-off { opacity: .5; cursor: not-allowed; }
.btn-gold { background: linear-gradient(180deg, #f6cf74, var(--gold-2)); color: #2a1a02; border-color: #f6cf74; box-shadow: 0 6px 18px rgba(201, 143, 42, .35); }
.btn-gold:hover { background: linear-gradient(180deg, #ffdc8a, #d79b30); border-color: #ffdc8a; }
.btn-lg { padding: 15px 30px; font-size: 1.15rem; border-radius: 12px; }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.btn-block { width: 100%; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
	content: ""; position: absolute; inset: 0;
	background: url("img/hero-bg.jpg") 32% center / cover no-repeat;
	filter: saturate(.9) brightness(.6);
	transform: scale(1.04);
}
.hero::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(8, 20, 28, .35) 0%, rgba(8, 20, 28, .65) 60%, var(--bg) 100%);
}
.hero .wrap { position: relative; z-index: 1; padding: 64px 0 84px; text-align: center; }
.hero .logo { width: min(480px, 78vw); margin: 0 auto 8px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .6)); }
.hero p.lead { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: #cfe3ec; max-width: 640px; margin: 10px auto 28px; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.hero small { display: block; margin-top: 16px; color: var(--muted); }
.resume { margin: 0 auto 18px; display: none; }
.resume.on { display: inline-flex; }

/* ---------- sections ---------- */
section { padding: 72px 0; }
section h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); text-align: center; margin-bottom: 10px; }
section h2::after { content: ""; display: block; width: 64px; height: 3px; background: var(--gold); margin: 12px auto 0; border-radius: 2px; }
.sub { text-align: center; color: var(--muted); max-width: 640px; margin: 14px auto 36px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { font-size: 1.15rem; color: var(--gold); margin-bottom: 8px; }
.card p { margin: 0; color: #c3d6df; font-size: .96rem; }
.card .ico { font-size: 1.8rem; margin-bottom: 8px; }

/* feature cards: a game picture on top, kicker tag, title, text */
.feats { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.feat {
	background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
	display: flex; flex-direction: column; transition: transform .18s, border-color .18s, box-shadow .18s;
}
.feat:hover { transform: translateY(-4px); border-color: var(--gold-2); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }
.feat .pic { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.feat .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.feat:hover .pic img { transform: scale(1.06); }
.feat .pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(17, 41, 58, .9) 100%); }
.feat .tag {
	position: absolute; left: 12px; top: 12px; z-index: 1; padding: 3px 11px; border-radius: 999px;
	background: linear-gradient(180deg, #f6cf74, var(--gold-2)); color: #2a1a02; font: 700 .82rem "Kanit", sans-serif;
	box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
}
.feat .body { padding: 6px 20px 22px; }
.feat h3 { font-size: 1.22rem; color: var(--gold); margin-bottom: 8px; }
.feat p { margin: 0; color: #c3d6df; font-size: .95rem; }
.extras {
	list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.extras li {
	display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px;
	background: var(--bg-2); border: 1px solid var(--line); color: #c3d6df; font-size: .92rem;
}
.extras b { flex: none; min-width: 40px; text-align: center; color: var(--gold); font: 700 1.1rem "Kanit", sans-serif; }

.shots { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.shots figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.shots img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.shots figcaption { padding: 10px 14px; color: var(--muted); font-size: .9rem; }

.dl { background: var(--bg-2); border-block: 1px solid var(--line); }
.dl .box { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; align-items: stretch; }
.dl .card h3 { font-size: 1.3rem; }
.dl ul { margin: 12px 0 18px; padding-left: 20px; color: #c3d6df; }
.dl .meta { color: var(--muted); font-size: .88rem; margin-top: 10px; }
.note { font-size: .88rem; color: var(--muted); }

footer { padding: 34px 0 48px; color: var(--muted); font-size: .88rem; text-align: center; border-top: 1px solid var(--line); }

/* ---------- auth dialog ---------- */
dialog.auth {
	padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--panel);
	color: var(--text); width: min(420px, calc(100% - 24px)); box-shadow: var(--shadow);
}
dialog.auth::backdrop { background: rgba(2, 8, 12, .72); backdrop-filter: blur(3px); }
.auth-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.auth-head h2 { font-size: 1.35rem; }
.auth-head h2::after { display: none; }
.x { background: none; border: 0; color: var(--muted); font-size: 1.6rem; cursor: pointer; line-height: 1; padding: 4px 8px; }
.x:hover { color: var(--text); }
.tabs { display: flex; margin: 14px 20px 0; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: 0; color: var(--muted); padding: 10px; font: 600 1rem "Prompt", sans-serif; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--gold); }
.auth form { padding: 18px 20px 6px; display: grid; gap: 12px; }
.auth form[hidden] { display: none; }
.auth label { display: grid; gap: 4px; font-size: .88rem; color: var(--muted); }
.auth input[type="text"], .auth input[type="password"] {
	width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line);
	background: #0a1a25; color: var(--text); font: 1rem "Prompt", sans-serif;
}
.auth input:focus { outline: 2px solid var(--sea); outline-offset: 1px; }
.auth .check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }
.auth .hint { font-size: .8rem; color: var(--muted); margin-top: -4px; }
.msg { min-height: 1.3em; font-size: .9rem; color: var(--red); }
.msg.ok { color: var(--ok); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; padding: 6px 20px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.alt { padding: 0 20px 20px; display: grid; gap: 10px; }
.gbtn { min-height: 44px; display: flex; justify-content: center; }
.gbtn:empty { display: none; }
.alt [hidden] { display: none; }
.linkbox { display: grid; gap: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: #0d2231; }
.linkbox h3 { font-size: 1rem; color: var(--gold); }
.linkbox .hint { margin-top: 0; line-height: 1.5; }
.linkbox .hint b { color: var(--text); font-weight: 600; }
.linkish { justify-self: center; background: none; border: 0; padding: 2px 4px; color: var(--muted); font: .85rem "Prompt", sans-serif; text-decoration: underline; cursor: pointer; }
.linkish:hover { color: var(--gold); }
.gfallback { display: none; }
.gfallback.on { display: inline-flex; }
.busy { opacity: .6; pointer-events: none; }

@media (max-width: 860px) {
	.nav { display: none; }
	.top .wrap { gap: 10px; }
	.tools { margin-left: auto; }
	.dl .box { grid-template-columns: 1fr; }
	section { padding: 52px 0; }
	.hero .wrap { padding: 44px 0 60px; }
}
@media (max-width: 520px) {
	.brand span { display: none; }
	.btn-sm { white-space: nowrap; }
	.btn-lg { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.btn, .feat, .feat .pic img { transition: none; }
}
