/* The site's foundation: fonts, colours, type and the shared components (docs/REDESIGN.md). Every page and the room
   build on it. server/ds.test.mjs keeps the colour names honest. */

/* ---------- fonts (self-hosted, OFL: /ds/fonts/OFL-*.txt) ---------- */
@font-face {
  font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("/ds/fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("/ds/fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Caveat"; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url("/ds/fonts/caveat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Caveat"; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url("/ds/fonts/caveat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* While Nunito loads, a local font stretched to Nunito's size, so the page does not jump when it arrives */
@font-face {
  font-family: "Nunito Fallback"; src: local("Arial"), local("Helvetica"), local("Roboto");
  size-adjust: 101.4%; ascent-override: 99.7%; descent-override: 34.8%; line-gap-override: 0%;
}

/* ---------- colours and type: new names only (base.css and tv.css own --bg, --muted, --yellow ...) ---------- */
:root {
  --night: #150b2b;
  --night-glow: #2e1870;
  --menu-bg: #24164a;
  --frame: #0d0720;
  --surface: rgba(255, 255, 255, 0.07);
  --surface-hi: rgba(255, 255, 255, 0.1);
  --stroke: rgba(255, 255, 255, 0.14);
  --stroke-hi: rgba(255, 255, 255, 0.2);
  --well: rgba(0, 0, 0, 0.3);
  --text: #fff;
  --text-soft: #e4ddf7;
  --text-body: #d3cbec;
  --text-dim: #b9add9;
  --text-faint: #8f84b3;
  --on-light: #1b1033;
  --sun: #ffd23f;
  --sun-hi: #ffe27a;
  --sun-edge: #c99a00;
  --rose: #ff5fa2;
  --rose-hi: #ff6fae;
  --sky: #3fd0f0;
  --leaf: #3ad38a;
  --font: "Nunito", "Nunito Fallback", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-hand: "Caveat", "Nunito", cursive;
}

/* each game's colours (public/ds/games.js has the same values) */
.t-deme { --c: #ff6fae; --c2: #ff3d8b; --rgb: 255, 111, 174; }
.t-spy { --c: #3fd0f0; --c2: #1aa7d6; --rgb: 63, 208, 240; }
.t-net { --c: #3ad38a; --c2: #1fae6a; --rgb: 58, 211, 138; }
.t-chain { --c: #ff9a52; --c2: #ff7a2e; --rgb: 255, 154, 82; }
.t-circle { --c: #ffd23f; --c2: #ffb81c; --rgb: 255, 210, 63; }
.t-forehead { --c: #a596ff; --c2: #7f6cff; --rgb: 165, 150, 255; }
.t-letter { --c: #b8ec4a; --c2: #8cc22a; --rgb: 184, 236, 74; }

/* ---------- the page ---------- */
html { background: var(--night); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.5;
  background: radial-gradient(90% 680px at 72% 0%, var(--night-glow) 0%, rgba(46, 24, 112, 0) 100%), var(--night);
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
*, *::before, *::after { box-sizing: border-box; }
:where(h1, h2, h3, p, ul, ol) { margin: 0; }
a { color: var(--sun); }
a:hover { color: var(--sun-hi); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- stroke icons (24 x 24) ---------- */
.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- a game's app icon with its emblem ---------- */
.ai {
  width: 64px; height: 64px; flex: none; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--c), var(--c2));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.ai svg { width: 44px; height: 44px; overflow: visible; }
.ai-lg { width: 76px; height: 76px; border-radius: 22px; }
.ai-lg svg { width: 52px; height: 52px; }
.ai .k { fill: none; stroke: var(--on-light); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.ai .t2 { stroke-width: 2.4; }
.ai .t3 { stroke-width: 3; }
.ai .kf { fill: var(--on-light); }
.ai .w { fill: #fff; }
.ai .cf { fill: var(--c); }
.ai .wk { fill: #fff; stroke: var(--on-light); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.ai .kd { fill: none; stroke: var(--on-light); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 1 6; }
.ai .wd { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1.5 6; }

/* ---------- buttons and fields ---------- */
.primary {
  font: inherit; font-size: 20px; font-weight: 900; color: var(--on-light); background: var(--sun); border: 0;
  border-radius: 16px; padding: 16px; min-height: 58px; box-shadow: 0 6px 0 var(--sun-edge); cursor: pointer;
  text-align: center; text-decoration: none; display: block; transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.primary:hover { color: var(--on-light); background: var(--sun-hi); }
.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--sun-edge); }
.ghost {
  font: inherit; font-weight: 900; color: var(--text); background: transparent; border: 2px solid var(--stroke-hi);
  border-radius: 14px; padding: 0 20px; min-height: 52px; cursor: pointer;
}
.ghost:hover { border-color: rgba(255, 255, 255, 0.4); }
.input {
  font: inherit; font-weight: 700; color: var(--text); width: 100%; background: var(--well);
  border: 2px solid transparent; border-radius: 14px; padding: 13px 14px; min-height: 52px;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--sun); }
.input.codefield { text-align: center; text-transform: uppercase; letter-spacing: 6px; font-size: 20px; }
.lbl { font-size: 12px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
.or {
  display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; font-weight: 900; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-dim);
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--stroke); }
.row { display: flex; gap: 8px; }
.row > .input { flex: 1; min-width: 0; }
.chip {
  flex: none; font: inherit; font-size: 15px; font-weight: 800; color: var(--text-soft); background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 99px; padding: 8px 16px; min-height: 42px; cursor: pointer;
}
.chip:hover { border-color: rgba(255, 255, 255, 0.35); }
.chip[aria-pressed="true"] { background: #fff; color: var(--on-light); border-color: #fff; }

/* ---------- section headings ---------- */
.kicker { font-size: 13px; font-weight: 900; letter-spacing: 1.5px; text-transform: uppercase; color: var(--rose-hi); margin-bottom: 8px; }
.h2 { font-size: 34px; line-height: 1.08; font-weight: 900; letter-spacing: -1px; }
.sublead { margin-top: 10px; max-width: 58ch; font-size: 18px; color: var(--text-dim); }

/* ---------- a game in a list: icon, name, one line, little pills ---------- */
.gc {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 14px; border-radius: 20px;
  border: 1px solid rgba(var(--rgb), 0.3);
  background: linear-gradient(120deg, rgba(var(--rgb), 0.16), rgba(var(--rgb), 0.03) 70%), rgba(255, 255, 255, 0.05);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.gc:hover { transform: translateY(-2px); border-color: rgba(var(--rgb), 0.75); }
.gc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gc h3 { font-size: 20px; line-height: 1.15; font-weight: 900; }
.gc h3 a { color: #fff; text-decoration: none; }
.gc h3 a::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; }
.gc h3 a:focus-visible { outline: none; }
.gc:focus-within { outline: 3px solid var(--sun); outline-offset: 3px; }
.gc-tag { font-size: 14.5px; line-height: 1.35; color: var(--text-body); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding: 0; list-style: none; }
.pills li { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: rgba(0, 0, 0, 0.28); color: var(--text-soft); }
.pills li:first-child { background: rgba(var(--rgb), 0.22); color: var(--c); }
.gc .go { width: 20px; height: 20px; color: var(--text-faint); }

/* ---------- the brand logo (public/ds/brand.js): the mark "Gece kartı" and the name ----------
   An element with .brand holds the mark and the name; its font-size is the name's size. Two lines by default (the
   landing, the room's opening screen), .one for a page header. */
.brand { display: flex; align-items: center; gap: 0.3em; text-decoration: none; }
.brand-mark { display: block; flex: none; height: 2.15em; width: auto; aspect-ratio: 102 / 112; overflow: visible; }
.brand-word {
  font-weight: 1000; letter-spacing: -0.04em; line-height: 0.92; white-space: nowrap; color: var(--sun);
  text-shadow: 0 0.075em 0 var(--rose), 0 0.15em 0 rgba(0, 0, 0, 0.25);
  transform: rotate(-3deg); transform-origin: left center; padding-bottom: 0.1em;
}
.brand-word span { display: block; }
.brand.one { gap: 0.34em; }
.brand.one .brand-mark { height: 1.6em; }
.brand.one .brand-word { transform: none; padding-bottom: 0.06em; }

/* ---------- game wordmarks (public/ds/wordmarks.js): each name with its logo's twist ---------- */
.wm { position: relative; display: inline-block; font-size: 88px; font-weight: 1000; line-height: 1; letter-spacing: -1px; color: #fff; }
.wm-deme { text-shadow: 5px 5px 0 #ff3d8b; }
.wm-deme .ex { display: inline-block; margin-left: 4px; color: var(--sun); transform: rotate(12deg); }
.wm-deme .band { display: block; width: max-content; margin-top: 12px; padding: 5px 14px; border-radius: 9px; background: #ff3d8b; color: #fff; font-size: 0.2em; letter-spacing: 0.22em; text-shadow: none; transform: rotate(-2deg); }
.wm-spy { letter-spacing: 0.16em; margin-right: -0.16em; }
.wm-spy .o { color: transparent; -webkit-text-stroke: 3px var(--c); }
.wm-net { display: inline-flex; align-items: center; gap: 14px; }
.wm-net .tiles { display: inline-flex; gap: 6px; }
.wm-net .tiles i { font-style: normal; display: flex; align-items: flex-end; justify-content: center; width: 1.06em; height: 1.34em; padding-bottom: 0.12em; border-radius: 0.2em; background: #fff8e8; color: var(--on-light); font-size: 0.7em; line-height: 1; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25); }
.wm-net .tiles i.g { background: var(--c); transform: translateY(-6px) rotate(-4deg); }
.wm-chain { display: inline-flex; flex-direction: column; font-family: var(--font-hand); font-weight: 700; font-size: 96px; line-height: 0.82; letter-spacing: 0; }
.wm-chain .l2 { margin-left: 0.9em; color: var(--c); }
.wm-chain .scrib { position: absolute; left: 10%; bottom: -16px; width: 80%; height: 18px; }
.wm-chain .scrib path { fill: none; stroke: var(--c); stroke-width: 4; stroke-linecap: round; }
.wm-circle { padding: 6px 26px; }
.wm-circle .ring { position: absolute; left: -14px; top: -10px; width: calc(100% + 28px); height: calc(100% + 20px); }
.wm-circle .ring path { fill: none; stroke: var(--c); stroke-width: 4.5; stroke-linecap: round; }
.wm-circle .stk { position: absolute; right: -40px; top: -26px; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--c); color: var(--on-light); font-size: 20px; letter-spacing: 0; transform: rotate(14deg); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.wm-forehead { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.wm-forehead .card { display: inline-block; padding: 4px 18px 8px; border-radius: 20px; background: #fff8e8; color: var(--on-light); transform: rotate(-6deg); box-shadow: inset 0 0 0 4px #fff8e8, inset 0 0 0 7px var(--c), 0 8px 0 rgba(0, 0, 0, 0.25); }
.wm-forehead .spk { position: absolute; width: 26px; height: 26px; fill: var(--sun); }
.wm-forehead .spk:nth-of-type(1) { right: -26px; top: -12px; }
.wm-forehead .spk:nth-of-type(2) { right: -6px; bottom: -14px; width: 16px; height: 16px; }
.wm-letter .ii { position: relative; display: inline-block; color: transparent; }
.wm-letter .ii::before { content: attr(data-g); position: absolute; left: 0; top: 0; color: #fff; }
.wm-letter .tile { position: absolute; left: 50%; top: 0.1em; width: 0.22em; height: 0.22em; margin-left: -0.11em; border-radius: 0.05em; background: var(--c); box-shadow: inset 0 -0.03em 0 rgba(0, 0, 0, 0.18), 0 0.04em 0 rgba(0, 0, 0, 0.25); animation: wmHop 2.4s cubic-bezier(0.3, 1.4, 0.5, 1) infinite; }
.wm-letter.stack { display: inline-flex; flex-direction: column; align-items: flex-start; }
.wm-letter .sm { font-size: 0.4em; color: var(--c); margin: 0 0 -0.02em 0.06em; letter-spacing: 0; }
.wm-letter .row { display: flex; align-items: flex-end; }
.wm-letter .stop { display: inline-block; width: 0.22em; height: 0.22em; margin: 0 0 0.1em 0.06em; border-radius: 0.05em; background: var(--c); box-shadow: inset 0 -0.03em 0 rgba(0, 0, 0, 0.18), 0 0.04em 0 rgba(0, 0, 0, 0.25); animation: wmDrop 2.4s cubic-bezier(0.3, 1.5, 0.5, 1) infinite; }
@keyframes wmHop { 0%, 55%, 100% { transform: translateY(0) rotate(-12deg); } 70% { transform: translateY(-0.16em) rotate(10deg); } 85% { transform: translateY(0) rotate(-12deg); } }
@keyframes wmDrop { 0%, 20% { transform: translateY(-0.5em) rotate(-30deg); opacity: 0; } 45%, 100% { transform: rotate(14deg); opacity: 1; } }

/* ---------- a phone showing a screen ---------- */
.phone {
  width: 250px; padding: 7px; border-radius: 36px; background: var(--frame);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1.5px rgba(255, 255, 255, 0.18);
}
.phone img { display: block; width: 100%; height: auto; border-radius: 29px; }

/* ---------- language: a round flag, the menu shows the names ---------- */
.langbox { position: relative; }
.langbox summary {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px 0 7px; border-radius: 99px;
  background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.16); color: var(--text-dim); cursor: pointer;
  list-style: none;
}
.langbox summary::-webkit-details-marker { display: none; }
.langbox summary .i { width: 16px; height: 16px; transition: transform 0.15s ease; }
.langbox[open] summary { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.langbox[open] summary .i { transform: rotate(180deg); }
.flagicon { width: 30px; height: 30px; flex: none; border-radius: 50%; overflow: hidden; display: block; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.flagicon svg { width: 100%; height: 100%; display: block; }
.ukw { stroke: #fff; stroke-width: 6; }
.ukr { stroke: #c8102e; stroke-width: 2; }
.ukw2 { stroke: #fff; stroke-width: 10; }
.ukr2 { stroke: #c8102e; stroke-width: 6; }
.langmenu {
  position: absolute; right: 0; top: 52px; z-index: 6; width: 210px; padding: 6px; border-radius: 18px;
  background: var(--menu-bg); border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; gap: 2px;
}
.langitem { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 10px; border-radius: 12px; color: #fff; text-decoration: none; font-weight: 800; }
.langitem:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.langitem[aria-current="true"] { background: var(--surface-hi); }
.langitem .ln { flex: 1; }
.langitem .ok { width: 18px; height: 18px; color: var(--leaf); }

/* ---------- footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 30px 0 calc(40px + env(safe-area-inset-bottom)); font-size: 14px; font-weight: 700; color: var(--text-dim);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot a { color: var(--text-dim); }
.foot a:hover { color: #fff; }

/* ---------- a short message at the bottom (public/ui.js toast()) ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 9; max-width: 90vw;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
  padding: 12px 18px; border-radius: 16px; background: #fff; color: var(--on-light); font-weight: 800; text-align: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
