/* Grand Prix (id "grandprix", premium): a sunny motor-racing circuit on race day, cartoon and friendly (a dark app on a bright
   scene). The main straight in front sweeps round a hairpin with red-and-white kerbs, race cars zooming round it, the
   start/finish gantry with its five red lights, the pit garages, grandstands packed with colour, the podium and its gold trophy,
   a marshal's chequered flag waving, a blimp drifting over. The app: carbon-fibre cards under a chequered strip between red
   stripes, buttons in race colours with twin racing stripes and chequered corners, Head to Head tiles as livery panels with a
   chequered flag on the corner, a red-and-white kerb along the carbon bottom bar.
   The scene is SCENES.grandprix in theme-grandprix.js; its style items use the code "gp". No real teams, drivers or sponsors. */

:root {
  /* carbon fibre */
  --gp-carbon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Crect width='12' height='12' fill='%2315171c'/%3E%3Cg fill='%2322262e'%3E%3Crect x='0' y='0' width='6' height='3'/%3E%3Crect x='6' y='3' width='6' height='3'/%3E%3Crect x='0' y='6' width='6' height='3'/%3E%3Crect x='6' y='9' width='6' height='3'/%3E%3C/g%3E%3Cg fill='%231c1f26'%3E%3Crect x='6' y='0' width='3' height='3'/%3E%3Crect x='0' y='3' width='3' height='3'/%3E%3Crect x='6' y='6' width='3' height='3'/%3E%3Crect x='0' y='9' width='3' height='3'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.06'%3E%3Crect x='0' y='0' width='6' height='.8'/%3E%3Crect x='6' y='3' width='6' height='.8'/%3E%3Crect x='0' y='6' width='6' height='.8'/%3E%3Crect x='6' y='9' width='6' height='.8'/%3E%3C/g%3E%3C/svg%3E");
  /* across a card's top: a chequered strip between red stripes */
  --gp-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 16'%3E%3Crect x='1.500' y='2' width='117' height='12' rx='3' fill='%23e0262e' stroke='%231b1033' stroke-width='1.400'/%3E%3Crect x='4' y='4' width='112' height='8' fill='%23f6f6f2'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='8' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='12' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='16' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='20' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='24' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='28' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='32' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='36' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='40' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='44' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='48' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='52' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='56' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='60' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='64' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='68' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='72' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='76' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='80' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='84' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='88' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='92' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='96' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='100' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='104' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='108' y='4' width='4' height='4' fill='%2316171c'/%3E%3Crect x='112' y='4' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='4' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='8' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='12' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='16' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='20' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='24' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='28' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='32' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='36' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='40' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='44' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='48' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='52' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='56' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='60' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='64' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='68' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='72' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='76' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='80' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='84' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='88' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='92' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='96' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='100' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='104' y='8' width='4' height='4' fill='%2316171c'/%3E%3Crect x='108' y='8' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='112' y='8' width='4' height='4' fill='%2316171c'/%3E%3Cpath d='M4 4h112M4 12h112' stroke='%231b1033' stroke-width='.8'/%3E%3Cpath d='M3 3.300h114' stroke='%23ff8a8a' stroke-width='.9'/%3E%3C/svg%3E");
  /* the kerb along the top of the bottom bar */
  --gp-ridge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 18'%3E%3Cpath d='M0 4h96v14H0z' fill='%23f6f6f2'/%3E%3Cpath d='M0 6h12l-3 10H-3z' fill='%23e0262e'/%3E%3Cpath d='M12 6h12l-3 10H9z' fill='%23f6f6f2'/%3E%3Cpath d='M24 6h12l-3 10H21z' fill='%23e0262e'/%3E%3Cpath d='M36 6h12l-3 10H33z' fill='%23f6f6f2'/%3E%3Cpath d='M48 6h12l-3 10H45z' fill='%23e0262e'/%3E%3Cpath d='M60 6h12l-3 10H57z' fill='%23f6f6f2'/%3E%3Cpath d='M72 6h12l-3 10H69z' fill='%23e0262e'/%3E%3Cpath d='M84 6h12l-3 10H81z' fill='%23f6f6f2'/%3E%3Cpath d='M96 6h12l-3 10H93z' fill='%23e0262e'/%3E%3Cpath d='M0 6.500h96' stroke='%23ffffff' stroke-opacity='.6' stroke-width='1'/%3E%3Cpath d='M0 5h96' stroke='%231b1033' stroke-width='1.600'/%3E%3C/svg%3E");
  /* a chequered flag on its pole (a topic tile's top right) */
  --gp-crest: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 36'%3E%3Cpath d='M7 2l1.600 32' stroke='%231b1033' stroke-width='3.400' stroke-linecap='round'/%3E%3Cpath d='M7 2l1.600 32' stroke='%23c9ccd4' stroke-width='1.600' stroke-linecap='round'/%3E%3Cpath d='M8 3q4-2 8 0t8 0v16q-4 2-8 0t-8 0z' fill='%23f6f6f2'/%3E%3CclipPath id='f'%3E%3Cpath d='M8 3q4-2 8 0t8 0v16q-4 2-8 0t-8 0z'/%3E%3C/clipPath%3E%3Cg clip-path='url(%23f)'%3E%3Crect x='8' y='3' width='4' height='4' fill='%2316171c'/%3E%3Crect x='12' y='4.6' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='16' y='3' width='4' height='4' fill='%2316171c'/%3E%3Crect x='20' y='4.6' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='8' y='7' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='12' y='8.6' width='4' height='4' fill='%2316171c'/%3E%3Crect x='16' y='7' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='20' y='8.6' width='4' height='4' fill='%2316171c'/%3E%3Crect x='8' y='11' width='4' height='4' fill='%2316171c'/%3E%3Crect x='12' y='12.6' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='16' y='11' width='4' height='4' fill='%2316171c'/%3E%3Crect x='20' y='12.6' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='8' y='15' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='12' y='16.6' width='4' height='4' fill='%2316171c'/%3E%3Crect x='16' y='15' width='4' height='4' fill='%23f6f6f2'/%3E%3Crect x='20' y='16.6' width='4' height='4' fill='%2316171c'/%3E%3C/g%3E%3Cpath d='M8 3q4-2 8 0t8 0v16q-4 2-8 0t-8 0z' fill='none' stroke='%231b1033' stroke-width='1.300' stroke-linejoin='round'/%3E%3Ccircle cx='7' cy='2.200' r='1.800' fill='%23f5c518' stroke='%231b1033' stroke-width='.8'/%3E%3C/svg%3E");
  /* chequered corners on a main button, and the glint on them */
  --gp-corners-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg transform=''%3E%3Cg%3E%3Cpath d='M2.500 14V5q0-2.500 2.500-2.500h9' fill='none' stroke='%231b1033' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M2.500 14V5q0-2.500 2.500-2.500h9' fill='none' stroke='%23f6f6f2' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M2.500 5q0-2.500 2.500-2.500h3v3h-3v3h-2.500z' fill='%2316171c'/%3E%3Cpath d='M8 2.500h3v3H8zM2.500 8.500h3v3h-3z' fill='%2316171c' fill-opacity='.85'/%3E%3C/g%3E%3C/g%3E%3Cg transform='translate(40 0) scale(-1 1)'%3E%3Cg%3E%3Cpath d='M2.500 14V5q0-2.500 2.500-2.500h9' fill='none' stroke='%231b1033' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M2.500 14V5q0-2.500 2.500-2.500h9' fill='none' stroke='%23f6f6f2' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M2.500 5q0-2.500 2.500-2.500h3v3h-3v3h-2.500z' fill='%2316171c'/%3E%3Cpath d='M8 2.500h3v3H8zM2.500 8.500h3v3h-3z' fill='%2316171c' fill-opacity='.85'/%3E%3C/g%3E%3C/g%3E%3Cg transform='translate(0 40) scale(1 -1)'%3E%3Cg%3E%3Cpath d='M2.500 14V5q0-2.500 2.500-2.500h9' fill='none' stroke='%231b1033' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M2.500 14V5q0-2.500 2.500-2.500h9' fill='none' stroke='%23f6f6f2' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M2.500 5q0-2.500 2.500-2.500h3v3h-3v3h-2.500z' fill='%2316171c'/%3E%3Cpath d='M8 2.500h3v3H8zM2.500 8.500h3v3h-3z' fill='%2316171c' fill-opacity='.85'/%3E%3C/g%3E%3C/g%3E%3Cg transform='translate(40 40) scale(-1 -1)'%3E%3Cg%3E%3Cpath d='M2.500 14V5q0-2.500 2.500-2.500h9' fill='none' stroke='%231b1033' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M2.500 14V5q0-2.500 2.500-2.500h9' fill='none' stroke='%23f6f6f2' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M2.500 5q0-2.500 2.500-2.500h3v3h-3v3h-2.500z' fill='%2316171c'/%3E%3Cpath d='M8 2.500h3v3H8zM2.500 8.500h3v3h-3z' fill='%2316171c' fill-opacity='.85'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --gp-corners-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg transform=''%3E%3Cpath d='M4 3.400h3' stroke='%23fff' stroke-width='.9' stroke-linecap='round'/%3E%3Ccircle cx='9' cy='2.400' r='.7' fill='%23fff'/%3E%3C/g%3E%3Cg transform='translate(40 0) scale(-1 1)'%3E%3Cpath d='M4 3.400h3' stroke='%23fff' stroke-width='.9' stroke-linecap='round'/%3E%3Ccircle cx='9' cy='2.400' r='.7' fill='%23fff'/%3E%3C/g%3E%3Cg transform='translate(0 40) scale(1 -1)'%3E%3Cpath d='M4 3.400h3' stroke='%23fff' stroke-width='.9' stroke-linecap='round'/%3E%3Ccircle cx='9' cy='2.400' r='.7' fill='%23fff'/%3E%3C/g%3E%3Cg transform='translate(40 40) scale(-1 -1)'%3E%3Cpath d='M4 3.400h3' stroke='%23fff' stroke-width='.9' stroke-linecap='round'/%3E%3Ccircle cx='9' cy='2.400' r='.7' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E");
  --gp-cheq: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Crect width='8' height='8' fill='%23f6f6f2'/%3E%3Crect width='4' height='4' fill='%2316171c'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%2316171c'/%3E%3C/svg%3E");
}

