:root {
  color-scheme: dark;
  --ink: #f7f5df;
  --muted: #becfc1;
  --line: #466b59;
  --paper: #173d33;
  --page: #102f2e;
  --forest: #f4d45c;
  --green: #ebcb57;
  --elevated: #285143;
  --gold-ink: #233d2d;
  --title: "Bricolage Grotesque", "Avenir Next", "Trebuchet MS", sans-serif;
  --font: "DM Sans", "Avenir Next", system-ui, sans-serif;
}

button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #ffdf73;
  outline-offset: 4px;
}

.arena { --hud-gap: clamp(16px, 2.2vw, 28px); }
.arena::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(#0b2e2947, transparent 21%, transparent 76%, #0a2d306b);
}
.pond:not(.pond--3d) #track-projection { left: max(var(--hud-gap), var(--track-left, 0px)); }
.arena-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: center; }
.arena-header .brand { padding: 0; gap: 10px; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink); font-size: clamp(1.2rem, 2.2vw, 1.6rem); letter-spacing: -.055em; }
.arena-header .brand-mark { width: 35px; height: 36px; background: none; border: 0; border-radius: 0; }
.arena-header .brand-mark .frog-art { width: 35px; filter: drop-shadow(0 3px 3px #082b2b55); }
.header-controls { display: flex; justify-content: end; align-items: center; gap: 13px; min-width: 0; }
.race-hud { position: static; padding: 11px 15px; gap: 0; border-radius: 16px; border: 1px solid #bde3b42e; background: #163b32f5; box-shadow: 0 5px 18px #07292c25; }
.board-stats { gap: 15px; font-size: .875rem; }
.leg-chip { padding: 0; background: none; color: var(--ink); font-family: var(--title); font-weight: 800; white-space: nowrap; }
.dice-status { gap: 10px; color: var(--muted); font-size: .8125rem; }
.leg-dice { gap: 4px; }
.leg-die { width: 23px; height: 25px; border: 0; border-radius: 6px; font-size: .6875rem; box-shadow: inset 0 -3px #17392e22; }
.leg-die.spent { background: #547269; border: 0; color: #b7c9bb; opacity: .5; }
.leg-die.spent::after { width: 10px; opacity: .7; }
.player-roster { border: 0; padding: 0; background: none; border-radius: 20px; }
.player-avatars { display: flex; gap: 4px; }
.player-avatar { display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid #6b968447; border-radius: 50%; background: color-mix(in srgb, var(--player-color) 40%, #1b4037); color: #f8f9e6; font-weight: 800; font-size: .75rem; text-transform: uppercase; }
.player-avatar.avatar-active { border-color: var(--forest); color: #ffe495; box-shadow: 0 0 12px #f5d56a17; }
.game-menu { position: relative; z-index: 6; }
.game-menu > summary { display: grid; place-items: center; width: 44px; height: 44px; list-style: none; border: 1px solid #c3e5be42; border-radius: 50%; color: var(--ink); background: #163b32; cursor: pointer; }
.game-menu > summary::-webkit-details-marker { display: none; }
.game-menu > summary:hover, .game-menu[open] > summary { background: #315a46; border-color: #d1e8b77d; }
.menu-icon { display: block; width: 19px; height: 15px; position: relative; background: linear-gradient(currentColor, currentColor) 0 2px / 19px 1.5px no-repeat, linear-gradient(currentColor, currentColor) 0 11px / 19px 1.5px no-repeat; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; width: 5px; height: 6px; border: 1.5px solid currentColor; border-radius: 2px; background: var(--paper); top: 0; left: 4px; }
.menu-icon::after { top: 9px; left: 11px; }
.game-menu .top-actions { position: absolute; top: calc(100% + 12px); right: 0; display: grid; width: 244px; max-height: calc(100dvh - 90px); overflow-y: auto; padding: 9px; gap: 3px; border: 1px solid var(--line); border-radius: 18px; background: #173d33; box-shadow: 0 14px 44px #052b3780; }
.game-menu .top-actions > button { display: flex; justify-content: start; width: 100%; min-height: 43px; height: auto; padding: 8px 12px; gap: 13px; border: 0; border-radius: 9px; color: var(--ink); font-size: .875rem; font-weight: 600; background: transparent; }
.game-menu .top-actions > button:hover { background: var(--elevated); }
.game-menu .guide-button > span:last-child { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; }
.game-menu .room-button-text { display: inline; }
.menu-symbol, .game-menu .help-icon, #sound-icon, .fullscreen-icon { display: grid; place-items: center; width: 19px; flex-shrink: 0; }
.game-menu .room-icon { position: relative; height: 22px; font-size: 0; }
.game-menu .room-icon::before { content: ""; position: absolute; width: 6px; height: 6px; top: 1px; left: 3px; border-radius: 50%; background: currentColor; box-shadow: 9px 3px currentColor; }
.game-menu .room-icon::after { content: ""; position: absolute; width: 11px; height: 9px; left: 0; top: 9px; border-radius: 8px 8px 3px 3px; background: currentColor; box-shadow: 9px 3px currentColor; }
.game-menu .new-game-button > span { display: grid; }
.game-menu .help-icon { width: 18px; height: 18px; }

.chat-toggle { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid #c3e5be42; border-radius: 22px; color: var(--ink); background: #163b32; font: 700 .875rem var(--font); cursor: pointer; }
.chat-toggle:hover, .chat-toggle[aria-expanded="true"] { background: #315a46; border-color: #d1e8b77d; }
.chat-toggle[hidden], .chat-panel[hidden], .chat-unread[hidden], .chat-empty[hidden] { display: none; }
.chat-bubble { position: relative; display: grid; place-items: center; width: 17px; height: 14px; border: 1.7px solid currentColor; border-radius: 5px; font-size: 5px; line-height: 1; }
.chat-bubble::after { content: ""; position: absolute; left: 2px; bottom: -5px; width: 5px; height: 5px; border-left: 1.7px solid currentColor; transform: skewY(-35deg); }
.chat-unread { position: absolute; right: -5px; top: -5px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 12px; color: #1d3b2e; background: #f5d65e; font: 800 .6875rem var(--title); }
.chat-panel { position: absolute; z-index: 7; top: 78px; right: var(--hud-gap); bottom: calc(var(--dock-clearance, 104px) + 16px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; width: min(355px, calc(100vw - 2 * var(--hud-gap))); min-height: 210px; overflow: hidden; border: 1px solid #a7d99b80; border-radius: 20px; color: var(--ink); background: #173d33; box-shadow: 0 16px 52px #062725a8; }
.chat-heading { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #7b9e7659; }
.chat-kicker { display: block; margin-bottom: 2px; color: #e9d66e; font: 800 .6875rem var(--title); letter-spacing: .1em; text-transform: uppercase; }
.chat-heading h2 { margin: 0; font: 800 1.25rem var(--title); letter-spacing: -.035em; }
.chat-close { width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--ink); background: #305842; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.chat-close:hover { background: #467053; }
.chat-messages { min-height: 0; margin: 0; padding: 15px 13px 8px; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.chat-message { display: flex; align-items: start; gap: 9px; margin-bottom: 14px; }
.chat-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border: 1px solid #ebd88396; border-radius: 50%; color: #fff9e3; background: color-mix(in srgb, var(--player-color) 55%, #173d33); font: 800 .8125rem var(--title); text-transform: uppercase; }
.chat-message > div { min-width: 0; max-width: calc(100% - 39px); }
.chat-meta { display: flex; align-items: baseline; gap: 7px; margin: 0 0 4px; }
.chat-meta strong { font: 800 .8125rem var(--title); }
.chat-meta time { color: #b5cdb2; font-size: .6875rem; }
.chat-message p { margin: 0; padding: 9px 11px; border: 1px solid #7a9b7352; border-radius: 3px 12px 12px 12px; color: #f6f7e7; background: #2b5843; font-size: .875rem; line-height: 1.36; overflow-wrap: anywhere; }
.chat-message-mine p { background: #385d43; border-color: #bfcb7590; }
.chat-empty { align-self: center; grid-row: 2; margin: 0; padding: 20px; color: #c2d3b7; text-align: center; font-size: .875rem; }
.chat-compose { display: flex; gap: 8px; padding: 11px 12px 12px; border-top: 1px solid #7b9e7659; }
.chat-compose input { min-width: 0; flex: 1; height: 42px; padding: 8px 10px; border: 1px solid #72936e; border-radius: 10px; color: var(--ink); background: #244d3d; font: 500 .875rem var(--font); }
.chat-compose input::placeholder { color: #c0d0b7; }
.chat-compose button { min-width: 62px; border: 1px solid #fff4b5; border-radius: 10px; color: #1e3b2e; background: #f5d65e; font: 800 .875rem var(--title); cursor: pointer; }
.chat-compose button:hover:not(:disabled) { background: #ffe489; }
.chat-compose button:disabled { opacity: .55; cursor: default; }
.chat-status { margin: 0; padding: 0 12px 10px; color: #ffdaa1; font-size: .8125rem; }
.chat-status:empty { display: none; }

.arena .arena-dock { display: block; max-width: 1040px; }
.arena .turn-panel { position: relative; display: grid; grid-template-columns: minmax(155px, .85fr) minmax(0, 3fr); align-items: center; gap: 20px; padding: 0; overflow: visible; border: 0; background: none; border-radius: 0; box-shadow: none; }
.arena .turn-banner { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-content: center; align-items: center; justify-content: initial; gap: 1px 10px; padding: 0; border: 0; background: none; }
.turn-avatar { grid-column: 1; grid-row: 1 / 3; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 2px solid #efd36b; color: #ffe290; background: color-mix(in srgb, var(--player-color) 50%, #1d4136); font-family: var(--title); font-size: 1.0625rem; font-weight: 800; text-transform: uppercase; }
.arena .turn-banner > div { grid-column: 2; display: block; min-width: 0; }
.arena .turn-label { color: #f4d879; font-size: .6875rem; font-weight: 800; letter-spacing: .09em; line-height: 1.2; }
.arena .turn-banner strong { margin-top: 3px; color: var(--ink); font-size: 1.125rem; line-height: 1.2; letter-spacing: -.025em; }
.arena .turn-wallet { grid-column: 2; display: block; }
.arena .turn-money { padding: 0; gap: 5px; border: 0; border-radius: 0; background: none; color: #e6ecd2; font-size: .8125rem; }
.arena .turn-money .coin { width: 12px; height: 12px; }
.arena .turn-body, .arena .turn-panel:has(.pad-tray:not([hidden])) .turn-body { display: grid; grid-template-columns: minmax(135px, 1.2fr) minmax(0, 2fr); gap: 11px; padding: 0; }
.arena .turn-body:has(.roll-controls[hidden]) { grid-template-columns: minmax(0, 1fr); }
.arena .turn-body > .field-hint[data-pending="true"] { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); width: max-content; max-width: min(100%, 540px); margin: 0; padding: 9px 14px; border: 1px solid #efce6f80; border-radius: 12px; background: #173d33; color: #f5e3ac; font-size: .8125rem; text-align: center; }
.arena .roll-controls { display: block; }
.arena .roll-readout { position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; border: 0; clip-path: inset(50%); }
.arena .die-button { width: 100%; min-height: 68px; padding: 12px 16px; gap: 12px; background: #f4d45c; border: 1px solid #fff4b7a3; border-radius: 17px; color: #233d2d; box-shadow: 0 5px 0 #9d872f, 0 9px 24px #e7d16a1c; font-family: var(--title); font-size: 1.25rem; font-weight: 800; transition: transform 180ms ease, background-color 180ms ease; }
.arena .die-button:hover:not(:disabled) { background: #ffe183; transform: translateY(-2px); }
.arena .die-button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #9d872f; }
.arena .die-button .die-face { transform: rotate(-9deg); width: 33px; height: 33px; }
.arena .die-button:hover:not(:disabled) .die-face { transform: translateY(-2px) rotate(3deg); }
.arena .action-list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto; gap: 11px; }
.arena .action-list:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.arena .action-button { min-height: 68px; padding: 10px 14px; justify-content: center; gap: 10px; border: 1px solid #b8d7aa47; border-radius: 17px; color: var(--ink); background: #173d33; box-shadow: 0 4px 0 #082d2d8f; transition: transform 180ms ease, background-color 180ms ease; }
.arena .action-button:hover:not(:disabled) { transform: translateY(-2px); background: #2c5944; border-color: #c2e89b80; }
.arena .action-button:active:not(:disabled) { transform: translateY(2px); }
.arena .action-icon { width: 23px; height: 24px; flex-basis: 23px; background: none; border-radius: 0; color: #dcdfb3; font-size: 1.2rem; }
.arena .action-copy strong { font-family: var(--title); font-size: 1rem; line-height: 1.15; font-weight: 700; }
.arena .action-copy > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ticket-icon { display: block; position: relative; width: 21px; height: 15px; border: 1.7px solid currentColor; border-radius: 3px; transform: rotate(-10deg); }
.ticket-icon::before, .ticket-icon::after { content: ""; position: absolute; top: 4px; width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 50%; background: var(--paper); }
.ticket-icon::before { left: -4px; border-left-color: transparent; }
.ticket-icon::after { right: -4px; border-right-color: transparent; }
.lily-icon { display: block; position: relative; width: 20px; height: 16px; border: 1.5px solid currentColor; border-radius: 50%; transform: rotate(-20deg); }
.lily-icon::before { content: ""; position: absolute; width: 9px; height: 9px; top: -2px; right: -2px; border: 1.5px solid currentColor; background: var(--paper); border-top-color: transparent; border-right-color: transparent; transform: rotate(-5deg); }
.lily-icon::after { content: ""; position: absolute; left: 3px; top: 7px; width: 9px; border-top: 1px solid currentColor; transform: rotate(-20deg); }
.room-lobby .arena-dock { max-width: 580px; }
.room-lobby .turn-panel { grid-template-columns: minmax(120px, 1fr) minmax(0, 1.4fr); }
.room-lobby .turn-banner > div { grid-column: 1 / -1; }

.arena .pad-tray { position: absolute; inset: auto 0 calc(100% + 18px); padding: 17px 19px; border: 1px solid #7c9f726b; border-radius: 21px; background: #173d33; box-shadow: 0 -6px 36px #092c3255; }
.arena .pad-tray-heading { gap: 12px; margin-bottom: 13px; }
.arena .pad-tray-heading h3 { color: var(--ink); font-size: 1.25rem; letter-spacing: -.03em; }
.arena .pad-tray-heading p { color: var(--muted); margin-top: 4px; font-size: .8125rem; }
.arena .close-pad-tray { background: #305842; border: 0; color: var(--ink); border-radius: 50%; width: 36px; height: 36px; }
.arena .pad-options { gap: 10px; }
.arena .pad-option { grid-template-columns: 53px minmax(0, 1fr); gap: 1px 7px; min-height: 69px; padding: 9px; color: var(--ink); background: #2c5241; border: 1px solid #6d8b6255; border-radius: 13px; font-size: .875rem; }
.arena .pad-option:hover:not(:disabled), .arena .pad-option[aria-pressed="true"] { background: #46623f; border-color: #f6d86b; }
.arena .modifier-preview { width: 53px; height: 48px; border-radius: 8px; }
.arena .pad-distance { color: #e1d79e; font-size: .8125rem; }
.arena .pad-option .pad-decal { width: 37px; }

.primary-button { background: #f4d45c; border-color: #ffebb08a; color: var(--gold-ink); box-shadow: 0 3px 0 #a48a35; }
.primary-button:hover:not(:disabled) { background: #ffe38b; }
.primary-button:active:not(:disabled) { box-shadow: 0 1px 0 #a48a35; }
.secondary-button, .icon-button { background: #2a5040; color: var(--ink); border-color: var(--line); }
.quiet-button { color: var(--ink); }
.secondary-button:hover, .icon-button:hover, .quiet-button:hover { background: #3b624a; }
.dialog { width: min(100% - 32px, 620px); border-color: #6c8c6a; border-radius: 22px; background: #173d33; box-shadow: 0 20px 70px #052b3799; }
.dialog::backdrop { background: #092b3670; backdrop-filter: blur(3px); }
.dialog-header { background: #173d33; border-color: var(--line); padding: 20px; }
.dialog-header h2 { font-size: 1.6rem; }
.close-dialog { min-width: 36px; height: 36px; border: 0; border-radius: 50%; background: #315842; }
.dialog-body { padding: 18px 20px; }
.dialog-footer { background: #173d33; border-color: var(--line); padding: 16px 20px; }
.dialog :is(.player-card, .setup-player, .audio-channel, .history-summary > div) { background: #2b5041; border-color: #63815b66; }
.dialog .player-active { background: #385c43; border-color: #d6c65a88; }
.dialog :is(.player-money, .audio-channel output) { background: #e9d494; color: #3a4929; border-color: #f8e0a5; }
.dialog .standing-leader { background: #355a41; }
.dialog .standing-leader .place-number { background: #e9d494; color: #3a4929; }
.dialog input[type="text"], .dialog select { background-color: #2b5142; color: var(--ink); border-color: #6a8560; min-height: 44px; }
.dialog select { background-image: linear-gradient(45deg, transparent 46%, #d6e0b6 47% 69%, transparent 70%), linear-gradient(-45deg, transparent 45%, #d6e0b6 46% 68%, transparent 69%); }
.dialog .segmented { padding: 3px; background: #0e302a; border-radius: 12px; }
.dialog .segmented button { color: #c3d3b6; min-height: 40px; border-radius: 9px; }
.dialog .segmented button:hover:not(:disabled) { background: #2c5241; }
.dialog .segmented button[aria-pressed="true"] { color: #243d2b; background: #f4d45c; border-color: #fff3ab70; box-shadow: none; }
.dialog .swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #f4d45c; }
.dialog .room-message { color: #ffdaa1; }
.dialog .results-hero { background: linear-gradient(138deg, #355b40, #284c3d); color: var(--ink); }
.dialog .results-hero > span:last-child { color: #f4d878; }
.dialog .rules-body strong { color: #f5dc81; }

.dialog:is([data-kind="leg"], [data-kind="race"]) { width: min(760px, calc(100% - 32px)); max-height: min(70dvh, 530px); bottom: calc(var(--dock-clearance, 104px) + 18px); }
.dialog:is([data-kind="leg"], [data-kind="race"])::backdrop { background: #082e321c; backdrop-filter: none; }
.dialog [data-form="bet"] :is(.dialog-header, .dialog-body, .dialog-footer) { padding: 14px 18px; }
.dialog [data-form="bet"] .dialog-header { align-items: center; border-bottom: 0; padding-bottom: 2px; }
.dialog [data-form="bet"] .dialog-header h2 { font-size: 1.375rem; }
.dialog [data-form="bet"] .dialog-header p { color: var(--muted); margin-top: 4px; font-size: .8125rem; }
.dialog .market-options { margin-bottom: 14px; }
.dialog .market-options button { font-size: .8125rem; padding-inline: 12px; }
.dialog .bet-options { gap: 9px; }
.dialog .bet-option { padding: 13px 6px 11px; gap: 6px; background: color-mix(in srgb, var(--frog-color) 9%, #285040); border: 1px solid #87a26c42; border-radius: 14px; color: var(--ink); font-size: .875rem; }
.dialog .bet-option .frog-art { width: 39px; }
.dialog .bet-option:hover { background: color-mix(in srgb, var(--frog-color) 17%, #285040); border-color: #c9db8b99; }
.dialog .bet-option[aria-pressed="true"] { background: color-mix(in srgb, var(--frog-color) 20%, #285040); border-color: #ffe388; box-shadow: inset 0 0 0 1px #ffe388; }
.dialog .leg-pick-payout { color: #ffe28b; font-size: 1rem; }
.dialog .bet-odds { gap: 6px; margin-top: 13px; }
.dialog .bet-odds h3 { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.dialog .bet-summary { border: 0; background: #244b3c; border-radius: 11px; padding: 7px 3px; }
.dialog .bet-summary > li > span { font-size: .6875rem; }
.dialog .bet-summary strong { color: #ffe28b; font-size: .9375rem; }
.dialog .bet-footer { align-items: center; justify-content: space-between; border-top: 0; padding-top: 0; gap: 16px; }
.bet-footer > p { font-size: .8125rem; line-height: 1.4; color: var(--muted); max-width: 36ch; }
.bet-footer .primary-button { min-height: 43px; flex-shrink: 0; }
.event-banner { color: #f6f0c8; background: #173d33; border-color: #e3ce69; }

@media (max-width: 1050px) {
  .header-controls { gap: 9px; }
  .player-avatars { gap: 3px; }
  .player-avatar { width: 27px; height: 29px; font-size: .6875rem; }
  .dice-count .dice-unit { display: none; }
}
@media (max-width: 820px) {
  .arena-header { grid-template-columns: minmax(0, 1fr) auto; gap: 13px; }
  .race-hud { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; justify-content: center; padding: 9px 13px; }
  .board-stats { justify-content: space-between; width: 100%; }
  .header-controls { grid-column: 2; grid-row: 1; }
  .arena .turn-panel { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .arena .turn-banner { display: flex; gap: 9px; }
  .turn-avatar { width: 32px; height: 32px; font-size: .875rem; }
  .arena .turn-banner > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; flex: 1; }
  .arena .turn-label { font-size: .6875rem; letter-spacing: .05em; }
  .arena .turn-banner strong { margin-top: 0; font-size: 1rem; }
  .arena .turn-wallet { margin-left: auto; }
  .arena .turn-body, .arena .turn-panel:has(.pad-tray:not([hidden])) .turn-body { gap: 9px; }
  .arena .die-button { min-height: 66px; font-size: 1.125rem; padding-inline: 9px; gap: 9px; }
  .arena .action-button { min-height: 66px; font-size: .875rem; padding-inline: 9px; }
  .arena .action-list { gap: 9px; }
  .arena .pad-option { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 3px; padding: 8px 4px; }
  .arena .pad-option :is(.modifier-preview, .pad-decal) { grid-row: auto; }
  .arena .modifier-preview { width: 47px; height: 43px; }
  .room-lobby .turn-panel { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .arena { --hud-gap: 16px; }
  .arena-header .brand { font-size: 1.3rem; gap: 8px; }
  .arena-header .brand-mark, .arena-header .brand-mark .frog-art { width: 31px; }
  .player-roster { display: none; }
  .chat-toggle { width: 44px; padding: 0; }
  .chat-toggle-text { display: none; }
  .chat-panel { top: auto; left: var(--hud-gap); right: var(--hud-gap); bottom: calc(var(--dock-clearance, 128px) + 10px); width: auto; height: min(47dvh, 390px); }
  .arena .action-button { flex-direction: column; gap: 5px; padding: 9px 4px; }
  .arena .action-copy strong { font-size: .875rem; }
  .arena .action-icon { height: 20px; flex-basis: auto; }
  .arena .die-button { padding-inline: 6px; }
  .arena .die-button .die-face { width: 29px; height: 29px; }
  .arena .action-button, .arena .die-button { min-height: 71px; border-radius: 15px; }
  .arena .pad-tray { padding: 14px 12px; border-radius: 18px; }
  .arena .pad-tray-heading h3 { font-size: 1.125rem; }
  .arena .pad-tray-heading p { font-size: .8125rem; }
  .arena .pad-options { gap: 5px; }
  .arena .pad-option { font-size: .8125rem; }
  .arena .pad-distance { font-size: .75rem; }
  .arena .pad-option .modifier-preview { width: 43px; height: 39px; }
  .dialog :is(.dialog-header, .dialog-body, .dialog-footer), .dialog [data-form="bet"] :is(.dialog-header, .dialog-body, .dialog-footer) { padding-inline: 13px; }
  .dialog .bet-options { gap: 5px; }
  .dialog .bet-option { font-size: .75rem; padding-inline: 2px; }
  .dialog .bet-option .frog-art { width: 34px; }
  .dialog .market-options button { font-size: .75rem; padding-inline: 4px; }
  .dialog [data-form="bet"] .dialog-header h2 { font-size: 1.25rem; }
  .bet-footer > p { font-size: .75rem; }
}
@media (max-width: 350px) {
  .arena { --hud-gap: 12px; }
  .arena-header .brand { font-size: 1.2rem; }
  .dice-count { display: none; }
  .arena .turn-body, .arena .turn-panel:has(.pad-tray:not([hidden])) .turn-body { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 7px; }
  .arena .action-list { gap: 7px; }
  .arena .die-button { flex-direction: column; gap: 5px; font-size: 1rem; }
  .arena .die-button .die-face { width: 25px; height: 25px; }
  .arena .die-button .die-face i { width: 4px; height: 4px; }
  .arena .turn-label { font-size: .625rem; }
  .arena .turn-banner strong { font-size: .9375rem; }
  .arena .pad-option { font-size: .75rem; }
}
@media (max-height: 520px) and (min-aspect-ratio: 8/5) {
  .arena { --hud-gap: 12px; }
  .arena-header { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; }
  .arena-header .brand { font-size: 1.125rem; }
  .arena-header .brand-mark, .arena-header .brand-mark .frog-art { width: 27px; }
  .race-hud { grid-column: 2; grid-row: 1; justify-self: center; padding: 8px 12px; }
  .header-controls { grid-column: 3; grid-row: 1; }
  .player-roster { display: none; }
  .chat-toggle { width: 38px; min-height: 38px; padding: 0; }
  .chat-toggle-text { display: none; }
  .chat-panel { top: 58px; bottom: calc(var(--dock-clearance, 76px) + 7px); width: min(320px, 50vw); height: auto; }
  .game-menu > summary { width: 38px; height: 38px; }
  .game-menu .top-actions { max-height: calc(100dvh - 70px); }
  .arena .turn-panel { grid-template-columns: minmax(110px, .85fr) minmax(0, 3fr); gap: 12px; }
  .arena .turn-banner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .arena .turn-avatar { display: none; }
  .arena .turn-banner > div { display: block; grid-column: 1; }
  .arena .turn-wallet { grid-column: 1; margin: 0; }
  .arena .turn-banner strong { margin-top: 2px; font-size: .9375rem; }
  .arena .die-button, .arena .action-button { min-height: 51px; flex-direction: row; gap: 8px; }
  .arena .die-button { font-size: 1.0625rem; }
  .arena .action-copy strong { font-size: .875rem; }
  .arena .action-button { padding-inline: 8px; }
  .arena .pad-tray { --side-tray: 1; left: 0; right: auto; bottom: calc(100% + 14px); width: clamp(220px, 29vw, 270px); padding: 11px 13px; }
  .arena .pad-tray-heading { margin-bottom: 8px; }
  .arena .pad-tray-heading h3 { font-size: 1rem; }
  .arena .pad-tray-heading p { margin-top: 2px; font-size: .75rem; }
  .arena .pad-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .arena .pad-option { grid-template-columns: 33px minmax(0, 1fr); justify-items: start; padding: 6px 4px; min-height: 52px; font-size: .8125rem; }
  .arena .pad-option :is(.modifier-preview, .pad-decal) { grid-row: span 2; }
  .arena .pad-option .modifier-preview { width: 33px; height: 33px; }
  .dialog:is([data-kind="leg"], [data-kind="race"]) { max-height: calc(100dvh - 100px); }
}
@media (max-width: 760px), (hover: none) and (pointer: coarse), (max-width: 960px) and (max-height: 520px) {
  .game-menu .top-actions > .fullscreen-button { display: none; }
}
@media (pointer: coarse) {
  .dialog .close-dialog, .arena .close-pad-tray { min-width: 44px; min-height: 44px; }
  .dialog .segmented button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .arena .die-button:hover:not(:disabled), .arena .action-button:hover:not(:disabled) { transform: none; }
}

/* Opening menu */
.start-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(16px, 3vw, 44px);
  overflow: auto;
  border: 0;
  color: #fff9dd;
  background: radial-gradient(circle at 15% 70%, #317358 0, transparent 34%),
    radial-gradient(circle at 80% 18%, #275d4c 0, transparent 38%), #12382f;
}
.start-screen::backdrop { background: #09221e; }
.start-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .82fr); gap: clamp(24px, 4vw, 72px); width: min(1260px, 100%); min-height: calc(100dvh - clamp(32px, 6vw, 88px)); margin: auto; align-items: center; }
.start-showcase { position: relative; display: flex; flex-direction: column; align-items: start; min-width: 0; }
.start-brand { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 9px; border: 1px solid #d0eca25c; border-radius: 100px; color: #fff7cf; background: #0d3029a8; font: 800 1rem/1 var(--title); letter-spacing: -.025em; }
.start-brand-frog { display: block; width: 28px; height: 24px; }
.start-brand-frog .frog-art { width: 28px; }
.start-art { position: relative; width: min(100%, 580px); height: clamp(230px, 38vh, 380px); margin: 2px 0 8px; isolation: isolate; }
.start-art::before { content: ""; position: absolute; inset: 17% 8% 4%; border: 2px solid #a7d6a951; border-radius: 50%; transform: rotate(-13deg); }
.start-art::after { content: ""; position: absolute; inset: 30% 22% 15%; border: 2px solid #b6deb77a; border-radius: 50%; transform: rotate(12deg); }
.start-ring { position: absolute; border: 1px dashed #9bd3bd7a; border-radius: 50%; }
.start-ring-one { inset: 6% 2% 2%; transform: rotate(12deg); }
.start-ring-two { inset: 38% 30% 23%; }
.start-pad { position: absolute; left: 31%; top: 18%; width: 43%; aspect-ratio: 1.18; border: 9px solid #b8dc73; border-radius: 54% 44% 49% 46%; background: radial-gradient(circle at 38% 30%, #c5ed80, #63ae5c 64%, #3c8055); box-shadow: inset 0 -17px #367449, 0 14px 0 #0c5b5366, 0 30px 38px #062a2e85; transform: rotate(-11deg); }
.start-pad::after { content: ""; position: absolute; right: -10px; top: -10px; width: 38%; height: 42%; background: #174b42; clip-path: polygon(2% 0, 100% 0, 100% 100%); }
.start-frog { position: absolute; display: block; width: clamp(88px, 11vw, 145px); filter: drop-shadow(0 14px 8px #0828207d); animation: start-frog-bob 3.8s ease-in-out infinite; }
.start-frog-green { top: 7%; left: 32%; z-index: 3; transform: rotate(-15deg); }
.start-frog-red { top: 38%; left: 8%; z-index: 4; transform: rotate(-28deg) scale(.83); animation-delay: -.8s; }
.start-frog-yellow { top: 40%; right: 3%; z-index: 2; transform: rotate(24deg) scale(.9); animation-delay: -1.8s; }
.start-spark { position: absolute; color: #f7db65; font-size: clamp(30px, 4vw, 52px); text-shadow: 0 0 20px #f4db75aa; animation: start-sparkle 3s ease-in-out infinite; }
.start-spark-one { top: 6%; right: 17%; }.start-spark-two { bottom: 3%; left: 26%; animation-delay: -1.2s; }
.start-eyebrow, .start-panel-kicker { margin: 0 0 10px; color: #f6d96d; font: 800 .875rem/1.2 var(--title); letter-spacing: .13em; text-transform: uppercase; }
.start-showcase h2 { margin: 0; font: 800 clamp(3.7rem, 7vw, 7rem)/.87 var(--title); letter-spacing: -.09em; }
.start-showcase h2 em { color: #f5d65e; font-style: normal; }
#start-description { max-width: 30ch; margin: 22px 0 0; color: #e0edd5; font-size: clamp(1rem, 1.4vw, 1.25rem); line-height: 1.45; }
.start-actions-panel { width: 100%; padding: clamp(23px, 3vw, 42px); border: 1px solid #c8e7ab55; border-radius: 30px; background: linear-gradient(155deg, #285c46, #194537 80%); box-shadow: 0 24px 80px #071f1e91, inset 0 1px #e5f5b340; }
.start-actions-panel h3 { margin: 0; font: 800 clamp(1.8rem, 3vw, 2.8rem)/1.08 var(--title); letter-spacing: -.06em; }
.start-panel-copy { margin: 8px 0 24px; color: #d4e6cc; font-size: 1rem; }
.start-action-list { display: flex; flex-direction: column; gap: 12px; }
.start-action { display: flex; align-items: center; gap: 15px; width: 100%; min-height: 78px; padding: 12px 17px; border: 1px solid #bde0af73; border-radius: 17px; color: #f9f8e6; background: #123a30; text-align: left; cursor: pointer; transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease; }
.start-action[hidden] { display: none; }
.start-action:hover { transform: translateY(-3px); background: #285845; }
.start-action:active { transform: translateY(2px); }
.start-action-primary { border-color: #fff4b5; color: #1c392c; background: #f6d45b; box-shadow: 0 5px 0 #ad9235; }
.start-action-primary:hover { background: #ffe489; box-shadow: 0 7px 0 #ad9235; }
.start-action-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; background: #ffffff1a; font-size: 1.7rem; }
.start-action-primary .start-action-icon { background: #ffffff69; }
.start-action strong, .start-action small { display: block; }
.start-action strong { font: 800 1.125rem/1.2 var(--title); }
.start-action small { margin-top: 3px; color: inherit; opacity: .78; font: 500 .8125rem/1.3 var(--font); }
.start-utilities { display: flex; gap: 10px; margin-top: 19px; }
.start-utilities button { min-height: 44px; padding: 8px 12px; border: 1px solid #9dc49780; border-radius: 11px; color: #f4f5dc; background: #ffffff0c; font: 700 .875rem var(--font); cursor: pointer; }
.start-utilities button:hover { background: #ffffff25; }
.start-footnote { margin: 26px 0 0; color: #b9d3b3; font: 600 .8125rem var(--font); }
@keyframes start-frog-bob { 50% { translate: 0 -8px; } }
@keyframes start-sparkle { 50% { opacity: .45; scale: .8; } }
@media (max-width: 860px) {
  .start-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 580px; align-content: center; }
  .start-showcase { align-items: center; text-align: center; }
  .start-art { width: min(100%, 370px); height: clamp(130px, 23vh, 210px); margin: 0; }
  .start-frog { width: clamp(68px, 13vw, 105px); }
  .start-eyebrow { margin-bottom: 7px; }
  .start-showcase h2 { font-size: clamp(2.8rem, 9vw, 4.6rem); }
  .start-showcase h2 br { display: none; }
  #start-description { margin-top: 9px; max-width: 44ch; }
  .start-actions-panel { padding: 22px; border-radius: 23px; }
  .start-actions-panel h3 { font-size: 1.75rem; }
  .start-panel-copy { margin-bottom: 14px; }
  .start-footnote { margin-top: 15px; }
}
@media (max-width: 520px) {
  .start-screen { padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
  .start-layout { min-height: calc(100dvh - 32px); }
  .start-art { height: clamp(120px, 19vh, 170px); margin-bottom: 10px; }
  .start-frog { width: 72px; }
  .start-showcase h2 { font-size: clamp(2.55rem, 10vw, 3.4rem); }
  #start-description { font-size: .9375rem; margin-top: 8px; }
  .start-action { min-height: 65px; }
  .start-action-icon { width: 40px; height: 40px; flex-basis: 40px; }
  .start-footnote { display: none; }
}
@media (max-height: 520px) and (min-aspect-ratio: 8/5) {
  .start-screen { padding: 12px 20px; }
  .start-layout { grid-template-columns: minmax(0, 1fr) minmax(310px, 1fr); gap: 20px; min-height: calc(100dvh - 24px); max-width: 1000px; }
  .start-showcase { align-items: start; text-align: left; }
  .start-art { height: 120px; width: 260px; }
  .start-frog { width: 65px; }
  .start-showcase h2 { font-size: clamp(2.5rem, 5vw, 3.7rem); }
  .start-showcase h2 br { display: block; }
  #start-description { font-size: .875rem; margin-top: 8px; }
  .start-actions-panel { padding: 16px 18px; }
  .start-panel-copy { margin: 4px 0 9px; font-size: .875rem; }
  .start-action-list { gap: 7px; }
  .start-action { min-height: 55px; padding: 7px 12px; }
  .start-action-icon { width: 34px; height: 34px; flex-basis: 34px; font-size: 1.3rem; }
  .start-action strong { font-size: .9375rem; }
  .start-action small { font-size: .75rem; }
  .start-utilities { margin-top: 8px; }
  .start-utilities button { min-height: 36px; }
  .start-footnote { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .start-frog, .start-spark { animation: none; }
  .start-action { transition: none; }
}
