/* The instruments are printed on the same cream stock as the title illustration.
   The fine marks are static. They never sit between the rider and the snow. */
:root {
  --print-paper: #ffedc8;
  --print-ink: #183e42;
  --print-green: #174e49;
  --print-vermilion: #a63f41;
  --print-ochre: #ecc47c;
  --print-fleck: radial-gradient(ellipse at 2px 2px, #69462b18 0 .65px, transparent .95px) 0 0 / 8px 11px;
  --print-cut: repeating-linear-gradient(137deg, transparent 0 4px, #ffdf9220 4px 5px, transparent 6px 10px);
}

#hud { --trail-ink: #225753; --trail-edge: #e5b363; --trail-paper: #ffedcb; }
#hud[data-region=woods] { --trail-ink: #28574e; --trail-edge: #c9c875; --trail-paper: #f4efd1; }
#hud[data-region=summit] { --trail-ink: #403e68; --trail-edge: #bcb9ed; --trail-paper: #f3e8d9; }
#hud[data-region=starlight] { --trail-ink: #573754; --trail-edge: #f3ab7f; --trail-paper: #ffe7cd; }

.is-playing .hud-top .clock, .is-playing .hud-top .score {
  color: var(--trail-ink);
  background: var(--print-fleck), var(--trail-paper);
  border: 2px solid var(--trail-ink);
  border-radius: 38% 34% 22% 18% / 18% 15% 14% 13%;
  box-shadow: inset 0 0 0 1px var(--trail-edge), 1px 2px 0 var(--trail-ink);
  text-align: center;
}
.is-playing .hud-top .clock strong, .is-playing .hud-top .score strong {
  font-weight: bold;
  letter-spacing: -.065em;
  font-variant-numeric: tabular-nums;
}
.is-playing .hud-top .clock small, .is-playing .hud-top .score small { color: inherit; font-weight: 750; }
.is-playing .hud-top .clock.is-urgent, .is-playing .hud-top .score.is-braking {
  color: #fff2cb; background: var(--print-cut), #8a3438; border-color: #5e3334;
  box-shadow: inset 0 0 0 1px var(--print-ochre), 1px 2px 0 #552e34;
}
.is-playing .hud-top .mission, .is-playing .cargo, .is-playing .standings {
  background: linear-gradient(95deg, #f5cf8018, transparent 18% 83%, #10282a25), var(--trail-ink);
  color: #fff1d1; border: 1px solid #edd098; outline: 1px solid var(--trail-ink);
  box-shadow: 2px 2px 0 #1c343c; border-radius: 4px 12px 5px 10px;
}
.is-playing .hud-top .mission { border-inline: 4px double var(--trail-edge); }
#hud[data-mode=race] .mission {
  background: linear-gradient(90deg, transparent 5px, var(--trail-ink) 5px calc(100% - 5px), transparent calc(100% - 5px)),
    repeating-conic-gradient(var(--trail-edge) 0 25%, var(--trail-ink) 0 50%) 0 0 / 6px 6px;
  border-inline: 1px solid var(--trail-edge);
}
.is-playing .mission small { color: #ffe3a2; }
.is-playing .standings .is-you { color: #ffdc91; }
.is-playing .cargo.is-splashed { background: #754137; }
.is-playing .cargo.is-brewing { border-color: #ffd873; }

.is-playing .target {
  color: #23413c; background: var(--print-fleck), #fff0d1;
  border: 1px solid #ad8254; border-left: 4px solid var(--trail-ink);
  border-radius: 2px 11px 3px 8px; box-shadow: 1px 2px 0 #5b483d;
}
.is-playing #target-arrow {
  display: grid; place-items: center; position: relative;
  min-height: 24px; line-height: 1; font-weight: 750; color: var(--trail-ink);
}
.is-playing .target:not(.race-target)[data-cue=guide] #target-arrow[data-portrait]:not([data-portrait=""]) {
  align-self: center; justify-self: center; width: 28px; height: 28px; color: transparent;
  background-image: url('./art/recipient-portraits.webp'); background-size: 700% 400%;
  background-repeat: no-repeat;
}
.is-playing .target[data-cue=ready] { color: #254639; background: var(--print-fleck), #f4edba; border-left-color: #367454; }
.is-playing .target:is([data-cue=slow], [data-cue=ramp-ahead], [data-cue=jump]) { background: var(--print-fleck), #ffe5ae; border-left-color: #b45b39; }
.is-playing .target:is([data-cue=shortcut], [data-cue=shortcut-ahead]) { background: var(--print-fleck), #e2efd0; border-left-color: #418674; }
.is-playing .target[data-cue=align] { background: var(--print-fleck), #e9edcb; }

.is-playing .top-actions button, .is-playing #greetings button {
  color: var(--print-paper); background: var(--print-green); border: 1px solid #edd3a0;
  border-radius: 20px 16px 15px 13px; box-shadow: 1px 2px 0 var(--print-ink);
}
.controls .steering button, .controls .quick-actions button, .controls .steady, .controls .serve {
  color: var(--print-ink); background: var(--print-fleck), var(--print-paper);
  border: 2px solid var(--print-ink);
  box-shadow: inset 0 0 0 1px #dcba83, 1px 2px 0 var(--print-vermilion), 2px 3px 0 var(--print-ink);
}
.controls .steering button {
  display: grid; place-items: center; position: relative; color: transparent;
  border-radius: 45% 21% 24% 38% / 33% 21% 27% 32%; font-size: 0;
}
.controls .steering :is(#left, #right) { position: relative; }
.controls .steering #right { border-radius: 21% 45% 38% 24% / 21% 33% 32% 27%; }
.controls .steering button::before {
  content: ""; position: absolute; inset: 28% 23%;
  background: repeating-linear-gradient(139deg, transparent 0 8px, #ffda9d88 8px 9px, transparent 9px 14px), var(--print-green);
  clip-path: polygon(0 49%, 50% 0, 56% 29%, 98% 25%, 94% 68%, 54% 72%, 53% 100%);
  pointer-events: none;
}
.controls .steering #right::before { transform: scaleX(-1); }
.controls .quick-actions button { border-radius: 15px 22px 9px 10px; }
.controls .quick-actions button span, .controls .steady small { font-weight: 700; }
.controls .steady {
  color: var(--print-paper); background: var(--print-cut) left bottom / 100% 5px no-repeat, var(--print-green);
  border-color: #e6cc94; box-shadow: 1px 2px 0 var(--print-ink);
}
.controls .quick-actions button:disabled { color: #445653; background: #dfddcb; opacity: .75; }
.controls button.is-held, .controls button[aria-pressed=true], .controls .steering button:active {
  color: #fff5db; background: #984244; border-color: #ffdb9e; box-shadow: 1px 1px 0 var(--print-ink);
}
.controls .steering button:is(.is-held, :active)::before { background-color: var(--print-paper); }
.controls .serve[data-ready=true] { color: #3b3532; background: var(--print-fleck), #ffcf74; border-color: #6f4938; }
.is-playing .threat { background: var(--print-vermilion); border-color: var(--print-paper); box-shadow: 1px 2px 0 #492d36; }

.snow-dialog {
  --letterhead: url('./art/village.webp');
  isolation: isolate; color: var(--print-ink);
  border: 2px solid var(--print-ink); border-radius: 9px 15px 9px 7px;
  background: var(--print-fleck), #fff2d6;
  box-shadow: 3px 3px 0 #c65548, 6px 6px 0 #233e40, 0 14px 44px #0d253968;
}
.snow-dialog::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 auto; height: 78px; pointer-events: none;
  border-top: 4px solid var(--print-vermilion);
  background:
    linear-gradient(0deg, #fff2d6, transparent 58%),
    linear-gradient(90deg, #fff2d618, #fff2d6 21% 79%, #fff2d618),
    var(--letterhead) center 42% / cover no-repeat;
}
.snow-dialog::backdrop { background: #14353dcc; backdrop-filter: none; }
.snow-dialog:is(#cloud-save,#results) { --letterhead: url('./art/starlight.webp'); }
.snow-dialog:is(#passport,#story-book) { --letterhead: url('./art/summit.webp'); }
.snow-dialog:is(#route-plan,#pause-dialog) { --letterhead: url('./art/woods.webp'); }
.snow-dialog .eyebrow, .snow-dialog .hearth-masthead { color: #815233; }
.snow-dialog .close {
  color: var(--print-ink); background: #fff2d7; border: 1px solid #a18c68;
  border-radius: 49% 43% 45% 42%; box-shadow: 1px 1px 0 var(--print-ink);
}
.snow-dialog .primary {
  background: var(--print-cut) left center / 11px 100% no-repeat, var(--print-green);
  border: 1px solid #143f40; box-shadow: 2px 2px 0 var(--print-vermilion);
  border-radius: 6px 13px 7px 9px; color: #fff0cf;
}
.snow-dialog .setting-row { border-bottom: 1px dashed #b89c70; }
.snow-dialog .setting-row select { background: #f5e4ba; border-color: #ad946b; }
.snow-dialog .difficulty button[aria-pressed=true] { color: #fff0cb; background: var(--print-green); border-color: var(--print-green); }
.results-stats { border-block: 1px dashed #ae8a64; padding-block: 9px; }
.results-stats strong { color: var(--print-green); }
.results-stats small { color: #6e513b; }
.snow-dialog :is(button, a, select):focus-visible, #controls button:focus-visible, #target:focus-visible {
  outline: 3px solid #bb543f; outline-offset: 2px;
}
@media (max-width:700px), (max-height:520px) {
  .is-playing #target-arrow { min-height: 19px; }
  .is-playing .target:not(.race-target)[data-cue=guide] #target-arrow[data-portrait]:not([data-portrait=""]) { width: 22px; height: 22px; }
  .snow-dialog::before { height: 52px; }
}
@media (forced-colors:active) {
  .controls .steering button::before { background: ButtonText; forced-color-adjust: none; }
  .snow-dialog::before { display: none; }
}
