/* Daily: Toss-like surfaces and one reading column. */
:root {
  --surface: var(--gx-s1); --surface-2: var(--gx-s2); --surface-3: var(--gx-s3);
  --line: var(--gx-line); --line-strong: var(--gx-line-2);
  --accent-soft: var(--gx-red-s); --correct-soft: var(--gx-green-s);
  --shadow-card: none; --r-md: 14px; --r-lg: 20px;
}
main { padding-top: 12px; }
#date { font-size: 13px; color: var(--gx-t3); }
#title { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.intro { margin-bottom: 12px; }

/* Quiz */
.quiz-card { padding: 20px; border-radius: var(--gx-r-lg); }
.quiz-card::before { display: none; }
.rule-chips, .deck-note, #weekHelp, #appHelp, .received-help { display: none; }
.q-head { margin-bottom: 16px; }
.tag { height: 26px; border: 0; border-radius: 8px; background: var(--gx-s2); color: var(--gx-t2); }
.tag-first { background: var(--gx-red-s); color: var(--gx-red-t); }
.tag-archive { background: var(--gx-green-s); color: var(--gx-green); }
.sound-toggle { border: 0; border-radius: 50%; background: var(--gx-s1); }
.sound-toggle svg { transition: opacity .16s linear; }
#questionTitle { margin: 16px 0 16px; font-size: 20px; font-weight: 700; line-height: 1.45; letter-spacing: -.015em; }

.choices { gap: 8px; }
.choice {
  grid-template-columns: 28px 1fr auto; min-height: 58px; padding: 12px 16px;
  border: 0; border-radius: var(--gx-r-md);
  background: var(--gx-s2);
  box-shadow: inset 0 0 0 1.5px rgba(255,68,84,0);
  transition: background-color .2s var(--gx-ease), box-shadow .2s var(--gx-ease), opacity .2s linear, color .2s linear;
}
.choice-number {
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: var(--gx-s3); color: var(--gx-t2);
  transition: background-color .2s var(--gx-ease), color .2s var(--gx-ease);
}
.choice.is-selected, .choice.is-incorrect { border: 0; background: var(--gx-red-s); box-shadow: inset 0 0 0 1.5px rgba(255,68,84,1); }
.choice.is-selected .choice-number, .choice.is-incorrect .choice-number { border: 0; }
.choice.is-correct { border: 0; background: var(--gx-green-s); box-shadow: inset 0 0 0 1.5px rgba(90,209,154,1); }
.choice.is-correct .choice-number { border: 0; }
.choices.is-revealed .choice:not(.is-correct):not(.is-incorrect) { opacity: .5; }
@media (hover:hover) {
  .choice:not(:disabled):hover { border: 0; background: var(--gx-s3); }
  .choice.is-selected:not(:disabled):hover { background: var(--gx-red-s); }
}
.feedback { border-radius: var(--gx-r-md); box-shadow: none; background: var(--gx-green-s); }
.feedback.is-wrong { background: var(--gx-red-s); box-shadow: none; }

/* Buttons */
.button {
  min-height: 52px; border: 0; border-radius: var(--gx-r-md);
  background: var(--gx-s2); color: var(--gx-t1); font-weight: 650;
}
.button.primary { background: var(--gx-red); color: var(--gx-red-ink); font-weight: 700; }
.button:disabled { background: var(--gx-s2); color: var(--gx-t3); }
.button.primary:disabled { background: var(--gx-s2); color: var(--gx-t3); }
.button:active { background: var(--gx-s3); }
.button.primary:active { background: var(--gx-red-2); scale: 1; }
@media (hover:hover) { .button:not(:disabled):hover { background: var(--gx-s3); } .button.primary:not(:disabled):hover { background: var(--gx-red-2); } }

