/* Moonlit Water: restrained caustics, warm ivory and fine brass edges.
   This stylesheet changes materials only; the existing responsive layouts own
   dimensions, placement, dialog scrolling and control visibility. */
:root {
  --water-caustics: url("assets/ui/moonlit-caustics.webp");
  --water-brass: #b79962;
  --water-brass-light: #e9c98f;
  --water-ivory: #fff0cf;
  --water-muted: #b6c9c6;
  --water-ink: #082633;
  --water-button: linear-gradient(175deg, #184b59d6, #0a2c3bec), var(--water-caustics);
  --water-selected: linear-gradient(175deg, #246576be, #103b4be3), var(--water-caustics);
  --water-panel: linear-gradient(170deg, #103949e8, #061c29fa), var(--water-caustics);
  --water-shadow: inset 0 1px #f4d9a657, inset 0 0 0 1px #0823308c,
    inset 0 -2px #051b27a3, 0 3px 8px #00141b80;
}

/* All playable buttons share one quiet surface, including their dialog CTAs. */
.scene-actions > :is(.balance, button),
#expert-hunter-enable,
#controls :is(.cast-button, .buy-feast-button, .turbo-button, .autoplay-button),
#controls :is(#bonus-buy, #bonus-rain-buy, #autoplay-start, #less, #more),
#rules :is(#close-rules, .dialog-play) {
  border-color: var(--water-brass);
  background: var(--water-button);
  background-color: var(--water-ink);
  background-size: auto, 240px 240px;
  background-position: 0 0, 36% 22%;
  background-repeat: no-repeat, repeat;
  color: var(--water-ivory);
  box-shadow: var(--water-shadow);
  text-shadow: 0 1px 2px #021b28b3;
}

/* Remove the former wood braces; the gold outline now carries the material. */
.balance::before,
.balance::after,
#expert-hunter-enable::before,
#expert-hunter-enable::after,
#controls .buy-feast-button::before,
#controls .buy-feast-button::after,
#controls :is(#bonus-buy, #bonus-rain-buy, #autoplay-start)::before,
#controls :is(#bonus-buy, #bonus-rain-buy, #autoplay-start)::after,
#rules .dialog-play::before,
#rules .dialog-play::after {
  content: none;
}

.balance .eyebrow,
#controls .bet .eyebrow,
#controls #bet-currency {
  color: #dfc593;
}

.scene-actions button:hover:not(:disabled),
#expert-hunter-enable:hover,
#controls .buy-feast-button:hover:not(:disabled),
#controls :is(.turbo-button, .autoplay-button):hover:not(:disabled):where(:not([aria-pressed="true"])),
#controls :is(#bonus-buy, #bonus-rain-buy, #autoplay-start, #less, #more):hover:not(:disabled),
#rules :is(#close-rules, .dialog-play):hover {
  border-color: var(--water-brass-light);
  filter: brightness(1.12);
}

.scene-actions button:active:not(:disabled),
#expert-hunter-enable:active,
#controls .buy-feast-button:active:not(:disabled),
#controls :is(#bonus-buy, #bonus-rain-buy, #autoplay-start, #less, #more):active:not(:disabled),
#rules .dialog-play:active {
  box-shadow: inset 0 2px 6px #021822bd, inset 0 1px #d8c18f3d;
}

.scene-actions .sound[aria-pressed="true"],
#controls :is(.turbo-button[aria-pressed="true"], .autoplay-button.active),
#controls .autoplay-widget .autoplay-button[aria-expanded="true"],
#controls .buy-feast-button:is([aria-expanded="true"], .is-running) {
  border-color: var(--water-brass-light);
  background: var(--water-selected);
  background-color: var(--water-ink);
  background-size: auto, 240px 240px;
  background-position: 0 0, 36% 22%;
  color: #fff3d6;
  box-shadow: var(--water-shadow), 0 0 0 1px #d8b67959;
}

#controls :is(.turbo-button[aria-pressed="true"], .autoplay-button.active) svg {
  filter: none;
}

#controls .buy-feast-button:is([aria-expanded="true"], .is-running) strong {
  text-shadow: 0 1px 2px #021b28b3;
}

#controls .turbo-button[aria-pressed="true"]::after {
  background: #f4d39c;
  box-shadow: 0 0 3px #f4d39c59;
}

#controls .cast-button:disabled {
  border-color: #607b7c;
  background: #102f3b;
  color: #8fa9ad;
  box-shadow: inset 0 1px #afcbc524;
}

