/* =============================================
   DUSNOTE DENEME SINAVI — PREMIUM
   Dark + Light theme via [data-theme]
   ============================================= */

:root {
  /* DARK (default) */
  --bg: #0B0F19;
  --bg-2: #0F1424;
  --bg-3: #161D31;
  --surface: rgba(22, 29, 49, 0.7);
  --surface-2: rgba(15, 20, 36, 0.85);
  --line: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.04);

  --ink: #F5F2EA;
  --ink-2: #B8BFD0;
  --ink-3: #6B7593;
  --ink-4: #3F4866;

  --gold: #C9A75A;
  --gold-2: #E5C57A;
  --gold-dim: rgba(201,167,90,0.18);

  --brand: #6FA8FF;
  --brand-2: #2E7DFF;
  --brand-deep: #0A3B96;
  --brand-tint: rgba(46,125,255,0.16);

  --hl: rgba(255, 215, 88, 0.32);
  --hl-strong: rgba(255, 215, 88, 0.55);

  --green: #5BD49C;
  --red: #FF6B7A;
  --amber: #FFC15E;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.25);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.5);
  --shadow-lg: 0 30px 80px rgba(0,0,0,0.6);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  --font-sans: 'Manrope', system-ui, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

[data-theme="light"] {
  --bg: #F5F1E8;
  --bg-2: #FAF7F0;
  --bg-3: #FFFFFF;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-2: rgba(255, 255, 255, 0.95);
  --line: rgba(15, 20, 36, 0.10);
  --line-2: rgba(15, 20, 36, 0.05);

  --ink: #14182B;
  --ink-2: #4A5168;
  --ink-3: #7B8299;
  --ink-4: #B5BBCD;

  --gold: #A8852D;
  --gold-2: #C9A75A;
  --gold-dim: rgba(168,133,45,0.12);

  --brand: #1B5BCC;
  --brand-2: #2E7DFF;
  --brand-deep: #0A3B96;
  --brand-tint: rgba(46,125,255,0.12);

  --hl: rgba(255, 196, 0, 0.30);
  --hl-strong: rgba(255, 196, 0, 0.55);

  --green: #1F8A5B;
  --red: #C03B3B;
  --amber: #B87A0E;

  --shadow-sm: 0 1px 2px rgba(15,20,36,0.05), 0 4px 14px rgba(15,20,36,0.06);
  --shadow-md: 0 8px 24px rgba(15,20,36,0.08);
  --shadow-lg: 0 20px 60px rgba(15,20,36,0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  transition: background .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { display: block; }
kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--line);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

/* Screens */
.screen { display: none; }
.screen.active { display: block; }

/* ===================== THEME TOGGLE ===================== */
.theme-toggle {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  display: grid; place-items: center;
  transition: transform .2s, color .2s, background .2s;
  backdrop-filter: blur(20px);
}
.theme-toggle:hover { color: var(--gold); transform: scale(1.05); }
.theme-toggle .t-sun { display: none; }
[data-theme="dark"] .theme-toggle .t-moon { display: block; }
[data-theme="dark"] .theme-toggle .t-sun { display: none; }
[data-theme="light"] .theme-toggle .t-sun { display: block; }
[data-theme="light"] .theme-toggle .t-moon { display: none; }

/* ===================== INTRO / RESULT SHARED BG ===================== */
.intro-bg {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.5;
  mix-blend-mode: overlay;
}
[data-theme="light"] .grain { opacity: 0.35; mix-blend-mode: multiply; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(46,125,255,0.35) 0%, transparent 70%);
  top: -200px; right: -200px;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(201,167,90,0.28) 0%, transparent 70%);
  bottom: -200px; left: -150px;
}
[data-theme="light"] .orb-1 { background: radial-gradient(circle, rgba(46,125,255,0.22) 0%, transparent 70%); opacity: 0.7; }
[data-theme="light"] .orb-2 { background: radial-gradient(circle, rgba(168,133,45,0.20) 0%, transparent 70%); opacity: 0.7; }

