:root {
  color-scheme: light;
  --paper: #fcf8ef;
  --ink: #171e27;
  --accent: #df350e;
  --muted: #62656a;
  --line: #d8d3c9;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 280px; }
body { margin: 0; min-height: 100svh; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, a, summary, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-underline-offset: 5px; }
button, summary { min-height: 44px; }
button { border: 1px solid var(--line); border-radius: 8px; padding: 12px 20px; color: var(--ink); background: transparent; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.game-shell { width: min(100%, 560px); min-height: 100svh; margin: 0 auto; padding: 44px 35px 35px; display: flex; flex-direction: column; }
.masthead { width: 100%; text-align: center; }
.brand { display: block; margin: 0 8px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); font: bold 64px/1.05 Georgia, 'Times New Roman', serif; letter-spacing: -5px; }
.challenge-date { margin: 12px 0 0; font-size: 14px; font-weight: 700; line-height: 18px; letter-spacing: 4px; }
.landing { text-align: center; padding-top: 69px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 700; line-height: 18px; letter-spacing: 2.4px; }
h1 { margin: 24px -10px 0; font: bold 70px/.92 Georgia, 'Times New Roman', serif; letter-spacing: -3.8px; }
.intro-copy { margin: 31px -12px 0; font-size: 22px; line-height: 28px; letter-spacing: -.25px; }
.primary { border: 1px solid var(--accent); background: var(--accent); color: var(--paper); font-weight: 700; }
.primary:hover:not(:disabled) { background: #c52e0b; border-color: #c52e0b; }
#start { display: block; width: 100%; min-height: 73px; margin-top: 53px; border-radius: 12px; font: bold 37px/1.1 Georgia, 'Times New Roman', serif; letter-spacing: -.6px; }
.entry-note { margin: 15px -14px 0; font-size: 15px; line-height: 22px; letter-spacing: -.1px; }
.status { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.status:empty { display: none; }
footer { text-align: center; margin-top: auto; padding-top: 48px; }
#today-link { display: block; padding: 12px 0; font-size: 15px; }
.text-button { border: 0; border-radius: 0; padding: 8px 3px; font-size: 18px; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
body:not([data-view="landing"]) .game-shell { padding-top: 24px; }
body:not([data-view="landing"]) .brand { font-size: 46px; letter-spacing: -3px; padding-bottom: 12px; }
body:not([data-view="landing"]) .challenge-date { font-size: 11px; letter-spacing: 3px; margin-top: 10px; }
body:not([data-view="landing"]) footer { padding-top: 30px; }
.reader { margin-top: 38px; min-width: 0; }
.reading-meta { margin: 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 20px; letter-spacing: 1.5px; text-transform: uppercase; }
.reading-window { height: clamp(300px, 49svh, 460px); position: relative; overflow: hidden; margin-top: 25px; }
.story-track { position: absolute; top: 50%; left: 0; right: 0; font-family: Georgia, 'Times New Roman', serif; font-size: 24px; line-height: 44px; letter-spacing: 0; will-change: transform; }
.story-line { height: 44px; line-height: 44px; white-space: pre; text-align: center; }
.countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--paper); font: bold 100px/1 Georgia, 'Times New Roman', serif; }
.progress-track { height: 2px; background: var(--line); margin-top: 16px; overflow: hidden; }
#progress-fill { height: 100%; width: 0; background: var(--accent); }
.quiz { padding-top: 56px; }
.quiz .eyebrow { color: var(--muted); font-size: 11px; letter-spacing: 1.7px; }
h2 { margin: 16px 0 25px; font: bold 33px/1.15 Georgia, 'Times New Roman', serif; letter-spacing: -1px; overflow-wrap: break-word; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.answers { display: grid; gap: 12px; }
.answers label { display: flex; align-items: center; gap: 12px; min-height: 62px; border: 1px solid var(--line); border-radius: 8px; padding: 15px; font-size: 16px; line-height: 1.45; cursor: pointer; overflow-wrap: anywhere; }
.answers label:has(input:checked) { border-color: var(--accent); background: #df350e08; }
.answers label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
input[type="radio"] { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
#answer-next { width: 100%; min-height: 54px; margin-top: 28px; font-size: 17px; }
.results { padding-top: 42px; text-align: center; }
.results h2 { font-size: 39px; margin: 14px 0 22px; }
.results p { margin: 15px 0; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.results .eyebrow { font-size: 11px; line-height: 18px; }
.results button { display: block; width: 100%; min-height: 52px; margin-top: 14px; font-size: 16px; }
.results .primary { font-family: Georgia, 'Times New Roman', serif; font-size: 24px; }
.result-score, .score { font: bold 62px/1.05 Georgia, 'Times New Roman', serif; letter-spacing: -2px; }
.results textarea { display: block; width: 100%; min-height: 120px; margin-top: 14px; padding: 12px; background: transparent; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font-size: 15px; line-height: 1.5; resize: vertical; }
.account-area { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; padding: 12px 0; font-size: 15px; font-weight: 600; }
.account-area .results, #account-panel { padding-top: 8px; text-align: left; }
#account-panel h2 { font-size: 25px; margin-top: 12px; }
#account-panel p { font-size: 14px; line-height: 1.6; }
#account-panel button { min-height: 48px; font-size: 13px; letter-spacing: .2px; }
#account-history { margin-top: 20px; border-top: 1px solid var(--line); }
#account-history:empty { display: none; }
dialog { width: min(490px, calc(100% - 36px)); max-height: calc(100svh - 48px); overflow-y: auto; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #171e2766; }
dialog h2 { margin-top: 0; }
dialog p { font-size: 16px; line-height: 1.6; }
dialog .primary { width: 100%; min-height: 50px; margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 600px) {
  .game-shell { width: min(100%, 560px); min-height: min(100svh, 960px); padding-top: 44px; padding-left: 42px; padding-right: 42px; }
  .brand { font-size: 90px; }
  .landing { padding-top: 65px; }
  h1 { font-size: 92px; }
  .eyebrow { font-size: 14px; letter-spacing: 2.7px; }
  .intro-copy { font-size: 23px; line-height: 32px; }
  #start { font-size: 40px; margin-top: 40px; }
  .entry-note { font-size: 16px; }
  body:not([data-view="landing"]) .game-shell { min-height: 100svh; }
  .story-track { font-size: 27px; }
}
@media (max-width: 359px) {
  .game-shell { padding-left: 25px; padding-right: 25px; }
  .brand { font-size: 65px; }
  .eyebrow { font-size: 11px; letter-spacing: 1.8px; }
  h1 { font-size: clamp(49px, 17.5vw, 63px); }
  .intro-copy { font-size: 18px; line-height: 26px; }
  #start { font-size: 33px; }
  .entry-note { font-size: 13px; }
  .story-track { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* The result's exported card is the same image the player can save. */
.share-card { display: block; width: 100%; height: auto; }
body.has-share-image .masthead { display: none; }
body.has-share-image .results { padding-top: 0; }
.results .share-tools { display: flex; justify-content: center; align-items: center; gap: 28px; margin-top: 8px; }
.results .share-tools button, .results .share-tools a { display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 44px; margin: 0; padding: 8px 0; border: 0; border-radius: 0; font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* Programmatic result focus announces completion without framing the whole page. */
#results:focus { outline: none; }

/* Direct social choices; brand SVGs are unchanged Font Awesome assets. */
.results .share-via { margin: 18px 0 12px; font: bold 22px/1.2 Georgia, 'Times New Roman', serif; letter-spacing: -.4px; }
.social-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.social-choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 64px; padding: 0; color: var(--ink); font: 600 11px/1.3 Arial, Helvetica, sans-serif; text-decoration: none; }
.social-badge { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: #090909; }
.social-badge img { width: 22px; height: 22px; filter: invert(1); }
.facebook-f .social-badge { background: #1877f2; }
.linkedin-in .social-badge { background: #0a66c2; }
.results .share-tools { gap: 12px; margin-top: 16px; }
.results .share-tools .result-utility { display: flex; flex: 1; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font: 600 14px/1.3 Arial, Helvetica, sans-serif; text-decoration: none; }
.result-utility img { width: 17px; height: 17px; }

/* Keep the on-page result focused; the downloaded PNG retains its footer. */
.score-preview { aspect-ratio: 1080 / 955; overflow: hidden; }

.result-heading { font-size: 24px; margin: 20px 0; }
.tier-table { margin: auto; font-size: 23px; border-spacing: 16px 12px; }
.tier-table th { text-align: right; font-size: 19px; }
.tier-table td { color: var(--accent, #df350e); letter-spacing: 8px; }
.result-recall { font-size: 18px; margin: 24px 0 12px; }
.results .score-badge { display: inline-block; background: var(--accent); color: var(--paper); padding: 12px 28px; font: bold 14px/1.3 Arial, Helvetica, sans-serif; letter-spacing: 1px; text-transform: uppercase; clip-path: polygon(0 0,100% 0,95% 50%,100% 100%,0 100%,5% 50%); }
body[data-view="result"] footer { margin-top: 12px; padding-top: 8px; }
body[data-view="result"] #help-toggle { font-size: 14px; color: var(--muted); }

.perfect-result .score-badge { background: var(--ink); border-bottom: 3px solid var(--accent); }
.result-app-icon { display: block; width: 36px; height: 36px; border-radius: 8px; margin: 0 auto 8px; }
#local-reset { display: block; margin: 0 auto 6px; color: var(--muted); font-size: 13px; }

.brand-logo { display: block; width: min(100%, 360px); height: auto; margin: 0 auto; }
body:not([data-view="landing"]) .brand-logo { width: min(100%, 280px); }

.results .share-tools { flex-wrap: wrap; }
.results .share-tools .native-image-share { flex: 0 0 100%; background: var(--ink); color: var(--paper); }

.email-preferences { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.email-preferences label { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.email-preferences input[type="checkbox"] { margin-top: 4px; flex: 0 0 auto; }
.email-preferences input[type="email"] { width: 100%; margin: 12px 0; padding: 10px; }

#account-panel .account-status:not(:empty) { margin: 12px 0; padding: 12px; border-left: 3px solid var(--accent); background: var(--paper); font-weight: 600; }

/* Account lives above the game; each task opens in a focused modal view. */
.account-toolbar { display: flex; justify-content: flex-end; margin: -16px 0 12px; }
.account-toolbar:has(> #account-toggle[hidden]):has(> #leaderboard-toggle[hidden]):has(> #streak-summary[hidden]) { display: none; }
.account-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 0; border-radius: 24px; font-size: 12px; min-height: 44px; }
.account-toggle[data-signed-in="true"] { background: #171e2708; }
.account-toggle img { width: 22px; height: 22px; }
.account-dialog { width: min(440px, calc(100% - 32px)); padding: 22px; }
.account-dialog-header { display: flex; align-items: center; justify-content: space-between; }
#account-close { margin-left: auto; }
.account-dialog-header .text-button { font-size: 13px; }
#account-panel { text-align: left; padding-top: 6px; }
#account-panel h2 { font-size: 32px; margin: 8px 0 14px; }
#account-panel button { display: block; width: 100%; margin: 10px 0; text-align: left; text-transform: none; }
#account-panel > .secondary { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 0; font-size: 15px; }
#account-panel > .account-subtle { border: 0; padding: 8px 0; margin: 0; color: var(--muted); }
#account-panel > a { display: inline-block; font-size: 13px; margin-top: 16px; }
#account-panel .account-delete { margin-top: 26px; border: 0; padding: 8px 0; color: var(--muted); text-decoration: underline; }
#account-history { margin: 8px 0 0; border: 0; }
.history-result { padding: 18px 0; border-bottom: 1px solid var(--line); }
.history-result h3 { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
#account-panel .history-result p { margin: 4px 0; }
#account-panel .history-result p:first-of-type { font: bold 32px/1.2 Georgia, serif; }
.account-dialog .email-preferences { margin: 0; padding: 0; border: 0; }
.account-dialog .email-preferences h3 { display: none; }

.account-toggle[data-signed-in="true"] { min-height: 44px; padding: 8px 0 8px 10px; gap: 7px; border-radius: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; max-width: 100%; }
#account-state { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-chevron { flex: 0 0 auto; font-size: 13px; }
.account-toggle[data-signed-in="true"] img { filter: invert(1); }
.account-dialog { height: min(580px, calc(100svh - 48px)); overflow: hidden; }
.account-dialog[open] { display: flex; flex-direction: column; }
.account-dialog-header { flex: 0 0 auto; }
.account-dialog #account-panel { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding: 6px 2px; }

.account-tabs { display: grid; grid-template-columns: 1fr 1fr 1.25fr; flex: 0 0 auto; gap: 4px; margin: 8px 0 20px; border-bottom: 1px solid var(--line); }
.account-tabs button { border: 0; border-radius: 0; padding: 12px 2px; font-size: 12px; line-height: 1.3; color: var(--muted); border-bottom: 2px solid transparent; }
.account-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 700; }
.account-footer { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 16px; }
.account-footer button { border: 0; padding: 8px 0; font-size: 13px; }
.account-footer a { font-size: 13px; }

#account-panel .account-status:empty { display: none; }
.account-profile label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.account-profile input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }
.account-profile p:empty { display: none; }
.account-profile + p strong, .account-profile + p span { display: block; overflow-wrap: anywhere; }
#account-panel .profile-help { color: var(--muted); font-size: 12px; }
.history-result { padding: 12px 0; }

.account-toolbar { align-items: center; gap: 8px; }
.streak-summary { margin: 0 auto 0 0; font-size: 13px; font-weight: 700; color: var(--accent); }
.leaderboard-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 50%; }
.leaderboard-dialog { width: min(490px, calc(100% - 32px)); height: min(580px, calc(100svh - 48px)); padding: 22px; overflow: hidden; }
.leaderboard-dialog[open] { display: flex; flex-direction: column; }
.leaderboard-dialog .account-dialog-header { justify-content: space-between; gap: 16px; }
.leaderboard-dialog h2 { font-size: 30px; margin: 0; }
.leaderboard-dialog .account-tabs { grid-template-columns: 1fr 1fr; }
.leaderboard-dialog .text-button { font-size: 13px; }
.leaderboard-content { flex: 1; min-height: 0; overflow-y: auto; }
.leaderboard-content > p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.leaderboard-table th { font-size: 11px; color: var(--muted); text-align: left; padding: 10px 4px; }
.leaderboard-table td { border-top: 1px solid var(--line); padding: 14px 4px; overflow-wrap: anywhere; }
.leaderboard-you { background: #df350e09; font-weight: 700; }
.leaderboard-note { flex: 0 0 auto; border-top: 1px solid var(--line); padding-top: 16px; margin-bottom: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

.leaderboard-personal { margin: 12px 0 4px; font-size: 13px; color: var(--accent); }

.score-category { padding: 11px 10px; border-bottom: 1px solid var(--line); }
.score-category-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.score-category h3 { margin: 0; font-size: 13px; line-height: 1.4; }
.score-category strong { font: bold 24px/1 Georgia, serif; }
.score-category-detail { display: flex; align-items: center; gap: 12px; margin-top: 7px; }
.score-category-detail > span { flex: 0 0 36px; font-size: 11px; color: var(--muted); }
.score-category progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 0; background: #e9e4da; accent-color: var(--muted); }
.score-category progress::-webkit-progress-bar { background: #e9e4da; }
.score-category progress::-webkit-progress-value { background: #9c9b96; }
.score-category progress::-moz-progress-bar { background: #9c9b96; }
.score-category-you { position: relative; color: var(--accent); }
/* Overlay the outline so highlighting never shifts the category text. */
.score-category-you::before { content: ""; position: absolute; inset: -1px 0; border: 1px solid var(--accent); pointer-events: none; }
.score-category-you progress { accent-color: var(--accent); }
.score-category-you progress::-webkit-progress-value { background: var(--accent); }
.score-category-you progress::-moz-progress-bar { background: var(--accent); }
.category-you { display: inline-block; margin-left: 7px; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; }

.cup-actions { display: grid; gap: 4px; width: 100%; margin: 12px 0 18px; text-align: center; }
.cup-challenge { display: flex; min-height: 48px; justify-content: center; align-items: center; background: var(--accent); color: var(--paper); border-radius: 8px; padding: 12px; font-weight: 700; text-decoration: none; }
.cup-link { display: inline-flex; min-height: 44px; justify-content: center; align-items: center; font-size: 14px; }
.results .share-tools .native-image-share { flex: 1; background: transparent; color: var(--ink); }
#cups-link { display:inline-flex; align-items:center; min-height:44px; padding:8px 12px; font-size:14px; }

/* Match the Cups desktop frame without changing the reader's content width. */
@media(min-width:700px){
  body[data-view]{background:#efebe2;display:flow-root}
  body[data-view] .game-shell{width:min(calc(100% - 64px),562px);min-height:calc(100svh - 64px);margin:32px auto;border:1px solid #ccc6bb;border-radius:12px;background:var(--paper)}
}