#controls .bet-amount {
  border-color: #a88c5b;
  background: linear-gradient(180deg, #0d3442, #092632);
  color: var(--water-ivory);
  box-shadow: inset 0 2px 5px #031a24b3, inset 0 1px #e6c9952b;
}

/* Purchase and autoplay panels use the same darker painted water. */
#controls :is(.bonus-panel, .autoplay-panel) {
  border-color: var(--water-brass);
  background: var(--water-panel);
  background-color: var(--water-ink);
  background-size: auto, 360px 360px;
  background-position: 0 0, 10% 0;
  color: var(--water-ivory);
  box-shadow: 0 16px 30px #00131bc2, inset 0 1px #f1d39c66,
    inset 0 0 0 3px #031c2633;
}

#controls :is(.bonus-panel, .autoplay-panel)::before,
#controls :is(.bonus-panel, .autoplay-panel)::after {
  border-color: #e5c68a80;
  background: #b99a62;
  box-shadow: inset 0 1px #ffe9ba80, 0 1px 2px #001b29b3;
}

#controls :is(.bonus-kicker, .autoplay-choice-label) {
  color: #dfbd81;
}

#controls .bonus-panel p {
  color: #d4e0d8;
}

#controls .autoplay-title {
  color: var(--water-ivory);
}

#controls .autoplay-presets button {
  border-color: #7e8874;
  background: #0c2b38;
  color: #e1e8db;
  box-shadow: inset 0 1px #b9d2ce24;
}

#controls .autoplay-presets button[aria-pressed="true"] {
  border-color: var(--water-brass-light);
  background: var(--water-selected);
  background-color: var(--water-ink);
  background-size: auto, 240px 240px;
  color: var(--water-ivory);
  box-shadow: inset 0 1px #f4d9a657, 0 0 0 1px #d8b67959;
}

/* Welcome: real translucence over the lagoon, with a clear text area. */
.expert-hunter-choice-content {
  border-color: #d5b276c9;
  background:
    linear-gradient(160deg, #103c4eb5, #061d2cce),
    var(--water-caustics);
  background-size: auto, 400px 400px;
  background-position: 0 0, 15% 0;
  background-repeat: no-repeat, repeat;
  color: var(--water-ivory);
  box-shadow: 0 12px 30px #00141b70, inset 0 1px #f4d9a657,
    inset 0 0 0 3px #04233326;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  text-shadow: 0 1px 3px #001724;
}

.expert-hunter-kicker {
  color: #dfc593;
}

.expert-hunter-choice h2 {
  color: #ffe2ac;
  text-shadow: 0 1px 3px #001724;
}

.expert-hunter-choice p {
  color: #f1ecd9;
}

.expert-hunter-choice .expert-hunter-confirm-note {
  color: #c6d8d2;
}

/* Information: fully opaque for reading, with caustics only in the header. */
#rules {
  --muted: var(--water-muted);
  --white: var(--water-ivory);
  --line: #a9916240;
  --gold: #f3d69e;
  border-color: var(--water-brass);
  background: linear-gradient(180deg, #102f3d, #081f2b);
  background-color: var(--water-ink);
  color: var(--water-ivory);
  box-shadow: 0 20px 48px #00151bd9, inset 0 1px #f1d39c66,
    inset 0 0 0 3px #02192340;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  scrollbar-color: #b69a66 #102d3a;
}

#rules .dialog-head {
  border-bottom-color: #b69a6652;
  background: var(--water-panel);
  background-color: var(--water-ink);
  background-size: auto, 360px 360px;
  background-position: 0 0, 15% 0;
}

#rules .dialog-head .eyebrow {
  color: #dfbd81;
}

#rules h2 {
  color: var(--water-ivory);
}

#rules p {
  color: #d5dfd7;
}

#rules .fine-print {
  color: #b6c9c6 !important;
}

#rules summary {
  color: #efe4c9;
}

#rules summary:hover,
#rules details[open] > summary {
  color: #f3d69e;
}

@media (prefers-reduced-motion: reduce) {
  .scene-actions button,
  #expert-hunter-enable,
  #controls :is(.turbo-button, .autoplay-button, .buy-feast-button),
  #rules summary {
    transition: none;
  }
}

/* A substantial event win can add a fourth balance digit on a phone. Keep
   the full amount together inside the existing centred-brand HUD. */
@container (min-width: 351px) and (max-width: 550px) {
  .balance:has(strong.long-balance) { padding-inline: 8px; }
  .balance strong.long-balance { font-size: 13px; white-space: nowrap; }
}