/* ===================== INTRO ===================== */
.screen-intro { position: relative; min-height: 100vh; display: none; flex-direction: column; }
.screen-intro.active { display: flex; }

.intro-header {
  position: relative; z-index: 2;
  padding: 28px 48px;
  display: flex; justify-content: space-between; align-items: center;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-sans);
  font-weight: 800; font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
.brand em { font-style: normal; color: var(--gold); }
[data-theme="light"] .brand em { color: var(--gold); }
.brand-sm { font-size: 16px; }
.brand-sm img { width: 28px; height: 28px; border-radius: 7px; }

.intro-header-right { display: flex; align-items: center; gap: 16px; }
.quiet-link { color: var(--ink-3); font-size: 14px; font-weight: 500; transition: color .15s; }
.quiet-link:hover { color: var(--ink); }

.intro-main {
  position: relative; z-index: 1;
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 48px 100px;
  display: flex; flex-direction: column; align-items: flex-start;
}

.intro-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid var(--gold-dim);
  border-radius: var(--r-pill);
  background: var(--gold-dim);
  margin-bottom: 32px;
}
.intro-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-dim);
}

.intro-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 24px;
}
.intro-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
  font-family: var(--font-serif);
  position: relative;
}
.intro-title em::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.6;
}

.intro-lead {
  font-size: 20px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0 0 48px;
  max-width: 580px;
}

/* Stats */
.intro-stats {
  display: flex; align-items: center; gap: 28px;
  margin-bottom: 56px;
  padding: 28px 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
}
.i-stat-div { width: 1px; height: 36px; background: var(--line); }
.i-stat-num {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 40px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.i-stat-num span { font-size: 16px; color: var(--ink-3); margin-left: 2px; }
.i-stat-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  margin-top: 6px;
}

