/* ============================================================
   QUIZ TELECOM — Mobile-First Design
   ============================================================ */

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

:root {
  --primary:      #4f8ef7;
  --primary-glow: rgba(79,142,247,0.45);
  --cyan:         #00d4ff;
  --success:      #00e676;
  --success-bg:   rgba(0,230,118,0.16);
  --error:        #ff5252;
  --error-bg:     rgba(255,82,82,0.16);
  --warning:      #ffb300;

  /* Dracula-inspired — lighter dark, more readable */
  --bg:           #1e1f2b;
  --bg2:          #282a36;
  --glass:        rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.14);
  --glass-hover:  rgba(255,255,255,0.12);
  --text:         #f8f8f2;
  --text2:        rgba(248,248,242,0.68);
  --text3:        rgba(248,248,242,0.38);

  --r:  14px;
  --rl: 20px;
  --shadow: 0 6px 30px rgba(0,0,0,0.5);
  --t: 0.25s cubic-bezier(0.4,0,0.2,1);

  /* iOS safe areas */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  height: 100%;
  /* prevent zoom on input focus on iOS */
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  min-height: -webkit-fill-available;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  /* smooth scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

/* ────────────── BACKGROUND PARTICLES ────────────── */
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-particles span {
  position: absolute;
  bottom: -200px;
  border-radius: 50%;
  background: rgba(79,142,247,0.09);
  animation: rise 22s linear infinite;
}

.bg-particles span:nth-child(1)  { left:10%; width:70px;  height:70px;  animation-delay:0s;  animation-duration:20s; }
.bg-particles span:nth-child(2)  { left:25%; width:18px;  height:18px;  animation-delay:3s;  animation-duration:18s; }
.bg-particles span:nth-child(3)  { left:40%; width:50px;  height:50px;  animation-delay:6s;  animation-duration:25s; }
.bg-particles span:nth-child(4)  { left:55%; width:14px;  height:14px;  animation-delay:1s;  animation-duration:16s; }
.bg-particles span:nth-child(5)  { left:70%; width:90px;  height:90px;  animation-delay:8s;  animation-duration:22s; }
.bg-particles span:nth-child(6)  { left:82%; width:22px;  height:22px;  animation-delay:4s;  animation-duration:19s; }
.bg-particles span:nth-child(7)  { left:15%; width:130px; height:130px; animation-delay:10s; animation-duration:28s; }
.bg-particles span:nth-child(8)  { left:62%; width:16px;  height:16px;  animation-delay:14s; animation-duration:20s; }
.bg-particles span:nth-child(9)  { left:35%; width:38px;  height:38px;  animation-delay:5s;  animation-duration:24s; }
.bg-particles span:nth-child(10) { left:90%; width:110px; height:110px; animation-delay:2s;  animation-duration:26s; }

@keyframes rise {
  0%   { transform: translateY(0)   rotate(0deg);   opacity:0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(-110vh) rotate(540deg); opacity:0; }
}

/* ────────────── SCREEN SYSTEM ────────────── */
.screen {
  display: none;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  padding-top: calc(16px + var(--safe-top));
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

/* Start screen: vertically centered */
#start-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* Quiz screen: top-aligned + scrollable — never clip content */
#quiz-screen.active {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  overflow-y: auto;
  padding-bottom: calc(80px + var(--safe-bottom)); /* space for sticky next btn */
}

/* End screen: vertically centered */
#end-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 16px calc(20px + var(--safe-bottom));
}

/* ────────────── HERO (START) ────────────── */
.hero {
  text-align: center;
  padding: 4px 0;
}

.logo-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px rgba(79,142,247,0.7));
  animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%,100% { filter: drop-shadow(0 0 18px rgba(79,142,247,0.6)); }
  50%      { filter: drop-shadow(0 0 34px rgba(0,212,255,0.9)); }
}

h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text2);
  font-size: 0.88rem;
}

.total-hint {
  color: var(--text3);
  font-size: 0.75rem;
  text-align: center;
  margin-top: -6px;
}

/* ────────────── CATEGORY CARDS ────────────── */
/* Mobile-first: 1 column. Goes to 2 on wider screens. */
.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
}

.category-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--rl);
  padding: 16px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  /* no hover transform on mobile — feels laggy on touch */
}

.cabling-card { border-top: 3px solid var(--primary); }
.fiber-card   { border-top: 3px solid var(--cyan); }

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.card-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }

.card-info h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.card-sub {
  font-size: 0.65rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card buttons side-by-side on mobile (saves vertical space) */
.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ────────────── BUTTONS — base ────────────── */
button { font-family: inherit; cursor: pointer; }

.btn-primary, .btn-secondary {
  width: 100%;
  /* min 48px touch target */
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border: none;
  color: #fff;
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text2);
}
.btn-secondary:active { background: var(--glass-hover); }

/* ALL QUESTIONS button */
.btn-all-questions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border: none;
  border-radius: var(--r);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 24px var(--primary-glow);
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn-all-questions:active { transform: scale(0.98); }

