/* New Year's Eve (premium, id "newyear", item code "ny"): a black-and-gold midnight. A big glowing clock a minute
   to twelve, a city skyline with lit windows mirrored in a river, gold and champagne fireworks blooming and drooping
   like willows, slow gold confetti, streamers and balloons. Gold-foil art-deco buttons with a glint sweeping across,
   black lacquer cards with deco corners, jewel tiles set in gold. The scene is built in theme-newyear.js. */

/* ---- colours ---- */
[data-theme="newyear"] {
  --bg-0: #060509; --bg-1: #110e16; --bg-2: #1b1622;
  --card: rgba(17, 14, 21, .92); --card-2: rgba(255, 226, 160, .07); --panel-edge: rgba(232, 190, 110, .36);
  --ink: #fdf6e6; --ink-dim: #cdbd9a; --on-hot: #2a1900;
  --hot: #e9b543; --cool: #efdcae; --amber: #f5cc5a; --good: #4fd18b; --bad: #ff5d6c; --seen: #f3d27a;
  --title-1: #fdf6e6; --title-2: #f0c35a;
  --mine: rgba(233, 181, 67, .2); --mine-edge: rgba(233, 181, 67, .5); --fact-bg: rgba(239, 220, 174, .09); --fact-edge: rgba(239, 220, 174, .38);
  --shadow: 0 6px 22px rgba(0, 0, 0, .5);
  --scrim: rgba(3, 2, 6, .7); --off: rgba(255, 255, 255, .18); --press: rgba(0, 0, 0, .45);
  /* jewel tones set in gold for the subject tiles */
  --s-general: #b9862a; --s-geography: #2766b0; --s-history: #a4432c; --s-science: #12878c;
  --s-nature: #23885a; --s-music: #b53279; --s-film_tv: #b0263a; --s-sport: #c4741a;
  --s-arts_lit: #6b3db8; --s-food: #c2522a; --s-tech_games: #3557c4; --s-words: #178675;
  --logo-a: #fff6d6; --logo-b: #f0c35a; --logo-c: #a8721a;
  --ny-gold: linear-gradient(180deg, #fff3c4 0%, #f6d377 22%, #e2a838 48%, #b07a1c 52%, #e9bd55 78%, #fbe39a 100%);
}

/* ---- the scene ---- */
[data-theme="newyear"] #stage-bg { background:
  radial-gradient(90% 30% at 50% calc(100% - var(--tabh) - 9vh), rgba(240, 180, 80, .28), transparent 70%),
  radial-gradient(70% 40% at 50% 26%, rgba(255, 214, 130, .1), transparent 70%),
  linear-gradient(#030205 0%, #09070d 40%, #15101a 70%, #241a1c 84%, #07060a 100%); }

.scene .ny-stars { position: absolute; inset: 0 0 40% 0; }
.scene .ny-stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff2cf; opacity: .6;
  animation: ny-twinkle 3.4s ease-in-out infinite; }
@keyframes ny-twinkle { 50% { opacity: .12; } }

/* the big clock, a minute to midnight: the second hand ticks round and the rim flares as it passes twelve */
.scene .ny-clock { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 8.5vh); width: min(66vw, 17rem, 34vh); aspect-ratio: 1;
  transform: translateX(-50%); }