/* ---- colours ---- */
[data-theme="grandprix"] {
  --bg-0: #0c0f15; --bg-1: #141922; --bg-2: #1e2430;
  --card: rgba(22, 25, 32, .96); --card-2: rgba(255, 255, 255, .07); --panel-edge: rgba(224, 38, 46, .65);
  --ink: #f6f6f2; --ink-dim: #c3c9d6; --on-hot: #ffffff;
  --hot: #e0262e; --cool: #1f6fd6; --amber: #ff8a1f; --gold: #f5c518; --good: #3fd66f; --bad: #ff5a4a; --seen: #8fd0ff;
  --title-1: #ffffff; --title-2: #f5c518;
  --mine: rgba(224, 38, 46, .3); --mine-edge: rgba(245, 197, 24, .8); --fact-bg: rgba(31, 111, 214, .18); --fact-edge: rgba(143, 208, 255, .5);
  --shadow: 0 8px 24px rgba(0, 0, 0, .55);
  --scrim: rgba(6, 8, 14, .72); --off: rgba(246, 246, 242, .18); --press: rgba(0, 0, 0, .32);
  /* the livery panels' colours */
  --s-general: #e0262e; --s-geography: #1f9a6a; --s-history: #b8742a; --s-science: #1f6fd6;
  --s-nature: #3f9a3a; --s-music: #8a4fd8; --s-film_tv: #3a4ab8; --s-sport: #ff8a1f;
  --s-arts_lit: #d8327a; --s-food: #c8582a; --s-tech_games: #13a0c0; --s-words: #6a8a2a;
  /* bottom-bar icon colours (look3d.js TAB_ICONS): race blue, red, green, gold, purple, red, white, orange, tyre */
  --tb-blue-1: #9fd0ff; --tb-blue-2: #1f6fd6; --tb-pink-1: #ffb0b4; --tb-pink-2: #e0262e; --tb-green-1: #b8f0b0; --tb-green-2: #2fa84f;
  --tb-gold-1: #fff0a0; --tb-gold-2: #e0a800; --tb-purple-1: #dcc8ff; --tb-purple-2: #8a4fd8; --tb-red-1: #ffa0a0; --tb-red-2: #c81e26;
  --tb-cream-1: #ffffff; --tb-cream-2: #c9ccd4; --tb-orange-1: #ffd08a; --tb-orange-2: #ff8a1f; --tb-brown-1: #6a6f7a; --tb-brown-2: #23262e;
}
[data-theme="grandprix"] #splash { background: linear-gradient(#3d9be6, #8fd0f6 46%, #5cb544 54%, #2f7a2a); }

