:root {
  color-scheme: dark;
  --bg: #172b29;
  --panel: #213b36;
  --panel-deep: #19312e;
  --line: #476158;
  --cream: #fff2cb;
  --muted: #bfd0bf;
  --yellow: #ffda73;
  --mint: #a9e5b9;
  font: 16px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--cream);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 48% -15%, #315248 0%, transparent 55%), var(--bg); }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .53; cursor: default; }
:focus-visible { outline: 3px solid #fff2a5; outline-offset: 3px; }
a { color: inherit; }
[hidden] { display: none !important; }
.cabinet { width: min(100%, 1750px); margin: 0 auto; padding: 12px clamp(12px, 2.4vw, 40px) max(10px, env(safe-area-inset-bottom)); }
.topbar { display: grid; grid-template-columns: 1fr 2.2fr 1.5fr; gap: 12px; align-items: center; min-height: 73px; padding-bottom: 11px; }
.brand { display: inline-flex; justify-self: start; align-items: center; gap: 9px; color: #f8e4ab; text-decoration: none; font-size: .68rem; letter-spacing: .13em; font-weight: 900; line-height: 1.03; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #36594b; color: #ffe99d; font-size: 1.76rem; line-height: 1; letter-spacing: 0; border: 1px solid #678473; }
.brand:hover .brand-mark { background: #426a58; }
.game-title { text-align: center; }
.game-title p, .dialog-head p { margin: 0 0 2px; color: #acd2b7; letter-spacing: .19em; font-size: .65rem; font-weight: 850; }
.game-title h1 { font-size: clamp(1.26rem, 3.2vw, 3.05rem); line-height: 1; letter-spacing: -.06em; margin: 0; white-space: nowrap; font-weight: 950; text-shadow: 0 2px #0c2421; }
.game-title em { color: var(--yellow); font-style: normal; }
.tools { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.button { border: 1px solid var(--line); border-radius: 11px; min-height: 42px; padding: 6px 12px; background: #294840; color: var(--cream); font-weight: 780; line-height: 1.15; }
.button:hover:not(:disabled) { background: #365b50; }
.compact { min-width: 41px; padding: 4px 8px; font-size: 1.18rem; }
.wallet { display: flex; align-items: center; gap: 7px; white-space: nowrap; background: #463f2d; border-color: #6b6040; }
.wallet b, .shop-balance { color: var(--yellow); font-variant-numeric: tabular-nums; }
.wallet-label { font-size: .75rem; }
.coin { display: inline-grid; align-items: center; justify-items: center; width: 22px; height: 22px; border: 1px solid #ffdc81; border-radius: 50%; background: linear-gradient(135deg,#ffe294,#d19438); box-shadow: inset 0 0 0 2px #b67a31, 0 1px 3px #242416; color: #684823; line-height: 1; font-size: .8rem; vertical-align: middle; }
.orientation { display: none; color: var(--mint); font-size: .82rem; margin: 1px 0 7px; }
.physics-panel { display: grid; grid-template-columns: minmax(106px,1fr) minmax(0,4.6fr) auto; align-items: center; gap: 8px 12px; margin-bottom: 10px; padding: 8px 12px; border: 1px solid #5a796a; border-radius: 16px; background: linear-gradient(120deg,#274a40,#1c3733 70%); }
.physics-intro p, .physics-intro h2 { margin: 0; }
.physics-intro .physics-kicker { font-size: .6rem; letter-spacing: .16em; font-weight: 850; color: var(--mint); }
.physics-intro h2 { font-size: clamp(1rem,1.7vw,1.42rem); line-height: 1.1; letter-spacing: -.025em; }
#physics-object { margin-top: 3px; color: var(--muted); font-size: .73rem; }
.physics-readout { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 0; }
.physics-readout > div { min-width: 0; padding: 2px clamp(6px,1.05vw,16px); border-inline-start: 1px solid #4b6b5e; }
.physics-readout dt { color: var(--mint); font-size: clamp(.66rem,1vw,.86rem); font-weight: 800; }
.physics-readout dd { margin: 0; }
.physics-value { font-size: clamp(1.04rem,2.4vw,2rem); color: var(--cream); font-weight: 920; font-variant-numeric: tabular-nums; letter-spacing: -.035em; white-space: nowrap; }
.physics-range { color: var(--yellow); }
.physics-caption { font-size: .68rem; color: var(--muted); }
.physics-panel > .button { padding: 5px 10px; font-size: .77rem; white-space: nowrap; }
.arena { position: relative; isolation: isolate; height: clamp(330px, calc(100svh - 414px), 830px); overflow: hidden; border-radius: 22px; border: 1px solid #829e80; background: linear-gradient(180deg,#77c6d1 0%,#9cdad6 39%,#dce9bc 73%,#a5bf7a 100%); box-shadow: 0 6px 0 #0b201d, 0 16px 44px #0b1b18aa; }
.arena[data-biome="Coral Cove"] { background: linear-gradient(#73b6d6,#b7e5de 57%,#f6dfb9); }
.arena[data-biome="Sunset Bluffs"] { background: linear-gradient(#8a88ac,#e1a795 56%,#f7ce9c 82%); }
.sky-sun { pointer-events: none; position: absolute; width: min(14%, 145px); aspect-ratio: 1; right: 23%; top: 12%; border-radius: 50%; background: radial-gradient(circle,#fff5c4 30%,#ffe8a0 59%,#fff1ad48 70%,transparent 73%); box-shadow: 0 0 80px #fff5ae85; }
.sky-clouds { position: absolute; pointer-events: none; inset: 4% 0 38%; background: radial-gradient(ellipse 14% 8% at 30% 32%,#f6f7d5af 0%,transparent 100%),radial-gradient(ellipse 11% 8% at 36% 27%,#e9f5ddcc 0%,transparent 100%),radial-gradient(ellipse 20% 6% at 81% 46%,#eff3cecc 0%,transparent 100%),radial-gradient(ellipse 15% 7% at 52% 17%,#edf7eabb 0%,transparent 100%); }
#field, #dung-fog, #aim-overlay, .field-effects { position: absolute; inset: 0; width: 100%; height: 100%; }
#field { cursor: crosshair; touch-action: none; display: block; }
#field.is-dragging { cursor: grabbing; }
#field:focus-visible { outline-offset: -5px; }
#dung-fog, #aim-overlay, .field-effects { pointer-events: none; }
#critter-markers { position: absolute; inset: 0; pointer-events: none; }
#critter-markers span { position: absolute; top: 0; left: 0; width: 7px; height: 7px; border-radius: 50%; background: #ffdb69; box-shadow: 0 0 0 1.5px #183e34; }
#critter-markers span.sheltered { background: #ff934d; border-radius: 2px; }
#field-notice { position: absolute; z-index: 2; top: 12%; left: 50%; transform: translateX(-50%); max-width: 90%; width: max-content; padding: 9px 18px; border: 1px solid #e0bc61; border-radius: 12px; background: #18352f; color: #ffeaad; font-weight: 850; font-size: clamp(1rem, 3vw, 1.55rem); text-align: center; pointer-events: none; }
#fuse-status, #last-throw-warning { color: #ffda73; }
#fuse-status:empty { display: none; }
#last-throw-warning { margin: 7px 0 0; }
.dung-cloud {
  position: absolute; transform: translate(-50%, -50%); border-radius: 50%;
  background:
    radial-gradient(ellipse at 34% 43%, #cbe572b3 0%, #9ed34078 27%, transparent 55%),
    radial-gradient(ellipse at 68% 52%, #c0ed677d 0%, #83b93268 33%, transparent 60%),
    radial-gradient(ellipse at center, #89c436b0 9%, #7aa83278 43%, #648c303d 60%, transparent 73%);
}
#aim-overlay path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
#angle-baseline { stroke: #fff4b3; stroke-opacity: .75; stroke-dasharray: 4 4; stroke-width: 2; }
#angle-sweep { stroke: #fff6b4; stroke-width: 2; }
#angle-ray { stroke: #ffd963; stroke-width: 2.5; }
#angle-origin { fill: #fff5b6; }
#angle-marker { fill: #fff7d1; stroke: #25463f; stroke-width: 4px; stroke-linejoin: round; paint-order: stroke; font: 900 17px system-ui; }
.field-header { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px 12px; margin-bottom: 6px; }
.field-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.field-heading > div { min-width: 0; overflow-wrap: anywhere; }
.round-tab { background: #173a33; color: #f9e6ae; border: 1px solid #548072; border-radius: 999px; padding: 6px 10px; min-height: 36px; display: flex; align-items: center; gap: 7px; font-weight: 900; font-size: .68rem; letter-spacing: .1em; }
.round-tab:hover { background: #2c5548; }
.field-heading h2 { font-size: clamp(1.08rem,2.3vw,1.72rem); letter-spacing: -.045em; margin: 0; line-height: 1.12; font-weight: 920; }
.field-meta { display: flex; flex-wrap: wrap; gap: 0 8px; margin: 2px 0 0; color: var(--mint); font-size: .66rem; font-weight: 850; letter-spacing: .11em; }
#fort-structures { letter-spacing: .025em; color: var(--muted); }
.field-objective, .coach, .camera-bar { display: flex; align-items: center; gap: 8px; background: var(--panel-deep); border: 1px solid var(--line); border-radius: 11px; }
.field-objective { padding: 4px 9px; }
.field-objective b, .field-objective div span { display: block; }
.field-objective b { font-size: .86rem; }
.field-objective div span { color: var(--muted); font-size: .68rem; }
.field-objective #throws-left { color: var(--yellow); font-weight: 800; }
.objective-icon { color: var(--yellow); font-size: 1.22rem; font-weight: 800; }
.field-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; margin-top: 10px; }
.coach { flex: 1 1 220px; min-width: 0; min-height: 37px; padding: 6px 10px; }
.coach p { margin: 0; font-size: .83rem; overflow-wrap: anywhere; }
.coach-dot { width: 8px; height: 8px; flex: none; background: var(--mint); border-radius: 50%; box-shadow: 0 0 9px #99d9a5; }
.camera-bar { gap: 2px; padding: 2px; margin-inline-start: auto; }
.camera-bar .button { background: transparent; border-color: transparent; min-height: 40px; min-width: 39px; }
.camera-bar .button:hover:not(:disabled) { background: #365b50; }
.camera-bar .camera-fit { min-width: 76px; padding-inline: 7px; font-size: .73rem; }
.round-result { background: #ffe09a; color: #302b1f; }
.round-result:hover:not(:disabled) { background: #fff0ad; }
.control-deck { display: grid; grid-template-columns: 1.2fr 1fr minmax(148px, .61fr); gap: 12px; margin-top: 8px; }
.dial, .throw-deck { border: 1px solid #476157; background: linear-gradient(168deg,#2b483f,#203a35); border-radius: 15px; padding: 8px 13px 6px; box-shadow: 0 3px 0 #0d2623; min-width: 0; }
.dial-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.dial-top label { display: block; font-size: clamp(.92rem,1.5vw,1.2rem); font-weight: 880; letter-spacing: -.02em; }
.dial-top label + span { display: block; font-size: .73rem; color: var(--muted); }
.stepper { display: flex; align-items: center; background: #162e2c; border: 1px solid #597366; border-radius: 9px; gap: 1px; font-weight: 900; color: var(--yellow); min-height: 38px; }
.stepper button { min-width: 34px; min-height: 36px; border: 0; background: none; color: var(--cream); border-radius: 8px; font-size: 1.12rem; padding: 1px 4px; }
.stepper button:hover { background: #3c6555; }
.stepper input { appearance: textfield; text-align: right; min-width: 0; width: 2.25ch; padding: 0; border: 0; font-variant-numeric: tabular-nums; background: transparent; color: inherit; font-size: 1.27rem; font-weight: 900; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.power-dial .stepper input { width: 3.1ch; text-align: center; color: var(--mint); }
.dial input[type="range"] { display: block; width: 100%; height: 24px; margin: 3px 0 0; accent-color: var(--yellow); cursor: pointer; }
.power-dial input[type="range"] { accent-color: #a2dfad; }
.dial-scale { display: flex; justify-content: space-between; gap: 2px; font-size: .68rem; color: #cfddc9; font-weight: 740; align-items: center; min-height: 26px; white-space: nowrap; }
.dial-scale button { padding: 4px 5px; min-width: 28px; min-height: 27px; background: none; color: inherit; border: 0; border-radius: 6px; }
.dial-scale button:hover, .dial-scale button[aria-pressed="true"] { background: #496350; color: #fff3c5; }
.throw-deck { display: grid; gap: 6px; padding: 8px; }
.fruit-selector { background: #192f2c; border: 1px solid #547064; border-radius: 9px; color: var(--cream); min-height: 34px; font-size: .82rem; font-weight: 830; }
.fruit-selector:hover { background: #365b50; }
.fruit-selector span:first-child { font-size: 1.1rem; margin-right: 5px; }
.fruit-selector span:last-child { margin-left: 4px; }
.launch-button { min-height: 47px; display: flex; align-items: center; justify-content: center; gap: 13px; border-radius: 10px; border: 1px solid #ffe29c; background: linear-gradient(168deg,#ffe697,#f7c455); color: #342a20; font-weight: 950; font-size: clamp(1.15rem,2vw,1.65rem); box-shadow: 0 3px 0 #986b30; }
.launch-button:hover:not(:disabled) { background: #ffecad; }
.launch-button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #986b30; }
.bottom-bar { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 6px 13px; margin-top: 8px; color: var(--muted); font-size: .74rem; }
.quick-toggles { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.quick-toggles label { display: inline-flex; align-items: center; cursor: pointer; min-height: 27px; gap: 3px; }
.quick-toggles input { accent-color: #b4e1b1; }
.quick-toggles button { color: #ffe6a3; border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; min-height: 27px; padding: 0 3px; }
.player-label { display: flex; gap: 5px; align-items: center; }
.player-label img { width: 24px; height: 24px; object-fit: contain; border-radius: 50%; }
dialog { width: min(94vw, 670px); max-height: min(94svh, 740px); background: var(--panel-deep); color: var(--cream); padding: 0; border: 1px solid #7c9d82; border-radius: 19px; box-shadow: 0 20px 75px #0b2421a6; }
dialog::backdrop { background: #081917be; backdrop-filter: blur(3px); }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 13px 17px; background: #29483f; border-bottom: 1px solid #547365; }
.dialog-head h2 { margin: 0; font-size: clamp(1.4rem,5vw,2.15rem); line-height: 1.05; letter-spacing: -.045em; }
.shop-balance { margin-left: auto; font-size: 1.15rem; font-weight: 900; white-space: nowrap; }
.dialog-content { padding: 12px 17px; }
.dialog-copy { color: #cedbc8; margin: 0 0 12px; }
.dialog-actions { position: sticky; bottom: 0; z-index: 1; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 10px 17px; border-top: 1px solid #547365; background: #213e37; }
.button.primary { background: #f6d77d; color: #302b1f; border-color: #ffe7a4; }
.button.primary:hover:not(:disabled) { background: #ffebae; }
.shop-group { margin: 9px 0 18px; }
.shop-group h3 { margin: 0 0 6px; font-size: 1rem; color: var(--mint); }
.shop-grid, #round-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(177px, 1fr)); gap: 7px; }
.shop-card, .round-choice { text-align: left; background: #28463d; border: 1px solid #597665; border-radius: 10px; color: var(--cream); padding: 8px; }
.shop-card { min-height: 91px; }
.shop-card:disabled { opacity: 1; background: #233a35; border-color: #4a675d; color: #d2dbcf; }
.shop-card b, .round-choice b { display: block; }
.shop-card small, .round-choice small { display: block; color: #d0deca; line-height: 1.27; margin-top: 3px; }
.shop-card em { display: block; margin-top: 4px; color: #ffe292; font-size: .79rem; font-weight: 850; font-style: normal; }
.shop-card[aria-pressed="true"], .round-choice[aria-current="true"] { border-color: #ffe08a; box-shadow: inset 0 0 0 1px #ffe08a; }
.shop-card:hover:not(:disabled), .round-choice:hover:not(:disabled) { background: #3c5e50; }
#shop-status { min-height: 1.25em; margin-bottom: 0; color: var(--mint); }
#saved-games-list { display: grid; gap: 7px; padding: 0; margin: 0; list-style: none; }
.current-game, #saved-games-list li { padding: 10px; background: #28463d; border: 1px solid #597665; border-radius: 10px; }
.current-game { margin-bottom: 10px; }
#saved-games-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#saved-games small { display: block; color: #d0deca; margin-top: 3px; overflow-wrap: anywhere; }
#saved-games-status { min-height: 1.25em; margin: 8px 0 0; color: var(--mint); }
.help-angles { display: flex; justify-content: space-around; gap: 8px; margin: 0 0 10px; }
.help-angles span { display: grid; text-align: center; color: var(--muted); }
.help-angles b { font-size: 1.65rem; color: var(--yellow); }
.help-content ol { padding-left: 1.5em; }
.help-content li { margin-bottom: 7px; }
#physics-equations { width: min(660px,calc(100vw - 18px)); }
.equations-list { margin: 0 0 12px; padding-left: 1.45rem; }
.equations-list li { padding: 6px 0; }
.equations-list li::marker { color: var(--yellow); font-weight: 800; }
.equations-list h3 { margin: 0 0 3px; color: var(--mint); font-size: 1rem; }
.equations-list p { margin: 3px 0; }
.equation { border-left: 2px solid #789d7d; padding: 4px 8px; background: #152f2a; color: var(--cream); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-content { text-align: center; }
#clear-stars { color: var(--yellow); font-size: clamp(1.9rem,9vw,4.4rem); line-height: 1; letter-spacing: .1em; padding: 6px 0; }
.badge-link { color: var(--mint); }
.confetti { position: absolute; left: var(--x); top: -12px; width: 8px; height: 12px; background: var(--c); border-radius: 2px; animation: drift var(--duration) var(--delay) both ease-out; }
@keyframes drift { to { transform: translate(var(--drift), 570px) rotate(var(--spin)); opacity: 0; } }
html.arcade-expanded .cabinet { width: 100%; max-width: none; }
.no-script { padding: 16px; }
@media (max-width: 990px) {
  .wallet-label { display: none; }
  .topbar { grid-template-columns: 1fr 2.5fr 1.4fr; }
}
@media (max-width: 740px) {
  .physics-panel { grid-template-columns: minmax(0,1fr) auto; }
  .physics-panel > .button { grid-column: 2; grid-row: 1; }
  .physics-readout { grid-column: 1 / -1; }
  .physics-readout > div:first-child { border-inline-start: none; }
}
@media (max-width: 660px) and (orientation: portrait) {
  .cabinet { padding-inline: 8px; }
  .topbar { grid-template-columns: 42px minmax(0, 1fr); gap: 5px; min-height: 59px; }
  .brand > span + span, .game-title p { display: none; }
  .tools { grid-column: 1 / -1; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .tools .button { min-width: 32px; min-height: 35px; padding-inline: 5px; }
  .game-title h1 { font-size: clamp(.88rem,4.6vw,1.8rem); white-space: normal; }
  .orientation { display: block; }
  .arena { height: clamp(235px,45svh,425px); border-radius: 14px; }
  .field-heading { flex-direction: column; align-items: flex-start; gap: 3px; }
  .field-objective { padding-inline: 6px; }
  .objective-icon { display: none; }
  .camera-bar .button { min-height: 44px; min-width: 44px; }
  .control-deck { grid-template-columns: 1fr; gap: 6px; margin-top: 9px; }
  .throw-deck { grid-template-columns: 1fr 1fr; }
  .dial-scale button { min-width: 36px; }
}
@media (max-width: 440px) and (orientation: portrait) {
  .physics-panel { padding: 7px; gap: 6px; }
  .physics-readout { grid-template-columns: repeat(2,minmax(0,1fr)); row-gap: 4px; }
  .physics-readout > div:nth-child(odd) { border-inline-start: none; }
}
@media (orientation: landscape) and (max-height: 595px) {
  .cabinet { padding-top: 4px; }
  .topbar { min-height: 45px; padding-bottom: 4px; }
  .brand-mark, .tools .button { min-height: 34px; height: 34px; }
  .game-title p { font-size: .51rem; }
  .game-title h1 { font-size: clamp(1.1rem,3.5vw,1.95rem); }
  .physics-panel { margin-bottom: 6px; padding-block: 4px; }
  .physics-panel > .button { min-height: 33px; }
  .physics-value { font-size: clamp(1rem,2.45vw,1.45rem); }
  .arena { height: max(150px, calc(100svh - 288px)); border-radius: 12px; }
  .field-meta { display: none; }
  .field-toolbar { gap: 4px 7px; margin-top: 8px; }
  .coach { min-height: 32px; padding: 4px 7px; }
  .coach p { font-size: .75rem; }
  .camera-bar .button { min-height: 34px; padding-block: 3px; }
  .control-deck { margin-top: 7px; gap: 6px; }
  .dial, .throw-deck { padding: 4px 7px; }
  .dial input[type="range"] { height: 19px; margin-top: 0; }
  .dial-scale button { min-height: 20px; padding-block: 2px; }
  .dial-scale { min-height: 20px; }
  .launch-button { min-height: 34px; }
  .fruit-selector { min-height: 25px; }
  .bottom-bar { margin-top: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .confetti { animation: none; display: none; }
}

.score-line, .round-pages { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.score-line a { color: var(--mint); text-underline-offset: 3px; }
.round-pages { justify-content: center; margin: 0 0 10px; }
.round-pages span { min-width: 7.5rem; text-align: center; color: var(--mint); }

