:root {
  --bg: #07101f;
  --surface: rgba(255,255,255,.96);
  --surface-soft: #f7f9fc;
  --text: #0e1728;
  --muted: #6d788b;
  --line: #e6eaf0;
  --primary: #5b5df0;
  --primary-2: #7c6cff;
  --primary-dark: #4547d7;
  --green: #14a77b;
  --green-soft: #eaf9f4;
  --red: #dc4c64;
  --orange: #f59f36;
  --shadow: 0 24px 70px rgba(4, 11, 26, .18);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 5%, rgba(91,93,240,.34), transparent 29rem),
    radial-gradient(circle at 88% 28%, rgba(31,191,155,.16), transparent 28rem),
    linear-gradient(180deg, #091426 0, #101b2f 390px, #f3f5f9 390px, #f3f5f9 100%);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
.page-glow { position: fixed; width: 300px; height: 300px; border-radius: 50%; filter: blur(100px); opacity: .2; pointer-events: none; }
.glow-one { top: -80px; right: 5%; background: #8b5cf6; }
.glow-two { top: 220px; left: -130px; background: #16c8a4; }
.app-shell { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 26px 22px 40px; }
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg,#756eff,#4f56df); box-shadow: 0 10px 30px rgba(91,93,240,.35); font-weight: 900; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { color: #9ba7ba; font-size: 11px; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.save-status { color: #9eabc0; font-size: 12px; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.78fr) minmax(290px, .72fr); gap: 22px; align-items: start; }
.main-column, .side-column { display: grid; gap: 18px; }
.card { background: var(--surface); border: 1px solid rgba(230,234,240,.9); border-radius: 22px; box-shadow: var(--shadow); }
.hero-card { padding: 28px; overflow: hidden; position: relative; }
.hero-card::after { content:""; position:absolute; width:220px; height:220px; border-radius:50%; background:rgba(91,93,240,.05); right:-80px; top:-90px; }
.hero-top { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; }
.section-kicker { display: block; color: #8893a5; font-size: 10px; letter-spacing: .14em; font-weight: 900; margin-bottom: 8px; }
.section-kicker.light { color: #8290a8; }
.letter-badge { width: 82px; height: 82px; border-radius: 20px; display: grid; place-items: center; color: white; background: linear-gradient(145deg,var(--primary-2),var(--primary)); font-size: 44px; line-height: 1; font-weight: 900; box-shadow: 0 14px 30px rgba(91,93,240,.3); }
.round-label { display: inline-flex; gap: 4px; align-items: center; color: #747f91; font-size: 12px; font-weight: 700; }
.hero-copy h1 { margin: 5px 0 5px; font-size: clamp(22px, 2.4vw, 32px); letter-spacing: -.035em; }
.hero-copy h1 span { color: var(--primary); }
.hero-copy p { margin: 0; color: var(--muted); font-size: 13px; }
.round-score { min-width: 92px; text-align: right; }
.round-score strong { display: block; font-size: 29px; letter-spacing: -.05em; }
.round-score strong small { color: #9aa3b2; font-size: 16px; }
.round-score > span { color: var(--muted); font-size: 11px; }
.progress-row { display: flex; align-items: center; gap: 11px; margin: 24px 0 18px; }
.progress-track { height: 9px; flex: 1; border-radius: 99px; overflow: hidden; background: #e9edf4; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--primary),#8c76ff); transition: width .25s ease; }
.progress-row > span { width: 40px; text-align: right; color: #667085; font-size: 12px; font-weight: 800; }
.answer-input-wrap { display: flex; align-items: center; gap: 9px; padding: 7px 7px 7px 14px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfe; transition: .18s; }
.answer-input-wrap:focus-within { background: white; border-color: #b5b5ff; box-shadow: 0 0 0 4px rgba(91,93,240,.09); }
.input-icon { color: #929bad; font-size: 22px; transform: translateY(-1px); }
.answer-input-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; padding: 9px 2px; color: var(--text); }
.answer-input-wrap input::placeholder { color: #a3abba; }
.btn { border: 1px solid transparent; border-radius: 12px; padding: 11px 15px; font-weight: 800; font-size: 13px; transition: transform .15s, background .15s, border .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { color: white; background: linear-gradient(135deg,var(--primary-2),var(--primary)); box-shadow: 0 7px 18px rgba(91,93,240,.18); }
.btn-primary:hover { background: linear-gradient(135deg,#6c64ef,var(--primary-dark)); }
.btn-secondary { background: rgba(255,255,255,.96); color: #263248; border-color: var(--line); }
.btn-secondary:hover { background: #f7f9fc; }
.feedback { min-height: 20px; margin: 9px 2px 0; font-size: 12px; font-weight: 750; }
.feedback.success { color: var(--green); }
.feedback.error { color: var(--red); }
.hint-card, .answers-card, .alphabet-card { padding: 23px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.card-heading.compact { align-items: center; }
.card-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.card-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.hint-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 7px; }
.counter-pill { white-space: nowrap; border: 1px solid #dedffc; background: #f2f2ff; color: #5a5dd8; padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.link-btn { padding: 0; border: 0; background: none; color: var(--primary); font-size: 11px; font-weight: 800; }
.link-btn:hover { text-decoration: underline; }
.hint-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-top: 18px; }
.hint-btn { min-height: 76px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 11px; padding: 12px 13px; text-align: left; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfe; color: var(--text); transition: .18s; }
.hint-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: #cfcfff; box-shadow: 0 8px 22px rgba(31,41,55,.07); background: white; }
.hint-btn.revealed { background: #f4f4ff; border-color: #d8d8ff; }
.hint-btn:disabled { opacity: .48; }
.hint-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: white; border: 1px solid #e9ebf1; font-size: 19px; font-weight: 900; }
.hint-copy small, .hint-copy strong { display: block; }
.hint-copy small { color: #7c8798; font-size: 10px; font-weight: 800; margin-bottom: 4px; }
.hint-copy strong { font-size: 13px; line-height: 1.25; }
.hint-btn[data-hint="flag"].revealed .hint-copy strong { font-size: 24px; line-height: 1; }
.hint-arrow { color: #a0a8b6; font-size: 16px; }
.answer-grid { display: flex; flex-wrap: wrap; gap: 8px; min-height: 50px; margin-top: 15px; }
.answer-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--green-soft); color: #08765a; border: 1px solid #ccefe3; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 800; }
.answer-chip .chip-flag { font-size: 15px; }
.empty-state { align-self: center; color: #929aaa; font-size: 12px; padding: 9px 0; }
.revealed { margin-top: 17px; padding: 15px; border-radius: 14px; border: 1px solid #f7d5ad; background: #fff8ef; }
.revealed-label { display: block; margin-bottom: 7px; color: #a25b13; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.missing-list { color: #8a511c; font-size: 12px; line-height: 1.7; }
.hidden { display: none; }
.navigation-row { display: flex; justify-content: space-between; gap: 12px; }
.dark-card { padding: 24px; color: white; background: linear-gradient(145deg,#111d31,#0b1425); border-color: #1c2940; }
.global-score { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 14px; }
.global-score strong { font-size: 48px; letter-spacing: -.055em; }
.global-score span { color: #78869d; font-size: 18px; font-weight: 750; }
.dark-track { background: #263249; }
.score-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; color: #8492a8; font-size: 10px; font-weight: 700; }
.alphabet-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-top: 15px; }
.alpha-btn { aspect-ratio: 1; min-width: 0; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); color: #626e81; background: #fbfcfe; font-size: 11px; font-weight: 900; transition: .15s; }
.alpha-btn:hover:not(:disabled) { border-color: #c8c9ff; color: var(--primary); }
.alpha-btn.active { color: white; background: var(--primary); border-color: var(--primary); box-shadow: 0 5px 12px rgba(91,93,240,.2); }
.alpha-btn.done:not(.active) { color: #098060; background: #e9faf5; border-color: #c6efe2; }
.alpha-btn.disabled { opacity: .24; }
.legend { display: flex; gap: 14px; margin-top: 13px; color: #8993a3; font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.current { background: var(--primary); }.dot.done { background: var(--green); }
.info-card { padding: 18px; display: flex; gap: 12px; align-items: flex-start; }
.info-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #fff7e9; }
.info-card strong { font-size: 12px; }.info-card p { margin: 4px 0 0; color: var(--muted); line-height: 1.5; font-size: 11px; }
footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 24px; color: #7d8797; font-size: 10px; }
@media (max-width: 900px) {
  body { background: linear-gradient(180deg, #091426 0, #101b2f 300px, #f3f5f9 300px); }
  .dashboard { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: repeat(2, 1fr); }
  .score-card { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .app-shell { padding: 18px 13px 30px; }
  .save-status { display: none; }
  .hero-card, .hint-card, .answers-card, .alphabet-card { padding: 18px; border-radius: 18px; }
  .hero-top { grid-template-columns: auto 1fr; }
  .round-score { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 7px; text-align: left; }
  .round-score strong { font-size: 21px; }.round-score > span { font-size: 10px; }
  .letter-badge { width: 66px; height: 66px; font-size: 34px; border-radius: 17px; }
  .hero-copy h1 { font-size: 21px; }
  .answer-input-wrap { display: grid; grid-template-columns: auto 1fr; }
  .answer-input-wrap .btn { grid-column: 1 / -1; width: 100%; }
  .hint-grid { grid-template-columns: 1fr; }
  .card-heading { flex-direction: column; align-items: stretch; }
  .card-heading.compact { flex-direction: row; }
  .hint-meta { align-items: flex-start; flex-direction: row; justify-content: space-between; }
  .navigation-row { flex-direction: column; }.navigation-row .btn { width: 100%; }
  .side-column { grid-template-columns: 1fr; }
  .score-card { grid-column: auto; }
  footer { flex-direction: column; }
}

/* echte vlagafbeeldingen */
.answer-chip .chip-flag{display:inline-flex;align-items:center;width:24px;height:18px;overflow:hidden;border-radius:3px;box-shadow:0 0 0 1px rgba(15,23,42,.10)}
.answer-chip .chip-flag img{width:100%;height:100%;object-fit:cover;display:block}
.hint-flag-image{display:block;max-width:112px;width:auto;height:66px;object-fit:contain;border-radius:7px;box-shadow:0 6px 18px rgba(15,23,42,.14);background:#fff}
.hint-btn[data-hint="flag"].revealed [data-value]{display:flex;align-items:center;min-height:70px}

/* compacte interface + centraal hintpaneel */
:root { --shadow: 0 12px 34px rgba(4,11,26,.13); }
.app-shell { max-width: 1160px; padding-top: 16px; padding-bottom: 22px; }
.topbar { height: 50px; margin-bottom: 14px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; }
.brand strong { font-size: 15px; }
.dashboard { gap: 14px; grid-template-columns: minmax(0,1.9fr) minmax(270px,.65fr); }
.main-column, .side-column { gap: 12px; }
.card { border-radius: 17px; }
.hero-card { padding: 18px 20px; }
.hero-top { gap: 15px; }
.letter-badge { width: 64px; height: 64px; border-radius: 16px; font-size: 34px; }
.hero-copy h1 { font-size: clamp(20px,2vw,27px); margin: 2px 0 2px; }
.hero-copy p { font-size: 11px; }
.section-kicker { margin-bottom: 5px; font-size: 9px; }
.round-score strong { font-size: 25px; }
.progress-row { margin: 12px 0 10px; }
.progress-track { height: 7px; }
.answer-input-wrap { min-height: 45px; padding: 4px 5px 4px 11px; border-radius: 13px; }
.answer-input-wrap input { padding: 7px 2px; }
.btn { padding: 9px 13px; font-size: 12px; }
.feedback { min-height: 14px; margin-top: 5px; }
.hint-card, .answers-card, .alphabet-card { padding: 16px 18px; }
.centered-hints .card-heading { align-items: center; text-align: center; flex-direction: column; gap: 6px; }
.centered-hints .card-heading > div:first-child { width: 100%; }
.centered-hints .hint-meta { align-items: center; flex-direction: row; justify-content: center; gap: 12px; }
.centered-hints .hint-grid { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 9px; margin-top: 12px; }
.centered-hints .hint-btn { min-height: 92px; grid-template-columns: 1fr; grid-template-rows: auto auto; justify-items: center; text-align: center; gap: 5px; padding: 9px 7px; }
.centered-hints .hint-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.centered-hints .hint-copy small { margin-bottom: 2px; font-size: 9px; }
.centered-hints .hint-copy strong { font-size: 11px; }
.centered-hints .hint-arrow { display: none; }
.centered-hints .hint-btn[data-hint="flag"].revealed [data-value] { min-height: 0; justify-content: center; }
.centered-hints .hint-flag-image { width: 62px; max-width: 62px; height: 38px; border-radius: 4px; }
.answer-grid { margin-top: 9px; min-height: 34px; max-height: 90px; overflow-y: auto; }
.answer-chip { padding: 5px 8px; font-size: 11px; }
.revealed { margin-top: 10px; padding: 10px; }
.navigation-row .btn { min-width: 140px; }
.dark-card { padding: 17px; }
.global-score { margin-bottom: 8px; }
.global-score strong { font-size: 36px; }
.alphabet-grid { margin-top: 9px; gap: 5px; }
.alpha-btn { border-radius: 8px; font-size: 10px; }
.info-card { padding: 13px; }
footer { margin-top: 12px; }

@media (max-width: 900px) {
  body { background: linear-gradient(180deg,#091426 0,#101b2f 210px,#f3f5f9 210px); }
  .app-shell { max-width: 760px; }
  .dashboard { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: 1fr 1fr; }
  .score-card { grid-column: auto; }
  .info-card { display: none; }
}

@media (max-width: 650px) {
  html, body { min-height: 100%; }
  body { background: #f3f5f9; }
  .page-glow { display: none; }
  .app-shell { padding: 8px 8px 10px; min-height: 100dvh; }
  .topbar { height: 38px; margin-bottom: 7px; }
  .brand { gap: 7px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
  .brand strong { color: #152033; font-size: 13px; }
  .brand small { display: none; }
  .top-actions .btn { padding: 6px 9px; border-radius: 9px; font-size: 10px; }
  .dashboard { display: block; }
  .main-column { gap: 7px; }
  .side-column { display: none; }
  .card { border-radius: 13px; box-shadow: 0 5px 16px rgba(4,11,26,.08); }

  .hero-card { padding: 10px; }
  .hero-top { grid-template-columns: 46px minmax(0,1fr) auto; gap: 9px; }
  .letter-block .section-kicker { display: none; }
  .letter-badge { width: 46px; height: 46px; border-radius: 11px; font-size: 25px; box-shadow: 0 7px 16px rgba(91,93,240,.22); }
  .round-label { font-size: 9px; }
  .hero-copy h1 { font-size: 15px; margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hero-copy p { display: none; }
  .round-score { min-width: 48px; grid-column: auto; display: block; text-align: right; }
  .round-score strong { font-size: 18px; }
  .round-score strong small { font-size: 11px; }
  .round-score > span { display: none; }
  .progress-row { margin: 7px 0 7px; gap: 7px; }
  .progress-track { height: 5px; }
  .progress-row > span { width: 29px; font-size: 9px; }
  .answer-input-wrap { display: flex; min-height: 38px; padding: 3px 3px 3px 8px; border-radius: 10px; gap: 4px; }
  .input-icon { display: none; }
  .answer-input-wrap input { padding: 6px 3px; font-size: 13px; }
  .answer-input-wrap .btn { grid-column: auto; width: auto; padding: 7px 9px; font-size: 10px; border-radius: 8px; }
  .feedback { min-height: 11px; margin: 3px 1px 0; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .hint-card { padding: 9px 8px 8px; }
  .centered-hints .card-heading { gap: 3px; }
  .centered-hints .section-kicker { display: none; }
  .centered-hints .card-heading h2 { font-size: 13px; }
  .centered-hints .card-heading p { display: none; }
  .centered-hints .hint-meta { gap: 10px; }
  .counter-pill { padding: 3px 6px; font-size: 8px; }
  .link-btn { font-size: 9px; }
  .centered-hints .hint-grid { grid-template-columns: repeat(2,minmax(0,1fr)); width: min(100%,360px); margin: 7px auto 0; gap: 6px; }
  .centered-hints .hint-btn { min-height: 70px; padding: 6px; border-radius: 11px; gap: 3px; }
  .centered-hints .hint-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
  .centered-hints .hint-copy small { font-size: 8px; margin-bottom: 1px; }
  .centered-hints .hint-copy strong { font-size: 10px; line-height: 1.12; }
  .centered-hints .hint-flag-image { width: 50px; max-width: 50px; height: 30px; }

  .answers-card { padding: 8px 10px; }
  .answers-card .card-heading { flex-direction: row; align-items: center; }
  .answers-card .section-kicker { display: none; }
  .answers-card .card-heading h2 { font-size: 12px; }
  .answer-grid { margin-top: 5px; min-height: 26px; max-height: 56px; gap: 4px; }
  .answer-chip { padding: 3px 6px; gap: 4px; font-size: 9px; }
  .answer-chip .chip-flag { width: 18px; height: 13px; }
  .empty-state { padding: 4px 0; font-size: 9px; }
  .revealed { max-height: 52px; overflow-y: auto; margin-top: 5px; padding: 6px; }
  .revealed-label { margin-bottom: 2px; font-size: 8px; }
  .missing-list { font-size: 9px; line-height: 1.35; }

  .navigation-row { flex-direction: row; gap: 6px; }
  .navigation-row .btn { width: 50%; min-width: 0; padding: 7px 6px; border-radius: 9px; font-size: 9px; }
  footer { display: none; }
}

@media (max-width: 390px) and (max-height: 720px) {
  .topbar { height: 32px; margin-bottom: 5px; }
  .brand-mark { width: 27px; height: 27px; }
  .hero-card { padding: 8px; }
  .hint-card { padding-top: 7px; padding-bottom: 7px; }
  .centered-hints .hint-btn { min-height: 62px; }
  .answers-card { padding-top: 6px; padding-bottom: 6px; }
  .answer-grid { max-height: 42px; }
}

/* account + Flask */
.account-actions { gap: 7px; }
.user-pill { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; font-size: 11px; font-weight: 800; }
.logout-form { margin: 0; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 25% 0%, #243877 0, transparent 35%), linear-gradient(145deg,#081326,#12203a); }
.auth-shell { width: min(100%, 430px); }
.auth-card { padding: 34px; text-align: center; }
.auth-logo { width: 60px; height: 60px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(145deg,#7b6cff,#5358ee); color: white; font-weight: 1000; box-shadow: 0 14px 30px rgba(83,88,238,.28); }
.auth-card h1 { margin: 4px 0 7px; font-size: 28px; }
.auth-card > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.auth-form { display: grid; gap: 13px; text-align: left; }
.auth-form label { display: grid; gap: 6px; color: #3b4658; font-size: 11px; font-weight: 900; }
.auth-form input { width: 100%; box-sizing: border-box; border: 1px solid #dde2ea; border-radius: 12px; padding: 12px 13px; outline: none; font: inherit; background: #fbfcfe; }
.auth-form input:focus { border-color: #8c82ff; box-shadow: 0 0 0 3px rgba(91,93,240,.10); }
.auth-submit { width: 100%; margin-top: 3px; }
.auth-error { margin: 0 0 15px; padding: 10px 12px; border-radius: 10px; background: #fff0f1; color: #b42335; font-size: 11px; font-weight: 800; text-align: left; }
.auth-switch { margin: 18px 0 0 !important; font-size: 11px !important; }
.auth-switch a { color: var(--primary); font-weight: 900; text-decoration: none; }
@media (max-width: 650px) {
  .account-actions { gap: 4px; }
  .user-pill { max-width: 90px; padding: 5px 7px; font-size: 9px; background: #eef0ff; color: #4f51d8; }
  .account-actions .logout-form .btn { display: none; }
  .auth-body { padding: 12px; }
  .auth-card { padding: 25px 19px; }
}


/* stabiele, volledig gecentreerde hints + fullscreen vlag */
.centered-hints .hint-btn {
  position: relative;
  height: 106px;
  min-height: 106px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow: hidden;
  text-align: center;
}
.centered-hints .hint-icon { flex: 0 0 auto; }
.centered-hints .hint-copy {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.centered-hints .hint-copy small,
.centered-hints .hint-copy strong {
  width: 100%;
  text-align: center;
}
.centered-hints .hint-copy strong[data-value] {
  height: 42px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 3px;
}
.centered-hints .hint-btn.revealed .hint-icon { display: none; }
.centered-hints .hint-btn.revealed .hint-copy strong[data-value] { height: 58px; min-height: 58px; }
.centered-hints .hint-btn[data-hint="flag"].revealed .hint-copy strong[data-value] {
  height: 58px;
  min-height: 58px;
  width: 100%;
  padding: 0;
}
.flag-inline-wrap {
  position: relative;
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}
.flag-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  color: #c4c9d3;
  font-size: 22px;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0;
  user-select: none;
}
.centered-hints .hint-flag-image {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: 94px;
  height: 52px;
  object-fit: contain;
  margin: 0;
  border-radius: 5px;
  box-shadow: 0 5px 14px rgba(15,23,42,.16);
  background: #fff;
}
.hint-btn[data-hint="flag"].flag-is-visible { cursor: zoom-in; }
.hint-btn[data-hint="flag"].flag-is-visible::after {
  content: "Vlag";
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: rgba(10,17,31,.72);
  color: white;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
@media (hover: hover) and (pointer: fine) {
  .hint-btn[data-hint="flag"].flag-is-visible:hover::after { opacity: 1; }
}

body.modal-open { overflow: hidden; }
.flag-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(4,9,18,.92);
  backdrop-filter: blur(10px);
}
.flag-modal.hidden { display: none; }
.flag-modal-panel {
  width: min(94vw, 1100px);
  height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.flag-modal-title {
  color: rgba(255,255,255,.88);
  font-size: clamp(18px,2.2vw,28px);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.flag-modal-image {
  display: block;
  max-width: min(92vw, 980px);
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: white;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.flag-modal-help { color: rgba(255,255,255,.55); font-size: 12px; }
.flag-modal-close {
  position: fixed;
  top: 20px;
  right: 22px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px;
  background: rgba(255,255,255,.09);
  color: white;
  font-size: 30px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.flag-modal-close:hover { background: rgba(255,255,255,.16); }

@media (max-width: 650px) {
  .centered-hints .hint-btn {
    height: 76px;
    min-height: 76px;
    gap: 2px;
  }
  .centered-hints .hint-copy strong[data-value] { height: 30px; min-height: 30px; }
  .centered-hints .hint-btn.revealed .hint-copy strong[data-value],
  .centered-hints .hint-btn[data-hint="flag"].revealed .hint-copy strong[data-value] {
    height: 45px;
    min-height: 45px;
  }
  .flag-inline-wrap { height: 45px; }
  .flag-watermark {
    opacity: .48;
    font-size: 19px;
    color: #aeb4c0;
  }
  .centered-hints .hint-flag-image {
    max-width: 74px;
    height: 41px;
    box-shadow: 0 4px 12px rgba(15,23,42,.17);
  }
  .flag-modal { padding: 14px; }
  .flag-modal-panel { width: 100%; height: 100%; gap: 14px; }
  .flag-modal-image { max-width: 96vw; max-height: 72vh; border-radius: 8px; }
  .flag-modal-close { top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 12px; }
  .flag-modal-help { font-size: 10px; }
}

@media (max-width: 390px) and (max-height: 720px) {
  .centered-hints .hint-btn { height: 68px; min-height: 68px; }
  .centered-hints .hint-btn.revealed .hint-copy strong[data-value],
  .centered-hints .hint-btn[data-hint="flag"].revealed .hint-copy strong[data-value] { height: 39px; min-height: 39px; }
  .flag-inline-wrap { height: 39px; }
  .centered-hints .hint-flag-image { height: 35px; max-width: 66px; }
}

/* v8 - rijke lokale landendatabase + extra hints */
.more-hints-row {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}
.more-hints-btn {
  border: 1px solid #dfe3eb;
  border-radius: 999px;
  background: #f8f9fc;
  color: #4f51d8;
  padding: 7px 12px;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}
.more-hints-btn:hover { background: #eff0ff; border-color: #cfd1fb; }
.more-hints-btn:disabled { opacity: .45; cursor: default; }

.sheet-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(7,12,24,.68);
  backdrop-filter: blur(9px);
}
.sheet-modal.hidden { display: none; }
.sheet-panel {
  width: min(980px, 96vw);
  max-height: min(88vh, 820px);
  overflow: auto;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(3,9,24,.32);
  padding: 22px;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 13px;
  border-bottom: 1px solid #edf0f4;
}
.sheet-head h2 { margin: 3px 0 4px; font-size: 21px; }
.sheet-head p { margin: 0; color: var(--muted); font-size: 11px; }
.sheet-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid #e1e5ec;
  background: #f8f9fb;
  color: #394254;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.sheet-meta {
  margin: 12px 0 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
}
.extra-hint-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.extra-hint-btn {
  position: relative;
  min-height: 112px;
  padding: 10px 8px;
  border: 1px solid #e5e8ef;
  border-radius: 14px;
  background: #fbfcfe;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #172033;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.extra-hint-btn:hover { border-color: #cfd2fa; box-shadow: 0 7px 18px rgba(45,52,94,.09); transform: translateY(-1px); }
.extra-hint-btn > span:first-child { font-size: 21px; line-height: 1; }
.extra-hint-btn small { color: #7a8495; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.extra-hint-btn strong {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4e5870;
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.extra-hint-btn.revealed {
  background: #f5f5ff;
  border-color: #d9dafb;
}
.extra-hint-btn.revealed strong { color: #34375f; }
.extra-hint-btn.visual-is-visible { cursor: zoom-in; }
.extra-hint-btn.visual-is-visible::after {
  content: "Vergroot";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,17,31,.74);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
}
@media (hover: hover) and (pointer: fine) {
  .extra-hint-btn.visual-is-visible:hover::after { opacity: 1; }
}
.outline-wrap {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.outline-wrap img { max-width: 96px; max-height: 54px; object-fit: contain; }
.locator-map {
  position: relative;
  width: 100%;
  height: 54px;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f5f8;
}
.locator-map img { width: 100%; height: 100%; object-fit: cover; display: block; }
.locator-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5c5ff0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(92,95,240,.25), 0 2px 8px rgba(15,23,42,.25);
  transform: translate(-50%,-50%);
}
.extra-unavailable { color: #8c95a5; font-size: 9px; }

.visual-panel { width: min(96vw, 1120px); }
.extra-visual-content {
  width: min(92vw, 980px);
  min-height: min(62vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.outline-wrap.large {
  width: min(88vw, 820px);
  height: min(62vh, 540px);
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 25px 70px rgba(0,0,0,.28);
}
.outline-wrap.large img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.locator-map.large {
  width: min(90vw, 980px);
  height: auto;
  aspect-ratio: 2 / 1;
  border-radius: 18px;
  box-shadow: 0 25px 70px rgba(0,0,0,.28);
}
.locator-map.large .locator-dot {
  width: 18px;
  height: 18px;
  border-width: 3px;
  box-shadow: 0 0 0 8px rgba(92,95,240,.22), 0 3px 10px rgba(15,23,42,.3);
}

@media (max-width: 900px) {
  .extra-hint-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 650px) {
  .more-hints-row { margin-top: 6px; gap: 7px; }
  .more-hints-row > span { display: none; }
  .more-hints-btn { padding: 5px 10px; font-size: 9px; }
  .sheet-modal { align-items: flex-end; padding: 0; }
  .sheet-panel {
    width: 100%;
    max-height: 88dvh;
    border-radius: 18px 18px 0 0;
    padding: 13px 10px 12px;
  }
  .sheet-head { gap: 10px; padding-bottom: 8px; }
  .sheet-head .section-kicker { display: none; }
  .sheet-head h2 { margin: 0 0 2px; font-size: 16px; }
  .sheet-head p { font-size: 9px; line-height: 1.25; }
  .sheet-close { width: 32px; height: 32px; border-radius: 10px; font-size: 21px; }
  .sheet-meta { margin: 8px 0 7px; font-size: 8px; }
  .sheet-meta > span:last-child { display: none; }
  .extra-hint-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
  .extra-hint-btn { min-height: 82px; border-radius: 11px; padding: 6px 4px; gap: 3px; }
  .extra-hint-btn > span:first-child { font-size: 17px; }
  .extra-hint-btn small { font-size: 7px; }
  .extra-hint-btn strong { min-height: 26px; font-size: 8px; line-height: 1.12; }
  .outline-wrap, .locator-map { height: 38px; }
  .outline-wrap img { max-height: 38px; max-width: 70px; }
  .locator-dot { width: 8px; height: 8px; }
  .extra-visual-content { width: 96vw; min-height: 60vh; }
  .outline-wrap.large { width: 94vw; height: 58vh; padding: 14px; border-radius: 12px; }
  .locator-map.large { width: 96vw; border-radius: 10px; }
}

@media (max-width: 390px) and (max-height: 720px) {
  .sheet-panel { max-height: 92dvh; padding-top: 9px; }
  .extra-hint-grid { gap: 4px; }
  .extra-hint-btn { min-height: 72px; }
  .extra-hint-btn > span:first-child { font-size: 15px; }
  .extra-hint-btn strong { min-height: 22px; font-size: 7.5px; }
  .outline-wrap, .locator-map { height: 33px; }
  .outline-wrap img { max-height: 33px; }
}


/* v9: compacte totaalscore + directe letterkiezer */
.quick-status-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: -4px 0 10px;
}
.mobile-total-score, .letter-picker-btn {
  min-height: 38px;
  border: 1px solid rgba(214,220,231,.95);
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 5px 16px rgba(4,11,26,.06);
}
.mobile-total-score {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 7px 11px;
  color: #778194;
  font-size: 10px;
  font-weight: 800;
}
.mobile-total-score strong { color: #182236; font-size: 14px; letter-spacing: -.02em; }
.letter-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: #5a6476;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.letter-picker-btn strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
}
.letter-picker-btn:hover { border-color: #c6c8fb; background: #fff; }
.letter-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(7,12,24,.58);
  backdrop-filter: blur(7px);
}
.letter-picker-modal.hidden { display: none; }
.letter-picker-panel {
  width: min(430px, 94vw);
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(3,9,24,.30);
}
.letter-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.letter-picker-head h2 { margin: 0; font-size: 19px; }
.letter-picker-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 7px; }
.letter-picker-option {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #e0e4eb;
  border-radius: 10px;
  background: #fafbfd;
  color: #596579;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.letter-picker-option:hover:not(:disabled) { border-color: #c8c9ff; color: var(--primary); }
.letter-picker-option.active { background: var(--primary); color: white; border-color: var(--primary); }
.letter-picker-option.done:not(.active) { color: #087b5d; background: #eaf9f4; border-color: #c6eee2; }
.letter-picker-option.disabled { opacity: .22; cursor: default; }

@media (max-width: 650px) {
  .quick-status-bar {
    position: sticky;
    top: 0;
    z-index: 80;
    margin: 0 0 6px;
    padding: 3px 0;
    justify-content: space-between;
    background: rgba(243,245,249,.94);
    backdrop-filter: blur(9px);
  }
  .mobile-total-score, .letter-picker-btn { min-height: 32px; border-radius: 10px; box-shadow: 0 3px 10px rgba(4,11,26,.05); }
  .mobile-total-score { padding: 5px 8px; font-size: 8px; gap: 5px; }
  .mobile-total-score strong { font-size: 12px; }
  .letter-picker-btn { padding: 4px 7px 4px 9px; font-size: 8px; gap: 5px; }
  .letter-picker-btn strong { width: 22px; height: 22px; border-radius: 7px; font-size: 11px; }
  .letter-picker-modal { align-items: flex-end; padding: 0; }
  .letter-picker-panel { width: 100%; padding: 14px 10px 17px; border-radius: 18px 18px 0 0; }
  .letter-picker-head { margin-bottom: 10px; }
  .letter-picker-head .section-kicker { display: none; }
  .letter-picker-head h2 { font-size: 16px; }
  .letter-picker-grid { grid-template-columns: repeat(7, 1fr); gap: 5px; }
  .letter-picker-option { border-radius: 8px; font-size: 10px; }
}

/* v10: zes standaardhints */
.centered-hints .hint-btn[data-hint="outline"].revealed [data-value]{display:flex;align-items:center;justify-content:center;min-height:0}
.centered-hints .hint-btn[data-hint="outline"] .outline-wrap{width:64px;height:40px;display:flex;align-items:center;justify-content:center}
.centered-hints .hint-btn[data-hint="outline"] .outline-wrap img{max-width:62px;max-height:38px;object-fit:contain}
@media (max-width:650px){
  .centered-hints .hint-grid{grid-template-columns:repeat(2,minmax(0,1fr));width:min(100%,360px)}
  .centered-hints .hint-btn[data-hint="outline"] .outline-wrap{width:50px;height:30px}
  .centered-hints .hint-btn[data-hint="outline"] .outline-wrap img{max-width:48px;max-height:28px}
}


.mobile-letter-label { display: none; }

/* v12: compacte mobiele letterkiezer */
@media (max-width: 650px) {
  .quick-status-bar {
    gap: 6px;
    padding: 2px 0 4px;
  }

  .mobile-total-score,
  .letter-picker-btn {
    min-height: 30px;
    border-radius: 9px;
  }

  .mobile-total-score {
    padding: 4px 7px;
  }

  .letter-picker-btn {
    padding: 3px 6px 3px 8px;
    gap: 5px;
  }

  .letter-picker-btn .desktop-letter-label { display: none; }
  .letter-picker-btn .mobile-letter-label { display: inline; }
  .letter-picker-btn strong {
    width: 21px;
    height: 21px;
    border-radius: 6px;
  }

  .letter-picker-modal {
    align-items: flex-end;
    padding: 8px;
    background: rgba(7,12,24,.48);
    backdrop-filter: blur(5px);
  }

  .letter-picker-panel {
    width: 100%;
    max-width: 390px;
    padding: 10px;
    margin: 0 auto;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(3,9,24,.28);
  }

  .letter-picker-head {
    min-height: 32px;
    margin-bottom: 7px;
    gap: 8px;
  }

  .letter-picker-head h2 {
    font-size: 14px;
    line-height: 1.1;
  }

  .letter-picker-head .sheet-close {
    width: 29px;
    height: 29px;
    min-width: 29px;
    border-radius: 8px;
    font-size: 19px;
  }

  .letter-picker-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  .letter-picker-option {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    aspect-ratio: auto;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1;
    box-shadow: none;
  }
}

@media (max-width: 350px) {
  .letter-picker-modal { padding: 5px; }
  .letter-picker-panel { padding: 8px 7px; }
  .letter-picker-grid { gap: 3px; }
  .letter-picker-option {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 7px;
    font-size: 10px;
  }
}


/* v13: iPhone/Safari invoer + betrouwbare mobiele submit */
html { -webkit-text-size-adjust: 100%; }
button, .btn, .letter-picker-btn, .hint-btn, .extra-hint-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.hero-card::after { pointer-events: none; }
#answerForm,
.answer-input-wrap,
.answer-input-wrap input,
.answer-input-wrap .btn {
  position: relative;
  z-index: 2;
}
.answer-input-wrap input {
  width: 100%;
  max-width: 100%;
}
#checkAnswerBtn:disabled {
  opacity: .72;
  cursor: wait;
}

@media (max-width: 650px) {
  /* iOS zoomt automatisch bij focus wanneer een input kleiner dan 16px is. */
  .answer-input-wrap input,
  .auth-form input {
    font-size: 16px !important;
    line-height: 1.25;
  }
  .answer-input-wrap {
    overflow: visible;
  }
  .answer-input-wrap input {
    min-width: 0;
    flex: 1 1 auto;
    padding: 7px 4px;
  }
  .answer-input-wrap .btn {
    flex: 0 0 auto;
    min-width: 86px;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 11px;
  }
}

/* v14: PWA / iPhone standalone app experience */
html, body {
  overscroll-behavior-y: none;
}
body {
  -webkit-touch-callout: none;
}
input, textarea {
  -webkit-touch-callout: default;
}
a, button, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

/* In standalone mode iOS removes the browser chrome. These safe-area paddings
   keep the interface clear of the Dynamic Island/home indicator. */
@media (display-mode: standalone) {
  html, body {
    min-height: 100dvh;
    background-color: #f3f5f9;
  }
  .app-shell {
    min-height: 100dvh;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
  }
  .auth-shell {
    min-height: 100dvh;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
  }
}

/* iOS also exposes navigator.standalone; pwa.js mirrors that into this class. */
html.pwa-standalone body {
  min-height: 100dvh;
}
html.pwa-standalone .app-shell {
  min-height: 100dvh;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

@media (max-width: 650px) and (display-mode: standalone) {
  .app-shell {
    padding-top: max(7px, env(safe-area-inset-top));
  }
  .topbar {
    margin-top: 0;
  }
  footer {
    padding-bottom: max(2px, env(safe-area-inset-bottom));
  }
}

/* v17: difficulty, hint inventory and account statistics */
.account-link { text-decoration: none; display: inline-flex; align-items: center; }
.difficulty-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 10px; border-radius: 999px; background: #eef0ff; color: #4f51d8;
  font-size: 10px; font-weight: 900; white-space: nowrap;
}
.hint-stock { font-style: normal; font-weight: 900; color: var(--primary); margin-left: 3px; }
.super-hint { border-color: rgba(91,93,240,.28) !important; background: linear-gradient(180deg,#fbfaff,#f3f1ff) !important; }
.super-hint .hint-icon { background: linear-gradient(145deg,#7b6cff,#5358ee); color: white; }
.difficulty-modal {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background: rgba(7,12,24,.62); backdrop-filter: blur(8px);
}
.difficulty-modal.hidden { display: none; }
.difficulty-panel {
  width: min(100%, 680px); max-height: calc(100dvh - 36px); overflow: auto;
  box-sizing: border-box; padding: 28px; border-radius: 24px; background: white;
  box-shadow: 0 24px 70px rgba(3,9,24,.32); text-align: center;
}
.difficulty-panel h2 { margin: 6px 0 7px; font-size: 28px; }
.difficulty-panel > p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.difficulty-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.difficulty-option {
  min-height: 126px; padding: 18px; border: 1px solid #e1e5ec; border-radius: 16px; background: #fbfcfe;
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px; text-align: left; cursor: pointer;
  font: inherit; color: #20283a; transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.difficulty-option:hover { transform: translateY(-2px); border-color: #9e98ff; box-shadow: 0 10px 24px rgba(48,53,100,.10); }
.difficulty-option strong { font-size: 16px; }
.difficulty-option span { color: var(--muted); font-size: 12px; }
.difficulty-option b { margin-top: auto; color: var(--primary); font-size: 13px; }

.stats-body { min-height: 100vh; background: #f3f5f9; color: #20283a; }
.stats-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom)); }
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.stats-title h1 { margin: 4px 0 0; font-size: 28px; }
.stats-title p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.stats-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stats-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card { padding: 18px; }
.stat-card small { display:block; color: var(--muted); font-weight: 800; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.stat-card strong { display:block; margin-top: 7px; font-size: 26px; }
.stats-section { padding: 18px; margin-top: 14px; }
.stats-section h2 { margin: 0 0 5px; font-size: 18px; }
.stats-section > p { margin: 0 0 13px; color: var(--muted); font-size: 11px; }
.stats-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.stats-table th, .stats-table td { padding: 10px 9px; border-bottom: 1px solid #e9ecf1; text-align: left; white-space: nowrap; }
.stats-table th { color: #697386; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.stats-table tbody tr:last-child td { border-bottom: 0; }
.stats-ok { color: #14804a; font-weight: 900; }
.stats-muted { color: var(--muted); }

@media (max-width: 650px) {
  .difficulty-badge { padding: 5px 7px; font-size: 9px; }
  .difficulty-panel { padding: 20px 14px; border-radius: 19px; }
  .difficulty-panel h2 { font-size: 22px; }
  .difficulty-grid { grid-template-columns: 1fr; gap: 8px; }
  .difficulty-option { min-height: 88px; padding: 13px; }
  .stats-shell { width: min(100% - 18px, 1180px); }
  .stats-head { align-items: flex-start; flex-direction: column; }
  .stats-actions { justify-content: flex-start; }
  .stats-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 21px; }
  .stats-section { padding: 13px; }
}

/* v19 - iPhone 15: compact, viewport-locked quiz (other pages unaffected) */
@media (max-width: 650px) {
  html:has(.dashboard), body:has(.dashboard) { height: 100%; overflow: hidden; overscroll-behavior: none; }
  body:has(.dashboard) .app-shell {
    height: 100dvh; min-height: 0; overflow: hidden;
    display: flex; flex-direction: column;
    padding: max(8px, env(safe-area-inset-top)) 9px max(7px, env(safe-area-inset-bottom));
  }
  body:has(.dashboard) .topbar { flex: 0 0 43px; height: 43px; margin: 0 0 7px; }
  body:has(.dashboard) .quick-status-bar { flex: 0 0 40px; margin: 0 0 7px; padding: 0; }
  body:has(.dashboard) .dashboard { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 0; overflow: hidden; }
  body:has(.dashboard) .main-column { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 7px; }
  body:has(.dashboard) .side-column, body:has(.dashboard) footer { display: none; }
  body:has(.dashboard) .hero-card { flex: 0 0 auto; padding: 11px 12px 8px; }
  body:has(.dashboard) .hero-top { gap: 9px; }
  body:has(.dashboard) .letter-badge { width: 48px; height: 48px; font-size: 27px; border-radius: 12px; }
  body:has(.dashboard) .hero-copy h1 { font-size: 17px; line-height: 1.13; margin: 3px 0; }
  body:has(.dashboard) .round-score strong { font-size: 19px; }
  body:has(.dashboard) .progress-row { margin: 8px 0; }
  body:has(.dashboard) .answer-input-wrap { padding: 3px 5px 3px 10px; }
  body:has(.dashboard) .answer-input-wrap .btn { min-height: 35px; }
  body:has(.dashboard) .feedback { min-height: 12px; margin-top: 3px; font-size: 10px; }
  body:has(.dashboard) .hint-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 10px 12px 7px; }
  body:has(.dashboard) .hint-card .card-heading { flex: 0 0 auto; gap: 3px; }
  body:has(.dashboard) .hint-card .card-heading h2 { font-size: 16px; }
  body:has(.dashboard) .hint-meta { gap: 5px; }
  body:has(.dashboard) .centered-hints .hint-grid { flex: 1 1 auto; min-height: 0; width: 100%; grid-template-rows: repeat(4,minmax(0,1fr)); gap: 6px; margin-top: 7px; }
  body:has(.dashboard) .centered-hints .hint-btn { height: 100%; min-height: 0; padding: 3px 5px; gap: 2px; border-radius: 11px; }
  body:has(.dashboard) .centered-hints .hint-icon { width: 27px; height: 27px; font-size: 15px; border-radius: 8px; }
  body:has(.dashboard) .centered-hints .hint-copy small { font-size: 9px; margin: 0 0 2px; }
  body:has(.dashboard) .centered-hints .hint-copy strong { font-size: 12px; line-height: 1.1; }
  body:has(.dashboard) .centered-hints .hint-copy strong[data-value],
  body:has(.dashboard) .centered-hints .hint-btn.revealed .hint-copy strong[data-value] { height: auto; min-height: 0; max-height: 38px; overflow: hidden; }
  body:has(.dashboard) .centered-hints .hint-flag-image { max-height: 30px; }
  body:has(.dashboard) .more-hints-row { flex: 0 0 auto; margin-top: 5px; }
  body:has(.dashboard) .answers-card { flex: 0 0 auto; padding: 9px 12px; max-height: 76px; overflow: hidden; }
  body:has(.dashboard) .answers-card .answer-grid { max-height: 38px; overflow-y: auto; min-height: 0; margin-top: 4px; }
  body:has(.dashboard) .navigation-row { flex: 0 0 auto; flex-direction: row; gap: 6px; }
  body:has(.dashboard) .navigation-row .btn { min-height: 35px; padding: 7px 5px; font-size: 11px; }
  body:has(.dashboard) .letter-picker-modal, body:has(.dashboard) .flag-modal { overflow: auto; }
}
