/* ==========================================================================
   Wahoot — tasarım sistemi
   Tokenlar → temel → bileşenler → sayfa düzenleri
   ========================================================================== */

:root {
  /* Renk */
  --ink: #1c1a3a;
  --ink-soft: #55526f;
  --ink-faint: #67647f;
  --paper: #f7f4ee;
  --card: #ffffff;
  --line: #e4dfd3;
  --brand: #5a3df0;
  --brand-ink: #ffffff;
  --brand-soft: #ece8ff;
  --good: #0c6f48;
  --good-soft: #dff5ea;
  --bad: #b42d25;
  --bad-soft: #fde6e4;
  --warn-soft: #fff1cc;

  /* Şık renkleri: her biri bir şekille eşleşir (renk körlüğü için) */
  --opt-a: #e0453a;
  --opt-b: #2563d8;
  --opt-c: #c27400;
  --opt-d: #12945a;

  /* Ölçekler */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --shadow-1: 0 1px 2px rgba(28, 26, 58, .06), 0 2px 8px rgba(28, 26, 58, .05);
  --shadow-2: 0 10px 30px rgba(28, 26, 58, .12);
  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1eff9;
    --ink-soft: #bcb8d4;
    --ink-faint: #8985a6;
    --paper: #14122b;
    --card: #1e1c3a;
    --line: #34315a;
    --brand: #8b74ff;
    --brand-ink: #14122b;
    --brand-soft: #2b2759;
    --good: #3ed195;
    --good-soft: #143a2d;
    --bad: #ff7a70;
    --bad-soft: #43201f;
    --warn-soft: #3d3216;
    --opt-b: #3f7bf0;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, .4);
  }
}

/* ---------- Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 var(--s3); letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 var(--s3); }
a { color: var(--brand); }
.muted { color: var(--ink-soft); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: var(--s3) var(--s4); z-index: 100; }
.skip:focus { left: 0; }

/* ---------- Düzen ---------- */
.wrap { width: min(1080px, 100% - 2 * var(--s4)); margin-inline: auto; }
.wrap-narrow { width: min(520px, 100% - 2 * var(--s4)); margin-inline: auto; }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* ---------- Üst çubuk ---------- */
.topbar { padding: var(--s4) 0; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; color: var(--ink); font: 800 1.35rem var(--font-display); letter-spacing: -.03em; }
.brand svg { width: 34px; height: 34px; }
.nav { display: flex; gap: var(--s2); align-items: center; }

/* ---------- Düğmeler ---------- */
.btn {
  --bg: var(--card); --fg: var(--ink); --bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s5);
  background: var(--bg); color: var(--fg);
  border: 2px solid var(--bd); border-radius: var(--r-md);
  font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { --bg: var(--brand); --fg: var(--brand-ink); --bd: var(--brand); }
.btn.danger { --fg: var(--bad); --bd: var(--bad-soft); }
.btn.ghost { --bg: transparent; --bd: transparent; }
.btn.ghost:hover:not(:disabled) { --bg: var(--brand-soft); box-shadow: none; }
.btn.sm { min-height: 36px; padding: 0 var(--s4); font-size: .9rem; border-radius: var(--r-sm); }
.btn.lg { min-height: 56px; padding: 0 var(--s6); font-size: 1.15rem; }
.btn.block { width: 100%; }
.btn .spin { width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kart ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-1); }
.card.pad-lg { padding: var(--s6); }

/* ---------- Form ---------- */
.field { display: block; }
.field > span, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: var(--s1); color: var(--ink-soft); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: var(--s3) var(--s4);
  background: var(--card); color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--r-md);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 84px; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input.invalid { border-color: var(--bad); }
.hint { font-size: .85rem; color: var(--ink-faint); margin-top: var(--s1); }
.error-text { color: var(--bad); font-size: .9rem; margin-top: var(--s1); font-weight: 600; }
.pin-input { text-align: center; font: 800 2rem var(--font-display); letter-spacing: .35em; padding-left: .35em; }

