/* Sixth web Daily, /daily/ only. Uses the tokens in site.css.
   The stage borrows the app's Ocean palette in light and its Dark palette in
   dark (src/theme/palette.ts). Served from /assets/ (immutable): a change
   ships as daily-v2.css. */

.daily-head { padding: var(--s1) 0 var(--s3); text-align: center; }
.daily-head h1 { font-size: clamp(28px, 6vw, 40px); margin: 0 0 var(--s1); }
.daily-head .lede { color: var(--ink-soft); font-size: 17px; line-height: 1.45; max-width: 40ch; margin: 0 auto; text-wrap: pretty; }
.daily-wrap { padding-top: var(--s2); padding-bottom: var(--s5); }

.dg, .dg-fallback {
  --dg-bg: linear-gradient(135deg, #a8c5e8, #88b0d8 25%, #b0c8e5 50%, #7ba0c8 75%, #9cbde0);
  --dg-text1: #0a2540; --dg-text2: #1e3a5f; --dg-text3: #2a4a6a;
  --dg-glass: rgba(255, 255, 255, .35); --dg-glass-strong: rgba(255, 255, 255, .5);
  --dg-border: rgba(255, 255, 255, .5);
  --dg-hidden: rgba(170, 205, 242, .55); --dg-hidden-mark: #36567a;
  --dg-face: rgba(255, 255, 255, .62);
  --dg-tile: rgba(255, 255, 255, .3);
  --dg-hit-fill: rgba(122, 212, 184, .45); --dg-miss-fill: rgba(225, 140, 155, .35);
  --dg-correct: #4a9a8a; --dg-wrong: #c87080;
  --dg-hit-text: #0f3d35; --dg-miss-text: #5a2230;
  --dg-grid-hit: #2f7d6d; --dg-grid-miss: rgba(255, 255, 255, .6);
  --dg-primary: linear-gradient(180deg, #8ec4ee, #6ea8dc); --dg-primary-text: #0a2540;
  --dg-shadow: 0 18px 40px rgba(40, 80, 140, .28);
  --dg-daily-dot: #f0a93b;
  max-width: 480px; margin: 0 auto; padding: var(--s2);
  background: var(--dg-bg); color: var(--dg-text2);
  border: 1px solid var(--dg-border); border-radius: 28px;
  box-shadow: var(--shadow-lift);
}
@media (prefers-color-scheme: dark) {
  .dg, .dg-fallback {
    --dg-bg: linear-gradient(135deg, #1a2540, #0f1a35 25%, #25304a 50%, #0a1530 75%, #1f2a45);
    --dg-text1: #f0f6ff; --dg-text2: #dde8f8; --dg-text3: #c4d4e8;
    --dg-glass: rgba(255, 255, 255, .12); --dg-glass-strong: rgba(255, 255, 255, .16);
    --dg-border: rgba(255, 255, 255, .25);
    --dg-hidden: rgba(120, 160, 220, .3); --dg-hidden-mark: #e0eeff;
    --dg-face: rgba(255, 255, 255, .12);
    --dg-tile: rgba(255, 255, 255, .08);
    --dg-hit-fill: rgba(42, 124, 98, .55); --dg-miss-fill: rgba(225, 140, 155, .28);
    --dg-correct: #80d4bc; --dg-wrong: #f0a0b0;
    --dg-hit-text: #daf4ec; --dg-miss-text: #fae2e8;
    --dg-grid-hit: #80d4bc; --dg-grid-miss: rgba(255, 255, 255, .16);
    --dg-primary: linear-gradient(180deg, #3668ac, #285592); --dg-primary-text: #f0f6ff;
    --dg-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  }
}
.dg[hidden], .dg [hidden] { display: none; }
.dg p { margin: 0; }
.dg b { font-weight: 600; color: inherit; }
.dg :focus-visible { outline: 3px solid var(--dg-text1); outline-offset: 3px; border-radius: 12px; }
:where(.dg) button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* top bar */
.dg-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); margin-bottom: var(--s2); }
.dg-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px;
  background: var(--dg-glass); border: 1px solid var(--dg-border); border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--dg-text2); line-height: 1.2;
}
.dg-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--dg-daily-dot); }

/* the play area: card, one slot of text, the choices. Nothing in it changes
   size between a guess and its reveal. */