.all-tag {
  background: rgba(255,255,255,0.2);
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ────────────── QUIZ HEADER ────────────── */
.quiz-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-exit {
  width: 44px; height: 44px;
  flex-shrink: 0;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text2);
  font-size: 1rem;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn-exit:active { background: var(--error); color: #fff; border-color: var(--error); }

.progress-wrap { flex: 1; min-width: 0; }

.q-count {
  font-size: 0.75rem;
  color: var(--text3);
  display: block;
  text-align: center;
  margin-bottom: 5px;
  font-weight: 600;
}

.progress-track {
  background: var(--glass);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

.score-box {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 6px 12px;
  text-align: center;
  min-width: 54px;
  flex-shrink: 0;
}
.score-box span:first-child {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--cyan);
  display: block;
  line-height: 1;
}
.score-lbl {
  font-size: 0.62rem;
  color: var(--text3);
}

/* ────────────── TIMER ────────────── */
/* Mobile: smaller ring, no extra wrapper space */
.timer-wrap {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.timer-ring {
  position: relative;
  width: 72px; height: 72px;
}

.timer-svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}

.timer-track {
  fill: none;
  stroke: var(--glass-border);
  stroke-width: 7;
}

.timer-progress {
  fill: none;
  stroke: var(--success);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 276.46;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}

.timer-num {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.timer-ring.warn   .timer-progress { stroke: var(--warning); }
.timer-ring.danger .timer-progress { stroke: var(--error); }
.timer-ring.danger { animation: shake 0.4s infinite; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}

/* ────────────── QUESTION CARD ────────────── */
.question-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--rl);
  padding: 18px 16px;
  width: 100%;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: slide-in 0.35s ease;
  flex-shrink: 0;
}

@keyframes slide-in {
  from { opacity:0; transform: translateY(16px); }
  to   { opacity:1; transform: translateY(0); }
}

.q-meta {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cat-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  line-height: 1.4;
}

.cabling-badge {
  background: rgba(79,142,247,0.18);
  color: var(--primary);
  border: 1px solid rgba(79,142,247,0.28);
}

.fiber-badge {
  background: rgba(0,212,255,0.15);
  color: var(--cyan);
  border: 1px solid rgba(0,212,255,0.25);
}

.prod-name {
  font-size: 0.72rem;
  color: var(--text3);
  line-height: 1.4;
}

.q-text {
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 500;
}

/* ────────────── ANSWERS ────────────── */
/* Mobile-first: SINGLE column. 2 columns on wider screens only. */
.answers-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.ans-btn {
  width: 100%;
  /* min 52px ensures comfortable thumb target */
  min-height: 52px;
  padding: 14px 16px;
  background: rgba(79, 142, 247, 0.08);
  border: 1px solid rgba(79, 142, 247, 0.22);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background var(--t), border-color var(--t), color var(--t);
  animation: fade-up 0.32s ease both;
  -webkit-tap-highlight-color: transparent;
}

.ans-btn:nth-child(1) { animation-delay: 0.04s; }
.ans-btn:nth-child(2) { animation-delay: 0.09s; }
.ans-btn:nth-child(3) { animation-delay: 0.14s; }
.ans-btn:nth-child(4) { animation-delay: 0.19s; }

@keyframes fade-up {
  from { opacity:0; transform: translateY(10px); }
  to   { opacity:1; transform: translateY(0); }
}

/* Active state for touch (replaces hover on mobile) */
.ans-btn:active:not(:disabled) {
  background: rgba(79, 142, 247, 0.18);
  border-color: var(--primary);
}

.ans-btn:disabled { cursor: default; }

.ans-btn.correct {
  background: var(--success-bg) !important;
  border-color: var(--success) !important;
  color: var(--success) !important;
  box-shadow: 0 0 20px rgba(0,230,118,0.2) !important;
}

.ans-btn.wrong {
  background: var(--error-bg) !important;
  border-color: var(--error) !important;
  color: var(--error) !important;
}

/* ────────────── NEXT BUTTON ────────────── */
/* Sticky at bottom so it's always reachable */
.btn-next {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 568px;
  min-height: 54px;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border: none;
  border-radius: var(--r);
  color: #fff;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 24px var(--primary-glow);
  transition: all var(--t);
  z-index: 50;
  animation: fade-up 0.28s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-next:active { transform: translateX(-50%) scale(0.98); }

/* ────────────── RESULTS ────────────── */
.results-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--rl);
  padding: 28px 20px;
  width: 100%;
  max-width: 460px;
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: slide-in 0.4s ease;
}

.result-icon {
  font-size: 3.6rem;
  display: block;
  margin-bottom: 10px;
  animation: pop 0.5s cubic-bezier(0.68,-0.55,0.265,1.55);
}

@keyframes pop {
  0%   { transform:scale(0); opacity:0; }
  65%  { transform:scale(1.2); }
  100% { transform:scale(1); opacity:1; }
}

.result-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.result-msg {
  color: var(--text2);
  font-size: 0.9rem;
  margin-bottom: 22px;
  line-height: 1.5;
}