/* ---- the scene ---- */
[data-theme="grandprix"] #stage-bg { background: #8fd0f6; }
.gp-scene { position: absolute; inset: 0; overflow: hidden; --b: calc(var(--tabh) + env(safe-area-inset-bottom)); pointer-events: none; }
.gp-scene img { display: block; -webkit-user-drag: none; }
/* the sky: a deep summer blue fading to haze at the horizon, the sun high on the right, clouds drifting */
.gp-sky { position: absolute; inset: 0; background: radial-gradient(22% 16% at 84% 10%, rgba(255, 252, 220, .95), rgba(255, 246, 190, .35) 45%, transparent 72%),
  linear-gradient(#2f8fe0, #5cb0ee 30%, #a6dcf8 52%, #d6f0fb 60%, #8fcf6a 61%, #5cb544); }
.gp-cloud { position: absolute; width: 34%; aspect-ratio: 3 / 1; border-radius: 50%; opacity: .92;
  background: radial-gradient(40% 70% at 30% 62%, #fff 60%, transparent 62%), radial-gradient(34% 80% at 55% 45%, #fff 60%, transparent 62%), radial-gradient(30% 60% at 76% 66%, #fff 60%, transparent 62%), radial-gradient(70% 30% at 52% 82%, #eaf4fb 60%, transparent 62%);
  filter: drop-shadow(0 4px 0 rgba(150, 190, 220, .45)); animation: gp-cloud linear infinite; }
@keyframes gp-cloud { from { transform: translateX(-40vw); } to { transform: translateX(140vw); } }
.gp-ground { position: absolute; left: 0; right: 0; bottom: 0; height: var(--b); background: linear-gradient(#5cb544, #3f8f30); }
/* one sheet in world units, as tall as the space above the bottom bar, centred; every piece is placed in it by percent */
.gp-world { position: absolute; left: 50%; bottom: var(--b); height: calc(100% - var(--b)); aspect-ratio: 880 / 660; transform: translateX(-50%); }
.gp-world > * { position: absolute; }
.gp-layer { max-width: none; }
/* the crowd, bobbing as they cheer; camera flashes going off; the trophy glinting */
.gp-crowd { animation: gp-cheer 1.1s steps(2, jump-none) infinite; }
@keyframes gp-cheer { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.35%); } }
.gp-flash { mix-blend-mode: screen; animation: gp-flash 2.300s steps(1) infinite; }
@keyframes gp-flash { 0% { opacity: .15; } 20% { opacity: 1; } 26% { opacity: .2; } 55% { opacity: .85; } 60% { opacity: .1; } 80% { opacity: .6; } }
/* the start lights: on one by one, a moment's hold, then all out together (and round again) */
.gp-lamp { mix-blend-mode: screen; opacity: 0; animation: 7s steps(1) infinite; }
.gp-lamp.i0 { animation-name: gp-l0; } .gp-lamp.i1 { animation-name: gp-l1; } .gp-lamp.i2 { animation-name: gp-l2; } .gp-lamp.i3 { animation-name: gp-l3; } .gp-lamp.i4 { animation-name: gp-l4; }
@keyframes gp-l0 { 0% { opacity: 0; } 10% { opacity: 1; } 62% { opacity: 0; } }
@keyframes gp-l1 { 0% { opacity: 0; } 20% { opacity: 1; } 62% { opacity: 0; } }
@keyframes gp-l2 { 0% { opacity: 0; } 30% { opacity: 1; } 62% { opacity: 0; } }
@keyframes gp-l3 { 0% { opacity: 0; } 40% { opacity: 1; } 62% { opacity: 0; } }
@keyframes gp-l4 { 0% { opacity: 0; } 50% { opacity: 1; } 62% { opacity: 0; } }
/* a picture strip of N frames: the flags waving played by steps; the cars' strips are turned by hand (one frame per heading) */
.gp-reel { display: block; width: 100%; height: 100%; background-repeat: no-repeat; background-size: calc(var(--n) * 100%) 100%; animation: gp-reel var(--t, 1s) steps(var(--n), jump-none) infinite; }
@keyframes gp-reel { from { background-position-x: 0%; } to { background-position-x: 100%; } }
.gp-car { left: 0; top: 0; will-change: transform; }
.gp-car i { display: block; width: 100%; height: 100%; background-repeat: no-repeat; background-size: 1600% 100%; }
.gp-car::before { content: ''; position: absolute; left: 14%; right: 14%; top: 66%; height: 22%; border-radius: 50%; background: rgba(10, 30, 10, .35); z-index: -1; }
.gp-car.p i { filter: hue-rotate(-60deg) saturate(1.1); }
/* the blimp, drifting over slowly, bobbing a little */
.gp-blimp { animation: gp-drift 150s linear infinite; }
.gp-blimp img { width: 100%; animation: gp-bob 7s ease-in-out infinite; }
@keyframes gp-drift { from { transform: translateX(-60vw); } to { transform: translateX(160vw); } }
@keyframes gp-bob { 50% { transform: translateY(8%) rotate(-1deg); } }
/* bits of paper streamers drifting down over the stands */
.gp-tape { inset: 0; overflow: hidden; }
.gp-tape i { position: absolute; width: 5px; height: 9px; border-radius: 1px; opacity: 0; animation: gp-tape 9s linear infinite; }
@keyframes gp-tape { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 10% { opacity: .9; } 90% { opacity: .8; } 100% { opacity: 0; transform: translate(var(--dx), 120px) rotate(540deg); } }

/* ---- the app ---- */
/* no stage spotlights here: it's broad daylight */
[data-theme="grandprix"] .hbeam { display: none; }
/* the title: "Party" in white with a red shadow, the second word in trophy gold, both with a thick dark edge */
[data-theme="grandprix"] .logo .l1 { color: #ffffff; text-shadow: 0 0 2px #1b1033, 0 2px 0 #1b1033, 3px 4px 0 #e0262e, 0 4px 12px rgba(0, 0, 0, .35); }
[data-theme="grandprix"] .logo .l2 { color: transparent; background: linear-gradient(180deg, #fffbe0 8%, #ffe45a 40%, #f5c518 55%, #b98a00 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(1.2px 0 0 #1b1033) drop-shadow(-1.2px 0 0 #1b1033) drop-shadow(0 1.2px 0 #1b1033) drop-shadow(0 -1.2px 0 #1b1033) drop-shadow(0 3px 0 #8a1218); }
[data-theme="grandprix"] :is(.logo .beta, .codechip, .bigcode, .me .pts, .pl .sc, .stat b, .rank .pt, .crumb, .agree a, .linkbtn) { color: #f5c518; }

/* main buttons: the race colour, glossy, twin white racing stripes on the slant, a carbon rim, chequered corners */
[data-theme="grandprix"] .btn:not(.ghost):not(.small) { position: relative; overflow: visible; }
:root[data-theme="grandprix"] .btn:not(.ghost) { border-radius: 9px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .22)),
    linear-gradient(105deg, transparent 76%, rgba(255, 255, 255, .85) 76% 79.5%, transparent 79.5% 82%, rgba(255, 255, 255, .85) 82% 85.5%, transparent 85.5%), var(--hot);
  box-shadow: inset 0 0 0 1.500px #1b1033, inset 0 0 0 4px #23262e, inset 0 0 0 5px rgba(255, 255, 255, .5), inset 0 0 0 6px rgba(27, 16, 51, .55), 0 5px 0 #0d0f14, 0 12px 18px -6px rgba(0, 0, 0, .55); }
[data-theme="grandprix"] .btn:not(.ghost):not(.small)::before, [data-theme="grandprix"] .btn:not(.ghost):not(.small)::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; box-sizing: border-box; background: none;
  border: 12px solid transparent; border-image: var(--gp-corners-a) 40% / 12px no-repeat; border-radius: 0; }
[data-theme="grandprix"] .btn:not(.ghost):not(.small)::after { border-image-source: var(--gp-corners-b); animation: gp-glint 3.600s ease-in-out infinite; }
@keyframes gp-glint { 50% { opacity: .2; } }

/* cards: carbon fibre in a red-edged rim, a chequered strip between red stripes across the top */
[data-theme="grandprix"] .panel { position: relative; margin-top: .6rem; }
:root[data-theme="grandprix"] :is(.panel, .sheetbox) { background: linear-gradient(160deg, rgba(255, 255, 255, .09), transparent 40%, rgba(0, 0, 0, .25)), var(--gp-carbon) 0 0 / 12px 12px, var(--card);
  box-shadow: inset 0 0 0 1.500px #e0262e, inset 0 0 0 4px #101217, inset 0 0 0 5px rgba(255, 255, 255, .22), 0 12px 24px -10px rgba(0, 0, 0, .65); }
[data-theme="grandprix"] .panel::before { content: ''; position: absolute; left: 6%; right: 6%; top: -.55rem; height: 1rem; pointer-events: none; z-index: 1;
  background: var(--gp-band) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }

/* Head to Head tiles: livery panels, each its own colour, a white racing stripe pair and a chequered band, a carbon rim, a flag on the corner */
[data-theme="grandprix"] .topic { position: relative; overflow: visible; border: 0; border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, .25)),
    linear-gradient(115deg, transparent 60%, rgba(255, 255, 255, .8) 60% 64%, transparent 64% 67%, rgba(255, 255, 255, .8) 67% 71%, transparent 71%),
    var(--gp-cheq) 0 100% / 8px 8px repeat-x, var(--sc);
  box-shadow: inset 0 0 0 2px #1b1033, inset 0 0 0 4.500px #23262e, inset 0 0 0 5.500px rgba(255, 255, 255, .45), inset 0 -8px 0 0 rgba(0, 0, 0, .0), 0 4px 0 #0d0f14, 0 9px 14px -6px rgba(0, 0, 0, .55); }
[data-theme="grandprix"] .topic::after { content: ''; position: absolute; top: -.5rem; right: .25rem; width: 1.05rem; height: 1.45rem; pointer-events: none; background: var(--gp-crest) center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
[data-theme="grandprix"] .topic span, [data-theme="grandprix"] .topic small { text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }

/* the bottom bar: carbon fibre, a red-and-white kerb along its top, the home button in race red */
[data-theme="grandprix"] #tabbar { overflow: visible; background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .25)), var(--gp-carbon) 0 0 / 12px 12px, #16181d; border-top: 2px solid #1b1033; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .12), 0 -8px 22px -8px rgba(0, 0, 0, .6); }
[data-theme="grandprix"] #tabbar::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 15px; pointer-events: none; background: var(--gp-ridge) 0 0 / 80px 15px repeat-x; }
[data-theme="grandprix"] #tabbar button.homebtn::before { background: linear-gradient(180deg, #ff4a50, #b81820); box-shadow: 0 -2px 0 #1b1033, 0 0 0 2px #ffffff inset, 0 -4px 16px rgba(224, 38, 46, .6); }
[data-theme="grandprix"] #tabbar button { color: #f6f6f2; text-shadow: 0 1px 2px rgba(0, 0, 0, .9); }
[data-theme="grandprix"] #tabbar button.on { color: #f5c518; }

/* ---- Grand Prix style items (code "gp") ---- */
/* the win celebration: chequered flags and confetti tumbling down (style-bundles.js draws them) */
.confetti.fx-gp i { position: absolute; top: -12%; width: calc(2.2rem * var(--s, 1)); height: auto; background: none; animation: fall 3.1s linear infinite; }
/* chat bubble "Pit Board": the black board held out over the pit wall, a yellow frame, white lettering */
html body .bubble.bub-gp.bub-gp { position: relative; color: #ffffff; border: 2px solid #1b1033; border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), transparent 40%), #17181d; box-shadow: inset 0 0 0 3px #f5c518, inset 0 0 0 4px #1b1033, 0 3px 6px rgba(0, 0, 0, .35); padding-left: .9rem; padding-right: .9rem; font-weight: 800; letter-spacing: .02em; }
html body .bubble.bub-gp.bub-gp small { color: #f5c518; opacity: 1; }

/* answer buttons "Racing Stripes": the answer's colour, twin white stripes on the slant, a carbon rim with a chequered foot */
body.btns-gp .abtn, .btns-gp-demo { position: relative; overflow: visible !important; color: #fff !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .8) !important; border: 2px solid #1b1033 !important; border-radius: 9px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .2)),
    linear-gradient(110deg, transparent 8%, rgba(255, 255, 255, .85) 8% 12%, transparent 12% 15%, rgba(255, 255, 255, .85) 15% 19%, transparent 19%), var(--c) !important;
  box-shadow: inset 0 0 0 2.500px #23262e, inset 0 0 0 3.500px rgba(255, 255, 255, .5), 0 5px 0 #0d0f14, 0 10px 14px -6px rgba(0, 0, 0, .5) !important; }
body.btns-gp .abtn::before, .btns-gp-demo::before { content: ''; position: absolute; left: 10px; right: 10px; bottom: 4px; top: auto; width: auto; height: 6px; z-index: 2; border: 0; border-radius: 0; opacity: .9; pointer-events: none;
  background: var(--gp-cheq) 0 0 / 6px 6px repeat-x; }
body.btns-gp .abtn::after { content: none; }
body.btns-gp .abtn:active { transform: translateY(4px); box-shadow: inset 0 0 0 2.500px #23262e, 0 1px 0 #0d0f14 !important; }
.btns-gp-demo { --c: #e0262e; }

@media (prefers-reduced-motion: reduce) {
  [data-theme="grandprix"] .gp-scene *, [data-theme="grandprix"] .btn::after { animation: none !important; }
  [data-theme="grandprix"] .gp-lamp { opacity: 1; }
}
