/*
 * Uncommon: a bright, friendly daily game show. One typeface (Fredoka), round shapes, clear colour badges,
 * and one signature: one coral o in the logo, and a hand-drawn ring around your score.
 *
 * Colour, each with one job:
 *   cream  the page              white  cards
 *   navy   text and the main button
 *   coral  the brand and "only you" (3 points)        amber  rare (2)
 *   lilac  common (1)            blue   waiting for judges          grey   no points
 *   sun    confetti only
 *
 * Type scale (Fredoka): 12 label, 15 note, 17 body, 22 answer, 30 heading, 64 score, 120 letter.
 * Radius: 14 chips and inputs, 18 cards, 28 hero. Space: 4 8 12 16 24 32.
 */
@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka-400.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka-500.woff2') format('woff2'); font-weight: 500; font-display: block; }
@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka-600.woff2') format('woff2'); font-weight: 600; font-display: block; }
@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka-700.woff2') format('woff2'); font-weight: 700; font-display: block; }
@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka-ext-500.woff2') format('woff2'); font-weight: 500; font-display: block; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka-ext-600.woff2') format('woff2'); font-weight: 600; font-display: block; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka-ext-700.woff2') format('woff2'); font-weight: 700; font-display: block; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --cream: #fff6ea;
  --white: #ffffff;
  --navy: #1f2340;
  --navy-60: rgba(31, 35, 64, 0.72);
  --navy-40: rgba(31, 35, 64, 0.4);
  --navy-10: rgba(31, 35, 64, 0.08);
  --coral: #ff5a3c;
  --coral-soft: #ffe0cf;
  --coral-ink: #a83512;
  --amber: #ffb020;
  --lilac: #ece7f7;
  --lilac-ink: #6b6585;
  --blue: #2f5bd3;
  --blue-soft: #e3edff;
  --grey: #f2f0f4;
  --grey-ink: #a19bb0;
  --sun: #ffd23f;
  --edge: #f0dcc4;
  --font: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { background: var(--cream); color: var(--navy); font: 500 17px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; display: flex; justify-content: center; overflow: hidden; }
main { width: 100%; max-width: 440px; height: 100%; padding: 20px; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; }
/* Phones: a little extra room below the sheet, so the keyboard never hides the field being typed in. */
main { padding-bottom: calc(20px + var(--kb, 0px)); }
/* long pages scroll; nothing on them is squeezed (the logo row kept shrinking on Today) */
main > * { flex-shrink: 0; }
p, li { margin: 0; text-wrap: pretty; }
b { font-weight: 700; }

/* ---- type ---- */
h1, .h1 { font: 700 30px/1.1 var(--font); letter-spacing: -0.01em; margin: 0; }
h2, .h2 { font: 700 22px/1.2 var(--font); margin: 0; }
.label { font: 600 12px/1.2 var(--font); letter-spacing: 0.05em; text-transform: uppercase; color: var(--navy-60); }
.note { font: 500 15px/1.45 var(--font); color: var(--navy-60); }
.center { text-align: center; text-wrap: balance; }
.grow { flex: 1; min-height: var(--s4); }

/* ---- top bar: logo and a pill ---- */
.top { display: flex; justify-content: space-between; align-items: center; min-height: 36px; flex-wrap: wrap; row-gap: 8px; }
.pill { font: 600 13px/1 var(--font); background: var(--coral-soft); color: var(--coral-ink); padding: 9px 13px; border-radius: 99px; white-space: nowrap; }
.pill.plain { background: var(--white); color: var(--navy-60); box-shadow: 0 2px 0 var(--edge); }

