/* Small shared assets; no animation library, remote badges or server rendering. */
.progression-strip { flex-shrink: 0; padding: .4rem .75rem; background: #0b0e15; border-bottom: 1px solid #1c2b39; }
.progression-open-button { display: block; position: relative; width: 100%; color: #dce8f8; text-align: left; border: 0; background: none; padding: .25rem .15rem; border-radius: 7px; }
.progression-open-button:focus-visible, .progression-button:focus-visible, .progression-toast button:focus-visible { outline: 2px solid #43E5FF; outline-offset: 4px; }
.progression-strip-line { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .3rem; font-size: .78rem; }
#progressionLevel { color: #43E5FF; font-weight: 800; white-space: nowrap; }
#progressionNextLevel { color: #b9c5d7; font-size: .72rem; text-align: right; }
.progression-track, .achievement-track { display: block; height: 7px; overflow: hidden; background: #304158; border-radius: 10px; box-shadow: inset 0 0 0 1px #52647b; }
.progression-track > span, .achievement-track > span { display: block; height: 100%; width: 0; border-radius: inherit; background: #66edff linear-gradient(90deg, #66edff, #ff91d9); box-shadow: inset 0 1px 0 #d7faff; transition: width .6s ease-out; }
.progression-strip-hint { color: #9facbe; font-size: .65rem; margin-left: .35rem; font-weight: 500; }
.progression-xp-gain { position: absolute; top: 0; left: 50%; font-weight: 900; color: #43E5FF; background: #0b0e15; padding: 0 .35rem; pointer-events: none; opacity: 0; }
.progression-xp-gain.is-visible { animation: progression-xp 1.8s ease-out both; }
@keyframes progression-xp { 0% { opacity: 0; transform: translateY(6px); } 15%, 70% { opacity: 1; transform: translateY(-3px); } 100% { opacity: 0; transform: translateY(-12px); } }
.progression-public { display: inline-flex; align-items: center; gap: .24rem; vertical-align: baseline; padding: .12rem .4rem; background: #132b38; color: #c3f3ff; border: 1px solid #497285; border-radius: 999px; white-space: nowrap; font-size: .8rem; font-weight: 800; line-height: 1.2; text-shadow: none; }
.progression-public-label { font-size: .68rem; font-weight: 650; }
.progression-public-badge { color: #ff91d9; font-size: .9rem; padding-left: .24rem; border-left: 1px solid #497285; }
.chat-author { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .35rem; max-width: 100%; }
.chat-author .sender-name { min-width: 0; overflow-wrap: anywhere; }
#chatMessages .chat-message { overflow-wrap: anywhere; line-height: 1.6; }
.top-scores-preview .player-entry { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.top-scores-preview .player-rank { color: #aab9cc; }
.top-scores-preview .player-streak { min-width: 1.4em; text-align: right; }
[data-frame="cyan"] { --frame-colour: #43E5FF; }
[data-frame="pink"] { --frame-colour: #FB67C7; }
[data-frame="aurora"] { --frame-colour: #E6D18C; }
.progression-public[data-frame="cyan"], .progression-public[data-frame="pink"], .progression-public[data-frame="aurora"] { border-color: var(--frame-colour); color: var(--frame-colour); }
.progression-open-button[data-frame="pink"] #progressionLevel, .progression-open-button[data-frame="aurora"] #progressionLevel { color: var(--frame-colour); }
body.progression-open { overflow: hidden; }
.progression-panel { position: fixed; inset: 0; z-index: 1200; overflow-y: auto; overscroll-behavior-y: contain; background: radial-gradient(ellipse at 10% 8%, #13303970, transparent 40%), #080b12; padding: 0 1rem calc(1.5rem + env(safe-area-inset-bottom)); color: #e5edf9; }
.progression-shell { max-width: 820px; margin: 0 auto; }
.progression-toolbar { position: sticky; top: 0; z-index: 2; background: #080b12; border-bottom: 1px solid #26384a; margin: 0 -1rem 1rem; padding: calc(.75rem + env(safe-area-inset-top)) 1rem .75rem; }
.progression-toolbar-main { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.progression-guest-reminder { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-top: 1px solid #26384a; margin-top: .65rem; padding-top: .65rem; }
.progression-guest-reminder > span { min-width: 0; color: #ddc19a; font-size: .87rem; line-height: 1.4; }
.progression-guest-reminder > button { flex-shrink: 0; min-height: 44px; }
.progression-toolbar h1 { margin: 0; font-size: 1.08rem; font-weight: 800; }
.progression-button { background: #17212e; border: 1px solid #3c536a; border-radius: 9px; color: #e5edf9; padding: .62rem .85rem; min-height: 42px; font-size: .85rem; font-weight: 650; line-height: 1.3; }
.progression-button:hover:not(:disabled) { background: #20323f; border-color: #43E5FF; }
.progression-button:disabled { opacity: .5; }
.progression-button-primary { background: #43E5FF; border-color: #43E5FF; color: #07121b; }
.progression-button-primary:hover:not(:disabled) { background: #93efff; color: #07121b; }
.progression-button-small { font-size: .73rem; min-height: 38px; padding: .5rem .45rem; flex: 1; }
.progression-muted { color: #aab9cc; font-size: .82rem; line-height: 1.55; }
.progression-live-note { font-size: .75rem; text-align: center; color: #b5c3d5; margin-bottom: 1rem; }
.progression-player-card { padding: 1.2rem; border: 1px solid var(--frame-colour, #3d526b); border-radius: 16px; background: linear-gradient(120deg, #162b3c, #11151f 80%); box-shadow: 0 0 24px color-mix(in srgb, var(--frame-colour, #30445b) 12%, transparent); }
.progression-player-card[data-frame="aurora"] { background: linear-gradient(120deg, #1e3142, #29192a); }
.progression-player-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.progression-eyebrow { color: #43E5FF; font-size: .65rem; letter-spacing: .12em; font-weight: 800; text-transform: uppercase; margin: 0 0 .25rem; }
#progressionPanelLevel { font-size: 2.1rem; font-weight: 850; color: #fff; margin: 0; letter-spacing: -.04em; }
#progressionTotalXp { margin-top: .2rem; color: #afbed1; font-size: .8rem; }
#progressionVisitXp { font-size: .78rem; font-weight: 700; color: #FB67C7; }
.progression-equipped { display: flex; align-items: center; gap: .55rem; margin: .95rem 0 .6rem; }
.progression-equipped-icon { color: #FB67C7; font-size: 1.6rem; }
.progression-equipped small { color: #aab9cc; display: block; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
#progressionEquipped { font-weight: 750; font-size: .92rem; }
#progressionFrame { font-size: .69rem; color: #aab9cc; }
.progression-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 1rem 0; }
.progression-stat { border: 1px solid #283c50; border-radius: 12px; padding: .75rem .4rem; text-align: center; background: #111b28; }
.progression-stat strong { display: block; color: #fff; font-size: 1.35rem; }
.progression-stat span { color: #afbed1; font-size: .7rem; }
.progression-goals { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: .9rem 0 1.4rem; }
.progression-goal { background: #101b27; border: 1px solid #2a4056; border-radius: 12px; padding: 1rem; }
.progression-goal h3 { font-size: .96rem; font-weight: 750; }
.progression-goal p { margin-bottom: .55rem; }
#progressionDailyCount { color: #43E5FF; font-size: .92rem; font-weight: 800; }
#progressionDailyReset { color: #91a6bd; font-size: .66rem; margin: .55rem 0 0; }
.progression-collection-header { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin: .8rem 0; }
.progression-collection-header h2 { font-weight: 800; font-size: 1.2rem; margin: 0; }
#progressionBadgeCount { color: #91a6bd; font-size: .75rem; }
.achievement-family { margin: 1.4rem 0; }
.achievement-family h3 { font-size: .98rem; font-weight: 800; margin-bottom: .3rem; }
.achievement-family > p { margin-bottom: .7rem; }
.achievement-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.achievement-card { display: flex; flex-direction: column; align-items: stretch; position: relative; padding: .9rem .65rem; border: 1px solid #314259; border-radius: 12px; background: #111a27; min-width: 0; }
.achievement-card.is-earned { border-color: #397288; background: linear-gradient(160deg, #14303a, #111a27 60%); }
.achievement-card.is-equipped { border-color: #FB67C7; box-shadow: 0 0 0 1px #FB67C7; }
.achievement-icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 58px; margin: 0 auto .5rem; color: #91a6bd; background: #1d2a3d; clip-path: polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%); font-size: 1.9rem; font-weight: 700; }
.is-earned .achievement-icon { color: #43E5FF; background: #164553; }
.is-earned[data-tier="3"] .achievement-icon { color: #FB67C7; background: #4b2946; }
.is-earned[data-tier="4"] .achievement-icon { color: #f6df91; background: #463d27; }
.achievement-state { color: #96abc1; font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; text-align: center; margin-bottom: .5rem; }
.is-earned .achievement-state { color: #43E5FF; }
.is-equipped .achievement-state { color: #FB67C7; }
.achievement-card h4 { font-size: .83rem; font-weight: 800; line-height: 1.4; text-align: center; margin-bottom: .45rem; overflow-wrap: anywhere; }
.achievement-description { font-size: .72rem; color: #afbed1; line-height: 1.5; text-align: center; margin-bottom: .7rem; flex: 1; }
.achievement-count { font-size: .7rem; color: #c4d4e5; margin-bottom: .35rem; text-align: center; }
.achievement-track { height: 6px; }
.achievement-actions { display: flex; gap: .35rem; }
.progression-guest { border: 1px solid #365f70; border-radius: 14px; background: #112632; padding: 1.2rem; margin: 1rem 0; }
.progression-guest h2 { font-size: 1.25rem; font-weight: 800; }
.progression-guest-summary { color: #edfbff; font-size: .95rem; font-weight: 650; line-height: 1.5; margin-bottom: .5rem; }
.progression-footer { border-top: 1px solid #293b4c; margin-top: 1.5rem; padding-top: 1rem; }
#progressionRules { color: #9aacbf; font-size: .75rem; line-height: 1.6; }
#progressionStatus { color: #e4cf91; min-height: 1.2em; font-size: .8rem; margin: .8rem 0; }
.achievement-share { border: 1px solid #397288; border-radius: 14px; padding: 1rem; margin: 1.2rem 0; scroll-margin-top: 10rem; }
.achievement-share h2 { font-size: 1.1rem; font-weight: 800; }
.achievement-share canvas { width: min(100%, 400px); height: auto; display: block; margin: 1rem auto; border-radius: 10px; }
.achievement-share-caption { user-select: text; font-size: .85rem; line-height: 1.55; color: #c5d4e7; overflow-wrap: anywhere; }
.achievement-share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
#achievementShareStatus { font-size: .8rem; color: #b6c9df; min-height: 1.5em; margin: .9rem 0 0; }
.progression-toast { position: fixed; left: 50%; top: calc(.6rem + env(safe-area-inset-top)); transform: translateX(-50%); width: min(92%, 420px); z-index: 1100; padding: .65rem .8rem; border: 1px solid #43E5FF; border-radius: 12px; background: #101e2bf5; box-shadow: 0 6px 30px #0008; display: flex; align-items: center; gap: .55rem; }
.progression-toast p { font-size: .83rem; font-weight: 750; line-height: 1.4; margin: 0; flex: 1; }
.progression-toast button { flex-shrink: 0; border: 0; background: none; color: #43E5FF; font-size: .75rem; padding: .45rem .2rem; min-height: 36px; }
.progression-toast #progressionToastClose { font-size: 1.25rem; color: #b6c9df; }
.progression-confetti { position: fixed; left: 50%; top: calc(7rem + env(safe-area-inset-top)); z-index: 1101; pointer-events: none; }
.progression-confetti-dot { position: absolute; width: 6px; height: 9px; background: #43E5FF; border-radius: 2px; animation: progression-confetti 1s ease-out var(--delay) both; }
.progression-confetti-dot:nth-child(2n) { background: #FB67C7; }
.progression-confetti-dot:nth-child(3n) { background: #f6df91; }
@keyframes progression-confetti { 0% { opacity: 0; transform: translate(0, 0); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--spin)); } }
.progression-correct-pulse { animation: progression-correct .5s ease-out; }
@keyframes progression-correct { 0%, 100% { filter: brightness(1); } 45% { filter: brightness(1.35); box-shadow: 0 0 18px #43E5FF88; } }
.progression-result-note { display: block; font-size: .76rem; margin-top: .4rem; color: #dfedff; }
.progression-temporary { display: block; color: #ddc19a; font-size: .77rem; font-weight: 500; margin-top: .12rem; }
.guest-save-prompt { margin-top: .65rem; padding: .7rem .8rem; background: #102731; border: 1px solid #397286; border-radius: 12px; }
.guest-save-prompt h4 { color: #edfbff; font-size: 1rem; font-weight: 750; margin: 0 0 .25rem; }
.guest-save-prompt p { color: #c4dce8; font-size: .87rem; line-height: 1.45; margin: 0 0 .55rem; }
.guest-save-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.guest-save-actions button { flex: 1 1 auto; min-height: 44px; font-weight: 650; }
.account-saved-notice { color: #cdf9e8; background: #10372d; padding: .5rem .85rem; font-size: .9rem; flex-shrink: 0; }
.registration-progress { border: 1px solid #38788b; background: #102731; color: #dbf6ff; border-radius: 10px; padding: .65rem .75rem; margin-bottom: .8rem; font-size: .94rem; font-weight: 650; line-height: 1.5; }
.wake-lock-status { white-space: normal; max-width: 200px; }
/* An opaque surface covers live question changes and existing award effects.
   Keep the quiz connected and updating so closing returns to its latest state. */
#accountModal { background: #080b12; z-index: 1250; }
#accountModal .modal-dialog { max-width: 480px; }
#accountModal .form-control, #accountModal .form-select, #tokenNameCard .form-control { font-size: 16px; min-height: 44px; }
#accountModal .form-check { min-height: 36px; padding-top: .2rem; }
#accountModal .form-check-label { line-height: 1.6; }
#accountModal .modal-footer { padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom)); }
#accountModal .modal-footer button, #accountModal .nav-link, #accountModal .btn { min-height: 44px; }
#accountModal .form-label { margin-bottom: .25rem; text-transform: none !important; }
#accountModal .mb-3 { margin-bottom: .85rem !important; }
#accountModal .text-muted { color: #b6c4d7 !important; }
#accountModal .text-success { color: #9ef0c5 !important; }
#registerNameStatus { min-height: 1.5em; }
@media (max-width: 600px) {
    .achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .progression-goals { grid-template-columns: 1fr; }
    .progression-goal { padding: .9rem; }
    .progression-toolbar h1 { font-size: 1.07rem; }
    .progression-toolbar .progression-button { font-size: .87rem; padding: .55rem .65rem; }
    .progression-muted, .achievement-description { font-size: .94rem; color: #c4d2e4; }
    .achievement-card h4 { font-size: 1rem; }
    .achievement-count, .progression-button-small, .progression-live-note,
    #progressionTotalXp, #progressionVisitXp, #progressionFrame,
    #progressionDailyReset, #progressionBadgeCount, #progressionRules,
    .progression-stat span { font-size: .87rem; }
    #progressionFrame, #progressionDailyReset, #progressionBadgeCount,
    #progressionRules, .progression-stat span { color: #bfcede; }
    .progression-eyebrow, .progression-equipped small, .achievement-state { font-size: .8rem; }
    .achievement-state { color: #bfcede; }
    .progression-strip-line { font-size: .87rem; }
    #progressionNextLevel, .progression-strip-hint { font-size: .8rem; }
    .progression-track { height: 8px; }
    .achievement-track { height: 7px; }
    #chatMessagesContainer { font-size: .9rem; }
    .progression-public { font-size: .87rem; }
    .progression-public-label { font-size: .75rem; }

    /* Give names the remaining width; keep the controls in a narrow column. */
    .top-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .75rem; row-gap: .3rem; font-size: .87rem; }
    .top-bar-actions { display: contents; }
    .top-scores-preview { grid-column: 1; grid-row: 1 / span 2; min-width: 0; text-align: left; }
    .top-scores-preview .player-entry { display: grid; grid-template-columns: 1em minmax(0, 1fr) auto auto; gap: .3rem; margin-bottom: .25rem; }
    .top-scores-preview .player-entry:last-child { margin-bottom: 0; }
    .top-scores-preview .player-rank { grid-column: 1; }
    .top-scores-preview .player-name { grid-column: 2; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
    .top-scores-preview .progression-public { grid-column: 3; }
    .top-scores-preview .player-streak { grid-column: 4; }
    .top-bar .settings-dropdown { grid-column: 2; grid-row: 1; justify-self: end; }
    .top-bar .your-streak-display-text { grid-column: 2; grid-row: 2; align-self: start; white-space: nowrap; font-size: .8rem; }
}
@media (max-width: 360px) {
    .progression-strip-hint { display: none; }
    .top-bar { padding-right: .5rem; padding-left: .5rem; }
}
@media (max-width: 340px) {
    .top-scores-preview { grid-column: 1 / -1; grid-row: 2; }
    .top-bar .your-streak-display-text { grid-column: 1; grid-row: 1; align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
    .progression-track > span, .achievement-track > span { transition: none; }
    .progression-correct-pulse, .progression-confetti-dot { animation: none; }
    .progression-xp-gain.is-visible { animation: none; opacity: 1; }
}