/* Features */
.intro-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  margin-bottom: 56px;
}
.i-feat {
  display: flex; gap: 14px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px);
}
.i-feat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gold-dim);
  color: var(--gold);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.i-feat b { display: block; color: var(--ink); font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.i-feat span { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }

/* Start button */
.btn-start {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 20px 36px;
  background: linear-gradient(180deg, var(--gold-2) 0%, var(--gold) 100%);
  color: #14182B;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.005em;
  border-radius: var(--r-pill);
  box-shadow: 0 12px 32px rgba(201,167,90,0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -3px 0 rgba(0,0,0,0.12);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(201,167,90,0.5), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -3px 0 rgba(0,0,0,0.12); }

.intro-note {
  margin-top: 22px;
  font-size: 13px;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 8px;
}

.intro-footer {
  position: relative; z-index: 1;
  padding: 24px 48px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
  color: var(--ink-3);
}
.intro-foot-keys { display: flex; align-items: center; gap: 8px; }

/* ===================== EXAM ===================== */
.screen-exam { min-height: 100vh; display: none; flex-direction: column; }
.screen-exam.active { display: flex; }

.exam-bar {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(28px);
  padding: 14px 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.bar-left { display: flex; align-items: center; gap: 20px; }
.bar-divider { width: 1px; height: 28px; background: var(--line); }
.bar-meta-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 700;
}
.bar-meta-name { font-size: 14px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.bar-center { display: flex; justify-content: center; }
.bar-right { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }

/* Timer */
.timer {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 14px 8px 18px;
  background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
[data-theme="light"] .timer { background: linear-gradient(180deg, #FFF 0%, #FAF7F0 100%); box-shadow: var(--shadow-sm); }
.timer.warning { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 0 24px rgba(255,193,94,0.2); }
.timer.danger {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red), 0 0 24px rgba(255,107,122,0.3);
  animation: timerPulse 1.5s ease-in-out infinite;
}
@keyframes timerPulse { 50% { box-shadow: 0 0 0 1px var(--red), 0 0 40px rgba(255,107,122,0.5); } }

.timer-icon { color: var(--gold); }
.timer.warning .timer-icon { color: var(--amber); }
.timer.danger .timer-icon { color: var(--red); }
.timer-display { text-align: center; }
.timer-time {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.timer-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-top: 2px;
}
.timer-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-2);
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.timer-btn:hover { background: var(--gold); color: #14182B; }

.btn-end {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-end:hover { background: var(--red); border-color: var(--red); color: white; }

/* Exam layout */
.exam-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  position: relative;
}
.question-col {
  display: flex; flex-direction: column;
  padding: 0;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}
.nav-col {
  border-left: 1px solid var(--line);
  background: var(--bg-2);
  display: flex; flex-direction: column;
  position: sticky; top: 71px;
  height: calc(100vh - 71px);
}
[data-theme="light"] .nav-col { background: var(--bg-2); }

/* Tool ribbon */
.tool-ribbon {
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px 36px 20px;
  gap: 16px;
}
.ribbon-left { display: flex; align-items: center; gap: 16px; }
.q-number {
  display: flex; align-items: baseline; gap: 4px;
  font-family: var(--font-serif);
}
.q-num-current {
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.q-num-total {
  font-size: 18px;
  color: var(--ink-3);
  font-weight: 500;
}
.q-branch {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  background: var(--brand-tint);
  color: var(--brand);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.flag-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: all .15s;
}
.flag-btn:hover { color: var(--amber); border-color: var(--amber); }
.flag-btn.active {
  background: var(--amber);
  color: #14182B;
  border-color: var(--amber);
}

.tools {
  display: flex; align-items: center; gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  backdrop-filter: blur(12px);
}
.tool {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background .15s, color .15s;
}
.tool:hover { background: var(--line); color: var(--ink); }
.tool.active { background: var(--gold); color: #14182B; }
.tool-divider { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }

/* Question content */
.question-wrap {
  padding: 12px 36px 40px;
  flex: 1;
  --q-zoom: 1;
}
.q-stem {
  font-size: calc(19px * var(--q-zoom));
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 32px;
  letter-spacing: -0.005em;
}
.q-stem b { font-weight: 700; color: var(--ink); }

/* Highlight + strike inline marks */
.hl {
  background: var(--hl);
  padding: 1px 2px;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.strike {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--red);
  color: var(--ink-3);
}

/* Options */
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  user-select: text;
  position: relative;
}
.opt:hover { border-color: var(--ink-4); }
.opt:active { transform: scale(0.998); }
.opt.selected {
  border-color: var(--brand);
  background: var(--brand-tint);
}
.opt.eliminated {
  opacity: 0.4;
}
.opt.eliminated .opt-text {
  text-decoration: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}
.opt-letter {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-2);
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.opt.selected .opt-letter { background: var(--brand); color: white; }
.opt-text {
  flex: 1;
  font-size: calc(15.5px * var(--q-zoom));
  line-height: 1.55;
  color: var(--ink);
  padding-top: 4px;
}

/* Zoom controls in tool ribbon */
.zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.zoom-btn { padding: 6px 8px; }
.zoom-pct {
  min-width: 46px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.zoom-pct:hover { background: var(--line); color: var(--ink); }
.opt-eliminate {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s;
  flex-shrink: 0;
}
.opt:hover .opt-eliminate { opacity: 1; }
.opt-eliminate:hover { background: var(--red); color: white; opacity: 1; }
.opt.eliminated .opt-eliminate { opacity: 1; background: var(--red); color: white; }

/* Footer nav */
.q-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 36px 32px;
  gap: 16px;
  border-top: 1px solid var(--line-2);
}
.foot-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: all .15s;
}
.foot-btn:hover:not(:disabled) { border-color: var(--ink-4); }
.foot-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.foot-btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
[data-theme="light"] .foot-btn-primary { background: #14182B; color: white; border-color: #14182B; }
.foot-btn-primary:hover:not(:disabled) {
  background: var(--gold);
  color: #14182B;
  border-color: var(--gold);
}
.foot-clear {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
}
.foot-clear:hover { color: var(--red); }

/* ===================== NAVIGATOR ===================== */
.nav-col.collapsed { width: 60px; }
.nav-col.collapsed .nav-head .nav-title,
.nav-col.collapsed .nav-progress,
.nav-col.collapsed .nav-legend,
.nav-col.collapsed .nav-grid,
.nav-col.collapsed .nav-submit { display: none; }

.nav-head {
  padding: 20px 24px 14px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line-2);
}
.nav-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
  font-weight: 700;
}
.nav-collapse {
  width: 28px; height: 28px;
  border-radius: 50%;
  color: var(--ink-3);
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.nav-collapse:hover { background: var(--line); color: var(--ink); }

.nav-progress { padding: 18px 24px 14px; }
.np-bar {
  height: 6px;
  background: var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.np-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
  border-radius: var(--r-pill);
  transition: width .3s ease;
}
.np-stats {
  display: flex; justify-content: space-between;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.np-stats b { color: var(--ink); font-weight: 700; }
.np-flag { display: inline-flex; align-items: center; gap: 6px; }

.nav-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 0 24px 14px;
  font-size: 11px;
  color: var(--ink-3);
}
.leg { display: inline-flex; align-items: center; gap: 5px; }
.leg i {
  width: 10px; height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.dot-answered { background: var(--brand); }
.dot-current { background: var(--gold); }
.dot-flag { background: var(--amber); }
.dot-empty { background: var(--line); border: 1px solid var(--ink-4); }

.nav-grid {
  flex: 1;
  overflow-y: auto;
  padding: 4px 24px 24px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  align-content: start;
}
.nav-grid::-webkit-scrollbar { width: 6px; }
.nav-grid::-webkit-scrollbar-track { background: transparent; }
.nav-grid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.nav-grid::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

.nav-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: grid; place-items: center;
  transition: all .15s;
  position: relative;
}
.nav-cell:hover { border-color: var(--ink-3); color: var(--ink); }
.nav-cell.answered {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}
.nav-cell.current {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-dim);
  color: var(--gold);
}
.nav-cell.answered.current {
  background: var(--brand);
  color: white;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-dim);
}
.nav-cell.flagged::after {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 6px; height: 6px;
  background: var(--amber);
  border-radius: 50%;
}

.nav-submit {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--line-2);
}
.btn-submit {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #14182B;
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--r-pill);
  box-shadow: 0 8px 20px rgba(201,167,90,0.3), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.12);
  transition: transform .2s, box-shadow .2s;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(201,167,90,0.45), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.12); }