/* Records */
#recordsTitle, #relatedTitle, #webMoreTitle { font-size: 17px; font-weight: 700; }
.daily-layout { gap: 24px; }
.record-tile { min-height: 0; padding: 16px; border: 0; border-radius: var(--gx-r-lg); background: var(--gx-s1); }
.record-tile.is-streak { box-shadow: none; border: 0; }
.record-value strong { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.week-card { margin-top: 8px; border: 0; border-radius: var(--gx-r-lg); background: var(--gx-s1); }
.week-days a { transition: background-color .2s var(--gx-ease); }
.day-complete > a { background: var(--gx-green-s); }

/* App */
.app-banner { margin-top: 32px; padding: 20px; border: 0; border-radius: var(--gx-r-lg); background: var(--gx-s1); }
#appTitle { font-size: 18px; font-weight: 700; }
.app-benefits li { padding: 6px 0; font-size: 14px; }
.app-benefits .action-icon { color: var(--gx-t3); width: 20px; height: 20px; }
.store-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.store-links .button { padding: 0 8px; font-size: 13px; gap: 6px; width: 100%; }
.app-shot { border: 0; }

/* Friends */
.related { margin-top: 32px; }
.related-grid { display: block; padding: 4px; border: 0; border-radius: var(--gx-r-lg); background: var(--gx-s1); overflow: visible; }
.feature, .feature + .feature { border: 0; background: none; }
.feature-link { grid-template-columns: 44px minmax(0,1fr) 16px; gap: 12px; min-height: 68px; padding: 12px; border-radius: 16px; }
.feature-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--gx-s2); color: var(--gx-t2); }
.feature-icon svg { width: 22px; height: 22px; }
.feature-kicker { display: none; }
.feature-link h3 { font-size: 15px; font-weight: 650; }
.feature-link p { display: none; }
.feature-action { margin-top: 2px; font-size: 13px; font-weight: 450; color: var(--gx-t3); }
.feature-chevron { width: 16px; color: var(--gx-t3); }
.feature-link:active { background: var(--gx-s1); }

.web-more { margin-top: 32px; }
.projecta-responsive-ad { margin-top: 32px; }
.ad-preview-label { border-color: var(--gx-line-2); }

/* Footer */
.site-footer { margin-top: 40px; border-top: 1px solid var(--gx-line); }
.footer-notes { font-size: 12px; }
.fan-note { margin-top: 12px; }

@media (min-width: 1024px) {
  .related-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; }
  .feature-link { display: grid; flex-direction: initial; }
  .feature-chevron { display: block; }
  .choice { min-height: 64px; }
  .store-links { grid-template-columns: repeat(2, minmax(0,200px)); }
}
a { transition: color .1s linear; }
.feature-link { background: var(--gx-s1); transition: background-color .16s var(--gx-ease); }
.week-days a { background: var(--gx-s1); }
.day-complete > a { background: var(--gx-green-s); }
html[lang="en"] .store-links { grid-template-columns: 1fr; }