/* Mobile-first: 2×2 grid. 4 columns on wider screens. */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px 8px;
}

.stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 5px;
}

.stat-lbl {
  font-size: 0.67rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stat-total   .stat-num { color: var(--text); }
.stat-correct .stat-num { color: var(--success); }
.stat-wrong   .stat-num { color: var(--error); }
.stat-pct     .stat-num { color: var(--cyan); }

.stars-row {
  font-size: 2.2rem;
  letter-spacing: 8px;
  margin-bottom: 22px;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-restart {
  min-height: 50px;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border: none;
  border-radius: var(--r);
  color: #fff;
  font-size: 0.93rem;
  font-weight: 700;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn-restart:active { transform: scale(0.97); }

.btn-home {
  min-height: 50px;
  padding: 13px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  color: var(--text2);
  font-size: 0.93rem;
  font-weight: 700;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn-home:active { background: var(--glass-hover); color: var(--text); }

/* ────────────── MODAL ────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.60);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal.open { display: flex; }

.modal-content {
  background: var(--bg2);
  border: 1px solid var(--glass-border);
  border-radius: var(--rl);
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: fade-scale 0.22s cubic-bezier(0.4,0,0.2,1);
}

@keyframes fade-scale {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.modal-header h3 { font-size: 1rem; font-weight: 700; }

.modal-close {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text2);
  width: 36px; height: 36px;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.modal-close:active { background: var(--error); color: #fff; border-color: var(--error); }

.modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-body::-webkit-scrollbar { width: 3px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }

.prod-btn {
  width: 100%;
  /* min 52px for touch */
  min-height: 52px;
  padding: 14px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  line-height: 1.4;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.prod-btn:active { background: var(--glass-hover); border-color: var(--primary); }

/* ────────────── EXIT CONFIRM ────────────── */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.confirm-overlay.open { display: flex; }

.confirm-box {
  background: var(--bg2);
  border: 1px solid var(--glass-border);
  border-radius: var(--rl);
  padding: 28px 20px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  animation: pop 0.26s ease;
}

.confirm-icon { font-size: 2.2rem; margin-bottom: 10px; }
.confirm-box h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.confirm-box p  { color: var(--text2); font-size: 0.85rem; margin-bottom: 18px; line-height: 1.5; }

.btn-score {
  width: 100%;
  min-height: 50px;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border: none;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 10px;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn-score:active { transform: scale(0.97); }

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-yes {
  min-height: 46px;
  padding: 11px;
  background: rgba(255,82,82,0.15);
  border: 1px solid rgba(255,82,82,0.35);
  border-radius: 10px;
  color: var(--error);
  font-weight: 700;
  font-size: 0.88rem;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn-yes:active { background: var(--error); color: #fff; border-color: var(--error); }

.btn-no {
  min-height: 46px;
  padding: 11px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text2);
  font-weight: 700;
  font-size: 0.88rem;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn-no:active { background: var(--glass-hover); color: var(--text); }

/* ────────────── TABLET / DESKTOP ────────────── */
@media (hover: hover) {
  /* Only apply hover effects on devices that support it (not touch) */
  .btn-primary:hover   { box-shadow: 0 4px 20px var(--primary-glow); }
  .btn-secondary:hover { background: var(--glass-hover); color: var(--text); }
  .btn-all-questions:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--primary-glow); }
  .btn-exit:hover      { background: var(--error); color: #fff; border-color: var(--error); }
  .btn-next:hover      { box-shadow: 0 8px 30px var(--primary-glow); }
  .btn-restart:hover   { box-shadow: 0 6px 22px var(--primary-glow); }
  .btn-home:hover      { background: var(--glass-hover); color: var(--text); }
  .prod-btn:hover      { background: var(--glass-hover); border-color: var(--primary); }
  .category-card:hover { transform: translateY(-4px); box-shadow: 0 14px 44px rgba(0,0,0,0.6); }
  .ans-btn:hover:not(:disabled) {
    background: rgba(79, 142, 247, 0.18);
    border-color: var(--primary);
    box-shadow: 0 4px 16px var(--primary-glow);
  }
}

@media (min-width: 480px) {
  h1 { font-size: 2.8rem; }

  /* 4-column stats on wider screens */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stat-num { font-size: 1.5rem; }
}

@media (min-width: 900px) {
  /* 2-column category cards on desktop only */
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Card actions back to column layout */
  .card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
}

@media (min-width: 600px) {
  .screen {
    padding: 24px 20px 40px;
    padding-top: calc(24px + var(--safe-top));
  }

  #quiz-screen.active { gap: 18px; }

  .logo-icon  { font-size: 64px; }
  h1          { font-size: 3rem; }

  .timer-ring { width: 88px; height: 88px; }
  .timer-num  { font-size: 1.4rem; }
}

@media (min-width: 900px) {
  /* Desktop: answers in 2 columns */
  .answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Desktop: next button static (not sticky) */
  .btn-next {
    position: static;
    transform: none;
    width: 100%;
  }

  #quiz-screen.active {
    padding-bottom: 24px;
  }
}