.submit-note { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 10px; }

/* ===================== SELECTION POPOVER ===================== */
.sel-pop {
  position: fixed;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px;
  display: none;
  gap: 2px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  backdrop-filter: blur(20px);
}
.sel-pop.visible { display: flex; }
.sel-pop button {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background .15s, color .15s;
}
.sel-pop button:hover { background: var(--gold); color: #14182B; }
.sel-pop button[data-action="strike"]:hover { background: var(--red); color: white; }
.sel-pop button[data-action="clear"]:hover { background: var(--line); color: var(--ink); }

/* ===================== RESULT ===================== */
.screen-result { position: relative; min-height: 100vh; display: none; flex-direction: column; }
.screen-result.active { display: flex; }
.result-main {
  position: relative; z-index: 1;
  flex: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 60px 48px 100px;
  display: flex; flex-direction: column; align-items: flex-start;
  width: 100%;
}

.result-summary {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin: 40px 0 32px;
}
.res-card {
  padding: 24px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px);
}
.res-net { background: linear-gradient(180deg, var(--gold-dim), transparent); border-color: var(--gold-dim); }
.res-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.res-value {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}
.res-net .res-value { font-size: 56px; color: var(--gold); }
.res-correct { color: var(--green); }
.res-wrong { color: var(--red); }
.res-empty { color: var(--ink-3); }
.res-time { color: var(--ink-2); font-size: 28px; }
.res-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
}

