/* gokhOZ — Zümrüt Şehir gece çarşısı.
   Gece moru zemin, antik altın vurgular, zümrüt yalnızca "oyna" anları için.
   Sarı tuğla yol bölümleri birbirine bağlayan tek süs. */
:root {
  --night: #120a1f;
  --night-2: #1a1029;
  --velvet: #22163a;
  --line: #34264d;
  --lavender: #c9a7f2;
  --gold: #d9a441;
  --gold-hi: #f2cf7a;
  --bronze: #a8702a;
  --emerald: #3fb37a;
  --emerald-hi: #6fe0a6;
  --brick: #e8c547;
  --fg: #f1eaf9;
  --muted: #a898bf;

  --display: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
  --ui: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --mono: "DM Mono", "Consolas", monospace;

  --radius: 14px;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgb(63 179 122 / .10), transparent 60%),
    radial-gradient(900px 500px at 0% 20%, rgb(201 167 242 / .07), transparent 60%),
    var(--night);
  color: var(--fg);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
}
/* ince film greni */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1240px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgb(18 10 31 / .82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 28px; padding-block: 12px; }
.brand { display: block; flex: none; }
.brand img { height: 42px; width: auto; }
.nav { display: flex; gap: 22px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--night-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; min-width: 0; width: 240px;
}
.search i { flex: none; color: var(--muted); font-size: 17px; }
.search input {
  all: unset; font: inherit; font-size: 14.5px; color: var(--fg); width: 100%; min-width: 0;
}
.search input::placeholder { color: var(--muted); }
@media (max-width: 820px) {
  .nav { display: none; }
  .brand img { height: 34px; }
  .search { width: auto; flex: 1; }
}
@media (max-width: 560px) {
  .site-head .search { display: none; }
  .site-head .account { margin-left: auto; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 16px/1 var(--ui); text-decoration: none; cursor: pointer;
  border-radius: 999px; padding: 14px 24px; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
}
.btn:active { transform: translateY(1px); }
.btn-play {
  background: linear-gradient(180deg, var(--emerald-hi), var(--emerald));
  color: #062214;
  box-shadow: 0 0 0 1px rgb(111 224 166 / .35), 0 10px 30px -10px rgb(63 179 122 / .7);
}
.btn-play:hover { box-shadow: 0 0 0 1px rgb(111 224 166 / .6), 0 14px 40px -10px rgb(63 179 122 / .9); }
.btn-ghost { border-color: var(--line); color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn-sm { padding: 9px 16px; font-size: 14px; }

/* ---------- eyebrow / headings ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold);
}
h1, h2, h3 { text-wrap: balance; }
.display {
  font-family: var(--display); font-weight: 300; line-height: .95; margin: 0;
}
.display em { font-style: italic; color: var(--gold-hi); font-weight: 500; }

/* ---------- sarı tuğla yol ---------- */
.brick-road {
  height: 14px; margin-block: 8px;
  background:
    repeating-linear-gradient(90deg, var(--brick) 0 38px, transparent 38px 42px) 0 0 / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--brick) 0 18px, transparent 18px 22px, var(--brick) 22px 38px, transparent 38px 42px) 0 8px / 100% 6px no-repeat;
  opacity: .5;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

/* ---------- game cards ---------- */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s, box-shadow .25s;
}
a.card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 18px 40px -20px rgb(217 164 65 / .5); }
.card .thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.card .meta { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 24px; line-height: 1.05; margin: 0; }
.card p { margin: 0; font-size: 14px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  border: 1px solid var(--line); color: var(--muted); padding: 2px 8px; border-radius: 999px;
}
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
}
.badge.live { background: var(--emerald); color: #062214; }
.badge.soon { background: rgb(18 10 31 / .8); color: var(--muted); border: 1px solid var(--line); }
.card.soon { opacity: .72; }
.card.soon .thumb { filter: saturate(.6); }
.card .play-hint {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
  background: rgb(18 10 31 / .45); opacity: 0; transition: opacity .25s;
}
.card .play-hint span {
  font-size: 28px; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--emerald); color: #062214; box-shadow: 0 0 0 6px rgb(63 179 122 / .25);
}
a.card:hover .play-hint, a.card:focus-visible .play-hint { opacity: 1; }

