/* Kelime Düellosu: tuş (keycap) diliyle çizilmiş, açık/koyu temalı arayüz.
   Yazı tipleri kendi sunucumuzdan yüklenir (SIL OFL, bkz. /fonts/LICENSES.txt). */

/* --- Yazı tipleri ------------------------------------------------------------ */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 200 800; font-display: swap;
  src: url("/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2-variations");
  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: "Bricolage Grotesque"; font-weight: 200 800; font-display: swap;
  src: url("/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations");
  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: "Instrument Sans"; font-weight: 400 700; font-display: swap;
  src: url("/fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  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: "Instrument Sans"; font-weight: 400 700; font-display: swap;
  src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations");
  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: "JetBrains Mono"; font-weight: 100 800; font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2-variations");
  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: "JetBrains Mono"; font-weight: 100 800; font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
  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; }

/* --- Renk belirteçleri: açık tema (varsayılan) ---------------------------------- */
:root {
  color-scheme: light;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #f4f4fb;
  --glow-1: rgba(110, 80, 255, 0.16);
  --glow-2: rgba(199, 244, 60, 0.26);
  --dots: rgba(20, 19, 43, 0.075);
  --surface: #ffffff;
  --surface-2: #eeeffa;
  --field: #f7f7fd;
  --ink: #14132b;
  --ink-2: #4b4a6b;
  --muted: #7a7a98;
  --line: #dcddf0;
  --line-strong: #bdbfdd;

  --primary: #5b3df5;
  --primary-deep: #3a20c8;
  --primary-ink: #ffffff;
  --primary-soft: rgba(91, 61, 245, 0.1);
  --link: #4a2fe0;
  --ring: rgba(91, 61, 245, 0.3);
  --volt: #c7f43c;
  --volt-deep: #8db515;
  --volt-ink: #14132b;
  --accent-text: #5b3df5; /* "Düellosu" gibi vurgu metinleri */

  --ok: #087a41;
  --ok-soft: rgba(8, 122, 65, 0.12);
  --bad: #d92b45;
  --bad-ink: #b01e36;
  --bad-soft: rgba(217, 43, 69, 0.13);
  --warn-soft: rgba(255, 180, 0, 0.24);

  --key: #ffffff;
  --key-hover: #f4f4ff;
  --key-edge: #bdbfdd;
  --caret: var(--primary);
  --series-1: #5b3df5;
  --grid: #e3e4f3;
  --axis: #c5c7e2;
  --rk2: #dadef3;
  --rk3: #ffd2b5;

  --shadow: 0 1px 0 rgba(20, 19, 43, 0.04), 0 22px 44px -26px rgba(50, 35, 160, 0.4);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
}