/* ---- the logo: uncommon, with one coral o ---- */
.logo { font: 700 25px/1 var(--font); letter-spacing: -0.015em; color: var(--navy); white-space: nowrap; }
.logo .o { color: var(--coral); display: inline-block; margin: 0 0.035em; transform: translateY(-0.09em) scale(1.12); animation: opop 0.7s 0.25s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
/* the uncommon o hops up out of the word, once, when a screen opens */
@keyframes opop { from { transform: translateY(0) scale(1); } }
/* the logo is the word with one coral o: the one that stands out. No ring (the old hand-drawn one is hidden). */
.logo svg { display: none; }

/* ---- the ring: the one signature, drawn when a screen opens ---- */
.ring { position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: -4%; width: 108%; height: 108%; overflow: visible; }
.ring path { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; }
.ring path.track { stroke: rgba(255, 255, 255, 0.3); }
.ring path.progress { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.8s 0.15s cubic-bezier(0.6, 0, 0.3, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: var(--ring, 0); } }

/* ---- today's letter: a big coral disc ---- */
.letter { position: relative; width: 168px; height: 168px; margin: 0 auto; border-radius: 50%; background: var(--coral); color: var(--white); display: grid; place-items: center; font: 700 108px/1 var(--font); box-shadow: 0 6px 0 var(--coral-ink); }
.letter span { transform: translateY(0.04em); }
.letter.sm { width: 44px; height: 44px; font-size: 26px; box-shadow: 0 3px 0 var(--coral-ink); flex: none; }
.dot { position: absolute; border-radius: 50%; pointer-events: none; }

/* ---- cards ---- */
.card { background: var(--white); border-radius: 18px; padding: 12px 16px; box-shadow: 0 2px 0 var(--edge); }
.hero { position: relative; overflow: hidden; background: var(--coral); color: var(--white); border-radius: 28px; padding: 20px 22px; }

/* ---- chips: the points ---- */
.chip { display: inline-block; font: 700 13px/1 var(--font); padding: 8px 11px; border-radius: 99px; white-space: nowrap; flex: none; }
.chip.c3 { background: var(--coral); color: var(--navy); }
.chip.c2 { background: var(--amber); color: var(--navy); }
.chip.c1 { background: var(--lilac); color: var(--lilac-ink); }
.chip.c0 { background: var(--grey); color: var(--navy); }
.chip.cq { background: var(--blue-soft); color: var(--blue); }
/* A laugh is not a point: the same soft coral as the day pill, never a point badge. */
.chip.fun { background: var(--coral-soft); color: var(--coral-ink); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; font: 700 19px/1 var(--font); color: var(--white); background: var(--navy); border: 0; border-radius: 99px; padding: 19px var(--s4); width: 100%; cursor: pointer; text-decoration: none; box-shadow: 0 5px 0 #000; transition: transform 0.08s, box-shadow 0.08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #000; }
.btn.line { color: var(--navy); background: var(--white); box-shadow: inset 0 0 0 2px var(--navy), 0 5px 0 var(--navy); }
.btn.line:active { box-shadow: inset 0 0 0 2px var(--navy), 0 1px 0 var(--navy); }
.btn.coral { background: var(--coral); box-shadow: 0 5px 0 var(--coral-ink); }
.btn.coral:active { box-shadow: 0 1px 0 var(--coral-ink); }
.btn:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---- sound on/off ---- */
.topr { display: flex; align-items: center; gap: var(--s2); }
.snd { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--white); box-shadow: 0 2px 0 var(--edge); display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.snd::after { content: ''; position: absolute; inset: -3px; }
.snd svg { width: 20px; height: 20px; }
.snd path { fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.snd .spk { fill: var(--navy); }
.snd .mute { display: none; stroke: var(--coral); }
.snd[aria-pressed='false'] .wave { display: none; }
.snd[aria-pressed='false'] .mute { display: block; }

/* ---- motion ---- */
.pop-in { animation: pop 0.45s cubic-bezier(0.25, 1.4, 0.5, 1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.92); } }
.bounce { animation: bounce 0.42s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes bounce { from { opacity: 0; transform: scale(0.4); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .ring path.progress { stroke-dashoffset: var(--ring, 0); } }