/* Mali Bird kapak: oyunun kendi gece arenası + yüz */
.thumb.mali {
  background:
    radial-gradient(120% 90% at 50% 0%, #3a1d6e 0%, #1b1036 50%, #0d0820 100%);
}
.thumb.mali::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgb(255 201 60 / .9) 0 3px, transparent 4px);
  background-size: 46px 46px; background-position: 12px 18px; opacity: .25;
}
.thumb.mali img { position: absolute; width: 58%; left: 50%; top: 46%; transform: translate(-50%, -50%) rotate(-6deg); z-index: 1; filter: drop-shadow(0 10px 18px rgb(0 0 0 / .5)); }
.thumb.mali .t {
  position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; z-index: 1;
  font: 800 30px/1 "Baloo 2", var(--ui); color: #ffc93c; letter-spacing: .02em;
  text-shadow: 0 3px 0 #1e161c, 0 0 18px rgb(255 201 60 / .4);
}
/* yakında kapakları: tek renk amblem */
.thumb.emblem { display: grid; place-items: center; background: var(--velvet); }
.thumb.emblem i { font-size: 64px; color: var(--gold); opacity: .8; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); margin-top: 96px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; padding-block: 28px 40px; color: var(--muted); font-size: 14px; }
.site-foot img { height: 28px; width: auto; opacity: .9; }
.site-foot .spacer { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- account (header) ---------- */
.account { position: relative; flex: none; }
.acct {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 600 14.5px/1 var(--ui); color: var(--fg);
  background: var(--night-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 5px;
}
.acct:hover { border-color: var(--gold); }
.acct-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(160deg, var(--gold-hi), var(--bronze)); color: var(--night);
  font: 700 14px/1 var(--ui);
}
.avatar.sm { width: 24px; height: 24px; font-size: 12px; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 200px;
  background: var(--velvet); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / .7);
  display: flex; flex-direction: column;
}
.acct-menu a, .acct-menu button {
  all: unset; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  font: 500 14.5px/1.2 var(--ui); color: var(--fg); cursor: pointer;
}
.acct-menu a:hover, .acct-menu button:hover, .acct-menu a:focus-visible, .acct-menu button:focus-visible { background: var(--night-2); }
.acct-menu i { font-size: 18px; color: var(--muted); }
@media (max-width: 820px) { .acct-name { display: none; } .acct { padding-right: 8px; } }

.muted { color: var(--muted); }

/* ---------- leaderboard list ---------- */
.lb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.lb li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; }
.lb li:nth-child(-n+3) .rk { color: var(--gold-hi); font-weight: 600; }
.lb li.me { background: rgb(63 179 122 / .12); box-shadow: inset 0 0 0 1px rgb(63 179 122 / .35); }
.lb .rk { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.lb .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .sc { font-family: var(--mono); font-size: 14px; }
.board-empty { color: var(--muted); margin: 0; padding: 8px 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 70; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  max-width: min(560px, calc(100vw - 32px));
  background: var(--velvet); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / .8); font-size: 15px;
}
.toast a { color: var(--gold-hi); }

/* ---------- loading skeleton ---------- */
.board-skel { display: flex; flex-direction: column; gap: 8px; }
.board-skel span { height: 28px; border-radius: 10px; background: linear-gradient(90deg, var(--velvet), var(--line), var(--velvet)); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .board-skel span { animation: shimmer 1.4s linear infinite; } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- game page: ways into the rooms (added by game-host.js) ---------- */
/* "play with friends" sits under the play cover; hidden together with it */
.friends-btn {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%);
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font: 600 15px/1 var(--ui); color: var(--fg); cursor: pointer;
  background: rgb(18 10 31 / .75); border: 1px solid rgb(217 164 65 / .55); border-radius: 999px; padding: 12px 18px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.friends-btn:hover { border-color: var(--gold-hi); }
.friends-btn i { font-size: 18px; color: var(--gold-hi); }
.cover[hidden] ~ .friends-btn, body.in-room .friends-btn { display: none; }
.friends-btn .count, .rooms-btn .count { font: 500 12px/1 var(--mono); color: var(--night); background: var(--emerald); border-radius: 999px; padding: 3px 7px; }
.friends-btn .count:empty, .rooms-btn .count:empty { display: none; }
/* the rooms panel briefly glows when a button brings you to it */
.panel.flash { animation: panel-flash 1.4s ease-out; }
@keyframes panel-flash { 0%, 30% { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 30px rgb(217 164 65 / .35); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .panel.flash { animation: none; outline: 2px solid var(--gold-hi); } }
/* game page tool buttons: one line each, the row wraps instead */
.title-row .tools { flex-wrap: wrap; }
.title-row .tools .btn { white-space: nowrap; }
/* scrolled-to targets stop below the sticky header */
.panel, .stage { scroll-margin-top: calc(76px + env(safe-area-inset-top, 0px)); }