/* ---------- Sekmeler ---------- */
.tabs { display: flex; gap: var(--s1); padding: var(--s1); background: var(--brand-soft); border-radius: var(--r-md); }
.tab { flex: 1; min-height: 40px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-soft); font: 700 .95rem var(--font-body); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- Rozet / toast ---------- */
.chip { display: inline-flex; align-items: center; gap: var(--s1); padding: 2px var(--s3); border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .85rem; }
.toasts { position: fixed; left: 50%; bottom: var(--s5); transform: translateX(-50%); display: grid; gap: var(--s2); z-index: 60; width: min(440px, 100% - 2 * var(--s4)); pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: var(--s3) var(--s4); border-radius: var(--r-md); box-shadow: var(--shadow-2); font-weight: 600; animation: rise .25s var(--ease); }
.toast.error { background: var(--bad); color: #fff; }
.toast.success { background: var(--good); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20, 18, 43, .55); display: grid; place-items: center; padding: var(--s4); z-index: 50; }
.modal { background: var(--card); border-radius: var(--r-lg); padding: var(--s6); width: min(440px, 100%); box-shadow: var(--shadow-2); animation: rise .25s var(--ease); }

/* ---------- Boş durum / yükleniyor ---------- */
.empty { text-align: center; padding: var(--s7) var(--s4); border: 2px dashed var(--line); border-radius: var(--r-lg); }
.empty svg { width: 64px; height: 64px; margin-bottom: var(--s3); }
.skeleton { height: 92px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--line), var(--brand-soft), var(--line)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Şık düğmeleri (A-D) ---------- */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 560px) { .opts { grid-template-columns: 1fr; } }
.opt {
  --c: var(--opt-a);
  position: relative; display: flex; align-items: center; gap: var(--s3);
  min-height: 84px; padding: var(--s3) var(--s4);
  background: var(--c); color: #fff; border: 0; border-radius: var(--r-md);
  font: 700 1.2rem/1.25 var(--font-body); text-align: left; cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .22);
  transition: transform .12s var(--ease), box-shadow .12s, opacity .2s, filter .2s;
}
.opt:nth-child(2) { --c: var(--opt-b); }
.opt:nth-child(3) { --c: var(--opt-c); }
.opt:nth-child(4) { --c: var(--opt-d); }
.opt:hover:not(:disabled) { transform: translateY(-2px); }
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.opt .shape { width: 28px; height: 28px; flex: none; fill: currentColor; }
.opt .txt { overflow-wrap: anywhere; }
.opt:disabled { cursor: default; }
.opt.picked { outline: 4px solid var(--ink); outline-offset: 3px; }
.opt.dim { opacity: .3; filter: saturate(.4); }
.opt.right::after, .opt.wrong::after {
  content: ""; position: absolute; right: var(--s3); top: 50%; width: 30px; height: 30px; margin-top: -15px;
  background: #fff center/18px no-repeat; border-radius: 50%;
}
.opt.right::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2311885a' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12l5 5L20 6'/%3E%3C/svg%3E"); }
.opt.wrong::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d23a31' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }

/* ---------- Süre çubuğu ---------- */
.timer { display: flex; align-items: center; gap: var(--s3); }
.timer-num { font: 800 2rem var(--font-display); min-width: 2.2ch; text-align: center; font-variant-numeric: tabular-nums; }
.timer-num.low { color: var(--bad); }
.timer-bar { flex: 1; height: 12px; background: var(--brand-soft); border-radius: 99px; overflow: hidden; }
.timer-bar > i { display: block; height: 100%; width: 100%; background: var(--brand); border-radius: 99px; transform-origin: left; }
.timer-bar.low > i { background: var(--bad); }

