@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  --bg: #f2ecdf;
  --surface: rgba(255, 252, 245, 0.92);
  --surface-solid: #fffdf8;
  --surface-raised: rgba(248, 243, 232, 0.86);
  --text: #302a23;
  --text-muted: #70685c;
  --border: rgba(85, 65, 44, 0.14);
  --border-strong: rgba(85, 65, 44, 0.28);
  --primary: #a84d37;
  --primary-hover: #873b2b;
  --primary-soft: rgba(168, 77, 55, 0.11);
  --grad: linear-gradient(135deg, #99402f 0%, #b95438 55%, #ca7847 100%);
  --grad-text: linear-gradient(120deg, #813b2d 0%, #aa4e36 55%, #bc7443 100%);
  --success: #4e7654;
  --danger: #b44739;
  --warning: #9b6a29;
  --shadow: 0 22px 56px -32px rgba(57, 42, 27, 0.42);
  --timer-low-bg: rgba(180, 71, 57, 0.1);
  --timer-low-text: #a43f33;
  --radius: 22px;
  --page-wash: rgba(248, 243, 232, 0.52);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", Georgia, serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #100f10;
  --surface: rgba(29, 27, 25, 0.95);
  --surface-solid: #211e1b;
  --surface-raised: rgba(255, 245, 226, 0.045);
  --text: #f5efe4;
  --text-muted: #bdb2a1;
  --border: rgba(245, 232, 208, 0.15);
  --border-strong: rgba(245, 232, 208, 0.28);
  --primary: #e49a69;
  --primary-hover: #f0b17f;
  --primary-soft: rgba(228, 154, 105, 0.14);
  --grad: linear-gradient(135deg, #b9583e 0%, #d2764d 55%, #d8a064 100%);
  --grad-text: linear-gradient(120deg, #edaa79 0%, #e6bd84 100%);
  --success: #91bd8e;
  --danger: #ee907d;
  --warning: #e4ba70;
  --shadow: 0 26px 64px -30px rgba(0, 0, 0, 0.82);
  --timer-low-bg: rgba(238, 144, 125, 0.13);
  --timer-low-text: #ffad98;
  --page-wash: rgba(12, 11, 12, 0.84);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding-bottom: 64px;
  min-height: 100vh;
  background-color: var(--bg);
  isolation: isolate;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(var(--page-wash), var(--page-wash)), url("./phoenix-background.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
}

.app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.screen { width: 100%; max-width: 720px; animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
#screen-home { max-width: 1100px; }
#screen-test { max-width: 820px; }
.hidden { display: none !important; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.card {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 44px;
}

@media (max-width: 480px) {
  .card { padding: 30px 20px; }
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin: 0 0 16px;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.035em; }
h1 { font-size: 36px; line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: 24px; line-height: 1.4; margin: 0 0 22px; }

.lede { color: var(--text-muted); font-size: 16px; line-height: 1.7; margin: 0 0 24px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  border-radius: 14px;
  padding: 14px 24px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.15s ease, border-color 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 3px; }

.btn-primary {
  background: var(--grad);
  background-size: 140% 100%;
  color: #fff;
  width: 100%;
  box-shadow: 0 10px 24px -10px rgba(153, 64, 47, 0.72);
}
.btn-primary:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 28px -10px rgba(153, 64, 47, 0.75);
  background-position: 100% 0;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:not(:disabled):hover { background: var(--surface-raised); color: var(--text); border-color: var(--border-strong); }

.btn-back { padding: 8px 12px; font-size: 20px; min-width: 44px; min-height: 44px; flex-shrink: 0; border-radius: 14px; }

.disclaimer {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 38px 0 0;
  padding: 20px 18px 0;
  border-top: 1px solid var(--border);
}

/* ---------- Home ---------- */
.home-content { width: 100%; margin: 0 auto; padding: 30px 0; }

.home-header { text-align: center; margin: 0 auto 46px; max-width: 760px; }
.home-eyebrow { margin-bottom: 20px; }
.home-header h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.02;
  margin: 0 0 20px;
  font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.home-subtitle { font-size: clamp(16px, 2vw, 19px); color: var(--text-muted); margin: 0 auto; max-width: 590px; line-height: 1.75; }

.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.test-card {
  --accent: var(--primary);
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface-solid), var(--surface));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 18px 42px -32px rgba(31, 22, 15, 0.42);
  cursor: default;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.test-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 35%, #fff));
}
.test-card::after {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  top: -110px; right: -90px;
  background: radial-gradient(circle, var(--accent), transparent 65%);
  opacity: 0.22;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.test-card:hover, .test-card:focus-within {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  box-shadow: 0 24px 55px -32px var(--accent);
}

.test-icon {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.test-icon svg {
  width: 48px;
  height: 48px;
  display: block;
  color: inherit;
}

.test-card h3 { position: relative; font-size: 21px; margin: 2px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.test-card p { position: relative; font-size: 14px; color: var(--text-muted); margin: 0; line-height: 1.75; flex-grow: 1; }

.test-meta, .test-card p.test-meta {
  flex-grow: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.test-best, .test-card p.test-best {
  flex-grow: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
}

.test-card .btn-small {
  position: relative;
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  margin-top: 6px;
  min-height: 48px;
  background: var(--accent);
  color: #fff;
  border-radius: 13px;
  box-shadow: 0 9px 20px -12px var(--accent);
}
.test-card .btn-small:hover { transform: translateY(-1px); filter: brightness(1.07); }

/* ---------- Info screen ---------- */
.info-card { text-align: center; position: relative; }
.info-card .btn-back { position: absolute; top: 20px; left: 20px; }
.info-card .eyebrow { margin-top: 18px; }

.btn-home { position: absolute; top: 20px; right: 20px; padding: 8px 12px; font-size: 18px; min-width: 44px; min-height: 44px; }

.info-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-width: 0;
}
.detail-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.detail-value { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text); }
.detail-item:last-child .detail-value { overflow-wrap: anywhere; }

@media (max-width: 768px) {
  .info-details { grid-template-columns: 1fr; }
  .tests-grid { grid-template-columns: 1fr; }
}

.disclaimer-small { margin-top: 20px; padding-top: 16px; font-size: 11px; border-top: 1px solid var(--border); }

/* ---------- Test screen ---------- */
.test-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.progress-wrap { flex: 1; }
.progress-bar { height: 9px; border-radius: 999px; background: var(--surface-raised); border: 1px solid var(--border); overflow: hidden; }
.progress-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 999px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.progress-label { display: block; margin-top: 7px; font-size: 12px; font-weight: 500; color: var(--text-muted); }

.timer {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 18px;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 9px 14px;
  border-radius: 12px;
  min-width: 78px;
  text-align: center;
}
:root[data-theme="light"] .timer { color: var(--primary); }
.timer.low { background: var(--timer-low-bg); color: var(--timer-low-text); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.6; } }

.category-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.question-card { padding: 42px; }
.question-text { font-size: clamp(23px, 3vw, 29px); line-height: 1.42; margin-bottom: 26px; }

.question-visual {
  font-size: 32px;
  letter-spacing: 6px;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 28px 20px;
  margin: 0 0 22px;
  background: var(--surface-raised);
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  display: none;
}
.question-visual.active { display: block; }
.question-visual.long { font-size: 22px; letter-spacing: 2px; }

.options { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; counter-reset: opt; }

.option {
  counter-increment: opt;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  font-family: inherit;
  padding: 16px 18px;
  min-height: 62px;
  border-radius: 15px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.option::before {
  content: counter(opt, upper-alpha);
  flex: 0 0 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--primary-soft);
  transition: background 0.2s ease, color 0.2s ease;
}
.option:hover { border-color: var(--primary); transform: translateX(3px); }
.option:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; }
.option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.option.selected::before { background: var(--grad); color: #fff; }

.test-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 20px; }
.test-footer .btn-primary { width: auto; flex: 1; min-width: 120px; }

/* ---------- Question navigator ---------- */
.question-map {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.map-chip {
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.map-chip:hover { border-color: var(--primary); color: var(--text); }
.map-chip:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; }
.map-chip.answered { background: var(--primary-soft); color: var(--text); border-color: transparent; }
.map-chip.current { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 14px -6px rgba(153, 64, 47, 0.7); }

/* ---------- Results ---------- */
.results-card { text-align: center; position: relative; }
.results-card .eyebrow { margin-top: 20px; }

.score-ring-wrap { position: relative; width: 220px; height: 220px; margin: 12px auto 12px; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--primary) 30%, transparent)); }
.score-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg, .ring-fill { fill: none; stroke-width: 14; }
.ring-bg { stroke: var(--border); }
.ring-fill {
  stroke: url(#ring-grad);
  stroke-linecap: round;
  stroke-dasharray: 553;
  stroke-dashoffset: 553;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.score-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-number {
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.score-caption { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-top: 6px; }

.percentile-text { font-size: 16px; font-weight: 500; margin: 6px 0 0; color: var(--text-muted); }
.band-text { font-size: 15px; font-weight: 600; color: var(--text); margin: 6px 0 22px; }

.breakdown { display: flex; flex-direction: column; gap: 14px; text-align: left; margin-bottom: 26px; padding: 20px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 18px; }
.breakdown-row { display: flex; align-items: center; gap: 12px; }
.breakdown-label { width: 92px; font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
.breakdown-bar-bg { flex: 1; height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; }
.breakdown-bar-fill { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.breakdown-pct { width: 44px; text-align: right; font-size: 13px; font-weight: 700; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 8px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 16px; }
.stat-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

.results-actions { display: flex; gap: 12px; }
.results-actions .btn { flex: 1; width: auto; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 10;
  padding: 6px 10px;
  font-size: 18px;
  min-width: 46px;
  min-height: 46px;
  border-radius: 50%;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.06); }

/* ---------- Resume banner ---------- */
.resume-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: 16px;
  padding: 14px 18px;
  margin: 0 auto 28px;
  max-width: 720px;
  font-size: 14px;
}
.resume-actions { display: flex; gap: 8px; }
.resume-actions .btn { width: auto; padding: 8px 16px; }

/* ---------- History ---------- */
.history { margin-top: 24px; text-align: left; }
.history h3 { font-size: 13px; margin: 0 0 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.history-list { list-style: none; margin: 0 0 10px; padding: 0; }
.history-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.history-date { color: var(--text-muted); flex: 1; }
.history-score { font-weight: 700; min-width: 48px; text-align: right; }
.history-band { color: var(--text-muted); min-width: 110px; text-align: right; }
.btn-tiny { min-height: 44px; padding: 8px 12px; font-size: 12px; }

/* ---------- Results extras ---------- */
.detail-text { font-size: 14px; margin: 0 0 8px; }
.history-text { font-size: 13px; color: var(--text-muted); margin: 0 0 20px; }

.review { text-align: left; margin-bottom: 24px; }
.review summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 12px 0; color: var(--primary); }
.review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.review-item { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); border-left-width: 4px; background: var(--surface-raised); font-size: 14px; }
.review-item.correct { border-left-color: var(--success); }
.review-item.partial { border-left-color: var(--warning); }
.review-item.wrong { border-left-color: var(--danger); }
.review-item.skipped { border-left-color: var(--text-muted); }
.review-q { margin: 0 0 6px; font-weight: 600; }
.review-visual { margin: 0 0 6px; white-space: pre-wrap; color: var(--text-muted); }
.review-line { margin: 2px 0; }
.review-label { color: var(--text-muted); }
.review-time { color: var(--text-muted); font-size: 12px; }
.review-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid currentColor; }
.review-badge.correct { color: var(--success); }
.review-badge.partial { color: var(--warning); }
.review-badge.wrong { color: var(--danger); }
.review-badge.skipped { color: var(--text-muted); }

/* ---------- Mobile / touch support ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
.btn, .option, .map-chip, .test-card { touch-action: manipulation; }

@supports (min-height: 100dvh) {
  body, .app { min-height: 100dvh; }
}

/* Disable hover-lift effects on touch devices so taps don't leave "stuck" states */
@media (hover: none) {
  .test-card:hover, .test-card:focus-within { transform: none; box-shadow: var(--shadow); }
  .test-card .btn-small:hover { transform: none; filter: none; }
  .option:hover { transform: none; }
  .btn-primary:not(:disabled):hover { transform: none; }
  .theme-toggle:hover { transform: none; }
}

@media (max-width: 768px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .app {
    align-items: flex-start;
    padding: 16px max(12px, env(safe-area-inset-right)) 16px max(12px, env(safe-area-inset-left));
  }
  .home-content { padding: 8px 0; }
  .home-header { margin-bottom: 32px; }
  .tests-grid { gap: 16px; }
  .test-card { padding: 24px; animation: none; }
  .resume-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .resume-actions { justify-content: center; }
  .resume-actions .btn { flex: 1; }
  .theme-toggle { bottom: calc(14px + env(safe-area-inset-bottom)); right: 14px; }
}

@media (max-width: 600px) {
  h1 { font-size: 28px; }
  h2 { font-size: 20px; margin-bottom: 16px; }
  .question-text { font-size: 19px; }
  .lede { font-size: 15px; }

  /* Test screen */
  .test-header { gap: 9px; padding: 9px; border-radius: 15px; }
  .timer { font-size: 16px; min-width: 66px; padding: 8px 10px; }
  .question-visual { font-size: 24px; letter-spacing: 3px; padding: 16px 10px; }
  .question-visual.long { font-size: 18px; letter-spacing: 1px; }
  .question-card { padding: 28px 20px; }
  .option { padding: 14px; min-height: 52px; font-size: 15px; gap: 12px; }
  .map-chip { min-width: 44px; height: 44px; }
  .question-map { gap: 6px; max-height: 132px; overflow-y: auto; }

  /* Footer: primary action full width on top, secondary actions in a row beneath */
  .test-footer { position: static; gap: 8px; }
  .test-footer .btn-primary { order: -1; flex: 1 1 100%; min-height: 50px; }
  .test-footer .btn-ghost { flex: 1 1 0; min-width: 0; padding: 12px 8px; font-size: 14px; min-height: 46px; }

  /* Info + results */
  .info-card .btn-back { top: 14px; left: 14px; }
  .btn-home { top: 14px; right: 14px; }
  .score-ring-wrap { width: 190px; height: 190px; }
  .score-number { font-size: 46px; }
  .breakdown { padding: 16px 14px; }
  .breakdown-label { width: 76px; font-size: 12px; }
  .breakdown-pct { width: 40px; }
  .stats-row { gap: 8px; }
  .stat-value { font-size: 19px; }
  .stat-label { font-size: 10px; }
  .results-actions { flex-direction: column-reverse; }
  .history-item { flex-wrap: wrap; }
  .history-band { min-width: 0; }
}

@media (max-width: 360px) {
  .card { padding: 26px 16px; }
  .test-card { padding: 20px; }
  .test-footer .btn-ghost { font-size: 13px; padding: 12px 4px; }
}

/* Short landscape phones */
@media (max-height: 480px) and (orientation: landscape) {
  .app { align-items: flex-start; padding-top: 12px; }
  .card { padding: 22px 24px; }
}
