/* ═══════════════════════════════════════════════════════════════
   KİM MİLYONER OLMAK İSTER — SINIF EDİSYONU
   Tasarım: "Neşeli Gündüz" karikatür konsepti
   Kalın konturlar, canlı renkler, comic gölgeler, zıplayan butonlar
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&display=swap');

:root {
  --ink: #23222b;               /* kontur & metin rengi */
  --sky-top: #8fd3ff;
  --sky-bot: #d8f2ff;
  --paper: #fffdf5;             /* kart zemini */
  --cream: #fff3d6;
  --sun: #ffc93c;
  --sun-deep: #ff9f1c;
  --red: #ff5d5d;
  --blue: #4dabf7;
  --green: #51cf66;
  --purple: #b197fc;
  --pink: #ff8fab;
  --correct: #37c871;
  --wrong: #ff5d5d;
  --shadow: 5px 6px 0 var(--ink);
  --shadow-sm: 3px 4px 0 var(--ink);
  --radius: 22px;
  --font: "Baloo 2", "Comic Sans MS", "Chalkboard SE", "Trebuchet MS", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bot) 100%);
  color: var(--ink);
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; color: var(--ink); }
input, textarea, select {
  font-family: inherit;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  color: var(--ink);
  padding: 10px 14px;
  font-size: 1rem;
  width: 100%;
  outline: none;
  box-shadow: inset 2px 3px 0 #00000012;
}
input:focus, textarea:focus, select:focus { border-color: var(--sun-deep); }
textarea { resize: vertical; }
::placeholder { color: #9a97a8; }

/* ─────────── Ekran yönetimi ─────────── */
.screen { display: none; min-height: 100vh; position: relative; }
.screen.active { display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 20px; }
#screen-admin.active { display: block; padding: 0; }

/* ─────────── Yüzen bulutlar ─────────── */
.clouds { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.clouds::before, .clouds::after {
  content: "";
  position: absolute;
  width: 180px; height: 60px;
  background: #ffffffee;
  border-radius: 60px;
  box-shadow: 40px -22px 0 -6px #ffffffee, 90px -10px 0 -2px #ffffffee,
              340px 90px 0 10px #ffffffbb, 420px 70px 0 -8px #ffffffbb,
              680px 30px 0 4px #ffffffdd, 750px 45px 0 -10px #ffffffdd;
  top: 12%; left: -80px;
  animation: cloud-drift 60s linear infinite;
}
.clouds::after {
  top: 58%; width: 140px; height: 46px;
  box-shadow: 30px -16px 0 -4px #ffffffcc, 70px -6px 0 -2px #ffffffcc,
              500px -120px 0 8px #ffffffaa, 560px -105px 0 -6px #ffffffaa;
  animation-duration: 90s; animation-delay: -30s;
}
@keyframes cloud-drift {
  from { transform: translateX(-200px); }
  to   { transform: translateX(calc(100vw + 300px)); }
}

/* ─────────── Butonlar (comic squash) ─────────── */
.btn {
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 1.05rem; font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: transform .1s, box-shadow .1s;
  background: #fff;
}
.btn:hover { transform: translate(-1px, -2px) rotate(-1deg); box-shadow: 5px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 3px) scale(.97); box-shadow: 1px 1px 0 var(--ink); }
.btn-gold { background: linear-gradient(180deg, #ffe066, var(--sun)); }
.btn-ghost { background: var(--paper); }
.btn-danger { background: var(--red); color: #fff; }
.btn-big { font-size: 1.3rem; padding: 16px 42px; }
.btn-small { font-size: .85rem; padding: 8px 16px; box-shadow: 2px 3px 0 var(--ink); }

/* ─────────── Ana Menü ─────────── */
.home-wrap { text-align: center; z-index: 1; }
.logo-ring {
  width: 300px; height: 300px; margin: 0 auto 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #ffe066, var(--sun) 60%, var(--sun-deep));
  border: 6px solid var(--ink);
  box-shadow: var(--shadow), 0 0 0 14px #ffffff88;
  display: flex; align-items: center; justify-content: center;
  animation: logo-bob 3.5s ease-in-out infinite;
  position: relative;
}
.logo-ring::before {
  content: "★"; position: absolute; top: -18px; right: 8px;
  font-size: 2.6rem; color: var(--pink); text-shadow: 2px 2px 0 var(--ink);
  transform: rotate(20deg);
}
.logo-ring::after {
  content: "★"; position: absolute; bottom: 4px; left: -14px;
  font-size: 1.8rem; color: var(--blue); text-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-15deg);
}
@keyframes logo-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}
.logo-inner { display: flex; flex-direction: column; line-height: 1.1; }
.logo-top { font-size: 1.5rem; letter-spacing: .35em; font-weight: 800; }
.logo-mid {
  font-size: 2.3rem; font-weight: 800; color: #fff;
  text-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-2deg);
}
.logo-bot { font-size: 1.25rem; letter-spacing: .12em; font-weight: 800; }
.logo-sub {
  margin-top: 10px; font-size: .72rem; letter-spacing: .28em; font-weight: 800;
  background: var(--ink); color: var(--sun); border-radius: 999px; padding: 3px 10px;
  align-self: center;
}
.home-buttons { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.home-foot { margin-top: 30px; color: #4a6a85; font-weight: 700; }

/* ─────────── Kart panelleri ─────────── */
.panel-card {
  z-index: 1; width: min(780px, 96vw);
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 30px 34px;
  box-shadow: var(--shadow);
}
.panel-card.narrow { width: min(470px, 96vw); }
.panel-card h2 { font-size: 1.6rem; margin-bottom: 6px; transform: rotate(-.5deg); }
.hint { color: #6b6880; font-size: .92rem; margin-bottom: 14px; }
.err { color: var(--wrong); font-size: .9rem; font-weight: 700; min-height: 1.2em; margin: 6px 0; }
.ok { color: #1e9e54; font-size: .9rem; font-weight: 700; min-height: 1.2em; margin: 6px 0; }
.row-btns { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.fld-label { display: block; font-size: .88rem; color: var(--ink); margin: 12px 0 6px; font-weight: 800; }

/* ─────────── Lobi ─────────── */
.lobby-grid { display: grid; grid-template-columns: 1fr 250px; gap: 24px; }
.lobby-right { text-align: center; }
.avatar-stage {
  width: 205px; height: 205px; margin: 0 auto 12px;
  background: radial-gradient(circle at 50% 30%, #fff, var(--cream));
  border: 4px solid var(--ink); border-radius: 50%;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.avatar-stage svg { width: 90%; height: 90%; }
.avatar-controls { display: flex; flex-direction: column; gap: 10px; }
.av-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.av-ctrl label { width: 86px; font-size: .85rem; font-weight: 800; }
.av-ctrl .swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch {
  width: 27px; height: 27px; border-radius: 50%;
  border: 3px solid var(--ink); cursor: pointer;
  transition: transform .1s;
}
.swatch:hover { transform: scale(1.15); }
.swatch.sel { box-shadow: 0 0 0 3px var(--sun); transform: scale(1.15); }
.av-arrows { display: flex; align-items: center; gap: 8px; }
.av-arrows button {
  background: var(--sun); border: 3px solid var(--ink);
  width: 32px; height: 32px; border-radius: 10px; font-size: 1rem; font-weight: 800;
  box-shadow: 2px 2px 0 var(--ink);
}
.av-arrows button:active { transform: translate(1px,1px); box-shadow: none; }
.av-arrows span { min-width: 86px; text-align: center; font-size: .88rem; font-weight: 700; }

/* ─────────── Oyun düzeni ─────────── */
.game-layout {
  z-index: 1; display: grid;
  grid-template-columns: minmax(0, 1fr) 235px;
  gap: 20px; width: min(1160px, 97vw);
}
.game-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Sunucu sahnesi */
.host-stage {
  position: relative; height: 305px;
  background:
    linear-gradient(180deg, #ffd97a 0%, #ffc93c 55%, #ff9f1c 100%);
  border: 4px solid var(--ink); border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.host-stage::before {  /* sahne perde süsü */
  content: "";
  position: absolute; top: -6px; left: 0; right: 0; height: 26px;
  background: radial-gradient(circle at 14px 0px, var(--red) 13px, transparent 14px);
  background-size: 28px 26px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 2px 0 var(--ink));
}
.host-stage::after {  /* zemin */
  content: "";
  position: absolute; bottom: 0; left: 0; right: 0; height: 34px;
  background: repeating-linear-gradient(90deg, #a86b2d 0 46px, #935a22 46px 92px);
  border-top: 3px solid var(--ink);
}
.spotlight {
  position: absolute; left: 50%; top: -30%;
  width: 320px; height: 150%; transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 0%, #ffffff88 0%, transparent 62%);
  pointer-events: none;
}
#host-container {
  /* sunucu videosu sahnenin tamamını kaplar */
  position: absolute; inset: 0; z-index: 2;
}

/* Soruya eklenen medya (GIF/resim/video) */
.q-media { text-align: center; margin-bottom: 12px; }
.q-media.hidden { display: none; }
.q-media img, .q-media video {
  max-width: 100%; max-height: 240px;
  border: 3px solid var(--ink); border-radius: 14px;
  background: #23222b;
}

.speech-bubble {
  position: absolute; right: 16px; top: 38px; z-index: 3;
  max-width: 305px;
  background: #fff; color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 12px 16px; font-size: .95rem; font-weight: 700;
  box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(-8px) scale(.9);
  transition: opacity .25s, transform .25s;
}
.speech-bubble::after {
  content: ""; position: absolute; left: -14px; bottom: 14px;
  width: 0; height: 0;
  border: 11px solid transparent;
  border-right-color: var(--ink);
}
.speech-bubble.show { opacity: 1; transform: none; }

.reaction-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.reaction-emoji {
  position: absolute; bottom: -50px; font-size: 2.5rem;
  animation: float-up 2.6s ease-out forwards;
  filter: drop-shadow(2px 2px 0 #00000033);
}
@keyframes float-up {
  0% { transform: translateY(0) rotate(0) scale(.6); opacity: 1; }
  100% { transform: translateY(-370px) rotate(35deg) scale(1.2); opacity: 0; }
}
.pow-burst {
  position: absolute; left: 50%; top: 34%; z-index: 5;
  transform: translate(-50%, -50%) rotate(-6deg);
  font-size: 2.6rem; font-weight: 800;
  color: #fff; -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 var(--ink);
  padding: 18px 30px;
  background: var(--pink);
  border: 4px solid var(--ink);
  clip-path: polygon(50% 0%, 61% 12%, 78% 5%, 80% 22%, 98% 24%, 88% 38%, 100% 50%, 88% 62%, 98% 76%, 80% 78%, 78% 95%, 61% 88%, 50% 100%, 39% 88%, 22% 95%, 20% 78%, 2% 76%, 12% 62%, 0% 50%, 12% 38%, 2% 24%, 20% 22%, 22% 5%, 39% 12%);
  animation: pow-in .35s cubic-bezier(.2, 2.2, .4, 1) forwards;
}
.pow-burst.good { background: var(--green); }
.pow-burst.bad { background: var(--red); }
@keyframes pow-in { from { transform: translate(-50%,-50%) scale(0) rotate(-40deg); } }

.player-badge {
  position: absolute; left: 14px; top: 34px; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 3px solid var(--ink);
  border-radius: 999px; padding: 5px 16px 5px 5px;
  box-shadow: var(--shadow-sm);
}
.player-badge-avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--cream); border: 2px solid var(--ink); }
.player-badge-avatar svg { width: 100%; height: 100%; }
.player-badge-name { font-size: .85rem; font-weight: 800; }
.player-badge-money { font-size: .82rem; color: var(--sun-deep); font-weight: 800; }

/* Zamanlayıcı */
.timer-wrap { position: absolute; left: 14px; bottom: 44px; width: 62px; height: 62px; z-index: 3; }
.timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: #fff; stroke: var(--ink); stroke-width: 5; }
.timer-fg { fill: none; stroke: var(--blue); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 163.4; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer-wrap span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.15rem;
}
.timer-wrap.danger .timer-fg { stroke: var(--wrong); }
.timer-wrap.danger span { color: var(--wrong); animation: blink .5s steps(2) infinite; }
.timer-wrap.hidden { display: none; }
@keyframes blink { 50% { opacity: .3; } }

/* Jokerler */
.jokers { display: flex; gap: 14px; justify-content: center; }
.joker {
  width: 88px; height: 46px;
  background: linear-gradient(180deg, #d4bdff, var(--purple));
  border: 3px solid var(--ink); border-radius: 50%;
  font-weight: 800; font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform .12s;
}
.joker:hover:not(:disabled) { transform: scale(1.12) rotate(-3deg); }
.joker:disabled { opacity: .3; cursor: not-allowed; text-decoration: line-through; box-shadow: 1px 1px 0 var(--ink); }
.joker.hidden { display: none; }

/* Soru & şık balonları */
.question-area { display: flex; flex-direction: column; gap: 12px; }
.q-lozenge, .a-lozenge {
  position: relative;
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 999px;
  padding: 15px 30px;
  font-size: 1.06rem;
  box-shadow: var(--shadow-sm);
}
.q-lozenge {
  min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 12px;
  font-weight: 800; text-align: center;
  background: var(--cream);
  transform: rotate(-.4deg);
}
.q-no {
  background: var(--sun); border: 3px solid var(--ink); font-weight: 800;
  border-radius: 50%; min-width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.answers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.a-lozenge {
  text-align: left; font-weight: 700;
  transition: transform .12s, background .2s;
  display: flex; align-items: center; gap: 10px;
}
.a-lozenge:nth-child(odd) { transform: rotate(-.5deg); }
.a-lozenge:nth-child(even) { transform: rotate(.5deg); }
.a-lozenge b {
  flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .9rem;
}
.a-lozenge[data-idx="0"] b { background: var(--red); color: #fff; }
.a-lozenge[data-idx="1"] b { background: var(--blue); color: #fff; }
.a-lozenge[data-idx="2"] b { background: var(--green); color: #fff; }
.a-lozenge[data-idx="3"] b { background: var(--purple); color: #fff; }
.a-lozenge:hover:not(:disabled) { transform: scale(1.03) rotate(0); background: #fff8dd; }
.a-lozenge.selected { background: var(--sun); animation: sel-wobble .6s ease-in-out infinite; }
@keyframes sel-wobble { 0%,100% { transform: rotate(-1deg) scale(1.02); } 50% { transform: rotate(1deg) scale(1.02); } }
.a-lozenge.correct { background: var(--correct); color: #fff; animation: correct-flash .4s ease-in-out 3; }
@keyframes correct-flash { 50% { filter: brightness(1.35); transform: scale(1.05); } }
.a-lozenge.wrong { background: var(--wrong); color: #fff; animation: wrong-shake .5s ease-in-out; }
@keyframes wrong-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.a-lozenge.removed { opacity: .12; pointer-events: none; }
.a-lozenge:disabled { cursor: default; }

/* Para listesi — bilet şeridi */
.money-ladder {
  background: var(--paper);
  border: 4px solid var(--ink); border-radius: 18px;
  padding: 16px 14px; height: fit-content;
  max-height: 84vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.money-ladder h3 { font-size: .95rem; text-align: center; margin-bottom: 12px; letter-spacing: .04em; }
.money-ladder ol { list-style: none; display: flex; flex-direction: column-reverse; gap: 4px; }
.money-ladder li {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  font-size: .9rem; font-weight: 800; color: #8d8a9e;
  border: 2px solid transparent;
}
.money-ladder li .no { color: #bbb8cc; }
.money-ladder li.current {
  background: var(--sun); color: var(--ink);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  animation: sel-wobble 1s ease-in-out infinite;
}
.money-ladder li.current .no { color: var(--ink); }
.money-ladder li.done { color: var(--correct); }
.money-ladder li.done .no { color: #9edcb6; }

/* Overlayler */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: #2a2440aa; backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.overlay.hidden { display: none; }
.overlay-card {
  background: var(--paper);
  border: 4px solid var(--ink); border-radius: var(--radius);
  padding: 30px 36px; text-align: center;
  width: min(450px, 92vw);
  box-shadow: 8px 9px 0 #00000055;
  animation: pop-in .3s cubic-bezier(.2, 1.8, .4, 1);
}
@keyframes pop-in { from { transform: scale(.7) rotate(-3deg); opacity: 0; } }
.confirm-q { font-size: 1.35rem; font-weight: 800; margin-bottom: 18px; }
.phone-text { font-size: 1.02rem; color: #55516b; margin-bottom: 18px; font-style: italic; }

.audience-bars { display: flex; justify-content: center; gap: 20px; height: 165px; align-items: flex-end; margin-bottom: 20px; }
.aud-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.aud-bar {
  width: 44px; border: 3px solid var(--ink); border-radius: 10px 10px 4px 4px;
  transition: height 1s cubic-bezier(.2, 1.4, .4, 1);
}
.aud-bar.b0 { background: var(--red); } .aud-bar.b1 { background: var(--blue); }
.aud-bar.b2 { background: var(--green); } .aud-bar.b3 { background: var(--purple); }
.aud-pct { font-size: .85rem; font-weight: 800; }
.aud-letter { font-weight: 800; }

.result-card .result-emoji { font-size: 4.2rem; animation: bounce-big .6s cubic-bezier(.2, 2, .4, 1); }
@keyframes bounce-big { 0% { transform: scale(0) rotate(-30deg); } }

/* Sonuç kartı: büyük GIF + "BAM!" çarpma efekti */
.result-card {
  position: relative;
  width: min(680px, 94vw);
  animation: bam-in .5s cubic-bezier(.2, 1.9, .3, 1);
}
@keyframes bam-in {
  0%   { transform: scale(2.4) rotate(5deg); opacity: 0; }
  50%  { transform: scale(.9) rotate(-2deg); opacity: 1; }
  72%  { transform: scale(1.06) rotate(1deg); }
  100% { transform: scale(1) rotate(0); }
}
.result-gif {
  max-width: 100%; max-height: min(52vh, 430px);
  border-radius: 14px; border: 3px solid var(--ink);
  margin: 10px auto; display: block;
  animation: gif-bam .55s cubic-bezier(.2, 2, .4, 1);
}
@keyframes gif-bam { 0% { transform: scale(.3) rotate(-6deg); opacity: 0; } 70% { transform: scale(1.05) rotate(1deg); } }
.result-gif.hidden { display: none; }
.result-title { font-size: 1.5rem; font-weight: 800; margin: 8px 0 4px; }
.result-title.good { color: #1e9e54; }
.result-title.bad { color: var(--wrong); }
.result-sub { color: #55516b; margin-bottom: 16px; font-weight: 600; }

/* ─────────── Mini oyun ─────────── */
.mini-hud { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.25rem; color: var(--sun-deep); margin-bottom: 14px; }
#mini-stage { min-height: 260px; }
.stroop-word { text-align: center; font-size: 3.2rem; font-weight: 800; margin: 26px 0; letter-spacing: .04em; -webkit-text-stroke: 1.5px var(--ink); }
.stroop-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stroop-btn {
  width: 76px; height: 58px; border-radius: 14px;
  border: 3px solid var(--ink); font-size: 1.4rem;
  box-shadow: var(--shadow-sm); transition: transform .1s;
}
.stroop-btn:hover { transform: scale(1.1) rotate(-2deg); }
.stroop-btn:active { transform: scale(.95); box-shadow: 1px 1px 0 var(--ink); }
.mini-q { text-align: center; font-size: 2.6rem; font-weight: 800; margin: 26px 0; }
.mini-opts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.mini-opt {
  min-width: 92px; padding: 14px; font-size: 1.4rem; font-weight: 800;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: var(--shadow-sm); transition: transform .1s;
}
.mini-opt:hover { transform: scale(1.08); background: var(--cream); }
.mini-feedback { text-align: center; font-size: 1.3rem; font-weight: 800; min-height: 1.6em; margin-top: 14px; }

/* ─────────── Oyun sonu ─────────── */
.end-summary { display: flex; align-items: center; gap: 20px; margin: 16px 0; }
.end-avatar {
  width: 92px; height: 92px; border-radius: 50%; overflow: hidden;
  border: 4px solid var(--ink); background: var(--cream); flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.end-avatar svg { width: 100%; height: 100%; }
.end-money { font-size: 2.5rem; font-weight: 800; color: var(--sun-deep); text-shadow: 2px 2px 0 #00000015; }
.end-stats div:last-child { color: #55516b; font-weight: 700; }
.lb-head { margin: 18px 0 10px; }
.lb-note { font-size: .75rem; color: #8d8a9e; font-weight: 600; }
.leaderboard { list-style: none; display: flex; flex-direction: column; gap: 7px; max-height: 250px; overflow-y: auto; padding: 4px; }
.leaderboard li {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 3px solid var(--ink); border-radius: 999px;
  padding: 6px 16px 6px 8px;
  box-shadow: 2px 3px 0 #00000022;
}
.leaderboard li.me { background: var(--sun); box-shadow: var(--shadow-sm); }
.lb-rank { font-weight: 800; min-width: 36px; font-size: 1.15rem; }
.lb-avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--cream); border: 2px solid var(--ink); flex-shrink: 0; }
.lb-avatar svg { width: 100%; height: 100%; }
.lb-name { flex: 1; font-weight: 800; }
.lb-detail { font-size: .8rem; color: #6b6880; font-weight: 600; }
.lb-money { font-weight: 800; color: var(--sun-deep); }
.result-code-box { margin-top: 18px; background: var(--cream); border: 3px dashed var(--ink); border-radius: 14px; padding: 14px; }
.result-code-box textarea { font-size: .78rem; margin: 6px 0; }

.confetti-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti {
  position: absolute; top: -20px; width: 11px; height: 17px;
  border: 2px solid var(--ink);
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ─────────── Admin paneli ─────────── */
.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }
.admin-tab-panel h3 { margin: 14px 0 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.tests-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.test-item {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 18px;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.test-item .t-title { font-weight: 800; flex: 1; min-width: 160px; font-size: 1.05rem; }
.test-item .t-meta { color: #6b6880; font-size: .85rem; font-weight: 600; }
.empty-note {
  color: #6b6880; padding: 34px; text-align: center; font-weight: 700;
  border: 3px dashed var(--ink); border-radius: 18px; margin-top: 12px;
  background: #ffffff88;
}

.editor-meta { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.fld { margin-bottom: 10px; }
.fld.narrow { max-width: 380px; }
.fld-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.fld-row .fld { flex: 1; min-width: 180px; }
.fld-row textarea { flex: 1; }
.check-row { display: flex; gap: 20px; flex-wrap: wrap; padding: 6px 0; }
.check-row label { display: flex; gap: 6px; align-items: center; cursor: pointer; font-weight: 700; }
.check-row input { width: auto; }

.q-card {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 18px;
  padding: 16px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.q-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.q-card-head .q-num {
  background: var(--sun); border: 3px solid var(--ink); font-weight: 800;
  border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.q-card-head input.q-text { flex: 1; }
.q-move { display: flex; gap: 4px; }
.q-move button, .q-del {
  background: #fff; border: 3px solid var(--ink);
  width: 32px; height: 32px; border-radius: 10px; font-weight: 800;
  box-shadow: 2px 2px 0 var(--ink);
}
.q-move button:active, .q-del:active { transform: translate(1px,1px); box-shadow: none; }
.q-del { background: var(--red); color: #fff; }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.q-opt { display: flex; align-items: center; gap: 8px; }
.q-opt .opt-letter { font-weight: 800; width: 20px; }
.q-opt input[type=radio] { width: auto; accent-color: var(--correct); transform: scale(1.4); }
.q-extra { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.q-extra label { font-size: .82rem; font-weight: 700; }
.q-extra input.q-value { width: 130px; }
.q-extra input.q-gif { flex: 1; min-width: 200px; }

.editor-actions { text-align: center; margin: 22px 0; }
.share-box { background: var(--cream); border: 3px dashed var(--ink); border-radius: 18px; padding: 16px; }
.share-box.hidden { display: none; }
.share-box textarea { font-size: .78rem; margin: 8px 0; }

/* ─────────── Öğretmen giriş kartı ─────────── */
.login-card {
  background: var(--paper); border: 4px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px 38px; width: min(440px, 94vw);
  margin: 6vh auto; text-align: center; position: relative; z-index: 2;
}
.login-hero { font-size: 3.4rem; margin-bottom: 6px; }
.login-card h2 { margin-bottom: 6px; }
.login-form { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.login-form input { text-align: center; font-size: 1.05rem; }
.login-divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; color: #8d8a9e; font-weight: 700;
}
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 2px dashed #d8d4c8; }
.local-login { text-align: left; background: var(--cream); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.local-login summary { cursor: pointer; font-weight: 700; font-size: .92rem; color: #6b6880; }
.local-login input { margin: 8px 0; }
.local-login .btn { width: 100%; }

/* ─────────── Kontrol paneli (dashboard) düzeni ─────────── */
.dash {
  display: grid; grid-template-columns: 84px 1fr 300px; gap: 20px;
  min-height: 100vh; padding: 20px;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bot));
  align-items: start;
}
.dash-side {
  position: sticky; top: 20px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: var(--shadow); padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-height: calc(100vh - 40px);
}
.dash-logo {
  font-size: 1.7rem; background: var(--sun); border: 3px solid var(--ink);
  border-radius: 14px; width: 52px; height: 52px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
}
.dash-nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.dash-nav .atab {
  width: 52px; height: 52px; font-size: 1.45rem; border-radius: 16px;
  background: transparent; border: 3px solid transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.dash-nav .atab:hover { transform: scale(1.12); background: var(--cream); }
.dash-nav .atab.active { background: var(--purple); border-color: var(--ink); box-shadow: 2px 3px 0 var(--ink); }
.dash-exit {
  width: 52px; height: 52px; font-size: 1.3rem; border-radius: 16px;
  background: transparent; border: 3px solid transparent; cursor: pointer;
}
.dash-exit:hover { background: #ffe3e3; }

.dash-main {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: var(--shadow); padding: 26px 30px; min-height: calc(100vh - 40px);
}
.dash-head {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding-bottom: 16px; border-bottom: 2px dashed #e8e4d8; margin-bottom: 18px;
  flex-wrap: wrap;
}
.dash-head h2 { font-size: 1.6rem; }

.dash-right { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 20px; }
.profile-card {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: var(--shadow); padding: 22px; text-align: center;
}
.profile-avatar {
  width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--sun); border: 3px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 900;
}
.profile-name { font-weight: 900; font-size: 1.15rem; }
.profile-sub { color: #6b6880; font-size: .84rem; font-weight: 600; margin: 4px 0 12px; }
.profile-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-tile {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 3px 4px 0 #00000022; padding: 12px 6px; text-align: center;
  display: flex; flex-direction: column; gap: 2px; font-size: 1.05rem;
}
.stat-tile b { font-size: 1.35rem; }
.stat-tile span { font-size: .74rem; color: #6b6880; font-weight: 700; letter-spacing: .04em; }

.donut-card {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: var(--shadow); padding: 18px; text-align: center;
}
.donut-card h4 { margin-bottom: 12px; }
.donut {
  width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 10px;
  border: 3px solid var(--ink);
  background: conic-gradient(#e8e4d8 0 100%);
  display: flex; align-items: center; justify-content: center;
}
.donut-hole {
  width: 92px; height: 92px; border-radius: 50%; background: var(--paper);
  border: 3px solid var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-hole b { font-size: 1.35rem; }
.donut-hole span { font-size: .72rem; color: #6b6880; font-weight: 700; }

@media (max-width: 1100px) {
  .dash { grid-template-columns: 72px 1fr; }
  .dash-right { grid-column: 1 / -1; position: static; flex-direction: row; flex-wrap: wrap; }
  .dash-right > * { flex: 1; min-width: 240px; }
}
@media (max-width: 700px) {
  .dash { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .dash-side {
    position: static; min-height: 0; flex-direction: row; justify-content: center;
    padding: 8px;
  }
  .dash-nav { flex-direction: row; }
  .dash-logo { margin-bottom: 0; }
  .dash-main { padding: 18px; min-height: 0; }
}

.results-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 12px; background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; }
.results-table th, .results-table td { padding: 10px 14px; text-align: left; border-bottom: 2px solid #e8e4d8; font-size: .92rem; }
.results-table th { background: var(--sun); border-bottom: 3px solid var(--ink); font-size: .82rem; letter-spacing: .04em; }
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: var(--cream); }

.hidden { display: none !important; }

/* ─────────── Duyarlılık ─────────── */
@media (max-width: 900px) {
  .game-layout { grid-template-columns: 1fr; }
  .money-ladder { order: -1; max-height: 150px; padding: 10px; }
  .money-ladder ol { flex-direction: row; flex-wrap: wrap-reverse; justify-content: center; }
  .money-ladder li { padding: 3px 9px; font-size: .75rem; }
  .money-ladder h3 { display: none; }
  .lobby-grid { grid-template-columns: 1fr; }
  .answers-grid { grid-template-columns: 1fr; }
  .host-stage { height: 250px; }
  .speech-bubble { max-width: 195px; font-size: .8rem; }
  .panel-card { padding: 20px; }
  .logo-ring { width: 240px; height: 240px; }
  .logo-mid { font-size: 1.8rem; }
  .result-gif { max-height: 40vh; }
}