/* --- Koyu tema: sistem tercihi (kullanıcı açıkça "açık" seçmediyse) ------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0b1a;
    --glow-1: rgba(122, 92, 255, 0.3);
    --glow-2: rgba(199, 244, 60, 0.09);
    --dots: rgba(241, 241, 255, 0.075);
    --surface: #14142b;
    --surface-2: #1b1b38;
    --field: #0f0f22;
    --ink: #f1f1ff;
    --ink-2: #b6b6d8;
    --muted: #8888ae;
    --line: #26264a;
    --line-strong: #3a3a6a;
    --primary: #6f4fff;
    --primary-deep: #3f26c4;
    --primary-soft: rgba(122, 92, 255, 0.18);
    --link: #afa3ff;
    --ring: rgba(122, 92, 255, 0.45);
    --volt: #cbff4d;
    --volt-deep: #8fbf1e;
    --accent-text: #cbff4d;
    --ok: #3ddc84;
    --ok-soft: rgba(61, 220, 132, 0.14);
    --bad: #ff6b81;
    --bad-ink: #ff8ca0;
    --bad-soft: rgba(255, 107, 129, 0.18);
    --warn-soft: rgba(255, 200, 0, 0.15);
    --key: #1e1e40;
    --key-hover: #26264d;
    --key-edge: #07070f;
    --caret: var(--volt);
    --series-1: #a394ff;
    --grid: #24244a;
    --axis: #3a3a6a;
    --rk2: #3a3a68;
    --rk3: #6b3f2e;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 44px -26px rgba(0, 0, 0, 0.85);
  }
}

/* --- Koyu tema: kullanıcı açıkça seçtiyse -------------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b1a;
  --glow-1: rgba(122, 92, 255, 0.3);
  --glow-2: rgba(199, 244, 60, 0.09);
  --dots: rgba(241, 241, 255, 0.075);
  --surface: #14142b;
  --surface-2: #1b1b38;
  --field: #0f0f22;
  --ink: #f1f1ff;
  --ink-2: #b6b6d8;
  --muted: #8888ae;
  --line: #26264a;
  --line-strong: #3a3a6a;
  --primary: #6f4fff;
  --primary-deep: #3f26c4;
  --primary-soft: rgba(122, 92, 255, 0.18);
  --link: #afa3ff;
  --ring: rgba(122, 92, 255, 0.45);
  --volt: #cbff4d;
  --volt-deep: #8fbf1e;
  --accent-text: #cbff4d;
  --ok: #3ddc84;
  --ok-soft: rgba(61, 220, 132, 0.14);
  --bad: #ff6b81;
  --bad-ink: #ff8ca0;
  --bad-soft: rgba(255, 107, 129, 0.18);
  --warn-soft: rgba(255, 200, 0, 0.15);
  --key: #1e1e40;
  --key-hover: #26264d;
  --key-edge: #07070f;
  --caret: var(--volt);
  --series-1: #a394ff;
  --grid: #24244a;
  --axis: #3a3a6a;
  --rk2: #3a3a68;
  --rk3: #6b3f2e;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 44px -26px rgba(0, 0, 0, 0.85);
}

/* --- Temel ------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
/* Arka plan: köşelerde yumuşak ışıma + üstte kaybolan nokta ızgarası (klavye hissi) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 28rem at 8% -8%, var(--glow-1), transparent 62%),
    radial-gradient(44rem 22rem at 104% 4%, var(--glow-2), transparent 58%),
    radial-gradient(var(--dots) 1.1px, transparent 1.3px) 0 0 / 24px 24px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 45%, transparent 100%);
}

.wrap { width: 100%; max-width: 980px; margin-inline: auto; padding-inline: 18px; }
main { flex: 1; padding-block: 28px 56px; outline: none; }
main:focus, main:focus-visible { outline: none; }
.view { display: flex; flex-direction: column; gap: 22px; }
.stack { display: flex; flex-direction: column; gap: 22px; }

h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.025em; line-height: 1.1; }
h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--volt); color: var(--volt-ink); }

.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--mono); }
.strong { font-weight: 700; }
.center { text-align: center; align-items: center; }
.error { color: var(--bad-ink); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eyebrow { font: 700 0.76rem/1 var(--font); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-2); }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 44ch; }

/* --- Üst çubuk ---------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid var(--line);
}
.bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 41px; flex: none; }
.brand-word { font: 800 1.28rem/1 var(--display); letter-spacing: -0.035em; }
.brand-word b { color: var(--accent-text); font-weight: 800; }

.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a { padding: 7px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

.theme-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.theme-toggle button { display: grid; place-items: center; width: 32px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer; }
.theme-toggle button:hover { color: var(--ink); }
.theme-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.theme-toggle svg { width: 17px; height: 17px; }

@media (max-width: 640px) {
  .site-nav { order: 3; width: 100%; }
  .site-nav a { padding: 6px 12px; }
}

.site-footer { border-top: 1px solid var(--line); padding-block: 20px calc(20px + env(safe-area-inset-bottom, 0px)); color: var(--ink-2); font-size: 0.875rem; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; font: 800 0.95rem/1 var(--display); color: var(--ink); letter-spacing: -0.02em; }
.foot-mark { width: 22px; height: 23px; }

/* --- Kartlar ------------------------------------------------------------------------- */
.card { display: flex; flex-direction: column; gap: 16px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card.empty { align-items: flex-start; }
.danger-card { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.grid-2 { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }

/* --- Düğmeler: tuş gibi basılır -------------------------------------------------------- */
.btn {
  --edge: var(--key-edge);
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 20px; margin-bottom: 4px;
  font: 700 0.95rem/1.1 var(--font);
  color: var(--ink); background: var(--key);
  border: 1.5px solid var(--edge); border-radius: 13px;
  box-shadow: 0 4px 0 var(--edge);
  cursor: pointer; text-decoration: none;
  transition: transform 0.06s ease, box-shadow 0.06s ease, background-color 0.15s;
}
.btn:hover { background: var(--key-hover); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--edge); }
.btn.primary { --edge: var(--primary-deep); background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 88%, #fff); }
.btn.big { min-height: 52px; padding-inline: 26px; font-size: 1.05rem; border-radius: 15px; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); margin-bottom: 0; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.ghost:active { transform: none; }
.btn.danger { --edge: #8d1226; background: var(--bad); color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 88%, #fff); }
.btn.ghost.danger { background: transparent; color: var(--bad-ink); }
.btn.ghost.danger:hover { background: var(--bad-soft); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }

/* --- Formlar ---------------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
label, legend { padding: 0; font-weight: 700; }
.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  font: 500 1rem/1.4 var(--font); color: var(--ink);
  background: var(--field); border: 1.5px solid var(--line-strong); border-radius: 13px;
}
textarea.input { resize: vertical; }
.input::placeholder { color: var(--muted); }
.input:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; }
.inline .input { flex: 1 1 200px; width: auto; min-width: 0; }
.choice { display: flex; align-items: flex-start; gap: 12px; font-weight: 500; cursor: pointer; }
.choice input { flex: none; width: 20px; height: 20px; margin-top: 3px; accent-color: var(--primary); }
.indent { margin-left: 32px; display: flex; flex-direction: column; gap: 6px; max-width: 340px; }
.callout { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--surface-2); border-radius: var(--r-md); }
.callout.warn { background: var(--warn-soft); }
.steps { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 8px; }

/* --- Sayfa başlığı ve etiketler ---------------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; color: var(--ink-2); font-size: 0.93rem; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip.phase-lobby::before, .chip.phase-countdown::before { background: var(--primary); }
.chip.phase-running { background: var(--ok-soft); color: var(--ok); }
.chip.phase-running::before { background: var(--ok); animation: pulse 1.4s ease-out infinite; }
.chip.phase-scoring::before { background: #e8a200; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
.tag { margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 0.72rem; font-weight: 700; vertical-align: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 5px 13px; border-radius: 999px; background: var(--surface-2); font-size: 0.92rem; font-weight: 600; }

/* --- Katılım kodu: altı tuş ---------------------------------------------------------------- */
.share { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.share .label { margin-bottom: 8px; color: var(--ink-2); font-size: 0.85rem; font-weight: 700; }
.code-keys { display: flex; flex-wrap: wrap; gap: 8px; }
.keycap {
  display: grid; place-items: center;
  width: clamp(42px, 11vw, 62px); height: clamp(48px, 12.5vw, 70px);
  margin-bottom: 5px;
  font: 800 clamp(1.5rem, 5.4vw, 2.2rem)/1 var(--display); color: var(--ink);
  background: var(--key); border: 1.5px solid var(--key-edge); border-radius: 14px; box-shadow: 0 5px 0 var(--key-edge);
}
.keycap:nth-child(odd) { transform: rotate(-2deg); }
.keycap:nth-child(even) { transform: rotate(1.6deg); }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.key-display { padding: 10px 14px; background: var(--field); border: 1.5px solid var(--line-strong); border-radius: 13px; font-size: 1rem; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.danger-zone { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }

/* --- Sayılar ------------------------------------------------------------------------------------ */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface-2); border-radius: var(--r-md); }
.tile-label { color: var(--ink-2); font-size: 0.85rem; font-weight: 600; }
.tile-value { font: 800 1.9rem/1.15 var(--display); letter-spacing: -0.03em; }
.tile-sub { color: var(--ink-2); font-size: 0.8rem; }
.hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.hero-num { font: 800 clamp(4.2rem, 17vw, 7rem)/0.9 var(--display); letter-spacing: -0.055em; }
.hero-unit { color: var(--ink-2); font: 700 1.15rem var(--display); }
.pb { min-height: 1.55em; color: var(--ink-2); }
.pb.good { color: var(--ok); font-weight: 700; }
.big-countdown { color: var(--primary); font: 800 clamp(6rem, 26vw, 10rem)/1 var(--display); letter-spacing: -0.06em; animation: pop 0.5s ease-out; }
.big-countdown.long { font-size: clamp(2.4rem, 9vw, 3.6rem); animation: none; }
@keyframes pop { 0% { transform: scale(0.82); opacity: 0.2; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }

.bar { display: inline-block; width: 100%; min-width: 80px; height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.bar-fill { display: block; height: 100%; border-radius: 5px; background: var(--primary); transition: width 0.4s ease; }
.timebar { height: 7px; }
.timebar .bar-fill { background: var(--volt-deep); transition: none; }

/* --- Tablolar ----------------------------------------------------------------------------------------- */
.table-scroll { max-width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.data th, table.data td { padding: 11px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data thead th { color: var(--ink-2); font: 700 0.74rem/1 var(--font); letter-spacing: 0.07em; text-transform: uppercase; border-bottom-color: var(--line-strong); }
table.data tbody th { font-weight: 600; }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .progress-cell { min-width: 140px; width: 40%; }
table.data tr.me { background: var(--primary-soft); }
.rk { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding-inline: 4px; border-radius: 9px; background: var(--surface-2); font: 800 0.9rem var(--display); }
.rk-1 { background: var(--volt); color: var(--volt-ink); box-shadow: 0 2px 0 var(--volt-deep); }
.rk-2 { background: var(--rk2); }
.rk-3 { background: var(--rk3); }

/* --- Yazma alanı ------------------------------------------------------------------------------------------ */
.typing { gap: 18px; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; }
.stat-label { color: var(--ink-2); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.stat strong { font: 800 2.1rem/1.15 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.typer { position: relative; display: flex; flex-direction: column; gap: 10px; --lh: 2.3rem; }
.typer-box { position: relative; height: calc(var(--lh) * 4 + 1.2rem); overflow: hidden; background: var(--field); border: 2px solid var(--line-strong); border-radius: 18px; cursor: text; transition: border-color 0.15s, box-shadow 0.15s; }
.typer-box.focused { border-color: var(--primary); box-shadow: 0 0 0 5px var(--ring); }
.typer-box:not(.focused) .typer-text { opacity: 0.5; }
.typer-text { position: relative; padding: 0.6rem 1.1rem; font: 500 1.5rem/var(--lh) var(--mono); white-space: pre-wrap; user-select: none; -webkit-user-select: none; }
.word { display: inline-block; white-space: nowrap; }
.ch.todo { color: var(--ink); }
.ch.ok { color: var(--ok); }
.ch.bad { color: var(--bad-ink); background: var(--bad-soft); text-decoration: underline 2px; text-underline-offset: 5px; border-radius: 4px; }
.ch.miss { color: var(--bad-ink); text-decoration: underline 2px; text-underline-offset: 5px; }
.ch.cur { border-radius: 4px; background: color-mix(in srgb, var(--caret) 26%, transparent); box-shadow: inset 3px 0 0 var(--caret); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { box-shadow: inset 3px 0 0 transparent; } }
.typer-input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; resize: none; pointer-events: none; font-size: 16px; }
.typer-hint { min-height: 1.5em; color: var(--ink-2); font-size: 0.92rem; }
.typer-hint.ok { color: var(--ok); font-weight: 700; }

/* --- Ana sayfa ----------------------------------------------------------------------------------------------- */
.home-hero { display: grid; gap: 32px; align-items: center; padding-block: 8px 6px; }
@media (min-width: 900px) { .home-hero { grid-template-columns: 1.08fr 0.92fr; gap: 56px; } }
.home-copy { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.home-copy h1 { font-size: clamp(2.7rem, 7.4vw, 4.9rem); line-height: 0.96; letter-spacing: -0.045em; }
.u-volt { text-decoration: underline; text-decoration-color: var(--volt); text-decoration-thickness: 0.14em; text-underline-offset: 0.09em; text-decoration-skip-ink: none; }
.join-bar { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; max-width: 480px; padding: 8px; background: var(--surface); border: 1.5px solid var(--key-edge); border-radius: 20px; box-shadow: 0 5px 0 var(--key-edge); margin-bottom: 5px; }
.join-bar .input { flex: 1 1 120px; width: auto; min-width: 0; border: 0; background: transparent; font: 800 1.5rem/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; }
.join-bar .input:focus-visible { box-shadow: none; }
.join-bar .btn { margin-bottom: 0; }
.home-or { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; color: var(--ink-2); font-weight: 600; }

.duel-card { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 22px; background: var(--surface); border: 1.5px solid var(--key-edge); border-radius: 28px; box-shadow: 0 7px 0 var(--key-edge), var(--shadow); transform: rotate(1.4deg); }
.duel-head { display: flex; align-items: center; justify-content: space-between; font: 800 0.95rem var(--display); }
.duel-live { display: inline-flex; align-items: center; gap: 8px; }
.duel-live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: pulse 1.4s ease-out infinite; }
.duel-time { font-family: var(--mono); font-weight: 700; color: var(--ink-2); }
.lanes { display: flex; flex-direction: column; gap: 14px; }
.lane { display: grid; grid-template-columns: 3.6rem 1fr 2.4rem; align-items: center; gap: 12px; font-weight: 700; font-size: 0.95rem; }
.lane b { text-align: right; font: 800 1rem var(--display); font-variant-numeric: tabular-nums; }
.lane-track { height: 14px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.lane-track i { display: block; height: 100%; border-radius: 7px; animation: race 7s ease-in-out infinite alternate; }
.lane-1 i { background: var(--primary); width: 78%; }
.lane-2 i { background: var(--volt); width: 66%; animation-duration: 8.5s; animation-delay: -2s; }
.lane-3 i { background: #ff7a93; width: 52%; animation-duration: 6.4s; animation-delay: -4s; }
@keyframes race { from { transform: scaleX(0.55); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }
.duel-text { padding: 14px 16px; background: var(--field); border-radius: 16px; font: 500 1.08rem/1.8 var(--mono); }
.duel-keys { display: flex; gap: 8px; flex-wrap: wrap; }
.duel-keys .keycap { width: 44px; height: 48px; font-size: 1.25rem; border-radius: 11px; margin-bottom: 4px; box-shadow: 0 4px 0 var(--key-edge); }
.duel-keys .keycap:nth-child(2n) { background: var(--primary); border-color: var(--primary-deep); box-shadow: 0 4px 0 var(--primary-deep); color: var(--primary-ink); }
.duel-keys .keycap:nth-child(3n) { background: var(--volt); border-color: var(--volt-deep); box-shadow: 0 4px 0 var(--volt-deep); color: var(--volt-ink); }
.step { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.step-num { font: 800 3.4rem/0.9 var(--display); letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 2px var(--primary); }
@media (forced-colors: active) { .step-num { color: CanvasText; -webkit-text-stroke: 0; } }

/* --- Hazır metin seçici ---------------------------------------------------------------------------------------------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 15px; background: var(--surface-2); align-self: flex-start; }
.seg button { padding: 9px 18px; border: 0; border-radius: 11px; background: transparent; color: var(--ink-2); font: 700 0.95rem var(--font); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 var(--line-strong), 0 3px 10px rgba(0, 0, 0, 0.1); }
.filter-rows { gap: 10px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-label { min-width: 4.6rem; color: var(--ink-2); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.filter { padding: 6px 15px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink-2); font: 700 0.88rem var(--font); cursor: pointer; }
.filter:hover { color: var(--ink); background: var(--surface-2); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.presets { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); padding: 4px 4px 8px; }
.preset { position: relative; display: flex; flex-direction: column; gap: 9px; padding: 15px 15px 14px; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 17px; box-shadow: 0 4px 0 var(--line-strong); cursor: pointer; transition: transform 0.06s, box-shadow 0.06s; }
.preset:hover { border-color: var(--ink-2); }
.preset:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line-strong); }
.preset[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 4px 0 var(--primary-deep), 0 0 0 3px var(--ring); }
.preset-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
.preset-tag { color: var(--ink-2); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.preset-title { font: 750 1.08rem/1.2 var(--display); letter-spacing: -0.02em; }
.preset-meta { color: var(--ink-2); font-size: 0.8rem; font-weight: 600; }
.preset-check { position: absolute; top: -9px; right: -9px; display: none; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); }
.preset-check svg { width: 14px; height: 14px; }
.preset[aria-checked="true"] .preset-check { display: grid; }
.level { padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; }
.level-easy { background: var(--ok-soft); color: var(--ok); }
.level-medium { background: var(--warn-soft); color: var(--ink); }
.level-hard { background: var(--bad-soft); color: var(--bad-ink); }
.preview-box { max-height: 10.5rem; overflow: auto; padding: 14px 16px; background: var(--field); border: 1.5px solid var(--line); border-radius: 15px; font: 500 0.92rem/1.75 var(--mono); }
.preview-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* --- Grafik ------------------------------------------------------------------------------------------------------------ */
.chart-wrap { display: flex; flex-direction: column; gap: 10px; }
.chart { position: relative; width: 100%; min-height: 220px; }
.chart-svg { display: block; max-width: 100%; touch-action: pan-y; }
.chart-svg:focus-visible { outline-offset: 4px; }
.chart-grid { stroke: var(--grid); stroke-width: 1; }
.chart-axis { stroke: var(--axis); stroke-width: 1; }
.chart-cross { stroke: var(--axis); stroke-width: 1; }
.chart-tick { fill: var(--muted); font: 600 11px var(--font); }
.chart-end-label { fill: var(--ink); font: 800 12px var(--display); }
.chart-line { fill: none; stroke: var(--series-1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--series-1); fill-opacity: 0.12; stroke: none; }
.chart-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart-overlay { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; z-index: 2; min-width: 130px; max-width: 240px; padding: 9px 12px; pointer-events: none; font-size: 0.85rem; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 12px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22); }
.tip-title { margin-bottom: 4px; color: var(--ink-2); overflow-wrap: anywhere; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-key { flex: none; width: 12px; height: 3px; border-radius: 2px; background: var(--series-1); }
.tip-label { flex: 1; color: var(--ink-2); }
.chart-table summary { padding: 4px 0; color: var(--ink-2); font-size: 0.9rem; font-weight: 600; cursor: pointer; }

/* --- Bildirimler ----------------------------------------------------------------------------------------------------------- */
.toasts { position: fixed; z-index: 60; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 10px; padding-inline: 16px; pointer-events: none; }
.toast { max-width: 540px; padding: 12px 18px; pointer-events: auto; font-weight: 600; color: var(--bg); background: var(--ink); border-radius: 14px; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35), 0 14px 30px rgba(0, 0, 0, 0.25); animation: toast-in 0.25s ease-out; }
.toast.error { background: var(--bad); color: #fff; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

@media (max-width: 560px) {
  .card, .step { padding: 18px; }
  .presets { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .preset { padding: 12px 12px 11px; }
  .preset-title { font-size: 1rem; }
  .typer { --lh: 2.05rem; }
  .typer-text { font-size: 1.2rem; }
  .join-bar .input { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .ch.bad, .ch.miss { text-decoration: underline 3px; }
  .ch.cur { outline: 2px solid Highlight; }
  .btn, .keycap, .preset { border-color: ButtonText; }
}