.scene .ny-clock::before { content: ''; position: absolute; inset: -22%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 120, .3), rgba(255, 190, 90, .08) 50%, transparent 68%); animation: ny-halo 60s linear infinite; }
.scene .ny-clock svg { position: relative; width: 100%; height: 100%; display: block; opacity: .7; filter: url(#f3dSmall); }
.scene .ny-clock .ny-sec { transform-origin: 100px 100px; animation: ny-tick 60s steps(60) infinite; }
.scene .ny-clock .ny-min { transform-origin: 100px 100px; transform: rotate(-6deg); }
.scene .ny-clock .ny-hr { transform-origin: 100px 100px; transform: rotate(-.5deg); }
@keyframes ny-tick { to { transform: rotate(360deg); } }
@keyframes ny-halo { 0%, 2% { opacity: 1; transform: scale(1.12); } 8%, 100% { opacity: .65; transform: scale(1); } }

/* fireworks: gold and champagne starbursts that open out, droop like willows and leave a glitter crackle */
.scene .ny-fw { position: absolute; width: 0; height: 0; animation: ny-droop var(--d) ease-in infinite; animation-delay: var(--t); }
.scene .ny-fw .ny-ray { position: absolute; left: -1px; top: 0; width: 2px; height: var(--r); transform-origin: 50% 0;
  background: linear-gradient(transparent, color-mix(in srgb, var(--fc) 60%, transparent) 55%, var(--fc) 92%, #fff);
  border-radius: 2px; opacity: 0; animation: ny-ray var(--d) cubic-bezier(.15, .8, .3, 1) infinite; animation-delay: var(--t); }
.scene .ny-fw .ny-ray::after { content: ''; position: absolute; left: -2px; bottom: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 6px 2px var(--fc); }
.scene .ny-fw .ny-flash { position: absolute; left: -2.2rem; top: -2.2rem; width: 4.4rem; height: 4.4rem; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 248, 220, .9), color-mix(in srgb, var(--fc) 40%, transparent) 35%, transparent 70%);
  opacity: 0; animation: ny-flash var(--d) ease-out infinite; animation-delay: var(--t); }
.scene .ny-fw .ny-gl { position: absolute; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; background: #fffbe8;
  box-shadow: 0 0 5px 1px var(--fc); opacity: 0; animation: ny-glitter var(--d) steps(1) infinite; animation-delay: var(--t); }
@keyframes ny-ray {
  0% { transform: rotate(var(--a)) scaleY(.05); opacity: 0; }
  2% { opacity: 1; }
  16% { transform: rotate(var(--a)) scaleY(1); opacity: 1; }
  34% { opacity: .75; }
  48%, 100% { transform: rotate(var(--a)) scaleY(1.08); opacity: 0; } }
@keyframes ny-flash { 0% { opacity: 0; transform: scale(.3); } 3% { opacity: 1; } 14%, 100% { opacity: 0; transform: scale(1.4); } }
@keyframes ny-droop { 0%, 12% { transform: translateY(0); } 50%, 100% { transform: translateY(2.2rem); } }
@keyframes ny-glitter { 0%, 22% { opacity: 0; } 26% { opacity: 1; } 30% { opacity: .1; } 34% { opacity: 1; } 39% { opacity: 0; }
  43% { opacity: .9; } 47%, 100% { opacity: 0; } }

/* the city along the bottom, and the river mirroring it */
.scene .ny-city { position: absolute; left: 0; right: 0; bottom: calc(var(--tabh) + 6vh + env(safe-area-inset-bottom)); height: 21vh; }
.scene .ny-city svg, .scene .ny-reflect svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene .ny-city .ny-lit { animation: ny-window 7s ease-in-out infinite; }
@keyframes ny-window { 0%, 70%, 100% { opacity: 1; } 78%, 92% { opacity: .15; } }
.scene .ny-city .ny-beacon { animation: ny-beacon 1.6s ease-in-out infinite; }
@keyframes ny-beacon { 50% { opacity: .2; } }
.scene .ny-river { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tabh) + 6vh + env(safe-area-inset-bottom)); overflow: hidden;
  background: linear-gradient(#120d14, #07060a 70%); box-shadow: inset 0 1px 0 rgba(255, 214, 140, .35); }
.scene .ny-reflect { position: absolute; left: 0; right: 0; top: 0; height: 21vh; transform: scaleY(-1); transform-origin: 50% 0; opacity: .5;
  -webkit-mask: linear-gradient(to top, #000, transparent 55%); mask: linear-gradient(to top, #000, transparent 55%); }
.scene .ny-ripples { position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, transparent 0 5px, rgba(7, 6, 10, .55) 5px 7px); animation: ny-ripple 4s linear infinite; }
@keyframes ny-ripple { to { background-position: 0 14px; } }
.scene .ny-glint { position: absolute; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #ffd98a, transparent);
  opacity: .7; animation: ny-glint var(--d) ease-in-out infinite; animation-delay: var(--t); }
@keyframes ny-glint { 50% { transform: scaleX(.4) translateX(.6rem); opacity: .2; } }

/* slow gold confetti, curly streamers and a few balloons */
.scene .ny-conf { position: absolute; top: -4vh; width: var(--w); height: calc(var(--w) * 1.6); border-radius: 1px; background: var(--cc);
  box-shadow: inset 0 0 0 .5px rgba(80, 50, 0, .5); animation: ny-fall var(--d) linear infinite; animation-delay: var(--t); }
@keyframes ny-fall {
  0% { transform: translate(0, -4vh) rotate(0) rotateX(0); }
  25% { transform: translate(var(--sway), 24vh) rotate(90deg) rotateX(180deg); }
  50% { transform: translate(0, 52vh) rotate(180deg) rotateX(360deg); }
  75% { transform: translate(calc(var(--sway) * -1), 80vh) rotate(270deg) rotateX(540deg); }
  100% { transform: translate(0, 108vh) rotate(360deg) rotateX(720deg); } }
.scene .ny-streamer { position: absolute; top: -10vh; width: 1.1rem; animation: ny-stream var(--d) linear infinite; animation-delay: var(--t); }
.scene .ny-streamer svg { width: 100%; height: auto; display: block; }
@keyframes ny-stream {
  0% { transform: translate(0, -10vh) rotate(-12deg); }
  50% { transform: translate(var(--sway), 50vh) rotate(14deg); }
  100% { transform: translate(0, 115vh) rotate(-12deg); } }
.scene .ny-balloon { position: absolute; bottom: -18vh; width: 2.4rem; animation: ny-rise var(--d) linear infinite; animation-delay: var(--t); }
.scene .ny-balloon svg { width: 100%; height: auto; display: block; filter: url(#f3dSmall); animation: ny-bob 3.6s ease-in-out infinite alternate; }
@keyframes ny-rise { 0% { transform: translate(0, 0); } 100% { transform: translate(var(--sway), -135vh); } }
@keyframes ny-bob { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }

/* ---- the app: gold foil, black lacquer and art deco ---- */
/* title: ivory "Smarty" in a striped party hat, gold-foil "Party" with a glint running through it */
[data-theme="newyear"] .logo .l1 { position: relative; }
[data-theme="newyear"] .logo:not(.small) .l1::before { content: ''; position: absolute; left: -.2em; top: -.66em; width: .78em; height: .95em;
  transform: rotate(-22deg); pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5));
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 74'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23fff0b0'/%3E%3Cstop offset='.5' stop-color='%23e9b543'/%3E%3Cstop offset='1' stop-color='%23a8721a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M6 66L30 10l24 56z' fill='url(%23g)' stroke='%231b1033' stroke-width='4' stroke-linejoin='round'/%3E%3Cpath d='M23 26l14 6-3 7-16-7zM16 42l23 10-3 7-24-10z' fill='%23171219'/%3E%3Cpath d='M22 30l6-14' stroke='%23fff' stroke-width='3' stroke-linecap='round' opacity='.6'/%3E%3Cpath d='M4 64q26 8 52 0l1 6q-27 9-54 0z' fill='url(%23g)' stroke='%231b1033' stroke-width='3' stroke-linejoin='round'/%3E%3Ccircle cx='30' cy='9' r='7' fill='url(%23g)' stroke='%231b1033' stroke-width='3'/%3E%3Cellipse cx='27' cy='7' rx='2.4' ry='1.6' fill='%23fff' opacity='.8'/%3E%3C/svg%3E") center / contain no-repeat; }
[data-theme="newyear"] .logo .l1 { color: #fdf6e6; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
[data-theme="newyear"] .logo .l2 {
  background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, .95) 50%, transparent 60%) -150% 0 / 250% 100% no-repeat, var(--ny-gold);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #4a3008) drop-shadow(0 0 12px rgba(240, 190, 80, .45)); animation: ny-textglint 5s ease-in-out infinite; }
[data-theme="newyear"] .logo.small .l2 { filter: drop-shadow(0 1px 0 #4a3008); }
@keyframes ny-textglint { 0%, 55% { background-position: 150% 0, 0 0; } 100% { background-position: -150% 0, 0 0; } }

/* main buttons: gold foil in the button's own colour, a thin deco line inside, a glint sweeping across */
[data-theme="newyear"] .btn:not(.ghost) {
  background:
    linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .7) 48%, rgba(255, 255, 255, .15) 54%, transparent 60%) 160% 0 / 260% 100% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .12) 46%, rgba(0, 0, 0, .14) 52%, rgba(255, 255, 255, .1) 80%, rgba(255, 255, 255, .28)),
    var(--hot);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .6), inset 0 -3px 0 rgba(0, 0, 0, .22), inset 0 0 0 1px color-mix(in srgb, var(--hot) 45%, black),
    0 5px 0 color-mix(in srgb, var(--hot) 40%, black), 0 12px 22px -6px color-mix(in srgb, var(--hot) 45%, transparent); }