.dg-play { display: flex; flex-direction: column; align-items: center; }
.dg-card { height: clamp(196px, 31vh, 320px); aspect-ratio: 5 / 7; perspective: 900px; }
@supports (height: 1svh) { .dg-card { height: clamp(196px, 31svh, 320px); } }
.dg-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.dg-card.is-revealed .dg-card-inner { transform: rotateY(180deg); }
.dg-side {
  position: absolute; inset: 0; display: grid; place-items: center;
  border-radius: 24px; border: 1px solid var(--dg-border);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: var(--dg-shadow);
}
.dg-back { background: var(--dg-hidden); color: var(--dg-hidden-mark); font-size: 64px; font-weight: 700; line-height: 1; }
.dg-front { background: var(--dg-face); color: var(--dg-text2); transform: rotateY(180deg); }
.dg-card.is-hit .dg-front { box-shadow: inset 0 0 0 3px var(--dg-correct), var(--dg-shadow); }
.dg-card.is-miss .dg-front { box-shadow: inset 0 0 0 3px var(--dg-wrong), var(--dg-shadow); }
.dg-front > svg { width: 46%; height: auto; }
.dg-front .dg-colour { width: 48%; height: auto; aspect-ratio: 1; }
.dg-front .dg-pair { width: 70%; }
.dg-front > .dg-pc { width: 56%; }

.dg-slot { position: relative; width: 100%; height: 106px; }
.dg-context, .dg-reveal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.dg-context { font-size: 15px; color: var(--dg-text1); }
.dg-context.is-off, .dg-reveal.is-off { visibility: hidden; }
.dg-verdict { font-size: 20px; font-weight: 700; line-height: 1.2; }
.dg-verdict.is-hit { color: var(--dg-hit-text); }
.dg-verdict.is-miss { color: var(--dg-miss-text); }
.dg-tally { font-size: 15px; color: var(--dg-text1); line-height: 1.3; }
.dg-next {
  position: relative; overflow: hidden; min-height: 44px; min-width: 132px; margin-top: 4px; padding: 0 22px;
  background: var(--dg-glass); border: 1px solid var(--dg-border); border-radius: 999px;
  font-size: 14px; font-weight: 600;
}
.dg .dg-next { color: var(--dg-text1); }
.dg-next:hover { background: var(--dg-glass-strong); }
.dg-next-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--dg-text1); opacity: .7; }
.dg-reveal:not(.is-off) .dg-next.is-timed .dg-next-bar { width: 100%; animation: dg-fill 1.7s linear; }
@keyframes dg-fill { from { width: 0; } to { width: 100%; } }