/* ---------- Second pass: states change in place, one icon set, nothing flashes ---------- */
html { scrollbar-gutter: stable; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
#quiz, #records { scroll-margin-top: 16px; }

/* First paint: no Korean flash for English readers, no reflow when the script fills the page in */
html.d-wait [data-copy] { opacity: 0; animation: d-failsafe 0s 4s forwards; }
html.d-wait-out [data-copy] { transition: opacity .2s linear; }
@keyframes d-failsafe { to { opacity: 1; } }
html.d-has-received #received[hidden] { display: block !important; min-height: 104px; }
html.d-entry-wait .feature-action { opacity: 0; animation: d-failsafe 0s 4s forwards; }
.feature-action { transition: opacity .2s linear; }
.language-control { min-width: 72px; min-height: 40px; }
.language-control:not(.gx-lang-host) > * { visibility: hidden; animation: d-entry-vis 0s 4s forwards; }
.record-note { min-height: 17px; }
.week-days { min-height: 84px; }
#weekSummary { min-height: 23px; }
.app-benefits { min-height: 102px; }
.date-row { min-height: 28px; }

/* Colour moves with its text, so a button never holds dark text on a grey fill */
.button, .text-button, .tag, .chip, .sound-toggle, .choice, .choice-number, .choice-text, .next-day .button {
  transition: background-color .2s var(--gx-ease), color .2s var(--gx-ease), box-shadow .2s var(--gx-ease), opacity .2s linear;
}
.button .action-icon { width: 18px; height: 18px; }

/* Header row */
.tag, .tag-first, .tag-practice, .tag-archive { height: 28px; padding: 0 10px; border: 0; }
.tag-practice { background: var(--gx-s2); color: var(--gx-t2); }
.q-count { font-variant-numeric: tabular-nums; }
.q-head { margin-bottom: 12px; }
.q-head[hidden] { display: none; }
.streak-chip { gap: 4px; padding: 0 10px 0 8px; border: 0; background: var(--gx-red-s); color: var(--gx-red-t); }
.streak-chip svg, .record-chips svg { width: 14px; height: 14px; flex: none; }
.streak-chip svg { color: var(--gx-red); }

/* Sound */
.sound-toggle svg path { transition: opacity .18s linear; }
.sound-mute { opacity: 0; }
.sound-toggle[aria-pressed="false"] svg { opacity: 1; }
.sound-toggle[aria-pressed="false"] .sound-wave { opacity: 0; }
.sound-toggle[aria-pressed="false"] .sound-mute { opacity: 1; }

/* Views stack while they swap */
#quizPlay, .q-stage, .q-swap { position: relative; }
.q-stage > *, .q-swap > * { position: relative; z-index: 1; }
.is-leaving { position: absolute !important; left: 0; right: 0; top: 0; z-index: 0 !important; pointer-events: none; }
.is-leaving [class] { animation: none !important; }

/* Answered cards and the one ring that walks across them */
.steps--cards { position: relative; width: max-content; }
.steps--cards b { display: grid; place-items: center; width: 100%; height: 100%; }
.steps--cards svg, .result-grid svg { width: 16px; height: 16px; }
.d-ring {
  position: absolute; left: 0; top: 0; z-index: 2; opacity: 0; pointer-events: none;
  border-radius: 7px; box-shadow: 0 0 0 1.5px var(--gx-red);
  transition: transform .32s var(--gx-ease-move), opacity .16s linear;
}
.steps--cards .is-correct[data-face="front"], .result-grid > .is-correct[data-face="front"] { background: var(--gx-green-s); color: var(--gx-green); }
.steps--cards .is-wrong[data-face="front"], .result-grid > .is-wrong[data-face="front"] { background: var(--gx-red-s); color: var(--gx-red-t); }

/* Question */
#questionTitle, #feedbackTitle, #resultTitle { outline: 0; }
.choice-state { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 650; }
.choice-state svg { width: 16px; height: 16px; flex: none; }
.choices.is-revealed .choice:not(.is-correct):not(.is-incorrect) .choice-text { color: var(--gx-t3); }
.choices.is-revealed .choice:not(.is-correct):not(.is-incorrect) { opacity: 1; }
.choices.is-revealed .choice:not(.is-correct):not(.is-incorrect) .choice-number { color: var(--gx-t3); }
.choice.is-correct .choice-number, .choice.is-selected .choice-number, .choice.is-incorrect .choice-number { transition-duration: .2s; }
#feedbackTitle { display: flex; align-items: center; gap: 6px; }
#feedbackTitle svg { width: 18px; height: 18px; flex: none; }
#feedbackExplanation { margin-top: 4px; color: var(--gx-t1); }
.feedback { margin-top: 12px; }
.q-actions { margin-top: 12px; }
.q-actions .button { transition: background-color .22s var(--gx-ease), color .22s var(--gx-ease); }
.key-hint[hidden] { display: none; }

/* Quiet text actions with an icon */
.text-button { min-height: 40px; padding: 0 12px 0 10px; gap: 6px; border-radius: 12px; background: var(--gx-s2); color: var(--gx-t2); font-size: 13px; }
.text-button:hover { text-decoration: none; }
.text-button .action-icon { width: 16px; height: 16px; }
#backToFirst { margin: 0 0 12px; }
.result-replay { display: inline-flex; min-width: 0; margin: 12px auto 0; }
.result-replay.is-waiting { color: var(--gx-t3); }

/* Result */
.result-view { position: relative; }
#resultTitle { font-size: 15px; font-weight: 600; color: var(--gx-t2); }
.record-chips { gap: 8px; }
.record-chips .chip { height: 32px; min-height: 32px; gap: 4px; padding: 0 12px 0 10px; border: 0; background: var(--gx-s2); font-size: 13px; font-weight: 600; }
.record-chips svg { color: var(--gx-t3); }
.actions { margin-top: 20px; }
.share-fallback { margin-top: 0; }
.share-fallback:not(:empty) { padding-top: 12px; }
.share-fallback label { min-height: 0; margin-bottom: 8px; color: var(--gx-t2); }
.share-fallback input { border: 0; border-radius: var(--gx-r-sm); background: var(--gx-s2); color: var(--gx-t1); font-family: inherit; }

/* Per-question review */
.review { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gx-line); }
#reviewTitle { margin-bottom: 4px; font-size: 16px; }
.review-item { grid-template-columns: 28px 1fr; padding: 12px 0 4px; border-top: 0; }
.review-mark { width: 28px; height: 28px; background: var(--gx-red-s); color: var(--gx-red-t); }
.review-item[data-correct="true"] .review-mark { background: var(--gx-green-s); color: var(--gx-green); }
.review-mark svg { width: 16px; height: 16px; }
.review-q { font-size: 15px; }
.review-a { margin-top: 2px; }
.review-a.correct-answer { color: var(--gx-green); }
.review-explain { position: relative; }
.review-explain summary { color: var(--gx-t2); border-radius: 10px; }
.review-explain summary::after { transition: transform .26s var(--gx-ease-move); transform: rotate(45deg); margin-right: 4px; }
.review-explain[open] summary::after { transform: rotate(-135deg); }
.review-explain.gx-closing summary::after { transform: rotate(45deg); }
.review-explain p { padding-bottom: 8px; color: var(--gx-t1); }

