/* ==========================================================================
   Kim Söylüyor — "Sahne" web teması
   Karanlık konser salonu, tepeden spot, tabela ampulleri. Tek stil dosyası.
   Renk adları Mobile/src/design/tokens.js ile birebir aynı kavramlar.
   ========================================================================== */

:root {
  color-scheme: dark;
  --deep: #0B0618;
  --raise: #150D2B;
  --velvet: #241546;
  --velvet-hi: #33205F;
  --marquee: #FFC24B;
  --marquee-fill: #FFC24B;
  --marquee-hi: #FFD574;
  --marquee-deep: #C98A16;
  --on-marquee: #3A2200;
  --live: #35E0C8;
  --on-live: #053B32;
  --hot: #FF4D7E;
  --violet: #8B5CF6;
  --ink: #F2EEFC;
  --ink2: #BBAEDC;
  --line: rgba(255, 255, 255, .09);
  --line2: rgba(255, 255, 255, .16);
  --ghost: rgba(255, 255, 255, .055);
  --bulb-off: rgba(255, 255, 255, .13);
  --ring-off: rgba(255, 255, 255, .1);
  --spot: rgba(255, 214, 140, .2);
  --spot2: rgba(139, 92, 246, .24);
  --beam: rgba(255, 214, 140, .2);
  --shadow: 0 14px 36px rgba(0, 0, 0, .42);
  --card-plate: #1A1035;

  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --gut: clamp(16px, 4vw, 32px);
  --tabbar: 66px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --deep: #F4F1FB;
    --raise: #FBFAFE;
    --velvet: #FFFFFF;
    --velvet-hi: #EFE9F8;
    --marquee: #8A5A05;
    --live: #0B7F6F;
    --on-live: #FFFFFF;
    --hot: #C4225A;
    --violet: #7C4DE0;
    --ink: #231738;
    --ink2: #5A4A7E;
    --line: rgba(35, 23, 56, .1);
    --line2: rgba(35, 23, 56, .2);
    --ghost: rgba(35, 23, 56, .05);
    --bulb-off: rgba(35, 23, 56, .14);
    --ring-off: rgba(35, 23, 56, .16);
    --spot: rgba(255, 194, 75, .34);
    --spot2: rgba(124, 77, 224, .14);
    --beam: rgba(124, 77, 224, .07);
    --shadow: 0 12px 30px rgba(50, 30, 90, .14);
    --card-plate: #F7F3FD;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --deep: #F4F1FB;
  --raise: #FBFAFE;
  --velvet: #FFFFFF;
  --velvet-hi: #EFE9F8;
  --marquee: #8A5A05;
  --live: #0B7F6F;
  --on-live: #FFFFFF;
  --hot: #C4225A;
  --violet: #7C4DE0;
  --ink: #231738;
  --ink2: #5A4A7E;
  --line: rgba(35, 23, 56, .1);
  --line2: rgba(35, 23, 56, .2);
  --ghost: rgba(35, 23, 56, .05);
  --bulb-off: rgba(35, 23, 56, .14);
  --ring-off: rgba(35, 23, 56, .16);
  --spot: rgba(255, 194, 75, .34);
  --spot2: rgba(124, 77, 224, .14);
  --beam: rgba(124, 77, 224, .07);
  --shadow: 0 12px 30px rgba(50, 30, 90, .14);
  --card-plate: #F7F3FD;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--deep);
  background-image:
    radial-gradient(90% 46vh at 50% -6vh, var(--spot), transparent 72%),
    radial-gradient(60% 40vh at 100% 30vh, var(--spot2), transparent 70%),
    radial-gradient(60% 40vh at 0 60vh, var(--spot2), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
  overflow-x: clip;
}

body.has-nav { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); }

h1, h2 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin: 0;
}
h1 { font-size: clamp(30px, 6vw, 44px); }
h2 { font-size: 24px; }
p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }

:focus-visible {
  outline: 3px solid var(--live);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 8px; top: -60px;
  z-index: 50;
  background: var(--marquee-fill);
  color: var(--on-marquee);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-weight: 700;
}
.skip:focus { top: 8px; }

/* Spot huzmeleri — sabit, tıklamaları engellemez */
.beams {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.beams::before, .beams::after {
  content: "";
  position: absolute;
  top: -20vh;
  width: 62vmax; height: 130vh;
  background: conic-gradient(from 168deg at 50% 0, transparent 0 4deg, var(--beam) 12deg, transparent 22deg);
  filter: blur(14px);
  transform-origin: 50% 0;
}
.beams::before { left: -24vmax; transform: rotate(-10deg); animation: sweepL 13s ease-in-out infinite alternate; }
.beams::after { right: -24vmax; transform: rotate(10deg); animation: sweepR 16s ease-in-out infinite alternate; }

@keyframes sweepL { to { transform: rotate(9deg); } }
@keyframes sweepR { to { transform: rotate(-9deg); } }

/* ---------------------------------------------------------------- üst şerit */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--gut);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  min-width: 0;
  text-decoration: none;
  margin-right: auto;
}
.brand-name {
  font: 800 19px/1.1 var(--display);
  letter-spacing: -.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-disc {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--on-marquee) 0 8%, var(--marquee-fill) 9% 30%, transparent 31%),
    repeating-radial-gradient(circle, #171024 0 2px, #09050f 2px 4px);
  box-shadow: 0 0 0 1px var(--line2), 0 0 18px rgba(255, 194, 75, .35);
}

.tools { display: flex; gap: 6px; flex: none; }
.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 10px;
  border-radius: var(--r-md);
  background: var(--ghost);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}
.tool:hover { background: var(--velvet-hi); }

/* Etkin temaya göre doğru düğme görünür: sunucu sistem temasını bilemez */
.to-dark { display: none; }
:root[data-theme="light"] .to-light { display: none; }
:root[data-theme="light"] .to-dark { display: inline-flex; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .to-light { display: none; }
  :root:not([data-theme="dark"]) .to-dark { display: inline-flex; }
}

/* Alt sekme çubuğu; geniş ekranda üst şeride oturur */
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--raise);
  border-top: 1px solid var(--line2);
}
.nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 48px;
  color: var(--ink2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.nav-icon { font-size: 21px; line-height: 1.2; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--ghost); box-shadow: inset 0 3px 0 var(--marquee-fill); }

.wrap {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px var(--gut) 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding: 10px var(--gut) 18px;
  color: var(--ink2);
  font-size: 14px;
}
.foot a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; }
.foot-bulbs { display: inline-flex; gap: 5px; }
.foot-bulbs i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--marquee-fill);
  box-shadow: 0 0 8px var(--marquee-fill);
}

/* ------------------------------------------------------------------ yüzeyler */
.panel {
  background: var(--velvet);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow);
  min-width: 0;
}

.duo { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }

.kicker {
  color: var(--marquee);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hint { color: var(--ink2); font-size: 14px; }
.hint a, .flash a { display: inline-block; font-weight: 700; padding: 14px 4px; margin: -14px 0; }
.empty { color: var(--ink2); }

.flash {
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-weight: 600;
  border: 1px solid var(--line2);
  background: var(--velvet);
}
.flash-error { border-color: var(--hot); color: var(--hot); }
.flash-success { border-color: var(--live); color: var(--live); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.chips li {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--ghost);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}
.chips .chip-gold { background: var(--marquee-fill); color: var(--on-marquee); border-color: transparent; }

/* ------------------------------------------------------------------ düğmeler */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 24px;
  border: 0;
  border-radius: var(--r-lg);
  font: 700 17px/1.2 var(--body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s, box-shadow .2s, background-color .2s;
}
.btn:active { transform: translateY(2px) scale(.99); }
.btn-primary {
  background: linear-gradient(180deg, var(--marquee-hi), var(--marquee-fill) 55%);
  color: var(--on-marquee);
  box-shadow: 0 5px 0 var(--marquee-deep), 0 12px 28px rgba(255, 194, 75, .34);
}
.btn-primary:hover { box-shadow: 0 5px 0 var(--marquee-deep), 0 14px 36px rgba(255, 194, 75, .5); }
.btn-primary:active { box-shadow: 0 2px 0 var(--marquee-deep); }
.btn-ghost {
  background: var(--velvet-hi);
  color: var(--ink);
  border: 1px solid var(--line2);
}
.btn-ghost:hover { border-color: var(--marquee); }
.btn-xl { width: 100%; min-height: 62px; font-size: 20px; }

.btn-quiet {
  background: none;
  border: 0;
  color: var(--ink2);
  font: 600 14px var(--body);
  min-height: 48px;
  padding: 0 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------- tabela ampulleri */
.board {
  position: relative;
  padding: 17px;
  border-radius: 26px;
  background: linear-gradient(180deg, #4A2C0A, #2C1806);
  box-shadow: 0 0 0 1px rgba(255, 194, 75, .35), 0 18px 60px rgba(255, 194, 75, .2);
  isolation: isolate;
}
/* İki ampul katmanı dönüşümlü yanar: yürüyen ışık etkisi */
.board::before, .board::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 23px;
  background-image: radial-gradient(circle, #FFE9B0 0 2.5px, #FFC24B 3.5px, rgba(255, 194, 75, .25) 5px, transparent 7px);
  background-size: 22px 22px;
  background-repeat: round;
  z-index: -1;
}
.board::before { animation: chaseA 1.1s steps(1) infinite; }
.board::after { background-position: 11px 0; animation: chaseB 1.1s steps(1) infinite; }

@keyframes chaseA { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .22; } }
@keyframes chaseB { 0%, 49% { opacity: .22; } 50%, 100% { opacity: 1; } }

.board-in {
  border-radius: var(--r-lg);
  background: radial-gradient(120% 130% at 50% -10%, #3B2469, #1B0F38 62%, #120A28);
  color: #F2EEFC;
  padding: clamp(20px, 5vw, 44px) clamp(14px, 4vw, 40px);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.board-in .kicker { color: #FFC24B; }

/* ----------------------------------------------------------------- ana sayfa */
.hero h1 {
  font-size: clamp(42px, 11vw, 92px);
  color: #FFC24B;
  line-height: 1;
  letter-spacing: -.045em;
  margin: 8px 0 12px;
  text-shadow: 0 0 34px rgba(255, 194, 75, .45), 0 3px 0 #8A5A05;
}
.hero-sub { color: #E4DCF7; font-size: clamp(16px, 2.6vw, 20px); max-width: 34em; margin: 0 auto; }

.resume {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--live);
  font-weight: 600;
}

.start { display: grid; gap: 16px; }
.diffs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.diffs legend { font: 800 21px/1.2 var(--display); letter-spacing: -.02em; margin-bottom: 12px; }

.diff {
  --tone: #4ADE80;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 92px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--ghost);
  border: 2px solid var(--line2);
  border-top: 5px solid var(--tone);
  cursor: pointer;
  font-size: 14px;
  color: var(--ink2);
  transition: transform .12s, background-color .2s, border-color .2s;
}
.diff strong { font: 800 20px/1.15 var(--display); color: var(--ink); letter-spacing: -.02em; }
.diff-pts { font-size: 13px; }
.diff-medium { --tone: #FBBF24; }
.diff-hard { --tone: #FB923C; }
.diff-legendary { --tone: #FF4D7E; }
.diff:hover { background: var(--velvet-hi); }

input.sr:checked + .diff {
  background: var(--velvet-hi);
  border-color: var(--marquee-fill);
  box-shadow: 0 0 0 2px var(--marquee-fill), 0 8px 22px rgba(255, 194, 75, .22);
  transform: translateY(-2px);
}
input.sr:focus-visible + .diff,
input.sr:focus-visible + .avatar {
  outline: 3px solid var(--live);
  outline-offset: 2px;
}

.daily-teaser h2 { margin-top: 4px; }

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  margin-top: 14px;
}
.podium li { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; text-align: center; }
.podium-1 { order: 2; }
.podium-2 { order: 1; }
.podium-3 { order: 3; }
.podium-name {
  font-weight: 700;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.podium-score { font-size: 14px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.podium-step {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
  padding-top: 6px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  font: 800 22px/1 var(--display);
  color: var(--on-marquee);
}
.podium-1 .podium-step { height: 76px; background: linear-gradient(180deg, #FFD574, #E8A92C); }
.podium-2 .podium-step { height: 54px; background: linear-gradient(180deg, #E4E0F2, #AFA7C9); }
.podium-3 .podium-step { height: 40px; background: linear-gradient(180deg, #EDB98C, #BE7F4C); }

.link-more { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; color: var(--marquee); }

.av {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--velvet-hi);
  box-shadow: inset 0 0 0 1px var(--line2);
  font-size: 23px;
  line-height: 1;
}
.av-xl { width: 84px; height: 84px; font-size: 44px; }

.app-cta {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 26px);
  border-radius: var(--r-xl);
  background: linear-gradient(120deg, #3B1D7A, #241546 70%);
  color: #F2EEFC;
}
.app-cta .kicker { color: #FFC24B; }
.app-cta h2 { margin: 2px 0 6px; }
.app-cta p:last-child { color: #D9D1EE; }
.app-links { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-store { background: #F2EEFC; color: #231738; flex: 1 1 140px; }
.btn-store:hover { background: #fff; }

/* -------------------------------------------------------------- oyun ekranı */
.game-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.meter { display: flex; flex-direction: column; line-height: 1.1; }
.meter span { font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--ink2); text-transform: uppercase; }
.meter strong {
  font: 800 24px/1.1 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.meter small { font-size: 15px; color: var(--ink2); font-weight: 600; }
.meter-end { text-align: right; align-items: flex-end; }

.bulbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-width: 0; }
.bulbs li {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--bulb-off);
  box-shadow: inset 0 0 0 1px var(--line);
}
.bulbs .b-ok { background: var(--live); box-shadow: 0 0 10px var(--live); }
.bulbs .b-miss { background: var(--hot); box-shadow: 0 0 10px var(--hot); }
.bulbs .b-now { background: var(--marquee-fill); box-shadow: 0 0 12px var(--marquee-fill); animation: pulse 1.1s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: .45; } }

.play { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }

.stage {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-areas: "ring ask" "ring player" "hint hint";
  align-items: center;
  gap: 8px 14px;
  padding: 14px;
  border-radius: var(--r-xl);
  background: radial-gradient(120% 120% at 50% 0, var(--velvet-hi), var(--velvet) 70%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.ring {
  grid-area: ring;
  position: relative;
  width: 112px; height: 112px;
}
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-off { stroke: var(--ring-off); }
.ring-on {
  stroke: var(--marquee-fill);
  stroke-linecap: round;
  stroke-dasharray: 100;
  animation: drain var(--limit) linear forwards;
  animation-delay: calc(var(--elapsed) * -1);
}
@keyframes drain {
  0%, 62% { stroke: var(--marquee-fill); }
  100% { stroke: var(--hot); stroke-dashoffset: 100; }
}

.vinyl {
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #E9D7A8 0 4%, #FFC24B 5% 34%, transparent 35%),
    repeating-radial-gradient(circle, #1a1228 0 1.5px, #07040c 1.5px 3.5px);
  box-shadow: 0 0 22px rgba(53, 224, 200, .3);
  animation: spin 3.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Geri sayım rakamı — @property destekli tarayıcılarda saf CSS sayaç */
@property --s { syntax: "<integer>"; inherits: false; initial-value: 0; }
.count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 800 25px/1 var(--display);
  color: var(--on-marquee);
  font-variant-numeric: tabular-nums;
  --s: var(--limit-n);
  counter-reset: s var(--s);
  animation: count var(--limit) linear forwards;
  animation-delay: calc(var(--elapsed) * -1);
}
.count::after { content: counter(s); }
@keyframes count { from { --s: var(--limit-n); } to { --s: 0; } }

.ask {
  grid-area: ask;
  font-size: clamp(20px, 5vw, 26px);
  align-self: end;
}
.player, .yt, .sound, noscript { grid-area: player; align-self: start; width: 100%; min-width: 0; }
.player { display: block; height: 48px; }
.hint-audio { grid-area: hint; text-align: center; }
.quit { text-align: center; }

/* YouTube görüntüsü cevabı ele vermesin diye kapalı; dokunma alttaki oynatıcıya geçer */
.yt {
  position: relative;
  height: 72px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--raise);
}
/* Oynatıcı 200 px'in altında kısıtlanıyor; görünmeyen alan kapağın arkasında kalır */
.yt iframe { position: absolute; left: 0; top: 0; width: max(100%, 320px); height: 200px; border: 0; }
.yt-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 12px;
  background: linear-gradient(120deg, #33205F, #241546);
  color: #F2EEFC;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}
.yt-eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; flex: none; }
.yt-eq i { width: 4px; height: 100%; border-radius: 2px; background: #35E0C8; transform-origin: bottom; animation: eq .8s ease-in-out infinite alternate; }
.yt-eq i:nth-child(2) { animation-delay: -.25s; }
.yt-eq i:nth-child(3) { animation-delay: -.5s; }
.yt-eq i:nth-child(4) { animation-delay: -.65s; }
@keyframes eq { from { transform: scaleY(.3); } to { transform: scaleY(1); } }

/* Karakter kartları — isim her zaman görselin ALTINDA, üstüne binmez */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  align-content: start;
}
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 2px solid var(--line2);
  border-radius: var(--r-lg);
  background: var(--card-plate);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  font: inherit;
  transition: transform .12s, border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--marquee-fill); transform: translateY(-3px); box-shadow: 0 10px 22px rgba(255, 194, 75, .24); }
.card:active { transform: scale(.97); }
.card:focus-visible { outline: 3px solid var(--live); outline-offset: 1px; border-radius: var(--r-lg); }

.card-img {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 50% 42%, var(--velvet-hi), var(--velvet) 75%);
  overflow: hidden;
}
.card-img img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Yalnızca KIRIK görselde çizilir (yüklü <img> ::after üretmez); onerror'suz yedek */
.card-img img::after {
  content: "♪";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: var(--ink2);
  background: radial-gradient(circle at 50% 42%, var(--velvet-hi), var(--velvet) 75%);
}
.card-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
  padding: 5px 4px 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.22;
  text-align: center;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------- sonuç adımı */
.reveal {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding: clamp(18px, 4vw, 32px) clamp(14px, 4vw, 32px);
  border-radius: var(--r-xl);
  background: radial-gradient(110% 90% at 50% 0, var(--velvet-hi), var(--velvet) 72%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.reveal h1 { font-size: clamp(36px, 9vw, 54px); }
.is-right h1 { color: var(--live); }
.is-wrong h1 { color: var(--hot); }
.is-wrong .reveal-card { animation: shake .42s; }
.reveal-sub { color: var(--ink2); font-size: 18px; font-weight: 600; }
.reveal form { width: 100%; max-width: 360px; }

.reveal-card {
  margin: 0;
  width: min(100%, 300px);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 3px solid var(--line2);
  background: var(--card-plate);
}
.is-right .reveal-card { border-color: var(--live); box-shadow: 0 0 34px color-mix(in srgb, var(--live) 45%, transparent); }
.reveal-card figcaption { display: grid; gap: 2px; padding: 12px; }
.reveal-tag { color: var(--ink2); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.reveal-card strong { font: 800 26px/1.15 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.reveal-song { color: var(--ink2); font-size: 15px; overflow-wrap: anywhere; }

@keyframes shake {
  20% { transform: translateX(-9px); }
  45% { transform: translateX(8px); }
  70% { transform: translateX(-5px); }
  90% { transform: translateX(3px); }
}

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -16px;
  left: calc(4% + (var(--n, 1) * 6.6%));
  width: 9px; height: 15px;
  border-radius: 2px;
  background: #FFC24B;
  animation: fall 1.7s ease-in forwards;
  animation-delay: calc(var(--n, 1) * 45ms);
  opacity: 0;
}
.confetti i:nth-child(2n) { background: #35E0C8; }
.confetti i:nth-child(3n) { background: #FF4D7E; }
.confetti i:nth-child(1) { --n: 3; } .confetti i:nth-child(2) { --n: 9; }
.confetti i:nth-child(3) { --n: 1; } .confetti i:nth-child(4) { --n: 12; }
.confetti i:nth-child(5) { --n: 6; } .confetti i:nth-child(6) { --n: 0; }
.confetti i:nth-child(7) { --n: 10; } .confetti i:nth-child(8) { --n: 4; }
.confetti i:nth-child(9) { --n: 13; } .confetti i:nth-child(10) { --n: 7; }
.confetti i:nth-child(11) { --n: 2; } .confetti i:nth-child(12) { --n: 11; }
.confetti i:nth-child(13) { --n: 5; } .confetti i:nth-child(14) { --n: 8; }
@keyframes fall {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(520px) rotate(560deg); }
}

/* ---------------------------------------------------------------- oyun sonu */
.final { display: grid; gap: 16px; width: 100%; max-width: 640px; margin: 0 auto; }
.final-title { font: 800 clamp(22px, 5vw, 30px)/1.15 var(--display); letter-spacing: -.02em; margin-top: 4px; }
.final-score {
  font: 800 clamp(62px, 18vw, 112px)/1 var(--display);
  letter-spacing: -.05em;
  color: #FFC24B;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 34px rgba(255, 194, 75, .45);
  margin: 6px 0;
}
.final-sub { color: #E4DCF7; font-size: 18px; margin-bottom: 12px; }
.board-in .bulbs li { background: rgba(255, 255, 255, .14); box-shadow: none; }
.board-in .bulbs .b-ok { background: #35E0C8; box-shadow: 0 0 10px #35E0C8; }
.board-in .bulbs .b-miss { background: #FF4D7E; box-shadow: 0 0 10px #FF4D7E; }

.breakdown { display: grid; gap: 2px; margin: 0; }
.breakdown div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.breakdown div:last-child { border-bottom: 0; }
.breakdown dt { color: var(--ink2); }
.breakdown dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.ach-list { display: grid; gap: 8px; margin-top: 10px; }
.ach-list li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.ach-list span:nth-child(2) { flex: 1; min-width: 0; }
.ach-xp { color: var(--marquee); font-variant-numeric: tabular-nums; }

.final-actions { display: grid; gap: 10px; }

/* ----------------------------------------------------- liste ve sayfa başı */
.page-head { display: grid; gap: 4px; }

.tabs { display: flex; gap: 6px; padding: 4px; border-radius: var(--r-lg); background: var(--ghost); border: 1px solid var(--line); }
.tabs a {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 4px 6px;
  border-radius: var(--r-md);
  color: var(--ink2);
  text-decoration: none;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.15;
}
.tabs a[aria-current="page"] { background: var(--marquee-fill); color: var(--on-marquee); }

.my-rank {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  border: 2px solid var(--marquee-fill);
  background: var(--velvet);
}
.my-rank-pos { font: 800 20px var(--display); color: var(--marquee); }
.my-rank-name { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lb { display: grid; gap: 6px; }
.lb li {
  display: grid;
  grid-template-columns: 36px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 8px 12px 8px 8px;
  border-radius: var(--r-lg);
  background: var(--velvet);
  border: 1px solid var(--line);
}
.lb li.is-top { background: linear-gradient(90deg, var(--velvet-hi), var(--velvet) 70%); }
.lb li.is-me { border: 2px solid var(--marquee-fill); }
.lb-rank { font: 800 19px/1 var(--display); text-align: center; color: var(--ink2); font-variant-numeric: tabular-nums; }
.lb-rank-1, .lb-rank-2, .lb-rank-3 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  color: var(--on-marquee);
}
.lb-rank-1 { background: #FFC24B; }
.lb-rank-2 { background: #CFC9E2; }
.lb-rank-3 { background: #DDA172; }
.lb-who { display: grid; min-width: 0; line-height: 1.25; }
.lb-name { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-name em { font-style: normal; font-size: 13px; color: var(--marquee); }
.lb-level { color: var(--ink2); font-size: 13px; }
.lb-score { font: 800 19px/1 var(--display); color: var(--marquee); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.lb-compact li { min-height: 56px; background: var(--ghost); }

.daily-bonus { font: 800 62px/1 var(--display); color: var(--marquee); letter-spacing: -.04em; }

/* ------------------------------------------------------------------- profil */
.form { display: grid; gap: 14px; align-content: start; }
.form p { color: var(--ink2); }
.field { display: grid; gap: 6px; font-weight: 600; }
.field input {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 2px solid var(--line2);
  background: var(--raise);
  color: var(--ink);
  font: 600 18px var(--body);
}
.field input:focus-visible { border-color: var(--live); outline: 2px solid var(--live); outline-offset: 1px; }
.field input::placeholder { color: var(--ink2); opacity: .75; }
.code-input { letter-spacing: .14em; text-transform: uppercase; }

.avatars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.avatars legend { font-weight: 600; margin-bottom: 8px; }
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 56px;
  border-radius: var(--r-lg);
  background: var(--ghost);
  border: 2px solid var(--line2);
  font-size: clamp(30px, 8vw, 40px);
  cursor: pointer;
}
input.sr:checked + .avatar { border-color: var(--marquee-fill); background: var(--velvet-hi); box-shadow: 0 0 0 2px var(--marquee-fill); }

.profile-top { display: flex; align-items: center; gap: 16px; }
.profile-id { flex: 1; min-width: 0; }
.profile-id h1 { font-size: clamp(26px, 6vw, 36px); overflow-wrap: anywhere; }
.profile-level { color: var(--ink2); font-weight: 600; margin: 2px 0 8px; font-size: 15px; }
.xp { height: 12px; border-radius: 999px; background: var(--ring-off); overflow: hidden; }
.xp span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--marquee-deep), var(--marquee-fill)); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stats li { display: grid; justify-items: center; gap: 1px; text-align: center; padding: 14px 8px; border-radius: var(--r-lg); }
.stat-icon { font-size: 22px; line-height: 1.2; }
.stats strong { font: 800 24px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.stats span:last-child { color: var(--ink2); font-size: 14px; }

.recovery { display: grid; justify-items: center; text-align: center; gap: 8px; }
.recovery p:last-child { color: var(--ink2); }
.recovery-code {
  font: 800 clamp(32px, 9vw, 44px)/1.1 var(--display);
  letter-spacing: .08em;
  color: var(--marquee);
  padding: 8px 20px;
  border: 2px dashed var(--line2);
  border-radius: var(--r-lg);
  user-select: all;
}
.signout { display: grid; justify-items: center; gap: 6px; text-align: center; }

.message { display: grid; justify-items: center; gap: 12px; text-align: center; max-width: 520px; margin: 24px auto; }
.message p:not(.message-icon) { color: var(--ink2); }
.message-icon { font-size: 54px; line-height: 1; }

/* ------------------------------------------------------------- geniş ekran */
@media (min-width: 560px) {
  .cards { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
  .card-name { font-size: 14px; }
  .diffs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .final-actions { grid-template-columns: 1fr 1fr; }
  .stage { grid-template-columns: 136px minmax(0, 1fr); padding: 18px; }
  .ring { width: 136px; height: 136px; }
  .vinyl { inset: 16px; }
  .count { font-size: 30px; }
  .yt { height: 96px; }
}

@media (min-width: 760px) {
  body.has-nav { padding-bottom: 0; }
  .nav {
    position: static;
    display: flex;
    gap: 2px;
    height: auto;
    padding: 0;
    background: none;
    border: 0;
    margin-right: 8px;
  }
  .nav a { flex-direction: row; gap: 7px; padding: 0 12px; border-radius: var(--r-md); font-size: 15px; }
  .nav-icon { font-size: 17px; }
  .nav a:hover { background: var(--ghost); color: var(--ink); }
  .nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--marquee-fill); }
  .duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-cta { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .app-links { justify-content: flex-end; }
  .btn-store { flex: 0 1 auto; min-width: 150px; }
  .lb-rank { font-size: 20px; }
}

@media (min-width: 980px) {
  .play { grid-template-columns: 330px minmax(0, 1fr); align-items: start; }
  .stage {
    position: sticky;
    top: 12px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "ring" "ask" "player" "hint";
    justify-items: center;
    text-align: center;
    padding: 24px 18px;
    gap: 12px;
  }
  .ring { width: 192px; height: 192px; }
  .vinyl { inset: 22px; }
  .count { font-size: 42px; }
  .ask { align-self: auto; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

/* Çok dar telefonda (320 px) sahne düzeni taşmasın */
@media (max-width: 359px) {
  .brand-name { font-size: 17px; }
  .stage { grid-template-columns: 92px minmax(0, 1fr); gap: 6px 10px; padding: 12px; }
  .ring { width: 92px; height: 92px; }
  .vinyl { inset: 11px; }
  .count { font-size: 21px; }
  .ask { font-size: 18px; }
  .bulbs { gap: 4px; }
  .bulbs li { width: 11px; height: 11px; }
  .lb li { grid-template-columns: 30px 38px minmax(0, 1fr) auto; gap: 7px; }
  .av { width: 38px; height: 38px; font-size: 20px; }
  .av-xl { width: 68px; height: 68px; font-size: 36px; }
}

/* ------------------------------------------------------------- az hareket */
@media (prefers-reduced-motion: reduce) {
  .beams::before, .beams::after,
  .board::before, .board::after,
  .vinyl, .yt-eq i, .bulbs .b-now, .is-wrong .reveal-card { animation: none; }
  .confetti { display: none; }
  .board::after { opacity: .22; }
  .btn, .card, .diff { transition: none; }
  .card:hover, .card:active, .btn:active, input.sr:checked + .diff { transform: none; }
  /* Süre halkası bilgi taşır: kalır, adım adım akar */
  .ring-on, .count { animation-timing-function: steps(20, end); }
}

/* ==================== Ses katmanı (assets/js/game.js) ==================== */
.sound { display: grid; gap: 10px; }
.sound .yt { grid-area: auto; }
.yt-text { min-width: 0; }
.yt[data-state="loading"] .yt-eq i,
.yt[data-state="blocked"] .yt-eq i,
.yt[data-state="failed"] .yt-eq i { animation-play-state: paused; opacity: .45; }
.yt[data-state="failed"] .yt-cover { background: linear-gradient(120deg, #5A2340, #3A1630); }
.yt.is-open { height: 200px; }
.yt.is-open .yt-cover { display: none; }

.sound-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--marquee-fill);
  color: var(--on-marquee);
  font: 800 18px/1.1 var(--display);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 194, 75, .35);
  animation: pulse-go 1.1s ease-in-out infinite alternate;
}
.sound-go[hidden] { display: none; }
@keyframes pulse-go { to { transform: scale(1.025); box-shadow: 0 10px 32px rgba(255, 194, 75, .6); } }

.count[data-live] { animation: none; counter-reset: none; }
.count[data-live]::after { content: none; }

h1[tabindex="-1"]:focus { outline: none; }
body.is-loading .card, body.is-loading .btn-primary { pointer-events: none; }
body.is-loading .card:not(.is-picked) { opacity: .55; }

.reveal-fact {
  max-width: 460px;
  margin: 14px auto 18px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--raise);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .sound-go { animation: none; }
}