[data-theme="newyear"] .btn:not(.ghost):not(.small) { animation: ny-glint-btn 4.6s ease-in-out infinite; }
[data-theme="newyear"] .btn:not(.ghost):not(.danger) { text-shadow: 0 1px 0 rgba(255, 245, 210, .45); }
[data-theme="newyear"] .btn.alt { --on-hot: #2a1d05; }
[data-theme="newyear"] .btn:not(.ghost):not(.small) { position: relative; }
[data-theme="newyear"] .btn:not(.ghost):not(.small)::before { content: ''; position: absolute; inset: 4px; border-radius: max(4px, calc(14px - 4px));
  pointer-events: none; border: 1px solid color-mix(in srgb, var(--hot) 35%, #3a2400); opacity: .55;
  -webkit-mask: linear-gradient(90deg, #000 0 1.2rem, transparent 1.2rem calc(100% - 1.2rem), #000 calc(100% - 1.2rem));
  mask: linear-gradient(90deg, #000 0 1.2rem, transparent 1.2rem calc(100% - 1.2rem), #000 calc(100% - 1.2rem)); }
@keyframes ny-glint-btn { 0%, 62% { background-position: 160% 0, 0 0, 0 0; } 100% { background-position: -60% 0, 0 0, 0 0; } }
[data-theme="newyear"] .btn:not(.ghost):active { box-shadow: inset 0 2px 5px rgba(0, 0, 0, .3), 0 1px 0 color-mix(in srgb, var(--hot) 40%, black); }
[data-theme="newyear"] .btn.ghost { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 0 0 1px rgba(233, 181, 67, .5), 0 3px 0 rgba(0, 0, 0, .4),
  0 8px 16px -6px rgba(0, 0, 0, .6); }

/* cards: black lacquer with a gold hairline and art-deco corner brackets */
[data-theme="newyear"] .panel { position: relative; backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 230, 170, .3), inset 0 0 0 1px rgba(233, 181, 67, .22), inset 0 -2px 0 rgba(0, 0, 0, .3),
    0 14px 30px -10px rgba(0, 0, 0, .75); }
[data-theme="newyear"] .panel::after { content: ''; position: absolute; inset: 5px; pointer-events: none; opacity: .7; border-radius: inherit;
  --ny-c: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1 23V1h22M5 23V5h18' fill='none' stroke='%23e9b543' stroke-width='1.3'/%3E%3Cpath d='M9 9l3-3 3 3-3 3z' fill='%23f5cc5a'/%3E%3C/svg%3E");
  background: var(--ny-c) left top / 1.1rem no-repeat; }
[data-theme="newyear"] .panel::before { content: ''; position: absolute; right: 5px; top: 5px; width: 1.1rem; height: 1.1rem; pointer-events: none; opacity: .7;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23 23V1H1M19 23V5H1' fill='none' stroke='%23e9b543' stroke-width='1.3'/%3E%3Cpath d='M15 9l-3-3-3 3 3 3z' fill='%23f5cc5a'/%3E%3C/svg%3E") center / contain no-repeat; }
[data-theme="newyear"] :is(.title, .tag, .home .dim) { text-shadow: 0 2px 10px rgba(0, 0, 0, .8); }

/* Head to Head tiles: jewels set in gold, with a deco sunburst fanning from the corner */
[data-theme="newyear"] .topic { position: relative; overflow: hidden; color: #fff; border: 2px solid #d9a63c;
  background:
    radial-gradient(140% 110% at 25% 0%, color-mix(in srgb, var(--sc) 70%, #fff) 0%, var(--sc) 42%, color-mix(in srgb, var(--sc) 42%, #000) 100%);
  outline: 1px solid rgba(255, 230, 160, .45); outline-offset: -6px;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .45), 0 5px 0 #6e4b10, 0 12px 18px -8px rgba(0, 0, 0, .8); }
[data-theme="newyear"] .topic::after { content: ''; position: absolute; right: -1.6rem; bottom: -1.6rem; width: 5.2rem; height: 5.2rem; pointer-events: none;
  border-radius: 50%; opacity: .5;
  background: repeating-conic-gradient(from 270deg, rgba(255, 220, 140, .65) 0 4deg, transparent 4deg 12deg),
    radial-gradient(circle, transparent 0 28%, rgba(255, 220, 140, .0) 28%);
  -webkit-mask: radial-gradient(circle, transparent 0 24%, #000 25% 70%, transparent 71%); mask: radial-gradient(circle, transparent 0 24%, #000 25% 70%, transparent 71%); }
[data-theme="newyear"] .topic :is(span, small) { position: relative; z-index: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
[data-theme="newyear"] .topic small { color: rgba(255, 248, 230, .9); }
html[data-theme="newyear"] .topic .tic { box-shadow: 0 0 0 2px #e9b543, 0 3px 6px rgba(0, 0, 0, .4); }
[data-theme="newyear"] .topic:active { transform: translateY(3px); }

/* bottom bar: black lacquer under a gold rail with deco diamonds */
[data-theme="newyear"] #tabbar { border-top: 0; }
[data-theme="newyear"] #tabbar::before { content: ''; position: absolute; left: 0; right: 0; top: -3px; height: 6px; pointer-events: none; z-index: 1;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 6'%3E%3Cpath d='M12 0l3 3-3 3-3-3z' fill='%23fff0b0' stroke='%235a3a08' stroke-width='.6'/%3E%3C/svg%3E") 0 0 / 24px 6px repeat-x,
    linear-gradient(180deg, transparent 1.5px, #f5cc5a 1.5px, #a8721a 4.5px, transparent 4.5px); }
[data-theme="newyear"] #tabbar button.homebtn::before { box-shadow: 0 -1.5px 0 #e9b543, 0 -8px 14px -6px rgba(0, 0, 0, .5); }

/* ---- --tb-* colours for the bottom-bar icons: gold, champagne, black lacquer, rose gold, ruby and emerald
   (html[…] so they beat theme-3d.css's :root defaults, which load later) ---- */
html[data-theme="newyear"] { --d3: .62;
  --tb-blue-1: #ffe9a6; --tb-blue-2: #d0951c; --tb-pink-1: #ffc9b8; --tb-pink-2: #c9604a;
  --tb-green-1: #8ff0c4; --tb-green-2: #17895c; --tb-gold-1: #fff0a8; --tb-gold-2: #d99b17;
  --tb-purple-1: #6a5d7a; --tb-purple-2: #1d1724; --tb-red-1: #ff9aa8; --tb-red-2: #b3203a;
  --tb-cream-1: #fffaf0; --tb-cream-2: #e6d3a8; --tb-orange-1: #f6dcae; --tb-orange-2: #9c6a2a;
  --tb-brown-1: #8a6a3a; --tb-brown-2: #4a3418; }

/* ---- Style items ---- */
/* chat bubble "Champagne Fizz": pale champagne with rising bubbles and a gold edge */
html body .bubble.bub-ny.bub-ny { color: #2e1f02; border-color: #c08a24;
  background:
    radial-gradient(circle at 12% 78%, rgba(255, 255, 255, .85) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 22% 40%, rgba(255, 255, 255, .7) 0 1.1px, transparent 1.6px),
    radial-gradient(circle at 86% 30%, rgba(255, 255, 255, .8) 0 1.4px, transparent 2px),
    radial-gradient(circle at 93% 70%, rgba(255, 255, 255, .6) 0 1px, transparent 1.5px),
    linear-gradient(180deg, #fff7dc, #f6dc95 55%, #e8bd5a); }
html body .bubble.bub-ny.bub-ny small { color: #5a3e06; opacity: .8; }

/* answer buttons "Midnight Deco": black lacquer framed in gold, the answer's colour glowing up from below,
   a deco fan behind the letter and the letter on a gold-rimmed jewel */
body.btns-ny .abtn, .btns-ny-demo {
  background: radial-gradient(120% 70% at 50% 110%, color-mix(in srgb, var(--c) 75%, transparent), transparent 70%),
    repeating-conic-gradient(from -60deg at 50% 0%, rgba(233, 181, 67, .14) 0 5deg, transparent 5deg 15deg),
    linear-gradient(180deg, #1d1822, #0b090e) !important;
  color: #fdf6e6 !important; border: 2px solid #e2ad45 !important; border-radius: 12px !important;
  outline: 1px solid rgba(255, 225, 150, .45); outline-offset: -6px;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, .35), 0 5px 0 #6e4b10, 0 10px 16px -6px rgba(0, 0, 0, .6) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
body.btns-ny .abtn .badge { box-shadow: 0 0 0 2px #f2c55a, 0 2px 5px rgba(0, 0, 0, .5); color: #fff; }
body.btns-ny .abtn:active { box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5), 0 1px 0 #6e4b10 !important; }
.btns-ny-demo { outline-offset: -4px; }

@media (prefers-reduced-motion: reduce) {
  [data-theme="newyear"] .scene *, [data-theme="newyear"] .scene *::before, [data-theme="newyear"] .scene *::after,
  [data-theme="newyear"] .logo .l2, [data-theme="newyear"] .btn { animation: none !important; }
  .scene :is(.ny-fw, .ny-conf, .ny-streamer, .ny-balloon) { display: none; }
}