/* Countdown */
.next-day { margin-top: 16px; padding: 16px; background: var(--gx-s2); }
.next-row { font-size: 14px; }
.next-caption { display: inline-flex; align-items: center; gap: 8px; color: var(--gx-t2); }
.next-caption svg { width: 18px; height: 18px; color: var(--gx-t3); }
#nextCountdown { font-size: 20px; font-weight: 700; }
.next-day .button { background: var(--gx-s3); }
.next-day .button.primary { background: var(--gx-red); }

/* Records */
.record-tile { position: relative; }
.record-icon { position: absolute; right: 12px; top: 12px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--gx-s2); color: var(--gx-t3); }
.record-tile.is-streak .record-icon { background: var(--gx-red-s); color: var(--gx-red); }
.record-icon svg { width: 18px; height: 18px; }
.record-value { margin-top: 6px; }
.week-card { position: relative; }
.week-card .d-ring { border-radius: 10px; }
.day-complete > a, .week-days a { transition: background-color .24s var(--gx-ease); }
.day-today .day-number, .day-today .day-name { color: var(--gx-red-t); }
.day-dot { border: 0; background: var(--gx-s2); color: var(--gx-green-s); transition: background-color .24s var(--gx-ease), color .24s var(--gx-ease); }
.day-dot svg { width: 12px; height: 12px; opacity: 0; transition: opacity .2s linear; }
.day-complete .day-dot { background: var(--gx-green); border: 0; color: var(--gx-green-s); }
.day-complete .day-dot svg { opacity: 1; }
.day-future { opacity: 1; }
.day-future .day-name, .day-future .day-number { color: var(--gx-line-2); }
.day-future .day-dot { background: var(--gx-s1); box-shadow: inset 0 0 0 1px var(--gx-line); }

/* Notices */
#received { border: 0; background: var(--gx-red-s); border-radius: var(--gx-r-lg); padding: 16px; }
#notice { border-radius: var(--gx-r-md); box-shadow: none; background: var(--gx-s2); }
#notice[data-tone="error"] { box-shadow: none; background: var(--gx-red-s); }

/* Toast */
.d-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 9200; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); min-height: 48px; padding: 0 16px 0 12px;
  border-radius: 16px; background: var(--gx-s3); color: var(--gx-t1); font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(4,10,16,.42);
}
.d-toast svg { width: 20px; height: 20px; color: var(--gx-green); flex: none; }

/* Sheet handles press like every other control */
.gx-sheet-grab, .entry-grab { position: relative; }
.gx-sheet-grab::after, .entry-grab::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: var(--gx-s3); opacity: 0; transform: scale(.7); z-index: -1;
  transition: opacity .2s var(--gx-ease), transform .2s var(--gx-ease);
}
.gx-sheet-grab:active::after, .entry-grab.is-held::after { opacity: 1; transform: scale(1); }
.gx-sheet-grab::before { position: relative; }
.gx-sheet, .entry-dialog { isolation: isolate; }

