/* Themes (theme.js picks one: html[data-theme]; Default is the pages' own colours). Each sets the same colour tokens the website and the
   app are drawn with: the backgrounds (bg, panel, surface, surface-2, sc, sc-high), the lines, the text, the accent the pages call pink
   (and the text on it), the green and the gold. Shared by the website and the app, byte for byte (like reel.css). */
:root { --on-pink: #2a0a1a; }
html[data-theme="midnight"] {
  --bg: #0a0a0d; --panel: #111116; --surface: #17171d; --surface-2: #202028; --line: #2b2b35; --sc: #121218; --sc-high: #1a1a21;
  --text: #eceef4; --muted: #a2a6b5; --pink: #ff6fa9; --pink-dark: #e8548f; --on-pink: #2a0a1a; --accent: #9be27a; --good: #9be27a; --gold: #ffc857;
}
html[data-theme="ocean"] {
  --bg: #06121a; --panel: #0b1b25; --surface: #10232f; --surface-2: #172e3c; --line: #20394a; --sc: #0a1822; --sc-high: #0f2230;
  --text: #e4f2f7; --muted: #96b5c4; --pink: #4fd4e4; --pink-dark: #22b4c8; --on-pink: #03222a; --accent: #7fe0a0; --good: #7fe0a0; --gold: #ffd166;
}
html[data-theme="matcha"] {
  --bg: #0b100a; --panel: #121a10; --surface: #182216; --surface-2: #212d1e; --line: #2b3a27; --sc: #10170e; --sc-high: #172014;
  --text: #eef4e8; --muted: #a6b69e; --pink: #b8e655; --pink-dark: #95c933; --on-pink: #172200; --accent: #62d6b2; --good: #62d6b2; --gold: #ffd166;
}
html[data-theme="ember"] {
  --bg: #140c08; --panel: #1d130e; --surface: #271a13; --surface-2: #32231a; --line: #3f2c21; --sc: #1b120d; --sc-high: #241811;
  --text: #fbefe6; --muted: #c6ad9d; --pink: #ff8a3d; --pink-dark: #e86f22; --on-pink: #2a1200; --accent: #a6e96b; --good: #a6e96b; --gold: #ffcf5a;
}
/* Void: true black for OLED screens, near-black panels, the colours on them vivid */
html[data-theme="void"] {
  --bg: #000000; --panel: #07070a; --surface: #0d0d12; --surface-2: #15151c; --line: #1f1f29; --sc: #050507; --sc-high: #0b0b10;
  --text: #f4f4fb; --muted: #9a9ab0; --pink: #c35cff; --pink-dark: #a238f0; --on-pink: #0d0016; --accent: #3dff8f; --good: #3dff8f; --gold: #ffd21f;
}
/* Cherry blossom: deep plum under sakura pink, a few petals drifting at the edges of the page */
html[data-theme="sakura"] {
  --bg: #170c14; --panel: #21111d; --surface: #2b1726; --surface-2: #372031; --line: #462b3e; --sc: #1e0f1a; --sc-high: #281422;
  --text: #fcedf5; --muted: #cda9bd; --pink: #ffa3cc; --pink-dark: #f27fb4; --on-pink: #2c0a1b; --accent: #b8ec8f; --good: #b8ec8f; --gold: #ffd38a;
}
html:is([data-theme="sakura"], [data-theme="petal"], [data-theme^="spring"], [data-theme^="summer"], [data-theme^="autumn"], [data-theme^="winter"]) body {
  background-image: radial-gradient(60vmax 40vmax at 100% -10%, color-mix(in srgb, var(--pink) 13%, transparent), transparent 70%),
    radial-gradient(50vmax 36vmax at -10% 110%, color-mix(in srgb, var(--pink) 9%, transparent), transparent 70%);
  background-attachment: fixed;
}
/* Cherry blossom, light: petal-white pages, ink text; pictures of the game (replays, covers) keep their own colours */
html[data-theme="petal"] {
  color-scheme: light;
  --bg: #fff5f9; --panel: #ffffff; --surface: #fdeaf2; --surface-2: #f8dce8; --line: #efc9d9; --sc: #fdeff5; --sc-high: #f9e2ec;
  --text: #2b1520; --muted: #7a5566; --pink: #d6427c; --pink-dark: #b5306a; --on-pink: #ffffff; --accent: #2e7d22; --good: #2e7d22; --gold: #9a6400;
}

/* The seasons (osu!bridge Plus), each dark and light, each with its weather (theme.js): spring's petals, summer's rays, autumn's leaves,
   winter's snow. A .th-scope wears one too (the Plus page shows them in small). */
:is(html, .th-scope)[data-theme="spring"] {
  --bg: #0c130f; --panel: #131d17; --surface: #19261e; --surface-2: #213027; --line: #2c3f33; --sc: #101913; --sc-high: #16221a;
  --text: #eef6ef; --muted: #a8bdad; --pink: #ff9ec8; --pink-dark: #f27db0; --on-pink: #2c0a1b; --accent: #9fe36f; --good: #9fe36f; --gold: #ffd76a;
}
:is(html, .th-scope)[data-theme="spring-light"] {
  color-scheme: light;
  --bg: #f3faf4; --panel: #ffffff; --surface: #e6f3e9; --surface-2: #d9ebdd; --line: #c6dfcc; --sc: #edf7ef; --sc-high: #e0efe3;
  --text: #162119; --muted: #52695a; --pink: #c63d78; --pink-dark: #a52f62; --on-pink: #ffffff; --accent: #2e7d32; --good: #2e7d32; --gold: #8a6100;
}
:is(html, .th-scope)[data-theme="summer"] {
  --bg: #120e1a; --panel: #1a1524; --surface: #221c2f; --surface-2: #2c253b; --line: #3a3149; --sc: #16121f; --sc-high: #1e1829;
  --text: #fbf2ea; --muted: #bfb1c6; --pink: #ffa24a; --pink-dark: #f2862a; --on-pink: #2a1300; --accent: #8fe388; --good: #8fe388; --gold: #ffd75e;
}
:is(html, .th-scope)[data-theme="summer-light"] {
  color-scheme: light;
  --bg: #f2f8fe; --panel: #ffffff; --surface: #e4f0fb; --surface-2: #d6e7f7; --line: #c1d9ef; --sc: #ebf4fd; --sc-high: #ddebf9;
  --text: #13202d; --muted: #4c6274; --pink: #b9530a; --pink-dark: #9a4406; --on-pink: #ffffff; --accent: #26773a; --good: #26773a; --gold: #8a5d00;
}
:is(html, .th-scope)[data-theme="autumn"] {
  --bg: #150b0b; --panel: #1f1111; --surface: #291716; --surface-2: #341f1d; --line: #442a27; --sc: #1a0e0e; --sc-high: #231312;
  --text: #fbeee8; --muted: #cdaaa1; --pink: #f2a33c; --pink-dark: #dd8a1f; --on-pink: #2a1600; --accent: #b9d36c; --good: #b9d36c; --gold: #ffcf6b;
}
:is(html, .th-scope)[data-theme="autumn-light"] {
  color-scheme: light;
  --bg: #faf4f2; --panel: #ffffff; --surface: #f4e6e1; --surface-2: #ebd8d1; --line: #e0c6bd; --sc: #f7ece8; --sc-high: #efe0da;
  --text: #2a1611; --muted: #6e4f47; --pink: #b2441a; --pink-dark: #92360f; --on-pink: #ffffff; --accent: #4c7a1c; --good: #4c7a1c; --gold: #8f5a00;
}
:is(html, .th-scope)[data-theme="winter"] {
  --bg: #09101a; --panel: #101a27; --surface: #162232; --surface-2: #1e2c3f; --line: #293b52; --sc: #0d1620; --sc-high: #131f2d;
  --text: #eef5fc; --muted: #a0b3c8; --pink: #8fd3ff; --pink-dark: #62bdf5; --on-pink: #062033; --accent: #8de3b8; --good: #8de3b8; --gold: #ffd98a;
}
:is(html, .th-scope)[data-theme="winter-light"] {
  color-scheme: light;
  --bg: #f2f6fb; --panel: #ffffff; --surface: #e6edf6; --surface-2: #d9e3ef; --line: #c6d5e6; --sc: #ecf2f8; --sc-high: #dfe8f2;
  --text: #132030; --muted: #4f6378; --pink: #1d6bb0; --pink-dark: #155591; --on-pink: #ffffff; --accent: #23784b; --good: #23784b; --gold: #8a6200;
}

/* the weather (theme.js): over the page (the website's, or the app's window), under its bars, menus and dialogs, never in the way of a
   click, drawn on its canvas; summer's rays are drawn here, in a layer behind the page */
.th-fx { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; border-radius: inherit; }
body > .th-fx { position: fixed; z-index: 22; border-radius: 0; bottom: auto; height: 100vh; height: 100lvh; } /* (a phone: as tall as the screen with its bar hidden, so it is not resized, and its picture redrawn, as the bar comes and goes) */
.shell > .th-fx { z-index: 5; }
.th-fx.th-behind { z-index: -1; } .shell:has(> .th-behind) { isolation: isolate; } /* (the weather: behind what is drawn there, its background) */
.th-fx canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.th-sun { --glow: 255, 186, 82; position: absolute; top: -62%; right: -38%; height: 124%; aspect-ratio: 1; border-radius: 50%; /* (summer's light: rays from past the corner, no sun itself) */
  background: radial-gradient(closest-side, rgba(var(--glow), .26), rgba(var(--glow), .08) 40%, transparent 70%); animation: th-sun 5.5s ease-in-out infinite; }
.th-sun::before { content: ''; position: absolute; inset: 0; border-radius: 50%; animation: th-rays 120s linear infinite;
  background: repeating-conic-gradient(from 2deg, rgba(var(--glow), .24) 0 4deg, transparent 4deg 13deg), repeating-conic-gradient(from 9deg, rgba(var(--glow), .12) 0 9deg, transparent 9deg 23deg);
  -webkit-mask: radial-gradient(closest-side, #000 18%, transparent 96%); mask: radial-gradient(closest-side, #000 18%, transparent 96%); }
@keyframes th-sun { 0%, 100% { transform: scale(.94); opacity: .7; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes th-rays { to { transform: rotate(1turn); } }
.th-idle .th-fx, .th-idle .th-fx *, .th-idle .th-fx *::before { animation-play-state: paused !important; } /* (another window has the focus: theme.js) */
.th-fx[data-tone="dark"] .th-sun { --glow: 255, 140, 64; } /* (dusk: orange) */
.th-fx[data-tone="light"] .th-sun { --glow: 255, 168, 28; }

/* the theme picker (theme.js picker()): a card each, the theme's own colours on it; the seasons under them, Plus's */
.th-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; width: 100%; }
.th-opt { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; border: 2px solid transparent; background: var(--t-bg); color: var(--t-text); font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line); transition: transform .15s var(--ease, ease), border-color .15s; }
.th-opt:hover { transform: translateY(-2px); } .th-opt:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.th-opt[aria-checked="true"] { border-color: var(--t-pink); box-shadow: 0 0 0 1px var(--t-pink), 0 8px 22px color-mix(in srgb, var(--t-pink) 28%, transparent); }
.th-opt i { display: block; height: 34px; border-radius: 9px; background: var(--t-fx, linear-gradient(transparent, transparent)), linear-gradient(90deg, var(--t-panel) 0 58%, var(--t-pink) 58% 72%, var(--t-good) 72% 84%, var(--t-gold) 84%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t-text) 12%, transparent); }
.th-opt b { font-size: 13.5px; } .th-opt small { margin-top: -6px; font-size: 11.5px; opacity: .75; }
.th-opt[aria-checked="true"]::after { content: '✓'; position: absolute; top: 6px; right: 8px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--t-pink); color: var(--t-on); font-size: 12px; font-weight: 900; }
.th-gh { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; }
.th-gh b { font-size: 14.5px; } .th-gh small { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.th-plus { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; background: linear-gradient(120deg, #ffc857, #ff9ac4); color: #2a1220; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.th-opt .th-plus { display: none; position: absolute; top: 7px; right: 8px; padding: 1px 7px; font-size: 10.5px; }
.th-opt.locked .th-plus { display: inline-flex; } .th-opt.locked i { opacity: .82; }
/* (each season's mark, on its card and wherever else it is shown: petals, sun rays, leaves, snow) */
[data-season="spring"] { --t-fx: radial-gradient(ellipse 5px 3px at 14% 34%, #ffc4dc 92%, transparent), radial-gradient(ellipse 5px 3px at 34% 68%, #fff 92%, transparent), radial-gradient(ellipse 5px 3px at 46% 28%, #ffd9e8 92%, transparent); }
[data-season="summer"] { --t-fx: repeating-conic-gradient(from 180deg at 100% 0, rgba(255, 196, 92, .75) 0 5deg, transparent 5deg 14deg) 0 0 / 58% 100% no-repeat; }
[data-season="autumn"] { --t-fx: radial-gradient(ellipse 5px 3px at 16% 30%, #e2733a 92%, transparent), radial-gradient(ellipse 5px 3px at 38% 66%, #c9472b 92%, transparent), radial-gradient(ellipse 5px 3px at 48% 26%, #f2a541 92%, transparent); }
[data-season="winter"] { --t-fx: radial-gradient(circle at 12% 30%, #fff 0 1.6px, transparent 2.2px), radial-gradient(circle at 26% 64%, #fff 0 2px, transparent 2.6px), radial-gradient(circle at 40% 36%, #fff 0 1.4px, transparent 2px), radial-gradient(circle at 50% 74%, #fff 0 1.6px, transparent 2.2px), linear-gradient(transparent 82%, #f4f8ff 82% 100%); }

/* Light themes: what pictures the game or the app as it is (the replay and live player, the app's preview and the home page's small ones,
   the picture on a replay card, map cards over their cover art, the explainers) and a profile drawn in its owner's own colours keep the
   dark ones, as the game itself does */
html:is([data-theme="petal"], [data-theme$="-light"]) :is(.th, .l-show, .wt-stage, .rpl-shot, .rp-thumb, .rk-cardmap, .dk, .th-table, .sp-view, .pf-box, .lb-duel, .lb-split, .l-tour) {
  color-scheme: dark; color: #f8efe8;
  --bg: #16110f; --panel: #1f1917; --surface: #282120; --surface-2: #342b29; --line: #3d3330; --sc: #221920; --sc-high: #2b2028;
  --text: #f8efe8; --muted: #bcaea6; --pink: #ff6fa9; --pink-dark: #e8548f; --on-pink: #2a0a1a; --accent: #a6e96b; --good: #a6e96b; --gold: #ffc857;
}

/* the effect: a season's weather over any theme (theme.js), its choices as small chips in the page's own colours */
.th-fxs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.th-fxo { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; transition: border-color .2s, transform .2s; }
.th-fxo:hover { transform: translateY(-1px); } .th-fxo:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.th-fxo[aria-checked="true"] { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink); }
.th-fxo.locked { opacity: .62; } .th-fxo.locked::after { content: '★'; margin-left: 2px; color: var(--gold, #ffc857); font-size: 11px; }
.th-fxi { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; line-height: 1; background: color-mix(in srgb, var(--pink) 18%, transparent); }
.th-fxi[data-fx="auto"]::before { content: '◐'; } .th-fxi[data-fx="none"]::before { content: '○'; }
.th-fxi[data-fx="spring"]::before { content: '🌸'; } .th-fxi[data-fx="summer"]::before { content: '☀'; color: #ffb34a; }
.th-fxi[data-fx="autumn"]::before { content: '🍂'; } .th-fxi[data-fx="winter"]::before { content: '❄'; color: #9fd8ff; }
.th-fxi[data-fx="rain"]::before { content: '🌧️'; } .th-fxi[data-fx="stars"]::before { content: '🌠'; }
.th-fxi[data-fx="embers"]::before { content: '🔥'; } .th-fxi[data-fx="confetti"]::before { content: '🎉'; }
.th-fxi[data-fx="fireflies"]::before, .th-fxi[data-fx="bubbles"]::before, .th-fxi[data-fx="aurora"]::before { content: ''; box-sizing: border-box; } /* (drawn: no picture of their own in every font) */
.th-fxi[data-fx="fireflies"]::before { width: 6px; height: 6px; border-radius: 50%; background: #ffd23f; box-shadow: 0 0 5px 2px rgba(255, 196, 40, .75); }
.th-fxi[data-fx="bubbles"]::before { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #5aa9e6; background: radial-gradient(circle at 32% 30%, #fff 0 1.4px, transparent 2px), rgba(90, 169, 230, .16); }
.th-fxi[data-fx="aurora"]::before { width: 14px; height: 11px; border-radius: 7px 7px 2px 2px; background: linear-gradient(rgba(176, 124, 255, .5), #59e3f0 55%, #3ddc97); box-shadow: 0 2px 6px rgba(61, 220, 151, .5); }

/* the logo (theme.js Theme.logo): two hit circles and the bridge between them, in the theme's accent and the colour that reads on it */
.mark { display: block; flex: none; overflow: visible; color: var(--on-pink, #2a0a1a); transition: color .35s ease; }
.mark .mk-bg { fill: var(--pink); transition: fill .35s ease; }