.result-actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.quiet-btn {
  padding: 18px 28px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  transition: border-color .15s, color .15s;
}
.quiet-btn:hover { border-color: var(--ink-2); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1100px) {
  .exam-layout { grid-template-columns: 1fr 320px; }
  .nav-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px) {
  .exam-bar { grid-template-columns: 1fr auto; padding: 12px 16px; }
  .bar-left { gap: 12px; }
  .bar-meta-eyebrow { display: none; }
  .bar-meta-name { font-size: 12px; }
  .bar-center { grid-column: 1 / -1; grid-row: 2; justify-content: center; padding-top: 8px; }
  .btn-end { padding: 8px 14px; font-size: 12px; }

  .exam-layout { grid-template-columns: 1fr; }
  .nav-col {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto;
    border-left: 0; border-top: 1px solid var(--line);
    z-index: 20;
  }
  .nav-col .nav-grid { display: none; }
  .nav-col .nav-head { padding: 12px 16px 8px; }
  .nav-col .nav-progress { padding: 8px 16px; }
  .nav-col .nav-legend { display: none; }
  .nav-col .nav-submit { padding: 8px 16px 14px; }

  .question-wrap { padding: 12px 20px 200px; }
  .tool-ribbon { padding: 18px 20px 12px; flex-wrap: wrap; }
  .q-foot { padding: 16px 20px 24px; }

  .intro-main { padding: 40px 24px 60px; }
  .intro-header { padding: 20px 24px; }
  .intro-stats { padding: 20px 22px; gap: 18px; flex-wrap: wrap; }
  .i-stat-div { display: none; }
  .intro-features { grid-template-columns: 1fr; }

  .result-summary { grid-template-columns: 1fr 1fr; }
  .result-main { padding: 40px 24px 80px; }
}

/* =========================================================
   REGISTER (kayıt) form
   ========================================================= */
.register-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 640px;
  margin-top: 28px;
}
.rf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.rf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.rf-field.rf-full { grid-column: 1 / -1; }
.rf-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.rf-field input,
.rf-field select {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color .15s, background .15s;
}
.rf-field input:focus,
.rf-field select:focus {
  border-color: var(--brand);
}
.rf-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
  cursor: pointer;
}
.rf-consent input[type="checkbox"] {
  width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px;
  accent-color: var(--brand);
}
.rf-consent b { color: var(--ink); font-weight: 700; }
.rf-fine { color: var(--ink-3); font-size: 12px; }
.rf-error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  color: #d44;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
}
#registerBtn { align-self: flex-start; margin-top: 6px; }
#registerBtn[disabled] { opacity: 0.6; cursor: progress; }

@media (max-width: 720px) {
  .rf-row { grid-template-columns: 1fr; }
}

/* =========================================================
   RANK CARD (sonuç ekranı sıra widget'ı)
   ========================================================= */
.rank-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, var(--brand-tint), var(--surface));
  border: 1.5px solid var(--brand);
  border-radius: var(--r-lg, 16px);
  padding: 22px 28px;
  margin: 28px 0;
  max-width: 720px;
}
.rank-card-main {
  display: flex;
  align-items: center;
  gap: 36px;
}
.rank-pos {
  font-family: var(--font-serif, Fraunces, serif);
  font-size: 44px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}
.rank-pos-hash { color: var(--brand); }
.rank-pos-total {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 6px;
}
.rank-pct {
  border-left: 1.5px solid var(--line);
  padding-left: 36px;
}
.rank-pct-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.rank-pct-lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-top: 2px;
}
.rank-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  padding: 10px 16px;
  border: 1.5px solid var(--brand);
  border-radius: var(--r-md);
  transition: background .15s, color .15s;
}
.rank-link:hover { background: var(--brand); color: white; }

@media (max-width: 720px) {
  .rank-card { flex-direction: column; align-items: flex-start; padding: 18px 20px; }
  .rank-card-main { gap: 20px; }
  .rank-pct { padding-left: 20px; }
  .rank-pos { font-size: 36px; }
}
