:root {
  color-scheme: light;
  --ink: #1c352b;
  --muted: #52675e;
  --line: #e3e8de;
  --paper: #fffefa;
  --page: #f6f7ee;
  --forest: #204f3b;
  --green: #34724e;
  --title: "Arial Rounded MT Bold", "Avenir Next", "Trebuchet MS", sans-serif;
  --font: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-inline-size: 300px; background: radial-gradient(ellipse at 95% 6%, #eef4dc, transparent 35%), var(--page); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #438c60; outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }

.brand { display: inline-flex; align-items: center; gap: 11px; font: 800 clamp(1.23rem, 2vw, 1.67rem)/1 var(--title); letter-spacing: -.055em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; background: #e4f0c8; border: 1px solid #dbe9ba; }
.brand-mark .frog-art { width: 35px; }
.brand-period { color: #699c4d; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.primary-button, .secondary-button, .icon-button, .quiet-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; font-size: .875rem; font-weight: 750; white-space: nowrap; }
.primary-button { min-height: 42px; padding: 0 15px; border: 1px solid #214733; background: var(--forest); color: #fffef6; box-shadow: 0 2px 0 #163a27; }
.primary-button:hover:not(:disabled) { background: #326248; }
.primary-button:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 #163a27; }
.primary-button:disabled { opacity: .45; box-shadow: none; }
.new-game-button span { font-size: 1.2rem; line-height: 0; font-weight: 600; }
.secondary-button { min-height: 42px; padding: 0 15px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.secondary-button:hover, .icon-button:hover, .quiet-button:hover { background: #eef3e7; }
.icon-button { width: 42px; height: 42px; background: var(--paper); border: 1px solid var(--line); color: var(--forest); padding: 0; }
.quiet-button { color: var(--forest); border: 0; background: transparent; min-height: 36px; padding: 0 9px; }
.help-icon { display: grid; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; width: 16px; height: 16px; font-size: .7rem; }
.speaker { width: 20px; height: 18px; position: relative; }
.speaker::before { content: ""; position: absolute; inset: 2px 9px 2px 0; background: currentColor; clip-path: polygon(0 31%, 37% 31%, 100% 0, 100% 100%, 37% 69%, 0 69%); }
.speaker i, .speaker i::before { position: absolute; border: 1.6px solid transparent; border-right-color: currentColor; border-radius: 50%; }
.speaker i { inset: 1px 1px 1px 5px; }
.speaker i::before { content: ""; inset: 2px 2px 2px 0; }
.speaker.muted i { border: 0; }
.speaker.muted i::before, .speaker.muted i::after { content: ""; position: absolute; inset: 7px 0 auto auto; width: 8px; height: 1.5px; transform: rotate(45deg); border: 0; border-radius: 2px; background: currentColor; }
.speaker.muted i::after { transform: rotate(-45deg); }

body { overflow: hidden; }
.arena { --hud-gap: clamp(12px, 1.7vw, 24px); position: relative; isolation: isolate; width: 100%; height: 100dvh; min-height: 300px; background: #12565d; overflow: hidden; }
.arena-header { position: absolute; z-index: 5; top: var(--hud-gap); left: var(--hud-gap); right: var(--hud-gap); display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none; }
.arena-header > * { pointer-events: auto; }
.arena-header .brand { color: #fffbed; padding: 6px 14px 6px 6px; background: #103f43e8; border: 1px solid #ffffff2e; border-radius: 13px; box-shadow: 0 5px 18px #082e3655; }
.arena-header .brand h1 { font: inherit; }
.arena-header .brand-period { color: #bbdb7b; }
.top-actions { border: 1px solid #fffef04a; border-radius: 13px; padding: 5px; background: #fffef3ee; box-shadow: 0 5px 18px #082e3655; }
.room-icon { font-size: 1rem; line-height: 1; }
.room-lobby .arena-dock { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
.room-lobby .arena-dock > .players-panel, .room-lobby .race-hud > button { display: none; }
.fullscreen-icon { width: 16px; height: 16px; background: conic-gradient(from 90deg at 2px 2px, transparent 90deg, currentColor 0) 0 0 / 7px 7px no-repeat, conic-gradient(from 180deg at calc(100% - 2px) 2px, transparent 90deg, currentColor 0) 100% 0 / 7px 7px no-repeat, conic-gradient(from 0deg at 2px calc(100% - 2px), transparent 90deg, currentColor 0) 0 100% / 7px 7px no-repeat, conic-gradient(from 270deg at calc(100% - 2px) calc(100% - 2px), transparent 90deg, currentColor 0) 100% 100% / 7px 7px no-repeat; }
.fullscreen-button[aria-pressed="true"] .fullscreen-icon { transform: rotate(180deg) scale(.78); }
@media (max-width: 760px), (hover: none) and (pointer: coarse), (max-width: 960px) and (max-height: 520px) {
  .top-actions .fullscreen-button { display: none; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.race-hud { position: absolute; z-index: 4; display: flex; align-items: center; gap: 7px; }
.race-hud { left: var(--hud-gap); top: calc(var(--hud-gap) + 67px); padding: 5px 6px 5px 10px; background: #fffef3ee; border: 1px solid #ffffff65; border-radius: 10px; box-shadow: 0 4px 16px #082e3650; }
.race-hud > button { min-height: 30px; }
.race-hud > .mobile-players { display: none; }
.panel { min-width: 0; border: 1px solid #ffffffcc; background: var(--paper); border-radius: 15px; box-shadow: 0 6px 28px #062f3f50; }
.panel h2 { font: 800 1.17rem/1.2 var(--title); letter-spacing: -.035em; }
.arena-dock { position: absolute; inset: auto var(--hud-gap) max(var(--hud-gap), env(safe-area-inset-bottom)); z-index: 4; display: grid; grid-template-columns: 292px minmax(0, 1fr); align-items: stretch; gap: 8px; max-width: 1250px; margin-inline: auto; pointer-events: none; }
.arena-dock > * { pointer-events: auto; }
.arena-dock .players-panel { padding: 3px 8px 6px; }
.arena-dock .players-panel .player-list { grid-auto-flow: column; grid-auto-columns: minmax(133px, 1fr); grid-template-columns: none; overflow-x: auto; gap: 6px; margin-top: 0; }
.arena-dock .player-card { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; column-gap: 5px; row-gap: 2px; padding: 4px 5px; }
.arena-dock .player-marker { width: 9px; height: 9px; }
.arena-dock .player-copy { display: contents; }
.arena-dock .player-copy > span { grid-area: 2 / 2 / 3 / 4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arena-dock .player-money { grid-area: 1 / 3; padding: 2px 4px; gap: 4px; }
.arena-dock .section-header .quiet-button { min-height: 28px; }
.players-title-button { font: inherit; min-height: 32px; margin-left: -5px; padding-inline: 5px; }
.arena > .board-footer { position: absolute; top: calc(var(--hud-gap) + 115px); left: var(--hud-gap); z-index: 4; min-height: 31px; width: max-content; max-width: min(590px, calc(100% - 2 * var(--hud-gap))); padding-block: 2px; border: 1px solid #ffffff65; border-radius: 10px; background: #fffef3ee; box-shadow: 0 4px 16px #082e3650; }
.arena > .board-footer .activity-icon { width: 24px; height: 24px; flex-basis: 24px; }
.arena > .board-footer #activity { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arena > .board-footer .log-button { min-height: 30px; }
.turn-panel:has(.pad-tray:not([hidden])) .turn-body { display: none; }

.board-stats { display: flex; align-items: center; gap: 12px; font-size: .875rem; font-weight: 750; white-space: nowrap; }
.leg-chip { display: inline-flex; align-items: center; line-height: 1.1; border-radius: 7px; padding: 6px 9px; color: #315b42; background: #edf4e6; }
.dice-status { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.leg-dice { display: flex; gap: 3px; }
.leg-die {
  position: relative; display: grid; place-items: center;
  width: 17px; height: 17px; border: 1px solid var(--dark); border-radius: 4px;
  background: linear-gradient(135deg, var(--light), var(--frog-color));
  color: var(--frog-ink); font-size: .64rem; font-weight: 850; line-height: 1;
  box-shadow: 0 1px 0 var(--dark);
}
.leg-die.spent { border-color: #c0c8be; background: #e4e9df; color: #627066; box-shadow: none; }
.leg-die.spent::after { content: ""; position: absolute; width: 120%; height: 1px; background: currentColor; transform: rotate(-45deg); }

.pond {
  position: absolute; inset: 0; isolation: isolate; container-type: inline-size;
  overflow: hidden; user-select: none; background: #1a8d91 url("./assets/pond.jpg") center 56% / cover no-repeat;
  box-shadow: inset 0 0 36px #044d5d2c;
}
#track-projection { position: absolute; inset: 0; pointer-events: none; }
.pond:not(.pond--3d) #track-projection { inset: var(--track-top, 135px) var(--hud-gap) var(--track-bottom, 145px); }
#track-line, #track-spaces, #frog-layer, .pond-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
#track-line, #frog-layer, #track-spaces { pointer-events: none; }
.pond-scene { display: none; }
.pond--3d .pond-scene { display: block; pointer-events: none; }
.pond--3d .space { width: max(27px, var(--projected-pad-width, 27px)); height: max(22px, var(--projected-pad-height, 22px)); }
.pond--3d .space .pad-number { color: #f9f0cc; background: #214b35eb; border: 1px solid #c5d98b; padding: 2px 6px; border-radius: 6px; text-shadow: none; font-size: .88rem; }
.pond--3d :is(.space--start, .space--finish) .pad-number { color: #335041; background: #fff0bc; bottom: -11%; }
.pond--3d #track-line, .pond--3d .pad-leaf, .pond--3d .finish-flag, .pond--3d .space:not(.drop-space) .pad-ripple { visibility: hidden; }
.space { position: absolute; display: grid; place-items: center; left: var(--x); top: var(--y); width: clamp(28px, 6.5cqw, 66px); height: clamp(22px, 4.85cqw, 49px); transform: translate(-50%, -50%); }
.drop-space { padding: 0; border: 0; background: none; border-radius: 50%; touch-action: manipulation; pointer-events: auto; }
.drop-space:disabled { pointer-events: none; }
.drop-space::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; }
.drop-space .pad-ripple { border: 1.5px dashed #fff4b6; box-shadow: 0 0 0 2px #28584b53; }
.drop-space:not(:disabled):is(:hover, :focus-visible, .drop-active) .pad-ripple { background: #fff5b957; border: 2px solid #fffadb; box-shadow: 0 0 0 3px #3e652a8c, 0 0 18px #fff396bd; }
.drop-space:focus-visible { outline-color: #fff4a4; }
.pad-ripple { position: absolute; inset: -12% -9% -16%; border-radius: 50%; border: 1px solid #b5eee252; box-shadow: 0 0 0 3px #86dbd717; }
.pad-leaf { position: absolute; inset: 0; transform: rotate(var(--angle)); border-radius: 50% 52% 48% 51%; overflow: hidden; background: #356c30; filter: drop-shadow(0 3px 2px #10393186); clip-path: polygon(0 0, 100% 0, 100% 31%, 66% 44%, 100% 68%, 100% 100%, 0 100%); }
.pad-leaf::before { content: ""; position: absolute; inset: 0 0 10%; border-radius: inherit; border: 1px solid #bcda75; background:
    repeating-conic-gradient(from 2deg at 62% 48%, transparent 0deg 36deg, #d4ed861f 38deg 40deg, transparent 42deg 58deg),
    radial-gradient(ellipse at 25% 20%, #a7ce5b, #7cae46 49%, #568734 100%);
  box-shadow: inset 0 0 0 2px #d2e99833;
}
.space:hover .pad-leaf::before { filter: brightness(1.13); }
.pad-number { position: relative; margin-top: -3px; pointer-events: none; text-align: center; font: 800 clamp(.72rem, 2.2cqw, 1.3rem)/1 var(--title); color: #1c411e; text-shadow: 0 1px #d0e59b76; }
.pond--3d .space > :is(.pad-number, .stack-count) { transition: opacity 200ms ease; }
.pond--3d:not([data-camera-view="overview"]) .space > :is(.pad-number, .stack-count) { opacity: 0; }
.space--start, .space--finish { width: clamp(47px, 10cqw, 100px); height: clamp(27px, 5.9cqw, 58px); }
.space--start .pad-leaf { transform: rotate(-12deg); }
.space--start .pad-leaf::before { background: radial-gradient(ellipse at 26% 12%, #bbdc73, #8fba48 50%, #659738); border-color: #e0e992; }
.space--start .pad-number, .space--finish .pad-number { position: absolute; z-index: 2; bottom: -23%; margin: 0; padding: 4px 9px; color: #2c5335; background: #fff2c2; border: 1px solid #e1cf85; border-radius: 6px; font: 850 clamp(.53rem, 1.28cqw, .74rem)/1 var(--font); letter-spacing: .09em; text-transform: uppercase; text-shadow: none; box-shadow: 0 2px 2px #163d3b42; }
.space--finish .pad-leaf { transform: rotate(0); clip-path: none; background: #8d6533; border-radius: 11px; box-shadow: inset 0 1px #ffffbd; }
.space--finish .pad-leaf::before { inset: 2px 2px 13%; border: 0; background: repeating-conic-gradient(#fbeecc 0% 25%, #2e503e 0% 50%) 0 0 / clamp(10px, 2.4cqw, 24px) clamp(10px, 2.4cqw, 24px); }
.finish-flag { position: absolute; z-index: 1; top: -63%; right: 4%; width: 3px; height: 78%; background: #ffebb5; border-radius: 3px; box-shadow: 1px 1px #705b3f; }
.finish-flag::after { content: ""; position: absolute; width: clamp(11px, 3cqw, 30px); height: 55%; margin-left: 3px; top: 8%; border-radius: 0 3px 3px 0; background: #f3ce69; clip-path: polygon(0 0,100% 0,79% 50%,100% 100%,0 100%); box-shadow: inset 2px 0 #c79140; }
.pad-effect { position: absolute; z-index: 3; top: -14%; right: -12%; display: flex; pointer-events: none; }
.pad-effect .pad-decal { width: clamp(17px, 3.5cqw, 34px); }
.stack-count { position: absolute; z-index: 3; padding: 3px 5px; border-radius: 6px; font-size: clamp(.56rem, 1.3cqw, .75rem); font-weight: 850; line-height: 1; white-space: nowrap; box-shadow: 0 1px 2px #163d3b42; }
.stack-count { right: 0; bottom: 3%; background: #f3f9d8; color: #35593a; }
.space--start .stack-count, .space--finish .stack-count { right: -9%; bottom: 35%; }
.pond--3d .space--track.space--occupied .pad-number { position: absolute; bottom: -8%; margin: 0; font-size: clamp(.66rem, 1.55cqw, .88rem); text-shadow: none; }
.pond--3d .pad-effect { display: none; }
.pond--3d .space:has(.pad-effect) .pad-number { position: absolute; bottom: -21%; margin: 0; }
.space--mud .pad-leaf::before { background: #b78b5c; border-color: #e6ba83; }
.space--slippery .pad-leaf::before { background: #b75b94; border-color: #ffc2e1; }
.space--sensor .pad-leaf::before { background: #b39bdf; border-color: #dec6f2; }
.space--boost .pad-leaf::before { background: #b6d758; border-color: #e0f29b; }

@media (max-width: 760px), (max-height: 520px), (pointer: coarse) {
  .pond .space .pad-number {
    position: absolute;
    inset: calc(95% + 2px) auto auto 50%;
    display: grid;
    place-items: center;
    width: 19px;
    height: 16px;
    margin: 0;
    transform: translateX(-50%);
    padding: 0;
    border: 1px solid #b9d28e;
    border-radius: 5px;
    color: #fff4cd;
    background: #163d33;
    font: 800 .69rem/1 var(--font);
    text-shadow: none;
  }
  .pond .space:is(.space--start, .space--finish) .pad-number {
    width: 44px;
    color: #335041;
    background: #fff0bc;
    font-size: .59rem;
    letter-spacing: .04em;
  }
  .pond .space.space--occupied .pad-number, .pond .space:has(.pad-effect) .pad-number { bottom: auto; font-size: .69rem; }
  .pond .space.space--start .pad-number { font-size: .59rem; }
  .pond--3d .space .pad-number {
    left: calc(50% + var(--pad-label-x, 0px));
    top: calc(50% + var(--pad-label-y, var(--projected-pad-bottom, 11px) + 3px));
  }
}

.frog--green { --light: #cbe677; --frog-color: #8ac64b; --dark: #528833; --frog-ink: #244524; --frog-pale: #eff6d6; }
.frog--blue { --light: #a4ebff; --frog-color: #67c4e7; --dark: #3a8db7; --frog-ink: #23465b; --frog-pale: #e2f5fb; }
.frog--yellow { --light: #fff0a3; --frog-color: #f3cf52; --dark: #c48b2e; --frog-ink: #624924; --frog-pale: #fff5d9; }
.frog--red { --light: #ffc1ae; --frog-color: #f57f74; --dark: #b84d4a; --frog-ink: #692c35; --frog-pale: #fcedea; }
.frog--purple { --light: #e6c9ff; --frog-color: #b68ae7; --dark: #875db5; --frog-ink: #432d5c; --frog-pale: #f2eafa; }
.frog-art { display: inline-block; position: relative; width: 100%; aspect-ratio: 1.18; filter: drop-shadow(0 1px 1px #24362e37); }
.frog-art i { position: absolute; display: block; }
.frog-leg { bottom: 8%; width: 32%; height: 34%; border-radius: 56% 48% 51% 51%; background: radial-gradient(ellipse at 43% 18%, var(--light), var(--frog-color) 43%, var(--dark) 95%); box-shadow: inset 0 -2px #142e3430; }
.leg-left { left: 5%; transform: rotate(-24deg); }
.leg-right { right: 5%; transform: rotate(24deg); }
.frog-body { inset: 27% 15% 10%; border-radius: 50% 50% 47% 47%; background: radial-gradient(ellipse at 54% 87%, var(--light) 8%, transparent 39%), radial-gradient(ellipse at 42% 18%, var(--light), var(--frog-color) 45%, var(--dark) 96%); box-shadow: inset 0 -2px #142e3438; }
.frog-eye { top: 10%; width: 29%; height: 44%; border-radius: 49%; background: radial-gradient(circle at 42% 36%, #fff 0 5%, transparent 7%), radial-gradient(ellipse at 48% 49%, var(--frog-ink) 0 21%, #fffdf0 22% 48%, var(--light) 50% 58%, var(--frog-color) 60% 85%, var(--dark)); box-shadow: 0 1px 1px #34514d2d; }
.eye-left { left: 19%; transform: rotate(-11deg); }
.eye-right { right: 19%; transform: rotate(10deg); }
.frog-nose { inset: 55% 40% 39%; background: radial-gradient(circle at 18% 55%, var(--dark) 0 13%, transparent 17%), radial-gradient(circle at 82% 55%, var(--dark) 0 13%, transparent 17%); }
.frog-mouth { inset: 55% 35% 28%; border-radius: 0 0 55% 55%; border-bottom: max(1px, .09em) solid var(--frog-ink); opacity: .8; }
.frog--yellow .frog-mouth { inset: 64% 42% 25%; border-radius: 65%; background: var(--frog-ink); }
.frog--red .eye-left, .frog--purple .eye-right { top: 14%; height: 40%; }
.frog--blue .frog-mouth { inset-inline: 30%; }
.frog-foot { bottom: 5%; width: 21%; height: 13%; border-radius: 50% 50% 37% 49%; background: linear-gradient(var(--light), var(--frog-color)); box-shadow: inset 0 -1px #142e3430; }
.foot-left { left: 21%; transform: rotate(-11deg); }
.foot-right { right: 21%; transform: rotate(11deg); }
.frog-piece { position: absolute; display: flex; left: var(--piece-x); top: var(--piece-y); width: clamp(23px, 5.5cqw, 54px); transform: translate(-50%, -78%); }
.frog-orientation { display: flex; width: 100%; rotate: var(--heading); }
.frog-piece .frog-art { filter: drop-shadow(0 2px 1px #173e3a77); transform-origin: 50% 87%; }
.frog-parachute { position: absolute; left: 50%; bottom: 119%; width: 170%; height: 82%; transform: translateX(-50%); transform-origin: center bottom; border: 1px solid var(--dark); border-radius: 60% 60% 12% 12% / 100% 100% 12% 12%; background: repeating-linear-gradient(90deg, var(--frog-color) 0 19%, var(--light) 19% 36%); box-shadow: inset 0 -2px #63374834; pointer-events: none; }
.frog-parachute::after { content: ""; position: absolute; top: 100%; left: 9%; right: 9%; height: 65%; border-inline: 1px solid #fff7d6; transform: perspective(22px) rotateX(-33deg); transform-origin: top; }
.pond[data-entrance="loading"] #frog-layer, .pond[data-entrance] .stack-count { visibility: hidden; }

.board-footer { display: flex; align-items: center; min-height: 55px; gap: 9px; padding: 7px 15px; color: var(--muted); font-size: .875rem; line-height: 1.35; }
.board-footer strong { color: var(--ink); }
.activity-icon { display: grid; flex: 0 0 29px; height: 29px; place-items: center; background: #ebf4e2; color: #49794c; border-radius: 8px; font-size: 1.25rem; font-weight: 700; }
.log-button { margin-left: auto; }
.event-banner { display: flex; align-items: center; gap: 10px; position: absolute; z-index: 20; left: 50%; top: max(82px, 13%); width: max-content; max-width: 85%; transform: translateX(-50%); pointer-events: none; border-radius: 10px; padding: 8px 14px; color: #553f23; background: #fff2c6; border: 1px solid #f0d782; box-shadow: 0 4px 20px #1a473e4d; animation: show-event 220ms ease-out; }
.event-banner > span { font-size: 1.4rem; color: #ae7927; }
.event-banner strong, .event-banner small { display: block; }
.event-banner small { font-size: .81rem; }
@keyframes show-event { from { opacity: 0; transform: translate(-50%, -12px); } }

.turn-panel { display: grid; grid-template-columns: 158px minmax(0, 1fr); overflow: hidden; }
.turn-banner { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 6px 8px; border-right: 1px solid #e0ebd0; background: linear-gradient(111deg, #e9f3d6, #f3f7e6); }
.turn-banner > div { min-width: 0; }
.turn-banner strong { display: block; margin-top: 3px; font: 800 1.08rem/1.12 var(--title); letter-spacing: -.045em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn-label { display: flex; align-items: center; gap: 4px; color: #3d624b; font-size: .65rem; text-transform: uppercase; letter-spacing: .045em; font-weight: 850; white-space: nowrap; }
.turn-label i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--player-color); }
.turn-money, .player-money { display: inline-flex; align-items: center; gap: 5px; color: #5e4727; background: #fff3d6; border: 1px solid #f0e2bc; padding: 4px 7px; border-radius: 8px; font-size: .875rem; font-weight: 800; white-space: nowrap; }
.turn-money { justify-content: center; background: #fff8e7; padding: 3px 5px; }
.turn-wallet { display: flex; flex-direction: column-reverse; align-items: end; gap: 3px; }
.coin { display: inline-grid; place-items: center; flex-shrink: 0; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #dca447; background: #f5ce66; box-shadow: inset 0 0 0 2px #fae49e, 0 1px #cd933d; vertical-align: -.2em; }
.coin::after { content: ""; height: 6px; border-left: 1px solid #b97e2c; box-shadow: 1px 0 #fde9ab; transform: rotate(12deg); }

.turn-body { display: grid; grid-template-columns: minmax(184px, .78fr) minmax(0, 2fr); align-content: center; align-items: stretch; gap: 6px; padding: 7px; }
.turn-body:has(.roll-controls[hidden]) { grid-template-columns: minmax(0, 1fr); }
.turn-body > h2, .turn-body > .field-hint { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; }
.turn-body > .field-hint[data-pending="true"] { grid-column: 1 / -1; position: static; width: auto; height: auto; margin: 0; clip-path: none; font-size: .75rem; }
.field-hint { font-size: .875rem; font-weight: 600; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.roll-controls { display: grid; grid-template-columns: minmax(103px, 1fr) minmax(0, 1fr); align-items: stretch; gap: 5px; }
.die-button { display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #24513d; background: #24513d; color: #fffdf3; border-radius: 9px; padding: 5px 6px 7px; min-height: 44px; font-size: .83rem; font-weight: 800; white-space: nowrap; }
.die-button:hover:not(:disabled) { background: #2e6649; }
.die-button:hover:not(:disabled) .die-face { transform: translateY(-2px) rotate(-4deg); filter: saturate(1.12); }
.die-button:disabled { opacity: .48; }
.die--neutral { --light: #fbf5dd; --frog-color: #e6d9aa; --dark: #a89468; --frog-ink: #59513c; }
.die-face { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); justify-items: center; align-items: center; flex: none; width: 31px; height: 31px; padding: 4px; border-radius: 8px; border: 1px solid var(--dark); box-shadow: 0 3px 0 var(--dark), inset 0 0 0 2px #fffc, inset 0 -5px #264e3b12, 0 4px 5px #253b2a26; background: linear-gradient(140deg, var(--light), var(--frog-color)); transition: transform 150ms ease, filter 150ms ease; }
.die-face i { width: 5px; height: 5px; border-radius: 50%; }
.die-face .pip-visible { background: var(--frog-ink); box-shadow: 0 1px #ffffff55; }
.roll-readout { display: grid; align-content: center; gap: 2px; min-width: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; background: #f5f7ef; }
.roll-readout > span { color: var(--muted); font-size: .68rem; font-weight: 700; }
.roll-readout > strong { color: var(--ink); font-size: .8rem; line-height: 1.2; }
.roll-shaker {
  --roll-light: #e9be6e;
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, #173e43a6 2%, #0d282de0 52%, #07191ded 100%);
  backdrop-filter: blur(2px);
  animation: enter-roll 170ms ease-out both;
}
.roll-shaker:is([data-phase="result"], [data-phase="fade"]) { --roll-light: var(--frog-color); }
.roll-shaker[data-phase="fade"] { animation: exit-roll var(--roll-phase-duration) ease-in both; }
.roll-presentation { position: relative; width: min(490px, 94vw, 108dvh); padding-bottom: clamp(37px, 7dvh, 61px); }
.roll-visual { position: relative; width: 100%; aspect-ratio: 1.53; isolation: isolate; }
.shaker-canvas, .roll-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.roll-visual:has(.shaker-canvas) .roll-fallback { display: none; }
.roll-halo {
  position: absolute;
  inset: 8% 5% 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 55% 48%, color-mix(in srgb, var(--roll-light) 44%, transparent), transparent 68%);
  opacity: .57;
  transform: scale(.89);
  transition: opacity 230ms ease-out, transform 230ms ease-out;
}
.roll-halo::after {
  content: "";
  position: absolute;
  inset: 73% 18% 7%;
  border: 1px solid var(--roll-light);
  border-radius: 50%;
  box-shadow: 0 0 25px #d8e7b267, inset 0 0 18px #d8e7b22b;
  opacity: .44;
}
.roll-shaker[data-phase="result"] .roll-halo { opacity: 1; transform: scale(1.06); }
.roll-caption { position: absolute; inset: auto 0 0; display: grid; justify-items: center; gap: 1px; opacity: 0; color: #fff9e4; }
.roll-caption strong { font: 800 clamp(1.75rem, 6vmin, 2.65rem)/1 var(--title); letter-spacing: -.05em; text-shadow: 0 3px 18px #09242c; }
.roll-caption span { color: var(--frog-pale); font: 800 clamp(.94rem, 3vmin, 1.18rem)/1.2 var(--font); }
.roll-shaker:is([data-phase="result"], [data-phase="fade"]) .roll-caption { opacity: 1; }
.roll-shaker[data-phase="result"] .roll-caption { animation: rise-roll 230ms cubic-bezier(.19,.95,.42,1.25) both; }
.shaker-cup {
  position: absolute;
  inset: 27% 36% 13%;
  display: grid;
  place-items: center;
  border: 2px solid #3c7065;
  border-block: 8px solid #e8bd6a;
  border-radius: 14px 14px 40% 40% / 14px 14px 12% 12%;
  background: linear-gradient(100deg, #123d3d, #458478 35%, #255d50 68%, #0e3b3e);
  box-shadow: inset 0 0 0 2px #fff3, 0 12px 26px #081f29a6;
  transform-origin: 50% 78%;
}
.shaker-cup i { width: 37%; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(from 31deg, #e6c479 0 322deg, #214c42 323deg 360deg); box-shadow: 0 0 0 5px #254a43, inset 1px 2px 1px #fff6; }
.shaker-cup::before, .shaker-cup::after { content: ""; position: absolute; border-radius: 50%; background: linear-gradient(#ffe5a0, #a97638); }
.shaker-cup::before { inset: -15% -7% auto; height: 19%; }
.shaker-cup::after { inset: -22% 36% auto; height: 13%; }
.roll-fallback .die-face { position: absolute; left: 53%; top: 46%; width: 19%; height: auto; aspect-ratio: 1; padding: 3%; border-radius: 18%; opacity: 0; rotate: -10deg; }
.roll-fallback .die-face i { width: 59%; height: 59%; }
.roll-shaker[data-phase="shake"] .shaker-cup { animation: shake-cup var(--roll-phase-duration) ease-in-out both; }
.roll-shaker[data-phase="toss"] .shaker-cup { animation: move-cup var(--roll-phase-duration) ease-out both; }
.roll-shaker[data-phase="toss"] .roll-fallback .die-face { animation: toss-die var(--roll-phase-duration) ease-out both; }
.roll-shaker:is([data-phase="result"], [data-phase="fade"]) .shaker-cup { transform: translate(-49%, 12%) rotate(15deg); }
.roll-shaker:is([data-phase="result"], [data-phase="fade"]) .roll-fallback .die-face { opacity: 1; }
@keyframes enter-roll { from { opacity: 0; } }
@keyframes exit-roll { to { opacity: 0; } }
@keyframes rise-roll { from { opacity: 0; transform: translateY(10px) scale(.92); } }
@keyframes shake-cup {
  7%, 31%, 56%, 81% { transform: translate(8%, -5%) rotate(-16deg); }
  19%, 44%, 69%, 93% { transform: translate(-8%, -9%) rotate(20deg); }
}
@keyframes move-cup { to { transform: translate(-49%, 12%) rotate(15deg); } }
@keyframes toss-die {
  0% { opacity: 0; transform: translate(-70%, 10%) rotate(-270deg) scale(.52); }
  30% { opacity: 1; }
  53% { transform: translate(-21%, -82%) rotate(-139deg) scale(.9); }
  87% { transform: translateY(7%) rotate(12deg); }
  100% { opacity: 1; }
}
.action-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; }
.action-button { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 6px; border: 1px solid #e8eadf; color: var(--ink); border-radius: 8px; text-align: start; background: #f9faf4; padding: 5px 6px; }
.action-button:hover:not(:disabled) { background: #eff5e8; border-color: #cedfc6; }
.action-button:disabled { opacity: .53; }
.action-icon { display: grid; place-items: center; flex: 0 0 26px; height: 26px; border-radius: 6px; font-size: .96rem; font-weight: 800; color: #3b7146; background: #e5efd8; }
.action-icon--leg { color: #805824; background: #faebcd; }
.action-icon--race { color: #68548d; background: #eee7f8; }
.action-icon--results { color: #8a6223; background: #fbefcf; }
.action-copy { display: grid; gap: 1px; }
.action-copy strong { font-size: .82rem; line-height: 1.18; }
.action-copy > span { font-size: .7rem; line-height: 1.2; font-weight: 550; color: var(--muted); }
.turn-busy .action-button, .turn-busy .die-button { pointer-events: none; }

.section-header { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.players-panel { padding: 11px 15px 15px; }
.player-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); gap: 9px; margin-top: 7px; }
.player-card { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 9px; border-radius: 10px; border: 1px solid #e7ebdf; background: #fbfbf6; }
.player-active { background: #f0f6e7; border-color: #c8dfbd; }
.player-marker { display: inline-block; flex: 0 0 13px; height: 13px; border: 2px solid #fff9; border-radius: 50%; background: var(--player-color); box-shadow: 0 0 0 1px var(--player-color); }
.player-copy { display: grid; gap: 1px; flex: 1; min-width: 0; }
.player-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.player-copy > span { color: var(--muted); font-size: .75rem; font-weight: 600; }
.history-icon { line-height: .7; font-size: 1.15rem; }

.standings-list { list-style: none; margin: 0; padding: 0; }
.standing-row { display: grid; grid-template-columns: 19px 29px minmax(0, 1fr) auto; align-items: center; min-height: 36px; gap: 7px; margin: 1px 0; padding: 0 5px; border-radius: 7px; }
.standing-leader { background: #f3f7e9; }
.place-number { width: 17px; text-align: center; font: 800 .77rem/1 var(--font); color: var(--muted); }
.standing-leader .place-number { background: #e7edce; color: #55703b; border-radius: 4px; padding: 3px 0; }
.standing-frog { display: flex; width: 28px; }
.standing-name { font-weight: 750; font-size: .875rem; }
.standing-space { color: var(--muted); font-size: .79rem; font-weight: 650; padding-right: 3px; }

.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 22; }
.confetti i { position: absolute; left: var(--x); top: -14px; width: 7px; height: 12px; border-radius: 2px; background: var(--color); animation: confetti-fall 1.2s var(--delay) ease-in both; }
@keyframes confetti-fall { to { top: 105%; transform: rotate(var(--spin)); opacity: .35; } }

.dialog { width: min(100% - 28px, 600px); max-height: min(90dvh, 760px); padding: 0; background: var(--paper); border: 1px solid #dce7d8; border-radius: 17px; color: var(--ink); box-shadow: 0 20px 80px #173a3452; overscroll-behavior: contain; }
.dialog::backdrop { background: #1a393d88; backdrop-filter: blur(3px); }
.dialog:is([data-kind="leg"], [data-kind="race"], [data-kind="history"]) { position: fixed; inset: auto 0 max(9px, env(safe-area-inset-bottom)); margin: 0 auto; }
.dialog:is([data-kind="leg"], [data-kind="race"], [data-kind="history"])::backdrop { background: #112e3b48; backdrop-filter: none; }
.dialog-header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 18px 20px 15px; border-bottom: 1px solid var(--line); background: var(--paper); }
.dialog-header h2 { font: 800 1.6rem/1.19 var(--title); letter-spacing: -.05em; }
.dialog-header p { margin-top: 5px; color: var(--muted); font-size: .94rem; line-height: 1.35; }
.close-dialog { width: 33px; height: 33px; flex: 0 0 33px; font-size: 1.35rem; }
.dialog-body { padding: 16px 20px 20px; }
.dialog-footer { position: sticky; bottom: 0; display: flex; justify-content: end; gap: 8px; padding: 12px 20px 14px; border-top: 1px solid var(--line); background: var(--paper); }

.room-body > label, .room-invite label { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 750; }
.room-invite { margin-bottom: 17px; }
.room-invite > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.room-body > h3 { display: flex; justify-content: space-between; font: 800 1.05rem var(--title); }
.room-body > h3 small { color: var(--muted); }
.room-players li > span:last-child { margin-left: auto; color: var(--muted); white-space: nowrap; }
.room-message { color: #805232; margin-top: 10px; font-size: .9rem; }
.room-message:empty { display: none; }

fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
legend, .setup-player label, .setup-options label, .pad-select { display: block; font-size: .875rem; color: var(--ink); font-weight: 750; margin-bottom: 6px; }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: #f1f4e9; }
.segmented button { background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--muted); font-weight: 750; font-size: .875rem; min-height: 36px; padding: 4px 9px; }
.segmented button:hover:not(:disabled) { background: #f8faef; }
.segmented button[aria-pressed="true"] { background: var(--paper); color: var(--forest); border-color: #dbe7d3; box-shadow: 0 1px 2px #364b3020; }
.segmented button:disabled { opacity: .45; }
.count-options { width: max-content; }
.count-options button { min-width: 38px; }
.market-options { margin-bottom: 7px; }
.market-options button { flex: 1; white-space: normal; font-size: .78rem; }
.setup-players, .setup-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 15px; }
.setup-player { background: #f8f9f1; border: 1px solid #e5eadf; border-radius: 9px; padding: 9px; }
.dialog input[type="text"], .dialog select { border: 1px solid #d7e0d4; border-radius: 8px; background: #fffefb; color: var(--ink); width: 100%; min-height: 39px; padding: 7px 9px; font-size: 1rem; }
.dialog select { appearance: none; padding-right: 31px; background-image: linear-gradient(45deg, transparent 46%, #52755e 47% 69%, transparent 70%), linear-gradient(-45deg, transparent 45%, #52755e 46% 68%, transparent 69%); background-position: right 16px center, right 12px center; background-size: 5px 5px; background-repeat: no-repeat; }
.setup-options select { display: block; margin-top: 5px; }
.setup-options .check-option { display: flex; align-items: center; gap: 6px; margin: 0; }
.check-option input { accent-color: var(--green); width: 16px; height: 16px; }
.dialog[data-kind="audio"] { max-width: 420px; }
.audio-options { display: grid; gap: 10px; }
.audio-channel { display: grid; grid-template-columns: 1fr 69px; align-items: center; gap: 4px 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #f5f8ee; }
.audio-channel label { font-weight: 800; }
.audio-channel label small { display: block; margin-top: 2px; color: var(--muted); font-size: .79rem; font-weight: 600; }
.audio-channel button { min-height: 30px; justify-self: end; font-size: .79rem; }
.audio-channel input { width: 100%; height: 28px; margin: 0; accent-color: var(--green); cursor: pointer; }
.audio-channel output { justify-self: end; min-width: 48px; padding: 4px 6px; border-radius: 6px; background: #e6eedb; color: var(--forest); text-align: center; font: 800 .81rem/1.1 var(--font); font-variant-numeric: tabular-nums; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.swatch { width: 25px; height: 25px; background: var(--player-color); border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #c9d4ca; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--forest); }
.swatch:disabled { opacity: .33; }

.bet-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.bet-option { display: grid; place-items: center; gap: 2px; min-width: 0; padding: 5px 1px; color: var(--ink); background: var(--frog-pale); border: 2px solid transparent; border-radius: 10px; font-size: clamp(.64rem, 3.1vw, .8rem); }
.bet-option strong { min-width: 0; overflow-wrap: anywhere; }
.bet-option:hover { border-color: var(--frog-color); }
.bet-option[aria-pressed="true"] { border-color: var(--dark); }
.bet-option .frog-art { width: min(100%, 38px); }
.leg-pick-payout { display: flex; align-items: center; gap: 4px; color: #654e32; font-weight: 800; }
.bet-odds { display: grid; gap: 5px; margin-top: 10px; }
.bet-odds h3 { font-size: .95rem; }
.bet-odds p { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.bet-summary { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; list-style: none; margin: 0; border: 1px solid var(--line); border-radius: 9px; padding: 5px; background: #f3f6eb; }
.bet-summary > li { display: grid; justify-items: center; gap: 4px; padding: 3px 1px; }
.bet-summary > li > span { font-size: .72rem; color: var(--muted); font-weight: 650; text-align: center; }
.bet-summary strong { display: flex; align-items: center; gap: 4px; }
.dialog [data-form="bet"] .dialog-header, .dialog [data-form="bet"] .dialog-body, .dialog [data-form="bet"] .dialog-footer { padding-block: 9px; }
.dialog [data-form="bet"] .dialog-header h2 { font-size: 1.35rem; }
.dialog [data-form="bet"] .dialog-header p { margin-top: 2px; font-size: .85rem; }

.pad-tray { padding: 7px 9px 8px; background: #f1f5e7; }
.pad-tray-heading { display: flex; align-items: start; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.pad-tray-heading h3 { font: 800 1rem/1.2 var(--title); }
.pad-tray-heading p { margin-top: 2px; color: var(--muted); font-size: .84rem; }
.close-pad-tray { width: 33px; height: 33px; flex-shrink: 0; font-size: 1.17rem; }
.pad-options { display: grid; gap: 7px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pad-option { display: grid; grid-template-columns: 43px minmax(0, 1fr); align-content: center; align-items: center; justify-items: start; gap: 2px 4px; padding: 5px 6px; min-height: 48px; min-width: 0; border: 1px solid #d8e4cf; border-radius: 9px; background: #fffef8; color: var(--ink); font-size: .83rem; font-weight: 750; cursor: grab; touch-action: none; user-select: none; }
.pad-option[aria-pressed="true"], .pad-option:hover:not(:disabled) { background: #f7f9e8; border-color: #91b178; }
.pad-option:disabled { opacity: .55; cursor: default; }
.pad-option.pad-dragging { cursor: grabbing; }
.pad-option :is(.modifier-preview, .pad-decal) { grid-row: span 2; }
.pad-option .pad-decal { width: 30px; margin-inline: auto; }
.modifier-preview { display: block; width: 43px; height: 43px; border-radius: 6px; object-fit: cover; }
.pad-distance { color: var(--muted); font-size: .75rem; }
.pad-decal { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 34% 42% 36% 41%; color: var(--decal-ink); background: linear-gradient(150deg, var(--decal-light), var(--decal-color)); border: 1px solid var(--decal-rim); box-shadow: inset 0 1px #fff9, 0 1px 2px #213b3b5e; }
.pad-decal i { position: relative; display: block; width: 72%; height: 72%; }
.pad-decal--boost { --decal-ink: #695101; --decal-light: #fff9b0; --decal-color: #f0cd42; --decal-rim: #d9a529; }
.pad-decal--boost i { background: currentColor; clip-path: polygon(51% 3%, 88% 3%, 61% 40%, 88% 40%, 28% 97%, 41% 56%, 13% 56%); }
.pad-decal--slippery { --decal-ink: #fff0ae; --decal-light: #a14c86; --decal-color: #643354; --decal-rim: #e195c5; }
.pad-decal--slippery i::before, .pad-decal--slippery i::after { content: ""; position: absolute; inset: 0 0 55%; background: currentColor; clip-path: polygon(0 28%, 63% 28%, 63% 0, 100% 50%, 63% 100%, 63% 72%, 0 72%); }
.pad-decal--slippery i::after { inset: 55% 0 0; transform: rotate(180deg); background: #ffc2e1; }
.pad-decal--mud { --decal-ink: #673818; --decal-light: #f8cf9e; --decal-color: #d89453; --decal-rim: #a96638; }
.pad-decal--mud i { background: radial-gradient(ellipse at 50% 61%, currentColor 0 44%, transparent 46%), radial-gradient(circle at 31% 18%, currentColor 0 11%, transparent 13%), radial-gradient(circle at 83% 27%, currentColor 0 12%, transparent 14%), radial-gradient(circle at 13% 46%, currentColor 0 12%, transparent 14%), radial-gradient(circle at 91% 66%, currentColor 0 7%, transparent 9%); }
.pad-decal--sensor { --decal-ink: #4e2c78; --decal-light: #f3d8ff; --decal-color: #d6acef; --decal-rim: #b984dc; }
.pad-decal--sensor i { border-radius: 50%; background: radial-gradient(circle at 71% 31%, currentColor 0 9%, transparent 11%), radial-gradient(circle, currentColor 0 13%, transparent 15% 30%, currentColor 33% 40%, transparent 43% 57%, currentColor 61% 67%, transparent 70%); }
.pad-ghost { position: fixed; top: 0; left: 0; z-index: 100; width: 43px; pointer-events: none; transform: translate(-46%, -94%) rotate(-10deg); filter: drop-shadow(1px 5px 3px #1b3c3b68); }
.pad-ghost .modifier-preview { width: 49px; height: 49px; }

.history-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 164px), 1fr)); gap: 6px; margin-bottom: 12px; }
.history-summary > div { display: grid; gap: 3px; background: #f6f8ef; border: 1px solid #e6ebdc; border-radius: 9px; padding: 7px 8px; }
.history-summary strong { overflow-wrap: anywhere; }
.history-summary span { color: var(--muted); font-size: .79rem; }
.empty-state { text-align: center; color: var(--muted); padding: 15px 0 8px; }
.dialog-list { list-style: none; padding: 0; margin: 0; }
.dialog-list li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.dialog-list li:last-child { border-bottom: 0; }
.dialog-list li > div { min-width: 0; }
.dialog-list small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.list-frog { display: flex; flex: 0 0 32px; }
.bet-status { margin-left: auto; flex-shrink: 0; padding: 4px 6px; border-radius: 6px; font-size: .8rem; font-weight: 750; white-space: nowrap; }
.bet-status--open { background: #fcf1d4; color: #745924; }
.bet-status--won { background: #e8f3dd; color: #3d6a36; }
.bet-status--lost { background: #f9eae5; color: #83463b; }
.rules-body { display: grid; gap: 12px; }
.rule-die-faces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rules-body h3 { font-size: .97rem; }
.rules-body p { margin-top: 3px; line-height: 1.5; color: var(--muted); }

.results-hero { display: grid; justify-items: center; gap: 5px; text-align: center; border-radius: 11px; padding: 10px; margin-bottom: 9px; background: linear-gradient(138deg, #ecf5d7, #fff1ce); }
.winner-frog { display: flex; width: 74px; }
.results-hero strong { font: 800 1.35rem/1.1 var(--title); }
.results-hero > span:last-child { font-size: .91rem; color: var(--forest); overflow-wrap: anywhere; }
.results-list li { padding-inline: 5px; }
.results-list .player-money { margin-left: auto; }
.result-order { width: 20px; flex-shrink: 0; color: var(--muted); font-weight: 700; text-align: center; }
.results-tail { padding-top: 9px; color: var(--muted); font-size: .875rem; }
.results-tail strong { margin-right: 5px; color: var(--ink); }

@media (max-width: 1120px), (max-height: 520px) {
  .arena-dock { grid-template-columns: minmax(0, 1fr); max-width: 930px; }
  .arena-dock > .players-panel { display: none; }
  .race-hud > .mobile-players { display: inline-flex; }
}

@media (max-width: 760px), (max-height: 520px) {
  .action-button { gap: 4px; padding-inline: 4px; }
  .action-icon { flex-basis: 21px; height: 21px; font-size: .83rem; }
  .action-copy > span { display: none; }
  .action-copy strong { font-size: .72rem; }
}

@media (max-width: 760px) {
  .room-button { width: 42px; padding: 0; }
  .room-button-text { display: none; }
}

@media (max-width: 640px) {
  .turn-panel { grid-template-columns: minmax(0, 1fr); }
  .turn-banner { min-height: 39px; padding: 4px 9px; border-right: 0; border-bottom: 1px solid #e0ebd0; }
  .turn-banner > div { display: flex; align-items: center; gap: 7px; }
  .turn-banner strong { margin: 0; }
  .turn-wallet { flex-direction: row; align-items: center; gap: 5px; }
  .turn-body { grid-template-columns: minmax(0, 1fr); }
  .action-button { min-height: 37px; padding-block: 3px; justify-content: center; }
  .pad-option { grid-template-columns: 1fr; justify-items: center; }
  .pad-option :is(.modifier-preview, .pad-decal) { grid-row: auto; }
  .pad-option .modifier-preview { width: 37px; height: 37px; }
}

@media (max-width: 700px) {
  .arena { --hud-gap: 9px; }
  .arena-header { gap: 4px; }
  .arena-header .brand { font-size: 1.15rem; padding: 4px 7px 4px 4px; gap: 5px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 7px; }
  .brand-mark .frog-art { width: 25px; }
  .top-actions { gap: 3px; padding: 3px; }
  .guide-button, .sound-button { width: 29px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; }
  .room-button { width: 29px; min-height: 32px; border-radius: 6px; }
  .guide-button > span:last-child { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  .new-game-button { min-height: 32px; padding-inline: 5px; font-size: .71rem; border-radius: 6px; }
  .new-game-button > span { display: none; }
  .race-hud { top: calc(var(--hud-gap) + 47px); gap: 2px; padding: 3px 3px 3px 6px; }
  .race-hud > button { font-size: .71rem; padding-inline: 4px; }
  .board-stats { gap: 5px; font-size: .72rem; }
  .leg-chip { padding: 5px 5px; }
  .dice-status { gap: 4px; }
  .dice-unit { display: none; }
  .arena > .board-footer { top: calc(var(--hud-gap) + 87px); font-size: .73rem; gap: 3px; }
  .log-button { padding-inline: 4px; font-size: .72rem; }
  .pad-options { gap: 5px; }
  .pad-option { gap: 2px; padding: 4px 0; font-size: .72rem; }
  .pad-option .pad-decal { width: 22px; }
  .pad-distance { margin: 0; }
  .player-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .player-card { padding: 7px 5px; gap: 5px; }
  .player-money { padding: 3px 4px; gap: 3px; }
  .dialog-header, .dialog-body, .dialog-footer { padding-inline: 12px; }
}

@media (max-height: 520px) and (min-aspect-ratio: 8/5) {
  .arena-header .brand { font-size: 1.17rem; gap: 6px; padding: 4px 8px 4px 4px; }
  .arena-header .brand-mark { width: 30px; height: 30px; border-radius: 7px; }
  .arena-header .brand-mark .frog-art { width: 25px; }
  .top-actions { gap: 4px; padding: 3px; }
  .top-actions .icon-button { width: 32px; height: 32px; }
  .top-actions :is(.quiet-button, .primary-button, .secondary-button) { min-height: 32px; }
  .race-hud { top: calc(var(--hud-gap) + 48px); display: grid; grid-template-columns: auto auto; gap: 1px 4px; padding: 3px 5px; }
  .board-stats { grid-column: 1 / -1; gap: 6px; font-size: .75rem; }
  .dice-status { gap: 4px; }
  .dice-unit { display: none; }
  .race-hud > button { min-height: 25px; font-size: .72rem; padding-inline: 5px; }
  .arena > .board-footer { --side-hud: 1; top: calc(var(--hud-gap) + 111px); max-width: min(187px, 27vw); padding: 2px 5px; font-size: .73rem; gap: 3px; }
  .arena > .board-footer .activity-icon { display: none; }
  .log-button { padding-inline: 4px; font-size: .72rem; }
  .turn-panel { grid-template-columns: minmax(118px, .24fr) minmax(0, 1fr); }
  .turn-body { grid-template-columns: minmax(141px, .72fr) minmax(0, 1.4fr); }
  .turn-banner > div { display: block; }
  .turn-wallet { flex-direction: column-reverse; align-items: end; }
}

@media (max-width: 640px) and (max-height: 395px) and (min-aspect-ratio: 8/5) {
  .turn-banner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; gap: 2px 4px; padding-inline: 6px; }
  .turn-banner > div { display: contents; }
  .turn-label { grid-column: 1 / -1; font-size: .55rem; }
  .turn-banner strong { grid-column: 1; font-size: .9rem; }
  .turn-wallet { grid-column: 2; }
  .turn-body { padding: 5px; }
  .roll-controls { grid-template-columns: minmax(74px, 1fr) minmax(58px, .78fr); }
  .die-button { font-size: .73rem; min-height: 40px; gap: 3px; padding-inline: 3px; }
  .die-button .die-face { width: 23px; height: 23px; padding: 3px; }
  .die-button .die-face i { width: 3px; height: 3px; }
  .roll-readout { padding: 3px; }
  .roll-readout > strong { font-size: .72rem; }
}

@media (max-width: 375px) {
  .dice-count { display: none; }
  .arena-header .brand { font-size: 1rem; gap: 4px; padding: 3px 5px 3px 3px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-mark .frog-art { width: 21px; }
  .guide-button, .sound-button, .room-button { width: 25px; height: 30px; min-height: 30px; }
  .new-game-button { min-height: 30px; font-size: .67rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.animations-off *, .animations-off *::before, .animations-off *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
