.decipher-page { --d-accent:var(--accent-color); --d-ink:var(--text-color); --d-muted:var(--muted-color); --d-line:var(--border-color); --d-soft:var(--surface-soft); --d-success:#267b57; --d-danger:#b94b4b; }
.decipher-heading { padding-bottom:27px; }


.decipher-page *, .decipher-page *::before, .decipher-page *::after { box-sizing:border-box; }


.decipher-subnav { display:flex; justify-content:flex-end; gap:8px; padding:17px 0 20px; flex-wrap:wrap; }
.decipher-subnav[hidden], .decipher-notice[hidden] { display:none!important; }
.subnav-button { border:0; border-radius:5px; background:transparent; color:var(--d-muted); padding:9px 13px; font-family:inherit; font-size:1.02rem; cursor:pointer; }
.subnav-button:hover,.subnav-button[aria-current="page"] { color:var(--d-accent); background:#eaf0f1; }
.decipher-surface { background:#fff; border:1px solid var(--d-line); border-radius:10px; box-shadow:0 8px 30px rgba(29,56,66,.035); padding:clamp(22px,3.3vw,38px); margin-top:24px; min-height:350px; }
.decipher-subnav:not([hidden]) + .decipher-surface { margin-top:0; }
.decipher-surface h2 { font-size:clamp(1.55rem,3vw,2.1rem); margin:0 0 10px; line-height:1.2; font-weight:700; color:var(--d-accent); }
.decipher-lead { margin:0 0 24px; }
.decipher-row { display:flex; gap:14px; align-items:center; flex-wrap:wrap; }
.decipher-btn:focus-visible,.select-tile:focus-within,.choice:focus-visible,.subnav-button:focus-visible { outline:2px solid var(--d-accent); outline-offset:3px; }
.decipher-btn { display:inline-flex; justify-content:center; align-items:center; gap:8px; border:1px solid var(--d-accent); border-radius:5px; font-family:inherit; font-size:1.04rem; font-weight:700; line-height:1.2; padding:13px 21px; min-height:47px; background:var(--d-accent); color:#fff; cursor:pointer; text-decoration:none; transition:background .12s, transform .12s; }
.decipher-btn:hover { background:#193e4e; }
.decipher-btn:active { transform:translateY(1px); }
.decipher-btn.secondary { background:#fff; color:var(--d-accent); }
.decipher-btn.secondary:hover { background:var(--d-soft); }
.decipher-btn.tertiary { color:var(--d-accent); background:var(--d-soft); border-color:var(--d-line); }
.decipher-btn[disabled] { opacity:.5; cursor:not-allowed; }
.decipher-toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:24px; }
.mode-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.mode-card { border:1px solid var(--d-line); border-radius:9px; padding:30px 26px; text-align:left; background:#f9fbfb; color:var(--d-ink); cursor:pointer; font-family:inherit; }
.mode-card:hover { border-color:#9fb6be; box-shadow:0 5px 22px rgba(33,69,83,.08); transform:translateY(-2px); }
.mode-index { color:var(--d-accent); font:700 .9rem/1.2 system-ui,sans-serif; letter-spacing:.1em; display:block; margin-bottom:25px; }
.mode-card strong { color:var(--d-accent); display:block; font-size:1.65rem; margin-bottom:10px; }
.mode-card span.mode-description { display:block; color:var(--d-muted); font-size:1.06rem; line-height:1.5; }
.alphabet-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(167px,1fr)); gap:10px; }
.select-tile { position:relative; cursor:pointer; display:flex; align-items:center; gap:11px; padding:15px 14px; border:1px solid var(--d-line); border-radius:5px; background:#f9fbfb; min-height:57px; font-size:1.06rem; }
.select-tile:has(input:checked) { border-color:#7aa0ac; background:#eaf2f4; color:var(--d-accent); font-weight:700; }
.select-tile input { accent-color:var(--d-accent); width:17px; height:17px; margin:0; flex-shrink:0; }
.alphabet-actions { display:flex; gap:9px; align-items:center; flex-wrap:wrap; margin:0 0 20px; }
.selected-count { color:var(--d-muted); margin-left:auto; }
.quiz-stats { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; padding-bottom:16px; border-bottom:1px solid var(--d-line); color:var(--d-muted); font-size:1.05rem; }
.quiz-stats strong { color:var(--d-accent); }
.quiz-hearts { color:#a64147; font-size:1.45rem; letter-spacing:.13em; white-space:nowrap; }
.quiz-prompt { text-align:center; padding:28px 0 20px; }
.quiz-instruction { color:var(--d-muted); font-size:1.04rem; margin:0; }
.quiz-glyph { display:flex; align-items:center; justify-content:center; min-height:167px; padding:14px; line-height:1.5; overflow-wrap:anywhere; color:var(--d-accent); font-family: "Times New Roman", Times, serif; font-size:clamp(2.55rem,7vw,4.35rem); }
.choices-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.choice { min-height:76px; border:1px solid var(--d-line); background:#f9fbfb; border-radius:6px; font:inherit; font-size:1.26rem; color:var(--d-ink); cursor:pointer; padding:14px; transition:background .15s; overflow-wrap:anywhere; }
.choice:hover:not(:disabled) { border-color:#7fa2ad; background:#edf3f4; }
.choice:disabled { cursor:default; }
.choice.correct { background:#e7f5ed; border-color:#68a987; color:#1e6544; font-weight:700; }
.choice.wrong { background:#faeceb; border-color:#d48a88; color:#9b3632; font-weight:700; }
.quiz-feedback { min-height:32px; text-align:center; padding-top:14px; font-size:1.05rem; font-weight:700; color:var(--d-muted); }
.quiz-feedback.positive { color:var(--d-success); }
.quiz-feedback.negative { color:var(--d-danger); }
.score-display { display:flex; align-items:center; justify-content:center; gap:24px; flex-wrap:wrap; padding:24px 0 8px; }
.score-number { font-size:clamp(3rem,7vw,5rem); line-height:1; font-weight:700; color:var(--d-accent); }
.score-tile { text-align:center; min-width:130px; }
.score-tile small { display:block; color:var(--d-muted); font-size:.97rem; margin-bottom:10px; }
.stats-grid { display:grid; grid-template-columns:1fr 1fr; gap:26px; }
.stats-grid h3 { font-size:1.35rem; color:var(--d-accent); margin:0 0 14px; }
.stats-table { width:100%; border-collapse:collapse; font-size:1.04rem; }
.stats-table th { text-align:left; color:var(--d-muted); background:var(--d-soft); font-size:.88rem; text-transform:uppercase; letter-spacing:.05em; }
.stats-table th,.stats-table td { border-bottom:1px solid var(--d-line); padding:11px 12px; }
.stats-table td:last-child,.stats-table th:last-child { text-align:right; }
.stats-glyph { font-family:"Noto Sans","Segoe UI Symbol",sans-serif; font-size:1.17rem; }
.decipher-empty { color:var(--d-muted); font-style:italic; padding:20px 0; }
.decipher-notice { padding:11px 16px; border:1px solid #e7caa6; background:#fff8ef; color:#805522; border-radius:6px; margin-top:16px; }
.decipher-footnote { color:var(--d-muted); margin-top:20px; font-size:.94rem; line-height:1.5; }
.loading-message { color:var(--d-muted); }
@media (max-width:750px) { .decipher-heading{align-items:flex-start;flex-direction:column;}  .decipher-subnav{justify-content:flex-start;} .mode-grid,.stats-grid{grid-template-columns:1fr;} .quiz-glyph{min-height:128px;} }
@media (max-width:520px) { .decipher-page{padding:27px 16px 70px;} .decipher-surface{padding:20px 16px;} .choices-grid{gap:9px;} .choice{font-size:1.08rem;min-height:74px;}  .selected-count{width:100%;} .alphabet-grid{grid-template-columns:repeat(2,minmax(0,1fr));} .select-tile{padding:12px 10px;font-size:.98rem;} }
@media (prefers-reduced-motion:reduce) { .decipher-page * { transition:none!important; } }
