/* Cabinet controls and shared score strip. Each playfield has its own palette. */
.trail-game {
  --trail-accent: #edcb87;
  --trail-edge: #63516d;
  padding: clamp(16px, 3vw, 30px);
  color: #f8f3f1;
  background: #17121e;
}
.trail-game * { box-sizing: border-box; }
.trail-game button, .trail-game input, .trail-game label { touch-action: manipulation; }
.trail-game button:focus-visible, .trail-game [tabindex]:focus-visible, .trail-game input:focus-visible {
  outline: 3px solid #ffe0a1; outline-offset: 3px;
}
.trail-game button:disabled { cursor: default; }
.trail-game [hidden] { display: none !important; }
.trail-hud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--trail-edge); }
.trail-hud > div { padding: 8px 12px; }
.trail-hud > div + div { border-left: 1px solid var(--trail-edge); }
.trail-hud small, .river-title span, .forge-piece > span, .beacon-display > [data-phase] {
  display: block; font: 700 10px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--trail-accent);
}
.trail-hud strong { display: block; font: 700 clamp(20px, 3vw, 29px)/1.1 var(--display); font-variant-numeric: tabular-nums; }
.trail-game .trail-instructions, .trail-game .trail-note { color: #d7cadb; font: 400 13px/1.55 var(--sans); margin: 14px 0; }
.trail-game .trail-note { font-size: 12px; }
.trail-game .trail-status { margin: 12px 0; font-size: 13px; line-height: 1.5; color: #e7d8c4; min-height: 1.5em; }
.trail-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 15px; margin-top: 13px; }
.trail-main, .trail-secondary {
  min-height: 43px; padding: 9px 15px; border-radius: 4px; border: 1px solid var(--trail-accent);
  background: var(--trail-accent); color: #211829; font: 700 13px/1.3 var(--sans); cursor: pointer;
}
.trail-secondary { background: transparent; color: var(--trail-accent); }
.trail-main:hover:not(:disabled), .trail-secondary:hover:not(:disabled) { filter: brightness(1.12); }
.trail-main:disabled, .trail-secondary:disabled { opacity: .55; }
.beacon-manual { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: 12px; }
.beacon-manual input { width: 16px; height: 16px; accent-color: var(--trail-accent); }

/* Four keys form a playable rune instrument. */
.beacon-game { --trail-accent: #e4c1ff; --trail-edge: #58455f; }
.beacon-instrument { background: #20182b; border: 1px solid #70597c; border-radius: 14px; padding: clamp(10px, 2vw, 18px); box-shadow: inset 0 0 0 4px #15101c; }
.beacon-display { padding: 12px 8px; border: 1px solid #4f445e; border-radius: 8px; text-align: center; background: radial-gradient(ellipse at 50% 90%,#35273d,#14121e 76%); }
.beacon-display > [data-phase] { margin: 0; color: #d4b4e8; }
.beacon-symbol { display: block; font: 400 42px/1.1 Georgia, serif; color: #ffe0aa; min-height: 1.1em; }
.beacon-display > [data-signal] { margin: 3px 0 9px; min-height: 1.5em; color: #e8dfec; font-size: 13px; }
.beacon-track { display: flex; justify-content: center; gap: 5px; }
.beacon-track i { width: 15px; height: 4px; background: #5b5065; }
.beacon-track i.lit { background: #ffd899; }
.beacon-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 11px 2px 2px; }
.beacon-key {
  --rune: #f7d48a; display: grid; position: relative; place-items: center; align-content: center; gap: 3px;
  min-height: 91px; padding: 6px 3px; border: 1px solid color-mix(in srgb,var(--rune) 55%,transparent);
  background: linear-gradient(150deg,color-mix(in srgb,var(--rune) 12%,#18141c),#18141c); color: var(--rune); border-radius: 6px; cursor: pointer;
}
.beacon-key.tide { --rune: #9eddf5; }
.beacon-key.leaf { --rune: #b3dfac; }
.beacon-key.star { --rune: #d1b0fb; }
.beacon-key i { font: 400 35px/1 Georgia,serif; }
.beacon-key span { font: 700 11px/1.4 var(--sans); }
.beacon-key kbd { position: absolute; right: 5px; top: 3px; font-size: 9px; opacity: .85; }
.beacon-key.lit, .beacon-key:hover:not(:disabled) { background: var(--rune); color: #18141d; border-color: var(--rune); box-shadow: 0 0 13px color-mix(in srgb,var(--rune) 32%,transparent); }

/* The pads are a forecast of the next turn; the traveler is a solid diamond. */
.river-game { --trail-accent: #9fe4cb; --trail-edge: #38555b; background: #131d24; }
.river-chart { background: #152c31; border: 1px solid #58787b; border-radius: 9px; overflow: hidden; }
.river-title { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 13px; background: #21393b; }
.river-title strong { font: 650 20px/1.1 var(--display); }
.river-title span { color: #bcdfd9; }
.river-board { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); padding: 3px; gap: 2px; background: #214047; }
.river-board:focus-visible { outline-offset: -3px !important; }
.river-tile { position: relative; display: grid; place-items: center; user-select: none; cursor: pointer; height: clamp(25px, 4.75vh, 46px); background-color: #214956; }
.river-water, .river-pad { background-image: repeating-linear-gradient(165deg,transparent 0 12px,#aedddc12 13px,transparent 14px 26px); }
.river-bank { background: repeating-linear-gradient(115deg,#60583e 0 2px,#4d513b 3px 15px); }
.river-tile i { display: block; width: min(52%, 34px); height: 51%; background: radial-gradient(ellipse at 38% 35%,#a7c997,#6e9c83); border: 1px solid #bde0a7; border-radius: 60% 45% 55% 42%; transform: rotate(-12deg); box-shadow: 0 2px 0 #183638; }
.river-tile i::after { content: ""; position: absolute; inset: 42% 0 auto 43%; height: 1px; background: #355c59; }
.river-tile em { position: absolute; right: 8%; top: 0; color: #ffe29a; font: bold 17px/1.1 Georgia,serif; text-shadow: 0 1px 3px #28252a; }
.river-here { outline: 2px solid #f4d493; outline-offset: -2px; }
.river-here b { display: grid; place-items: center; position: absolute; width: 22px; height: 22px; font-size: 14px; line-height: 1; border-radius: 50%; background: #27212a; color: #ffe09b; border: 1px solid #f8d685; }
.river-legend { display: flex; flex-wrap: wrap; gap: 12px; color: #c1cec9; margin-top: 6px; font-size: 11px; }
.river-controls { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; }
.river-controls button { border: 1px solid #648481; background: #20373d; color: #e9f4ed; border-radius: 5px; padding: 5px; cursor: pointer; min-height: 45px; }
.river-controls button:hover:not(:disabled) { background: #315355; border-color: #bde1cb; }
.river-controls b, .river-controls span { display: block; line-height: 1.2; }
.river-controls b { font-size: 17px; }
.river-controls span { font-size: 10px; }
.river-controls button:disabled { opacity: .45; }
.river-game [data-next] { margin-top: 10px; }

/* The crown is forged piece by piece over a measured, aimable track. */
.forge-game { --trail-accent: #f5bd84; --trail-edge: #685049; background: #20191d; }
.forge-bench { position: relative; background: radial-gradient(ellipse at 50% 56%,#553635,#221c22 70%); border: 1px solid #84614e; border-radius: 8px; padding: clamp(15px, 3vw, 27px); overflow: hidden; }
.forge-piece { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.forge-piece > span { color: #f1cfaa; }
.forge-sockets { display: flex; gap: 4px; }
.forge-sockets i { display: inline-block; width: 8px; height: 8px; border: 1px solid #957263; transform: rotate(45deg); }
.forge-sockets i.struck { background: #f3bc70; border-color: #f9ce82; }
.forge-sockets i.cold { background: #927785; }
.forge-crown { position: relative; width: 91px; height: 56px; margin: 13px auto 16px; }
.forge-crown i { position: absolute; inset: 0; clip-path: polygon(0 22%,30% 49%,49% 2%,69% 49%,100% 22%,88% 90%,12% 90%); background: linear-gradient(135deg,#a86436,#f7cf8b 50%,#9f603d); }
.forge-crown::after { content:""; position:absolute; bottom:0; height:3px; left:12%; right:12%; background:#f1ba74; }
.forge-crown b { position:absolute; color:#593a41; left:44%; top:42%; font-size:14px; }
.forge-meter { position: relative; height: 34px; border: 1px solid #917566; border-radius: 4px; background: repeating-linear-gradient(90deg,#24202a 0 calc(10% - 1px),#7b6360 calc(10% - 1px) 10%); }
.forge-target { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg,#eabc7699 0 4px,#eabc76b8 5px 9px); border-inline: 1px solid #ffd187; }
.forge-target::after { content: ""; position: absolute; inset: 2px 49%; background: #ffe6ac; }
.forge-marker { position: absolute; inset-block: -5px; width: 3px; background: white; outline: 1px solid #463a43; box-shadow: 0 0 8px #fff6; }
.forge-marker::before { content: ""; position: absolute; top: -4px; left: -4px; border: 6px solid transparent; border-top-color: #fff3d6; }
.forge-bench.stationary .forge-marker { display: none; }
.forge-bench.stationary.on-target .forge-target { background: #ffe0a2; }
.forge-numbers { display: flex; align-items: center; justify-content: space-between; font-variant-numeric: tabular-nums; font-size: 11px; color:#ddc5b7; margin-top:10px; }
.forge-numbers strong { color:#ffe2ae; min-height:1.5em; }
.forge-bench > p { margin: 8px 0 0; text-align: center; color: #ebd7c4; font: 600 12px/1.5 var(--sans); }
@media(max-width:420px) {
  .trail-game { padding: 14px 12px 18px; }
  .trail-hud > div { padding: 7px 8px; }
  .beacon-keys { gap: 4px; }
  .beacon-key { min-height: 74px; }
  .beacon-key i { font-size: 29px; }
  .trail-toolbar { gap: 7px; }
  .trail-main, .trail-secondary { padding-inline: 11px; }
}
@media(forced-colors:active) {
  .beacon-key.lit, .river-here, .forge-target { outline: 3px solid Highlight; }
  .river-pad i, .river-here b, .forge-marker, .forge-sockets i.struck { background: Highlight; }
}