/* ---------- Sıralama ---------- */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); counter-reset: rank; }
.board li {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); background: var(--card); border: 2px solid var(--line); border-radius: var(--r-md);
  font-weight: 700; animation: rise .35s var(--ease) backwards;
}
.board li::before { counter-increment: rank; content: counter(rank); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font: 800 .95rem var(--font-display); flex: none; }
.board li:nth-child(1)::before { background: #f5c542; color: #3a2d00; }
.board li:nth-child(2)::before { background: #d4d7de; color: #2a2d36; }
.board li:nth-child(3)::before { background: #e0a070; color: #3a1f08; }
.board .name { flex: 1; overflow-wrap: anywhere; }
.board .score { font: 800 1.15rem var(--font-display); font-variant-numeric: tabular-nums; }
.board li.me { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Sayfa: ana sayfa ---------- */
.hero { padding: var(--s7) 0 var(--s8); display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--s7); align-items: center; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; padding-top: var(--s5); gap: var(--s6); } }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 34ch; }
.join-card { transform: rotate(1.2deg); }
@media (max-width: 820px) { .join-card { transform: none; } }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); padding-bottom: var(--s8); }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: var(--brand-ink); font: 800 1.1rem var(--font-display); margin-bottom: var(--s3); }

/* ---------- Sayfa: öğretmen paneli ---------- */
.page-head { padding: var(--s6) 0 var(--s5); }
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: var(--s4); padding-bottom: var(--s8); }
.quiz-card { display: flex; flex-direction: column; gap: var(--s3); }
.quiz-card h3 { margin: 0; overflow-wrap: anywhere; }
.quiz-card p { margin: 0; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quiz-card .actions { margin-top: auto; display: flex; gap: var(--s2); flex-wrap: wrap; }
.quiz-card .actions .btn { white-space: nowrap; }
.quiz-card .actions .btn.primary { flex: 1; }

/* ---------- Sayfa: quiz editörü ---------- */
.q-card { position: relative; }
.q-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.q-num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: var(--paper); font: 800 1rem var(--font-display); flex: none; }
.q-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s4) 0; }
.a-row { display: flex; align-items: center; gap: var(--s2); }
.a-row + .a-row { margin-top: var(--s2); }
.a-badge { --c: var(--opt-a); width: 40px; height: 48px; border-radius: var(--r-sm); background: var(--c); color: #fff; display: grid; place-items: center; flex: none; }
.a-row:nth-child(2) .a-badge { --c: var(--opt-b); }
.a-row:nth-child(3) .a-badge { --c: var(--opt-c); }
.a-row:nth-child(4) .a-badge { --c: var(--opt-d); }
.a-badge svg { width: 20px; height: 20px; fill: currentColor; }
.a-correct { display: flex; align-items: center; gap: var(--s1); font-size: .85rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; cursor: pointer; padding: 0 var(--s2); min-height: 44px; }
.a-correct input { width: 20px; height: 20px; accent-color: var(--good); }
.savebar { position: sticky; bottom: 0; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: var(--s3) 0; margin-top: var(--s6); }

/* ---------- Sayfa: oyun / oturum ---------- */
.stage { min-height: 100vh; display: flex; flex-direction: column; }
.stage main { flex: 1; display: grid; align-content: start; padding: var(--s4) 0 var(--s7); }
.center { text-align: center; }
.pin-big { font: 800 clamp(3.4rem, 14vw, 7.5rem) var(--font-display); letter-spacing: .08em; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.lobby-hero { padding: var(--s6) var(--s5); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.players { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; min-height: 48px; }
.player { background: var(--brand-soft); color: var(--brand); padding: var(--s2) var(--s4); border-radius: 99px; font-weight: 700; animation: pop .3s var(--ease); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.q-text { font: 700 clamp(1.4rem, 4vw, 2.2rem)/1.2 var(--font-display); letter-spacing: -.015em; overflow-wrap: anywhere; }
.q-card-host { padding: var(--s6); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); margin-bottom: var(--s4); }
.result-banner { padding: var(--s6) var(--s5); border-radius: var(--r-lg); text-align: center; font: 800 clamp(1.6rem, 6vw, 2.4rem) var(--font-display); }
.result-banner.good { background: var(--good-soft); color: var(--good); }
.result-banner.bad { background: var(--bad-soft); color: var(--bad); }
.result-banner.neutral { background: var(--warn-soft); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); align-items: end; margin: var(--s5) 0; }
.podium > div { text-align: center; border-radius: var(--r-md) var(--r-md) 0 0; padding: var(--s3) var(--s2); background: var(--brand-soft); font-weight: 700; overflow-wrap: anywhere; }
.podium .n { font: 800 1.6rem var(--font-display); }
.podium .p1 { order: 2; min-height: 150px; background: #f5c542; color: #3a2d00; }
.podium .p2 { order: 1; min-height: 110px; background: #d4d7de; color: #2a2d36; }
.podium .p3 { order: 3; min-height: 84px; background: #e0a070; color: #3a1f08; }
.dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.conn { position: fixed; top: 0; left: 0; right: 0; padding: var(--s2); text-align: center; background: var(--warn-soft); font-weight: 700; z-index: 70; }

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


/* ==========================================================================
   Eklemeler: gezinme, istatistik, grafik, rapor, oyun geri bildirimi
   ========================================================================== */
.nav a.btn[aria-current="page"] { background: var(--brand-soft); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.tile { padding: var(--s4); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.tile b { display: block; font: 800 1.9rem var(--font-display); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { color: var(--ink-soft); font-size: .9rem; }

.switch { display: flex; align-items: center; gap: var(--s3); cursor: pointer; min-height: 44px; }
.switch input { width: 22px; height: 22px; accent-color: var(--brand); }
.seg { display: inline-flex; gap: var(--s1); padding: var(--s1); background: var(--brand-soft); border-radius: var(--r-md); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: grid; place-items: center; min-width: 64px; min-height: 40px; padding: 0 var(--s3); border-radius: var(--r-sm); font-weight: 700; color: var(--ink-soft); }
.seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }
.seg input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

.avatars { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s2); }
.avatars label { cursor: pointer; }
.avatars input { position: absolute; opacity: 0; }
.avatars span { display: grid; place-items: center; height: 48px; font-size: 1.6rem; background: var(--card); border: 2px solid var(--line); border-radius: var(--r-md); transition: transform .12s; }
.avatars input:checked + span { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.08); }
.avatars input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

.avatar { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--brand-soft); font-size: 1em; flex: none; }
.player { display: inline-flex; align-items: center; gap: var(--s2); }
.player.off { opacity: .45; }
.player button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; min-width: 28px; min-height: 28px; border-radius: 50%; }
.player button:hover { background: var(--bad-soft); color: var(--bad); }

.progress { height: 10px; background: var(--brand-soft); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .3s var(--ease); }

/* Cevap dağılımı: yatay çubuklar; şık kimliği renk + şekil + harf ile verilir */
.dist { display: grid; gap: var(--s2); }
.dist-row { --c: var(--opt-a); display: grid; grid-template-columns: 34px 1fr; gap: var(--s3); align-items: center; }
.dist-row:nth-child(2) { --c: var(--opt-b); }
.dist-row:nth-child(3) { --c: var(--opt-c); }
.dist-row:nth-child(4) { --c: var(--opt-d); }
.dist-key { width: 34px; height: 34px; border-radius: 8px; background: var(--c); color: #fff; display: grid; place-items: center; }
.dist-key svg { width: 18px; height: 18px; fill: currentColor; }
.dist-body { min-width: 0; }
.dist-label { display: flex; justify-content: space-between; gap: var(--s3); font-weight: 600; font-size: .95rem; }
.dist-label .t { overflow-wrap: anywhere; }
.dist-label .n { font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }
.dist-bar { height: 10px; margin-top: 4px; background: var(--brand-soft); border-radius: 99px; overflow: hidden; }
.dist-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--c); width: 0; min-width: 0; transition: width .6s var(--ease); }
.dist-row.right .dist-label .t::after { content: " ✓ doğru"; color: var(--good); font-weight: 800; }
.dist-row:not(.right).has-correct .dist-key, .dist-row:not(.right).has-correct .dist-bar > i { opacity: .55; }

/* Rapor tabloları */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th, .tbl td { padding: var(--s3) var(--s4); text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); background: var(--paper); position: sticky; top: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.qrow { padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.qrow + .qrow { margin-top: var(--s3); }
.qrow .head { display: flex; gap: var(--s3); align-items: flex-start; justify-content: space-between; }
.pct-bar { height: 12px; margin: var(--s2) 0 var(--s3); background: var(--brand-soft); border-radius: 99px; overflow: hidden; }
.pct-bar > i { display: block; height: 100%; background: var(--good); border-radius: 99px; }
.pct-bar.hard > i { background: var(--bad); }
.flag { display: inline-flex; gap: 4px; align-items: center; padding: 2px var(--s2); border-radius: 99px; background: var(--bad-soft); color: var(--bad); font-weight: 800; font-size: .8rem; white-space: nowrap; }
.flag.ok { background: var(--good-soft); color: var(--good); }

/* Öğrenci geri bildirimi */
.feedback { text-align: center; padding: var(--s6) var(--s4); border-radius: var(--r-lg); animation: pop .35s var(--ease); }
.feedback.good { background: var(--good-soft); color: var(--good); }
.feedback.bad { background: var(--bad-soft); color: var(--bad); }
.feedback.none { background: var(--warn-soft); color: var(--ink); }
.feedback .big { font: 800 clamp(2rem, 9vw, 3.2rem) var(--font-display); line-height: 1.05; }
.feedback .pts { font: 800 1.6rem var(--font-display); margin-top: var(--s2); }
.streak { display: inline-block; margin-top: var(--s2); padding: 2px var(--s3); border-radius: 99px; background: var(--card); color: var(--ink); font-weight: 800; }
.rank-big { font: 800 clamp(2.4rem, 11vw, 3.6rem) var(--font-display); line-height: 1; }
.delta { font-weight: 800; font-size: .9rem; white-space: nowrap; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.same { color: var(--ink-faint); }
.board .delta { margin-left: auto; margin-right: var(--s2); }
.board li .avatar { background: transparent; }
.q-image { display: block; max-width: 100%; max-height: 300px; margin: 0 auto; border-radius: var(--r-md); object-fit: contain; }
.podium > div { transform-origin: bottom; animation: rise-up .7s var(--ease) backwards; }
.podium .p3 { animation-delay: .1s; } .podium .p2 { animation-delay: 1s; } .podium .p1 { animation-delay: 1.9s; }
@keyframes rise-up { from { transform: scaleY(.05); opacity: 0; } }

.sound-btn { position: fixed; right: var(--s4); bottom: var(--s4); z-index: 40; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); cursor: pointer; font-size: 1.3rem; box-shadow: var(--shadow-1); }
.host-bar { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; justify-content: center; margin-top: var(--s5); }
.import-box { width: 100%; min-height: 160px; font: .9rem/1.5 ui-monospace, Menlo, Consolas, monospace; }
.link-list a { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); text-decoration: none; color: var(--ink); }
.link-list a:hover { border-color: var(--brand); }
.link-list a + a { margin-top: var(--s2); }

.stack > .board { margin-top: var(--s4); }

.fs { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.fs > legend { padding: 0; }

/* ---------- İçe aktarma ve yapay zeka ---------- */
.modal { max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.wide { width: min(640px, 100%); }
.import-bar { display: grid; gap: var(--s3); background: var(--brand-soft); border-color: transparent; }
.ai-btn { --bg: var(--ink); --fg: var(--paper); --bd: var(--ink); }
.ai-chip { background: var(--ink); color: var(--paper); }
.q-card.from-ai { border-color: var(--ink); }
.issue-list { margin: 0; padding-left: 1.2em; max-height: 180px; overflow-y: auto; font-size: .9rem; color: var(--ink-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.ai-wait { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--brand-soft); font-weight: 600; }
.ai-wait .spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--brand); border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