/* App dialog: a sheet on phones, a card on larger screens */
.entry-dialog[open] { animation: none; }
.entry-dialog { padding: 0 20px calc(20px + env(safe-area-inset-bottom)); border: 0; border-radius: 24px 24px 0 0; background: var(--gx-s1); box-shadow: 0 -12px 40px rgba(4,10,16,.5); }
.entry-dialog::before { display: none; }
.entry-dialog::backdrop { background: rgba(4,10,16,.64); }
.entry-grab { display: grid; place-items: center; height: 24px; margin: 0 -20px 4px; touch-action: none; cursor: grab; }
.entry-grab::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--gx-line-2); }
.entry-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: var(--gx-s2); color: var(--gx-t2); }
.entry-close svg { width: 20px; height: 20px; }
.entry-feature-mark { width: 44px; height: 44px; border-radius: 14px; background: var(--gx-s2); color: var(--gx-t2); }
.entry-feature-mark svg { width: 22px; height: 22px; }
#entryDialogTitle { margin-top: 12px; padding-right: 40px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.entry-dialog > a.primary, .entry-page > a.primary { margin-top: 16px; }
.entry-help { margin-top: 16px; padding-top: 0; border-top: 0; }
.entry-help h3 { font-size: 14px; font-weight: 650; }
.entry-help p { margin-top: 2px; font-size: 13px; line-height: 1.55; color: var(--gx-t3); }
.entry-native { min-height: 52px !important; }
.entry-transfer { margin-top: 16px; padding: 4px 16px; border-radius: var(--gx-r-md); background: var(--gx-s2); }
.entry-transfer summary { justify-content: flex-start; gap: 8px; min-height: 48px; font-size: 15px; font-weight: 650; }
.entry-transfer summary > svg { width: 20px; height: 20px; color: var(--gx-t3); flex: none; }
.entry-transfer summary::after { margin-left: auto; margin-right: 4px; transform: rotate(45deg); transition: transform .26s var(--gx-ease-move); }
.entry-transfer[open] summary::after { transform: rotate(-135deg); }
.entry-transfer.gx-closing summary::after { transform: rotate(45deg); }
.entry-qr { width: 176px; height: 176px; margin: 4px auto 0; }
.entry-transfer p.entry-qr-note { margin: 8px 0 12px; text-align: center; font-size: 13px; color: var(--gx-t3); }
.entry-transfer label { min-height: 0; margin: 0 0 6px; color: var(--gx-t2); }
.entry-transfer input { border: 0; background: var(--gx-s1); color: var(--gx-t1); font-family: inherit; font-size: 16px; }
.entry-transfer button { gap: 8px; margin: 8px 0 12px; min-height: 48px; border: 0; background: var(--gx-s3); }
.entry-transfer button svg { width: 18px; height: 18px; }
.entry-transfer p[role="status"]:not(.ys-sr-only) { margin: -4px 0 12px; }
.entry-help .store-links .button, .entry-page .button { background: var(--gx-s2); }
.entry-page > a.button.primary { background: var(--gx-red); }

/* Open page */
.entry-page { padding: 20px; border: 0; border-radius: var(--gx-r-lg); background: var(--gx-s1); }
.entry-page::before { display: none; }
.entry-page > h1 { font-size: 20px; font-weight: 700; }
html.d-entry-js:not(.d-entry-ready) #entryPageContent > * { visibility: hidden; }
html.d-entry-js:not(.d-entry-ready) #entryPageContent { min-height: 420px; animation: d-entry-show 0s 4s forwards; }
html.d-entry-js:not(.d-entry-ready) #entryPageContent > * { animation: d-entry-vis 0s 4s forwards; }
@keyframes d-entry-vis { to { visibility: visible; } }
@keyframes d-entry-show { to { min-height: 0; } }
.entry-back { width: 100%; margin-top: 12px; }
.entry-page .store-links { margin-top: 12px; }

/* Footer: name, links, then copyright, each on its own line */
@media (max-width: 600px) {
  .ys-studio__mark { width: 100%; margin-right: 0; }
}

/* Language swaps fade the whole page once */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }

@media (min-width: 768px) {
  .entry-dialog { padding: 20px 28px 28px; border-radius: var(--gx-r-lg); box-shadow: 0 16px 48px rgba(4,10,16,.5); }
  .entry-grab { display: none; }
  .entry-page { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .d-ring, .day-dot, .choice, .button, .text-button { transition: none; }
}
.day-today > a, .day-viewed > a, .day-viewed.day-today > a { box-shadow: none; }
.entry-help .store-links { grid-template-columns: 1fr 1fr; }
html[lang="en"] #title { min-height: 0; }
