:root { color-scheme: light; --ink: #173838; --muted: #57716f; --mint: #157965; --gold: #f7bc4a; --coral: #dd6074; --blue: #327eac; }
* { box-sizing: border-box; letter-spacing: 0; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-family: 'Segoe UI', Arial, sans-serif; color: var(--ink); background: #c6dfdc; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; color: inherit; }
button:disabled { cursor: default; opacity: .48; }
button:focus-visible, input:focus-visible { outline: 3px solid #cf8f16; outline-offset: 3px; }
button, dialog { border-radius: 8px; }
svg { width: 21px; height: 21px; flex: 0 0 auto; stroke-width: 1.8; pointer-events: none; }
[hidden] { display: none !important; }
#app { position: relative; isolation: isolate; }
#game3d { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#game3d:active { cursor: grabbing; }
.topbar { position: absolute; inset: max(16px, env(safe-area-inset-top)) 20px auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; gap: 10px; align-items: center; flex-shrink: 0; text-shadow: 0 1px 10px #fff9; }
.brand-mark { width: 44px; height: 48px; display: grid; place-items: center; color: #86520b; background: #ffd77b; border: 1px solid #ffe9b6; border-radius: 8px; box-shadow: 0 4px 0 #bf8c36; }
.brand-mark svg { width: 27px; height: 27px; }
h1 { font-size: 1.4375rem; line-height: 1.15; margin: 0 0 4px; }
.brand small { font-size: 0.75rem; font-weight: 600; }
.scoreboard { display: flex; gap: 10px; }
.player-card { --player: var(--coral); min-width: 205px; display: grid; grid-template-columns: 45px minmax(70px, 1fr) 32px; align-items: center; text-align: start; gap: 9px; padding: 6px 9px; border: 1px solid #ffffffb0; background: #f6fcf4ed; box-shadow: 0 4px 16px #224d4212; }
.player-card:nth-child(2) { --player: var(--blue); }
.player-card.active { outline: 2px solid var(--player); outline-offset: 2px; }
.player-card img { width: 45px; height: 45px; object-fit: contain; }
.player-card small { display: block; font-size: 0.625rem; color: var(--muted); }
.player-card strong { font-size: 0.9375rem; display: block; }
.player-card b { font-size: 1.5625rem; text-align: center; color: var(--player); }
.player-card small span { color: #8b386f; font-weight: 700; }
.track { height: 3px; display: block; margin-top: 4px; background: #dbe7df; overflow: hidden; }
.track > span { display: block; height: 100%; background: var(--player); transition: width .25s; }
.top-actions { display: flex; gap: 4px; padding: 5px; background: #f8fcf2e9; border: 1px solid #ffffffe0; border-radius: 8px; }
.quality-control { display: flex; align-items: center; gap: 3px; width: 115px; padding-inline: 4px; }
.quality-control svg { width: 17px; height: 17px; }
.quality-control select { width: 87px; min-width: 0; height: 34px; font: inherit; font-size: 0.75rem; color: var(--ink); background: transparent; border: 0; border-radius: 4px; cursor: pointer; }
.quality-control select:focus-visible { outline: 3px solid #cf8f16; outline-offset: 1px; }
.icon-button { border: 0; display: inline-grid; place-items: center; background: transparent; width: 38px; height: 38px; flex-shrink: 0; position: relative; }
.icon-button:hover { background: #dcebe3; }
.camera-bar { position: absolute; top: 94px; left: 20px; display: flex; gap: 6px; flex-direction: column; align-items: flex-start; }
.camera-modes { display: flex; padding: 4px; gap: 2px; background: #f8fcf2eb; border: 1px solid #fff; border-radius: 8px; box-shadow: 0 5px 15px #22544612; }
.camera-modes button { border: 0; display: flex; align-items: center; gap: 6px; padding: 9px; font-size: 0.75rem; font-weight: 600; background: transparent; min-height: 38px; }
.camera-modes button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.camera-modes svg { width: 17px; height: 17px; }
.camera-adjust { display: flex; padding: 3px; background: #f8fcf2df; border: 1px solid #fff; border-radius: 8px; }
.event-banner { position: absolute; top: 155px; inset-inline-start: 24px; max-width: min(390px, 70%); background: #fffbed; border-inline-start: 4px solid var(--gold); box-shadow: 0 4px 18px #2c4a4220; padding: 12px 18px; font-weight: 700; border-radius: 4px; }
.focus-label { position: absolute; bottom: 120px; inset-inline-start: 24px; display: flex; align-items: center; gap: 8px; background: #f8fcf2e6; border: 1px solid white; padding: 8px 12px; border-radius: 4px; font-size: 0.75rem; }
.live-dot { background: #dc536c; width: 7px; height: 7px; border-radius: 50%; }
.playbar { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(880px, calc(100% - 32px)); display: grid; grid-template-columns: minmax(140px, 1fr) minmax(200px, 1fr) minmax(195px, 1fr); align-items: center; gap: 14px; padding: 12px; background: #f8fcf2f2; border: 1px solid #fff; border-radius: 8px; box-shadow: 0 12px 34px #13453d26; }
.turn-message { min-width: 0; padding: 0 8px; }
.turn-message small { color: var(--mint); font-size: 0.6875rem; font-weight: 700; display: block; }
.turn-message strong { font-size: 1.1875rem; display: block; line-height: 1.3; margin: 3px 0; }
.turn-message > span { font-size: 0.6875rem; color: var(--muted); }
.power-button { display: flex; align-items: center; width: 100%; gap: 9px; padding: 12px; text-align: start; min-height: 68px; background: #e7ebfa; border: 1px solid #cdd4e9; }
.power-button:not(:disabled):hover { background: #dbe0f6; border-color: #8471bd; }
.power-button strong { display: block; font-size: 0.9375rem; }
.power-button small { display: block; font-size: 0.625rem; margin-top: 3px; }
.power-icon { width: 28px; display: grid; place-items: center; color: #6e56a4; }
.charge { display: flex; flex-direction: column; gap: 3px; margin-inline-start: auto; }
.charge i { width: 5px; height: 11px; background: #bec7d6; border-radius: 2px; }
.charge i.full { background: #7b65aa; }
.roll-button { display: flex; align-items: center; justify-content: center; gap: 14px; background: #197c63; color: #fff; border: 1px solid #309879; padding: 9px 16px; min-height: 68px; box-shadow: 0 4px 0 #105240; text-align: start; }
.roll-button:hover:not(:disabled) { background: #208b6e; }
.roll-button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #105240; }
.roll-button strong { display: block; font-size: 1.0625rem; }
.roll-button small { display: block; font-size: 0.625rem; color: #d3efdf; margin-top: 3px; }
.die-face { display: grid; direction: ltr; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 43px; height: 43px; padding: 7px; gap: 3px; background: #fffdf2; border-radius: 7px; box-shadow: 0 3px 0 #b9d7ca; flex-shrink: 0; }
.die-face i { border-radius: 50%; background: #173d35; visibility: hidden; }
.die-face i.on { visibility: visible; }
.rolling { animation: wobble .17s infinite alternate; }
@keyframes wobble { to { transform: rotate(10deg) translateY(-2px); } }
dialog { width: min(650px, calc(100% - 24px)); max-height: calc(100% - 28px); padding: 24px; border: 1px solid #fff; background: #f5f9f1; color: var(--ink); box-shadow: 0 24px 100px #0b312a70; overflow-y: auto; }
dialog::backdrop { background: #123e3b68; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.dialog-heading small { color: var(--muted); font-size: 0.75rem; }
h2 { margin: 3px 0 0; font-size: 1.75rem; }
.selection-title { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; margin: 12px 0 8px; font-weight: 700; }
.selection-title i { width: 8px; height: 8px; background: var(--coral); border-radius: 50%; }
.selection-title.player-1 i { background: var(--blue); }
.character-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.animal-choice { border: 1px solid #cfddd5; background: #fffdf9; text-align: center; padding: 8px 4px; }
.animal-choice.selected { border-color: #308872; box-shadow: inset 0 0 0 1px #308872; background: #e7f4e9; }
.animal-choice img { display: block; width: 80px; max-width: 100%; height: 75px; object-fit: contain; margin: auto; }
.animal-choice strong { display: block; font-size: 0.9375rem; }
.animal-choice small { display: block; font-size: 0.625rem; margin-top: 4px; }
.world-title { margin: 20px 0 8px; font-size: 0.8125rem; }
.world-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.world-choice { padding: 7px; background: #fffdf9; border: 1px solid #cfddd5; min-width: 0; }
.world-choice[aria-pressed="true"] { border-color: var(--world-accent); box-shadow: inset 0 0 0 1px var(--world-accent); }
.world-swatches { display: grid; grid-template-columns: repeat(4, 1fr); height: 27px; overflow: hidden; border-radius: 3px; }
.world-name { display: flex; gap: 5px; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 600; margin-top: 7px; min-height: 24px; }
.world-name svg { color: var(--world-accent); width: 16px; height: 16px; }
.mode-setting { margin: 22px 0; border-top: 1px solid #d4dfd6; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; }
.mode-setting small { display: block; font-size: 0.6875rem; margin-top: 4px; color: var(--muted); }
.switch { display: block; position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; position: absolute; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { display: block; height: 28px; border-radius: 20px; background: #bacbc1; }
.switch span::after { content: ''; display: block; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; border-radius: 50%; background: white; transition: transform .2s; box-shadow: 0 2px 5px #244b3430; }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid #cf8f16; outline-offset: 3px; }
.primary-button { width: 100%; padding: 13px; display: flex; justify-content: center; align-items: center; gap: 10px; border: 0; background: var(--mint); color: white; font-weight: 700; }
#victory { text-align: center; width: min(440px, calc(100% - 24px)); padding: 30px; }
.victory-symbol { width: 72px; height: 72px; margin: 0 auto 15px; background: #ffe3a1; color: #9d6916; border-radius: 50%; display: grid; place-items: center; }
.victory-symbol svg { width: 42px; height: 42px; }
#victory h2 { font-size: 2.125rem; }
#victory p { color: var(--muted); }
#load-error { position: absolute; inset: 25%; padding: 24px; background: white; }
@media(max-width: 1150px) { .brand h1 { font-size: 1.1875rem; } .player-card { min-width: 172px; } .topbar { gap: 10px; } .brand-mark { display: none; } }
@media(max-width: 850px) { .brand { display: none; } .topbar { inset: 12px 12px auto; } .scoreboard { flex: 1; } .player-card { flex: 1; min-width: 0; } .camera-bar { top: 85px; left: 12px; } .playbar { width: calc(100% - 24px); gap: 8px; grid-template-columns: 1fr 1.1fr 1.1fr; } .turn-message strong { font-size: 1.0625rem; } .roll-button { padding: 9px; gap: 9px; } .roll-button strong { font-size: 0.9375rem; } .power-button { padding: 9px; gap: 6px; } }
@media(max-width: 600px) {
  .topbar { gap: 6px; flex-wrap: wrap; inset: 10px 10px auto; } .scoreboard { width: 100%; flex-basis: 100%; gap: 8px; }
  .player-card { grid-template-columns: 36px minmax(40px, 1fr) 24px; gap: 5px; padding: 5px 7px; }
  .player-card img { width: 36px; height: 39px; } .player-card strong { font-size: 0.8125rem; } .player-card b { font-size: 1.375rem; }
  .top-actions { margin-inline-start: auto; padding: 2px; gap: 0; } .icon-button { width: 34px; height: 36px; }
  .camera-bar { top: 113px; left: 10px; right: 10px; flex-direction: row; justify-content: space-between; align-items: start; gap: 5px; }
  .camera-modes { flex: 1; } .camera-modes button { flex: 1; justify-content: center; padding: 8px 5px; } .camera-modes button span { display: none; } .camera-adjust { gap: 0; }
  .event-banner { top: 168px; inset-inline-start: 10px; max-width: calc(100% - 20px); font-size: 0.75rem; padding: 9px 12px; }
  .playbar { bottom: max(10px, env(safe-area-inset-bottom)); grid-template-columns: 1fr 1fr; padding: 9px; gap: 8px; width: calc(100% - 20px); }
  .turn-message { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; padding: 0 2px; }
  .turn-message strong { font-size: 0.875rem; margin: 0; } .turn-message > span { display: none; } .turn-message small { flex-shrink: 0; font-size: 0.625rem; }
  .roll-button, .power-button { min-height: 61px; padding: 7px; } .roll-button strong { font-size: 0.8125rem; } .roll-button small { font-size: 0.5625rem; } .power-button strong { font-size: 0.75rem; } .power-button small { font-size: 0.5625rem; } .power-icon { width: 22px; } .power-icon svg { width: 18px; } .charge { display: none; }
  .die-face { width: 36px; height: 36px; padding: 6px; gap: 2px; } .focus-label { bottom: 132px; inset-inline-start: 10px; }
  dialog { padding: 16px; } .animal-choice img { width: 58px; height: 64px; } .animal-choice small { font-size: 0.5625rem; } .character-row { gap: 5px; } .animal-choice strong { font-size: 0.8125rem; }
  .world-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; } .world-swatches { height: 20px; }
}
@media(max-height: 520px) and (min-width: 601px) {
  .topbar { inset: 7px 10px auto; } .player-card { padding: 3px 7px; } .player-card img { height: 32px; width: 32px; } .brand h1 { font-size: 1.0625rem; }
  .camera-bar { top: 65px; left: 10px; } .camera-modes button span { display: none; } .camera-modes button { padding: 7px; }
  .playbar { bottom: 7px; width: min(760px, calc(100% - 20px)); padding: 7px; } .power-button, .roll-button { min-height: 50px; padding: 5px 9px; } .turn-message strong { font-size: 0.9375rem; } .turn-message > span { display: none; } .die-face { width: 34px; height: 34px; padding: 5px; } .focus-label { bottom: 83px; }
  .event-banner { top: 115px; font-size: 0.75rem; }
}
@media(prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* Translation may reflow text, but never resizes or mirrors the Three.js scene. */
.top-actions { flex-wrap: wrap; max-width: 100%; }
.quality-control { width: auto; min-width: 115px; max-width: 100%; }
.quality-control select { width: auto; min-width: 87px; max-width: calc(100vw - 90px); }
select { font: inherit; color: inherit; }
select:focus-visible { outline: 3px solid #cf8f16; outline-offset: 3px; }
.player-card > div, .power-button > span, .roll-button > span, .dialog-heading > div { min-width: 0; }
.player-card small span[id^="player-name"] { color: var(--muted); font-weight: 400; }
#cpu-badge { display: inline-block; padding: 1px 5px; border-radius: 4px; background: #dbeae5; color: #145b4e; }
#cpu-badge[hidden] { display: none; }
.power-button, .roll-button { white-space: normal; }
.power-button strong, .roll-button strong, .world-name, .animal-choice strong, h2 { overflow-wrap: anywhere; }
.power-icon, .die-face { flex-shrink: 0; }
.world-name { flex-wrap: wrap; }
.dialog-heading { gap: 8px; }
.dialog-heading > div { flex: 1; }
.mode-setting { gap: 12px; }
#language-dialog { width: min(400px, calc(100% - 24px)); }
#language-dialog h2 { margin-bottom: 20px; font-size: 1.5rem; }
#language-dialog label { display: block; margin-bottom: 8px; }
#language-select { display: block; width: 100%; min-height: 44px; background: white; border: 1px solid #77938c; border-radius: 4px; padding: 8px; }
#language-notice { font-size: 0.8125rem; line-height: 1.5; }
#sub-message { unicode-bidi: plaintext; }
[dir="ltr"] #start-game-button svg { transform: scaleX(-1); }
@media(max-width: 600px) {
  .turn-message { flex-wrap: wrap; }
  .turn-message small { flex-shrink: 1; }
  .character-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .animal-choice strong { font-size: 0.875rem; }
  .animal-choice small { font-size: 0.6875rem; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.focus-shortcut:not(:focus) { position: fixed; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.focus-shortcut:focus { position: fixed; inset-block-start: 12px; inset-inline-start: 12px; z-index: 100; width: auto; height: auto; margin: 0; clip-path: none; overflow: visible; max-width: calc(100vw - 24px); min-height: 48px; padding: 12px; white-space: normal; color: #173838; background: #fffdf9; outline: 3px solid #173838; }
#available-actions { padding-inline-start: 1.6em; line-height: 1.6; }
.commentary-options { display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid #77938c; margin-block: 14px; }
.commentary-options label { display: flex; gap: 8px; align-items: center; min-height: 48px; padding-inline: 8px; }
.commentary-options input { width: 24px; height: 24px; accent-color: var(--mint); }
#commentary-who, #setup-commentary-enable { min-height: 48px; white-space: normal; max-width: 100%; }
#text-scale-probe { width: 1rem; height: 1rem; pointer-events: none; }
.settings-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; border-bottom: 1px solid #ccd8d1; }
.settings-row > label, .settings-row > span { overflow-wrap: anywhere; }
.settings-row select { max-width: 100%; min-height: 44px; border: 1px solid #77938c; border-radius: 4px; padding: 8px; background: white; }
.settings-row input { width: 24px; height: 24px; accent-color: var(--mint); }
.settings-note, #summary-content p, #last-action, #summary-pending { line-height: 1.65; overflow-wrap: anywhere; }
dialog h2:focus-visible { outline: 2px solid #173838; outline-offset: 4px; }
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { animation: none !important; transition: none !important; }
.text-reflow, .text-reflow body { height: auto; min-height: 100%; overflow: auto; }
.text-reflow #app { height: auto; min-height: 100vh; overflow: visible; padding-bottom: 12px; }
.text-reflow #game3d { position: fixed; inset: 0; height: 100vh; z-index: -1; }
.text-reflow .topbar { position: relative; inset: auto; margin: 12px; flex-wrap: wrap; }
.text-reflow .scoreboard { width: 100%; flex: 1 0 100%; flex-wrap: wrap; }
.text-reflow .player-card { flex: 1; min-width: min(100%, 300px); grid-template-columns: 45px minmax(0, 1fr) auto; }
.text-reflow .top-actions { margin: 0; flex-wrap: wrap; }
.text-reflow .camera-bar { position: relative; top: 0 !important; inset-inline: auto; margin: 12px; flex-wrap: wrap; }
.text-reflow .camera-modes { flex-wrap: wrap; }
.text-reflow .playbar { position: relative; inset: auto; transform: none; margin: 12px; width: calc(100% - 24px); grid-template-columns: minmax(0, 1fr); }
.text-reflow .turn-message { flex-wrap: wrap; }
.text-reflow .turn-message > span { display: block; }
.text-reflow .event-banner, .text-reflow .focus-label { position: relative; inset: auto !important; max-width: none; margin: 12px; }
.text-reflow .character-row, .text-reflow .world-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.text-reflow .quality-control { flex: 1 1 100%; }
.text-reflow .quality-control select { min-height: 44px; }
.text-reflow .settings-row { align-items: start; flex-direction: column; }
.text-reflow dialog { max-height: calc(100dvh - 24px); }
.select-wrap { position: relative; display: inline-grid; min-width: min(100%, 8rem); max-width: 100%; border: 1px solid #77938c; border-radius: 4px; background: white; }
.select-wrap select { position: absolute; inset: 0; width: 100% !important; height: 100% !important; min-width: 0 !important; max-width: none !important; margin: 0; opacity: 0; cursor: pointer; }
.select-value { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px; pointer-events: none; }
.select-value > span { min-width: 0; overflow-wrap: anywhere; }
.select-value svg { margin-inline-start: auto; width: 16px; }
.select-wrap:focus-within { outline: 3px solid #cf8f16; outline-offset: 3px; }
.quality-control .select-wrap { background: transparent; border: 0; min-width: 87px; font-size: .75rem; }
.quality-control .select-value { min-height: 34px; padding: 2px; }
#language-dialog > .select-wrap { display: grid; width: 100%; }

/* Measured by the camera adapter; env() values are not guessed in JavaScript. */
#safe-area-probe { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); pointer-events: none; }
.android-host {
  --native-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --native-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --native-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --native-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
}
.android-host #safe-area-probe { padding: var(--native-top) var(--native-right) var(--native-bottom) var(--native-left); }
.android-host:not(.text-reflow) .topbar { top: max(10px, var(--native-top)); left: max(10px, var(--native-left)); right: max(10px, var(--native-right)); }
.android-host:not(.text-reflow) .playbar { bottom: max(10px, var(--native-bottom)); left: calc(50% + (var(--native-left) - var(--native-right)) / 2); max-width: calc(100% - var(--native-left) - var(--native-right) - 20px); }
.android-host:not(.text-reflow) .camera-bar { left: max(10px, var(--native-left)); max-width: calc(100% - var(--native-left) - var(--native-right) - 20px); }
.android-host dialog { inset: var(--native-top) var(--native-right) var(--native-bottom) var(--native-left); max-width: calc(100vw - var(--native-left) - var(--native-right) - 24px); max-height: calc(100dvh - var(--native-top) - var(--native-bottom) - 24px); }
.android-host.text-reflow body { padding: var(--native-top) var(--native-right) var(--native-bottom) var(--native-left); }
#play-space { display: none; pointer-events: none; }
.camera-adjust .icon-button { width: 38px; height: 38px; }
.camera-bar { max-width: calc(100% - 40px); }
@media(max-width:600px) {
  .camera-bar { max-width: calc(100% - 20px); flex-wrap: wrap; }
  .camera-modes { flex: 1 1 100%; }
  .camera-modes button { min-width: 44px; min-height: 44px; }
  .camera-adjust { margin-inline-start: auto; }
  .camera-adjust .icon-button { width: 44px; height: 44px; }
}
@media(max-height:520px) and (min-width:601px) {
  .camera-bar { flex-direction: row; align-items: start; }
}
.text-reflow #play-space { display: block; height: max(240px, 42vh); }
.text-reflow .camera-bar { max-width: calc(100% - 24px); }
.text-reflow .camera-modes button span { display: none; }
.text-reflow .camera-modes button { flex: 1; min-width: 44px; min-height: 44px; justify-content: center; }
.text-reflow .focus-label { display: none; }

#trivia-dialog { width: min(620px, calc(100vw - 24px)); text-align: start; overflow-wrap: anywhere; line-height: 1.6; }
.trivia-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trivia-answers button, .trivia-actions > button:not(.primary-button) { min-height: 48px; border: 1px solid #77938c; border-radius: 8px; padding: 12px; background: #fff; color: #173838; font: inherit; white-space: normal; overflow-wrap: anywhere; }
.trivia-answers button[aria-pressed="true"] { border: 3px solid #286453; background: #e0eee6; }
.trivia-answers button:disabled { opacity: 1; }
.trivia-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 16px; }
.trivia-actions .primary-button { flex-basis: 100%; }
#trivia-result:focus-visible { outline: 2px solid #173838; outline-offset: 4px; }
.text-reflow .trivia-answers { grid-template-columns: minmax(0, 1fr); }

/* Explanation is ordinary readable UI; no new animation or live region. */
.ability-wrap { min-width: 0; }
.power-actions { display: flex; align-items: stretch; gap: 5px; }
.power-actions .power-button { flex: 1; min-width: 0; }
.power-info-action { flex: 0 0 4.5rem; min-height: 44px; padding: 5px; font-size: .75rem; border: 1px solid #77938c; background: #fffdf9; overflow-wrap: anywhere; }
.power-caption { margin: 5px 0 0; font-size: .8125rem; line-height: 1.35; }
.power-caption span { display: block; }
.player-card [id^="badge-"] { display: inline-flex; flex-wrap: wrap; gap: 3px; }
#help-offer, #help-dialog, #power-info-dialog { line-height: 1.6; overflow-wrap: anywhere; }
#help-offer { width: min(480px, calc(100vw - 24px)); }
.help-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; position: sticky; top: -16px; z-index: 1; padding-block: 8px; background: #f5f9f1; }
.help-header h2 { font-size: 1.4rem; }
.help-header .icon-button { min-width: 44px; min-height: 44px; }
.help-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 20px; }
.help-actions button { flex: 1 1 9rem; min-height: 48px; margin: 0; padding: 10px; border: 1px solid #77938c; white-space: normal; overflow-wrap: anywhere; }
.help-actions button:not(.primary-button) { background: #fffdf9; }
.finish-example { display: flex; flex-wrap: wrap; list-style: none; gap: 8px; padding: 0; direction: ltr; }
.finish-example li { border: 2px solid #336659; padding: 6px 10px; background: #fff; border-radius: 6px; }
.finish-example li + li::before { content: '→ '; }
#power-prediction { border-inline-start: 3px solid #7b65aa; padding-inline-start: 12px; }
#power-info-dialog.showing-preview { width: min(420px, calc(100vw - 24px)); max-height: 48dvh; margin: auto 12px 12px; }
#power-info-dialog.showing-preview::backdrop { background: transparent; backdrop-filter: none; }
#power-info-dialog.showing-preview #power-info-body { display: none; }
#power-info-dialog.showing-preview:has(#power-prediction[hidden]) #power-info-body { display: block; }
#power-info-dialog.showing-preview #power-prediction p { margin-block: 6px; }
.text-reflow .power-actions { flex-wrap: wrap; }
.text-reflow .power-info-action { flex-basis: 100%; }
/* Short landscape uses horizontal room for the explanation, not smaller text
   or a taller playbar that crowds the camera's measured safe area. */
@media(max-height:520px) and (min-width:850px) {
  html:not(.text-reflow) .playbar:has(.ability-wrap:not([hidden])) { width: calc(100% - 20px); grid-template-columns: minmax(0,.7fr) minmax(0,1.2fr) minmax(0,1.1fr) minmax(0,1fr); gap: 8px; }
  html:not(.text-reflow) .ability-wrap { display: contents; }
  html:not(.text-reflow) .power-caption { margin: 0; }
}

/* Preview metadata only; no game/style-source mutation. */
.top-actions{flex-wrap:wrap;max-width:min(32rem,100%)}
.preview-build{flex:1 0 100%;font:500 .75rem/1.4 system-ui,sans-serif;direction:ltr;text-align:center;overflow-wrap:anywhere;color:#173e3c;padding:0 .25rem;pointer-events:none}
.preview-details{font-size:.75rem;line-height:1.35;text-align:start;overflow-wrap:anywhere}