/* choices */
.dg-choices { display: grid; gap: 8px; width: 100%; grid-template-columns: repeat(var(--dg-cols, 5), minmax(0, 1fr)); }
.dg-n2 { --dg-cols: 2; }
.dg-n4 { --dg-cols: 4; }
.dg-n5 { --dg-cols: 5; }
.dg-n6 { --dg-cols: 6; }
.dg-n7 { --dg-cols: 8; }
.dg-n7 .dg-tile { grid-column: span 2; }
.dg-n7 .dg-tile:nth-child(5) { grid-column: 2 / span 2; }
.dg-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-width: 0; min-height: 84px; padding: 8px 2px;
  background: var(--dg-tile); border: 1px solid var(--dg-border); border-radius: 18px;
  transition: transform .12s ease, background-color .15s ease, opacity .15s ease;
}
.dg .dg-tile { color: var(--dg-text2); }
.dg-n7 .dg-tile { min-height: 64px; }
.dg-tile:not([aria-disabled]):hover { background: var(--dg-glass-strong); }
.dg-tile:not([aria-disabled]):active { transform: scale(.94); }
.dg-tile[aria-disabled] { cursor: default; }
.dg-tile.is-answer { background: var(--dg-hit-fill); box-shadow: inset 0 0 0 2px var(--dg-correct); border-color: transparent; }
.dg-tile.is-wrong { background: var(--dg-miss-fill); box-shadow: inset 0 0 0 2px var(--dg-wrong); border-color: transparent; }
.dg .dg-tile.is-answer, .dg .dg-tile.is-wrong { color: var(--dg-text1); }
.dg-tile.is-dim { opacity: .38; }
.dg-glyph { display: grid; place-items: center; height: 32px; }
.dg-glyph > svg { width: 30px; height: 30px; }
.dg-n7 .dg-glyph { height: 26px; }
.dg-tile-label { font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.dg-letter { font-size: 26px; font-weight: 700; line-height: 1; color: var(--dg-text1); }
.dg-colour { display: block; width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 2px 4px rgba(10, 37, 64, .25); }
.dg-coin { filter: drop-shadow(0 2px 3px rgba(10, 37, 64, .25)); }
@media (max-width: 359px) {
  .dg { padding: 12px; }
  .dg-choices { gap: 6px; }
  .dg-tile-label { font-size: 10px; letter-spacing: 0; }
}

/* playing cards (Cards and Face Cards) */
.dg-pc {
  position: relative; display: grid; place-items: center; aspect-ratio: 5 / 7;
  background: linear-gradient(180deg, #fff, #f6f8fc); color: #1a1a1a;
  border: 1px solid #d8dee8; border-radius: 12%/9%; box-shadow: 0 2px 6px rgba(40, 80, 140, .15);
  container-type: inline-size;
}
.dg-pc.is-red { color: #c91212; }
.dg-pc-index { position: absolute; top: 5%; left: 9%; font-weight: 700; font-size: 22cqw; line-height: 1; }
.dg-pc .dg-suit { width: 42%; height: auto; }
.dg-pair { display: grid; grid-template-columns: repeat(10, 1fr); width: 44px; }
.dg-pair .dg-pc { grid-row: 1; grid-column: 1 / span 6; transform: rotate(-9deg); }
.dg-pair .dg-pc + .dg-pc { grid-column: 5 / span 6; transform: rotate(9deg); }
.dg-glyph .dg-pair { width: 40px; }

/* result card */
.dg-result { display: flex; flex-direction: column; gap: 12px; }
.dg-summary {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 22px 16px; background: var(--dg-glass); border: 1px solid var(--dg-border); border-radius: 26px;
}
.dg-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dg-text3); }
.dg .dg-score { font-size: 60px; line-height: 64px; letter-spacing: -1.5px; margin: 0; color: var(--dg-text1); outline-offset: 6px; }
.dg-line { font-size: 15px; line-height: 21px; color: var(--dg-text2); text-wrap: balance; }
.dg-line.is-bold { font-weight: 700; }
.dg-grid { display: flex; gap: 5px; margin: 12px 0 8px; }
.dg-grid span { width: 20px; height: 20px; border-radius: 5px; background: var(--dg-grid-miss); }
.dg-grid span.is-hit { background: var(--dg-grid-hit); }
.dg-quiet { text-wrap: balance; font-size: 13px; line-height: 18px; color: var(--dg-text3); }
.dg-share, .dg-new {
  min-height: 52px; width: 100%; border: 0; border-radius: 18px;
  background: var(--dg-primary); font-size: 17px; font-weight: 700;
}
.dg .dg-share, .dg .dg-new { color: var(--dg-primary-text); }
.dg-share:hover, .dg-new:hover { filter: brightness(1.05); }
.dg-share:active, .dg-new:active { transform: scale(.98); }
.dg-share-note { min-height: 18px; text-align: center; }
.dg-app { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0 8px; text-align: center; }
.dg-app-line { font-size: 15px; font-weight: 600; color: var(--dg-text1); }
.dg-app .store-buttons { margin: 0; gap: 12px; }
@media (max-width: 359px) { .dg-app .store-btn { min-width: 0; width: 100%; } .dg-grid span { width: 18px; height: 18px; } }

/* no-JS fallback and the notes under the stage */
.dg-fallback { text-align: center; padding: var(--s3) var(--s2); }
.dg-fallback p { color: var(--dg-text1); margin: 0 0 var(--s2); }
.dg-fallback a:not(.store-btn) { color: var(--dg-text1); font-weight: 600; }
.dg-fallback .store-buttons { margin: 0; }
.daily-notes { max-width: 480px; margin: var(--s3) auto 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.5; color: var(--ink-soft); text-align: center; }
.daily-notes li { margin: 0 0 var(--s1); }
.daily-notes strong { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .dg-card-inner, .dg-tile { transition: none; }
  .dg-reveal:not(.is-off) .dg-next.is-timed .dg-next-bar { animation: none; }
}
@media (max-width: 379px) {
  .dg-n6 { --dg-cols: 3; }
  .dg-n6 .dg-tile { min-height: 60px; }
}
