/*
 * Colour themes. "classic" is the default set in stage.css; each block below overrides it.
 * Variables on #stage colour things drawn straight on the background; the "cards" block colours
 * everything inside a card. The lower quarter stays dark in every theme because TikTok writes its
 * white chat text over it.
 * To add a theme: copy a block, then add its name to src/core/themes.ts.
 */

/* ---------- shared by the bright themes: white cards, white text on the background ---------- */
#stage:is([data-theme="sunrise"], [data-theme="ocean"], [data-theme="meadow"], [data-theme="cream"]) {
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.9);
  --gold: #fff3b0;
  --headline-shadow: 0 2px 3px rgba(40, 10, 40, 0.55), 0 4px 22px rgba(40, 10, 40, 0.4);
  --panel: rgba(255, 255, 255, 0.95);
  --line: rgba(255, 255, 255, 0.9);
  --panel-shadow: 0 18px 44px rgba(40, 20, 60, 0.22);
  --chip-bg: rgba(255, 255, 255, 0.95);
  --chip-line: #ffffff;
  --pill: rgba(0, 0, 0, 0.2);
  --dot: rgba(255, 255, 255, 0.45);
  --ring-fill: #ffffff;
  --a: #ff6b6b;
  --b: #3d9df6;
  --c: #ffab2e;
  --d: #2fbf7f;
  --good: #16b866;
  --mote-1: rgba(255, 255, 255, 0.85);
  --mote-2: rgba(255, 244, 190, 0.75);
}
#stage:is([data-theme="sunrise"], [data-theme="ocean"], [data-theme="meadow"], [data-theme="cream"])
  :is(.panel, .choice, .chip) {
  --ink: var(--card-ink);
  --muted: var(--card-muted);
  --gold: var(--card-accent);
  color: var(--ink);
}
#stage:is([data-theme="sunrise"], [data-theme="ocean"], [data-theme="meadow"], [data-theme="cream"]) .row:nth-child(1) {
  border-color: #ffb81f;
}

/* Light text needs a soft shadow on the bright upper background. */
#stage:is([data-theme="sunrise"], [data-theme="ocean"], [data-theme="meadow"])
  :is(#brand, .q-number, .q-foot, .sub, .song, .champion-name, .champion-handle, .ticker) {
  text-shadow: 0 2px 8px rgba(30, 10, 40, 0.45);
}
#stage:is([data-theme="sunrise"], [data-theme="ocean"], [data-theme="meadow"], [data-theme="cream"]) :is(.panel, .choice, .chip) {
  text-shadow: none;
}
#stage:is([data-theme="sunrise"], [data-theme="ocean"], [data-theme="meadow"], [data-theme="cream"]) .revealed .choice.wrong {
  opacity: 0.68;
}
#stage:is([data-theme="sunrise"], [data-theme="ocean"], [data-theme="meadow"], [data-theme="cream"]) .lyric.now {
  text-shadow: none;
}

/* ---------- sunrise: peach to berry ---------- */
#stage[data-theme="sunrise"] {
  --stage-bg:
    radial-gradient(ellipse 900px 600px at 15% 5%, #ffd08a 0%, transparent 70%),
    linear-gradient(180deg, #ff9566 0%, #f76b7c 32%, #b94b90 56%, #5d2a74 76%, #210f36 100%);
  --card-ink: #3a1838;
  --card-muted: #85607f;
  --card-accent: #c2185b;
  --card: linear-gradient(160deg, #ffffff, #fff0e8);
  --row-first: linear-gradient(110deg, #ffe9a8, #fff8e6);
  --fade: #ffffff;
  --lyric-dim: #a98ba3;
  --ring-gap: #ffffff;
  --disc-1: #7a2c63;
  --disc-2: #a33f77;
}

/* ---------- ocean: sky to deep sea ---------- */
#stage[data-theme="ocean"] {
  --stage-bg:
    radial-gradient(ellipse 900px 600px at 85% 4%, #9ff0ee 0%, transparent 70%),
    linear-gradient(180deg, #2fb8e6 0%, #1f8fd6 32%, #2466b8 56%, #153c78 76%, #081a38 100%);
  --card-ink: #0e2a47;
  --card-muted: #56728f;
  --card-accent: #0a6fbe;
  --card: linear-gradient(160deg, #ffffff, #e8f7ff);
  --row-first: linear-gradient(110deg, #ffeaa0, #fffaea);
  --fade: #ffffff;
  --lyric-dim: #809bb5;
  --ring-gap: #ffffff;
  --disc-1: #124a7d;
  --disc-2: #1c6aa8;
}

/* ---------- meadow: fresh green ---------- */
#stage[data-theme="meadow"] {
  --stage-bg:
    radial-gradient(ellipse 900px 600px at 20% 4%, #c4f28f 0%, transparent 70%),
    linear-gradient(180deg, #46c27a 0%, #1fa386 32%, #17807c 56%, #0f4f55 76%, #06222a 100%);
  --card-ink: #10372f;
  --card-muted: #55756c;
  --card-accent: #0f7f55;
  --card: linear-gradient(160deg, #fffef8, #eefbe9);
  --row-first: linear-gradient(110deg, #ffeb9c, #fffbe8);
  --fade: #ffffff;
  --lyric-dim: #84a198;
  --ring-gap: #ffffff;
  --disc-1: #0f5c4c;
  --disc-2: #177a62;
}

/* ---------- cream: light and cosy, like daylight ---------- */
#stage[data-theme="cream"] {
  --stage-bg:
    radial-gradient(ellipse 900px 600px at 80% 4%, #ffffff 0%, transparent 70%),
    linear-gradient(180deg, #fff6e6 0%, #fde8cc 50%, #f6cfa6 70%, #a4532f 76%, #35180d 100%);
  --ink: #4a2615;
  --muted: #865942;
  --gold: #b0471a;
  --headline-shadow: 0 3px 10px rgba(160, 90, 40, 0.18);
  --panel-shadow: 0 16px 40px rgba(140, 80, 40, 0.18);
  --line: #f1d3b4;
  --chip-line: #f1d3b4;
  --pill: rgba(120, 60, 20, 0.12);
  --dot: rgba(120, 60, 20, 0.25);
  --card-ink: #4a2615;
  --card-muted: #8f6a55;
  --card-accent: #c0501c;
  --card: linear-gradient(160deg, #ffffff, #fff4e6);
  --row-first: linear-gradient(110deg, #ffe39a, #fff7e0);
  --fade: #ffffff;
  --lyric-dim: #b2927d;
  --ring-gap: #ffffff;
  --disc-1: #7b3a1d;
  --disc-2: #a55128;
  --mote-1: rgba(255, 170, 90, 0.7);
  --mote-2: rgba(255, 255, 255, 0.9);
}
/* The recent-answer pills and the bottom area sit on stronger colour in the cream theme. */
#stage[data-theme="cream"] #player,
#stage[data-theme="cream"] #handle { --ink: #ffffff; --muted: #ffe3cd; color: var(--ink); }
