/* adventure.css — Keno Quest: glossy cartoon adventure cabinet. Turquoise sky,
   timber and gold toy cabinet, terracotta Bricks, teal gem selections, brass
   compass emblem. Scoped to body[data-theme="adventure"]; decorative art lives on
   pseudo-elements (pointer-events:none) over painted CSS fallbacks. */

body[data-theme="adventure"] {
  --av-sky-hi: #7fe3ff; --av-sky: #2fc4ef; --av-sky-deep: #1590c9;
  --av-frost: #fffaf0; --av-frost-shade: #e3f3fb;
  --av-wood-hi: #e79a4f; --av-wood: #c46a2a; --av-wood-deep: #8a3f14; --av-wood-ink: #4e2108;
  --av-gold-hi: #fff3a6; --av-gold: #ffc934; --av-gold-deep: #d98b0c; --av-gold-ink: #6b3a00;
  --av-cream: #fff4d8; --av-cream-deep: #f3dcaa;
  --av-coral-hi: #ff8f78; --av-coral: #f0473a; --av-coral-deep: #a81f1c;
  --av-berry: #c2267e; --av-berry-deep: #6e0f4a; --av-berry-hi: #ff8acb;
  --av-star: #3c7bd9; --av-star-deep: #1d3f86;
  --av-ink: #3a1a06; --av-focus: #10305a;
  --av-font: "Fredoka FX", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  background-color: var(--av-sky);
  background-image:
    url("adventure-assets/scenery-landscape.webp"),
    radial-gradient(140% 22% at 50% 104%, var(--av-frost) 60%, transparent 61%),
    radial-gradient(120% 60% at 50% 0%, var(--av-sky-hi) 0%, var(--av-sky) 45%, var(--av-sky-deep) 100%);
  background-size: cover, 100% 100%, 100% 100%;
  background-position: center bottom, center, center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100dvh;
  color: var(--av-ink);
  font-family: var(--av-font);
}
html body[data-theme="adventure"] #gameApp { position: relative; z-index: 1; }

/* ============ Masthead: Keno Quest sign ============ */
html body[data-theme="adventure"][data-theme] #gameApp .brand {
  position: relative; padding: 8px 26px 10px; text-align: center;
  background:
    linear-gradient(180deg, #ffffff55 0 3px, transparent 3px),
    repeating-linear-gradient(90deg, #0000 0 38px, #8a3f1422 38px 40px),
    linear-gradient(180deg, var(--av-wood-hi), var(--av-wood) 55%, var(--av-wood-deep));
  border: 4px solid var(--av-gold); border-radius: 22px;
  box-shadow: 0 0 0 3px var(--av-wood-ink), inset 0 -5px 0 #5a24083d, 0 7px 0 var(--av-wood-ink), 0 14px 18px #0a4a6b44;
}
html body[data-theme="adventure"][data-theme] #gameApp .brand::before,
html body[data-theme="adventure"][data-theme] #gameApp .brand::after {
  content: ""; position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--av-gold-hi), var(--av-gold) 50%, var(--av-gold-deep));
  box-shadow: 0 0 0 2px var(--av-wood-ink); pointer-events: none; display: block;
}
html body[data-theme="adventure"][data-theme] #gameApp .brand::before { left: 7px; transform: none; opacity: 1; }
html body[data-theme="adventure"][data-theme] #gameApp .brand::after { right: 7px; left: auto; }
html body[data-theme="adventure"][data-theme] #gameApp .brand h1 {
  font-family: var(--av-font); font-weight: 700; color: var(--av-gold-hi); letter-spacing: .02em;
  -webkit-text-stroke: 1.5px var(--av-wood-ink); paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--av-wood-ink), 0 5px 4px #3a1a0666; filter: none; background: none;
}
html body[data-theme="adventure"][data-theme] #gameApp .brand h1 span span { color: #fff; }
html body[data-theme="adventure"][data-theme] #gameApp :is(.brand-kicker, .brand-subtitle) {
  color: var(--av-cream); font-family: var(--av-font); font-weight: 700; letter-spacing: .12em;
  text-shadow: 0 1px 0 var(--av-wood-ink); background: none; border: 0;
}
html body[data-theme="adventure"][data-theme] #gameApp .theme-label { color: #0b3a5a; font-weight: 700; }
html body[data-theme="adventure"][data-theme] #gameApp .game-help-link {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 14px;
  background: var(--av-frost); color: #0b3a5a; font-weight: 700; text-decoration: none;
  border: 3px solid #fff; box-shadow: 0 4px 0 #1581b4;
}
html body[data-theme="adventure"][data-theme] #gameApp .account-launcher {
  background: linear-gradient(var(--av-cream), var(--av-cream-deep)); color: var(--av-wood-ink);
  border: 3px solid var(--av-gold); border-radius: 16px; box-shadow: 0 0 0 2px var(--av-wood-ink), 0 4px 0 var(--av-wood-ink);
}
html body[data-theme="adventure"][data-theme] #gameApp .account-cue { background: var(--av-coral-deep); color: #fff7ec; }
html body[data-theme="adventure"][data-theme] #gameApp .account-warning { background: #fff1ef; color: #8a1424; border-color: #8a1424; }
html body[data-theme="adventure"][data-theme] #gameApp :is(.account-launcher, .game-help-link):focus-visible { outline: 4px solid var(--av-focus); outline-offset: 4px; }

/* ============ Compact top resources ============ */
html body[data-theme="adventure"][data-theme] #gameApp .header {
  background: linear-gradient(180deg, #0b5f8f99, #0a4a7099); border: 3px solid #ffffffb0; border-radius: 20px;
  box-shadow: inset 0 2px 0 #ffffff55, 0 6px 14px #06375a40; backdrop-filter: none;
}
html body[data-theme="adventure"][data-theme] #gameApp .balance-pill {
  font-family: var(--av-font); font-weight: 700; color: var(--av-gold-ink); gap: 6px; flex-wrap: wrap;
  background: linear-gradient(180deg, #ffffff99 0 2px, transparent 2px), linear-gradient(180deg, var(--av-gold-hi), var(--av-gold));
  border: 3px solid var(--av-cream); border-radius: 999px; box-shadow: 0 0 0 2px var(--av-gold-deep), 0 3px 0 var(--av-gold-deep);
  overflow-wrap: anywhere;
}
html body[data-theme="adventure"][data-theme] #gameApp #balance { font-variant-numeric: tabular-nums; font-size: 1.08rem; overflow-wrap: anywhere; }
html body[data-theme="adventure"][data-theme] #gameApp .wallet-unit { color: inherit; font-weight: 600; }
html body[data-theme="adventure"][data-theme] #gameApp .icon-coin { width: 26px; height: 26px; flex: none; filter: drop-shadow(0 2px 0 #8a5000); }
html body[data-theme="adventure"][data-theme] #gameApp .wallet .brick-balance {
  color: #fff4fa;
  background: linear-gradient(180deg, #ffffff66 0 2px, transparent 2px), linear-gradient(160deg, var(--av-berry-hi), var(--av-berry) 55%, var(--av-berry-deep));
  border: 3px solid #ffe1f1; box-shadow: 0 0 0 2px var(--av-berry-deep), 0 3px 0 var(--av-berry-deep);
}
html body[data-theme="adventure"][data-theme] #gameApp .wallet .brick-balance .brick-number-surface { background: var(--av-cream); color: var(--av-berry-deep); box-shadow: inset 0 2px 2px #6e0f4a33; }
html body[data-theme="adventure"][data-theme] #gameApp .wallet .brick-balance .wallet-unit { color: #fff4fa; text-shadow: 0 1px 0 var(--av-berry-deep); }
html body[data-theme="adventure"][data-theme] #gameApp .icon-brick { filter: hue-rotate(-40deg) saturate(1.2) drop-shadow(0 2px 0 #4a0830); }
html body[data-theme="adventure"][data-theme] #gameApp .level-pill {
  color: #fff; background: linear-gradient(180deg, #ffffff55 0 2px, transparent 2px), linear-gradient(160deg, #2f62bf, #234d9e 60%, var(--av-star-deep));
  border: 3px solid #e6f0ff; border-radius: 16px; box-shadow: 0 0 0 2px var(--av-star-deep), 0 3px 0 var(--av-star-deep);
}
html body[data-theme="adventure"][data-theme] #gameApp .level-details :is(strong, span) { color: #fff; text-shadow: 0 1px 0 var(--av-star-deep); }
html body[data-theme="adventure"][data-theme] #gameApp .level-details progress { accent-color: var(--av-gold); }
html body[data-theme="adventure"][data-theme] #gameApp .level-icon { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 2px 0 var(--av-star-deep)); }
html body[data-theme="adventure"][data-theme] #gameApp .level-icon path { fill: var(--av-gold-hi); stroke: var(--av-gold-deep); }

/* ---- Illustrated reward badges: Get Coins, chests, Map ---- */
html body[data-theme="adventure"][data-theme] #gameApp :is(.btn-get-coins, .btn-bonus, #mapButton.map-button) {
  position: relative; font-family: var(--av-font); font-weight: 700; color: var(--av-wood-ink); text-shadow: 0 1px 0 #fff6;
  background: linear-gradient(180deg, #ffffffaa 0 3px, transparent 3px), linear-gradient(180deg, var(--av-cream), var(--av-cream-deep));
  border: 3px solid var(--av-gold); border-radius: 18px;
  box-shadow: 0 0 0 2px var(--av-wood-ink), 0 4px 0 var(--av-wood-ink), 0 8px 10px #06375a44;
  filter: none; transition: transform .12s ease;
}
html body[data-theme="adventure"][data-theme] #gameApp :is(.btn-get-coins, .btn-bonus, #mapButton.map-button):hover:not(:disabled) { transform: translateY(-1px); }
html body[data-theme="adventure"][data-theme] #gameApp :is(.btn-get-coins, .btn-bonus, #mapButton.map-button):active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 2px var(--av-wood-ink), 0 1px 0 var(--av-wood-ink); }
html body[data-theme="adventure"][data-theme] #gameApp :is(.btn-get-coins, .btn-bonus, #mapButton.map-button):focus-visible { outline: 4px solid var(--av-focus); outline-offset: 4px; }
html body[data-theme="adventure"][data-theme] #gameApp .btn-get-coins { background: linear-gradient(180deg, #ffffffaa 0 3px, transparent 3px), linear-gradient(180deg, var(--av-gold-hi), var(--av-gold)); color: var(--av-gold-ink); }
html body[data-theme="adventure"][data-theme] #gameApp .btn-get-coins:disabled { background: linear-gradient(#efe6d2, #d6c8a8); color: #5d4c30; opacity: .8; }
html body[data-theme="adventure"][data-theme] #gameApp #mapButton .map-progress-ring { background: var(--av-cream); box-shadow: 0 0 0 2px var(--av-gold-deep); color: var(--av-wood-ink); border-radius: 50%; }
html body[data-theme="adventure"][data-theme] #gameApp #mapButton #mapProgressRing { stroke: var(--av-coral); }
html body[data-theme="adventure"][data-theme] #gameApp #mapButton .map-button-copy strong { color: var(--av-wood-ink); }
html body[data-theme="adventure"][data-theme] #gameApp #mapButton .map-button-copy small { background: #fff; color: #5a2a08; }
html body[data-theme="adventure"][data-theme] #gameApp #mapButton .map-button-arrow { color: var(--av-coral-deep); }
/* Chest cooldown stays grey */
html body[data-theme="adventure"][data-theme] #gameApp .btn-bonus:is(.is-cooling, :disabled) {
  color: #4f4a52; background: linear-gradient(#ecebef, #cfcdd5); border-color: #f5f4f7;
  box-shadow: 0 0 0 2px #7d7987, 0 3px 0 #7d7987; filter: none;
}
html body[data-theme="adventure"][data-theme] #gameApp .btn-bonus:is(.is-cooling, :disabled) .adventure-svg-art { filter: grayscale(1); opacity: .75; }
html body[data-theme="adventure"][data-theme] #gameApp .bonus-countdown {
  display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px;
  background: var(--av-wood-deep); color: var(--av-cream); font-family: var(--av-font); font-weight: 600; font-size: .8rem;
  box-shadow: inset 0 1px 0 #ffffff33;
}

/* ============ The cabinet ============ */
html body[data-theme="adventure"][data-theme] #gameApp .play-column {
  position: relative; gap: 0; padding: 14px 14px 0;
  background:
    linear-gradient(180deg, #ffffff40 0 3px, transparent 3px),
    repeating-linear-gradient(92deg, #0000 0 46px, #6a2a0a1c 46px 49px, #0000 49px 90px),
    linear-gradient(180deg, var(--av-wood-hi), var(--av-wood) 40%, var(--av-wood-deep));
  border: 5px solid var(--av-gold); border-radius: 30px 30px 26px 26px;
  box-shadow: 0 0 0 4px var(--av-wood-ink), inset 0 4px 0 #ffd9a866, inset 0 -6px 0 #4e21084d, 0 10px 0 var(--av-wood-ink), 0 22px 26px #06375a55;
}
/* gold corner studs (decorative) */
html body[data-theme="adventure"][data-theme] #gameApp .play-column::before,
html body[data-theme="adventure"][data-theme] #gameApp .play-column::after {
  content: ""; position: absolute; top: -12px; width: 56px; height: 56px; pointer-events: none; z-index: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M6 58V26C6 14 14 6 26 6h32' fill='none' stroke='%234e2108' stroke-width='11' stroke-linecap='round'/%3E%3Cpath d='M6 58V26C6 14 14 6 26 6h32' fill='none' stroke='%23ffc934' stroke-width='7' stroke-linecap='round'/%3E%3Cpath d='M9 50V27C9 17 16 9 27 9h22' fill='none' stroke='%23fff3a6' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='20' cy='20' r='9' fill='%23ffc934' stroke='%234e2108' stroke-width='3'/%3E%3Ccircle cx='17.5' cy='17' r='3' fill='%23fff8d0'/%3E%3C/svg%3E") center / contain no-repeat;
}
html body[data-theme="adventure"][data-theme] #gameApp .play-column::before { left: -12px; }
html body[data-theme="adventure"][data-theme] #gameApp .play-column::after { right: -12px; transform: scaleX(-1); }
html body[data-theme="adventure"][data-theme] #gameApp .play-column > * { position: relative; z-index: 1; }
/* Board sits first visually; controls become the action ledge below. order matches DOM? controls are first in DOM:
   keep DOM order (stakes header → board) and style controls as the top marquee, PLAY on ledge via order inside section. */
html body[data-theme="adventure"][data-theme] #gameApp .board-section {
  margin: 10px 0 14px; padding: 12px;
  background: linear-gradient(180deg, var(--av-cream), #fbe7bd);
  border: 4px solid var(--av-gold); border-radius: 20px;
  box-shadow: 0 0 0 3px var(--av-wood-ink), inset 0 4px 8px #8a3f1433, inset 0 -3px 0 #fff;
}
html body[data-theme="adventure"][data-theme] #gameApp .board-section::before,
html body[data-theme="adventure"][data-theme] #gameApp .board-section::after { content: none; }
html body[data-theme="adventure"][data-theme] #gameApp .number-grid { background: none; border: 0; box-shadow: none; padding: 0; gap: 6px; }

/* Tiles */
html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number {
  position: relative; font-family: var(--av-font); font-weight: 700; font-size: 1.05rem; color: var(--av-wood-ink);
  background: linear-gradient(180deg, #fff 0 2px, transparent 2px), linear-gradient(180deg, #fffaf0, #f6e4be);
  border: 2px solid #d8a75e; border-radius: 12px; box-shadow: 0 3px 0 #b77a34; text-shadow: none;
  transition: transform .1s ease; animation: none;
}
/* Ordinary hover must not replace selected, hit or drawn-miss finishes. */
html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number:hover:not(:disabled):not(.is-disabled):not(.is-selected):not(.is-match):not(.is-drawn) { transform: translateY(-1px); background: linear-gradient(#fff, #ffeec9); }
html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #b77a34; }
html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number:focus-visible { outline: 3px solid var(--av-focus); outline-offset: 2px; z-index: 2; }
html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number.is-selected {
  color: #fff; background: linear-gradient(180deg, #ffffff66 0 2px, transparent 2px), linear-gradient(180deg, #c42683, #93125d);
  border-color: var(--av-berry-deep); box-shadow: inset 0 3px 4px #4a083266, 0 1px 0 var(--av-berry-deep); transform: translateY(2px);
  text-shadow: 0 1px 0 var(--av-berry-deep);
}
html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number.is-selected::after {
  content: ""; position: absolute; top: 2px; right: 2px; width: 13px; height: 13px; border-radius: 50%; pointer-events: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2 5 8.2 9 4' fill='none' stroke='%236e0f4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/11px no-repeat;
}
html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number.is-match {
  color: var(--av-gold-ink); background: linear-gradient(180deg, #fff 0 2px, transparent 2px), radial-gradient(circle at 40% 30%, var(--av-gold-hi), var(--av-gold) 60%, var(--av-gold-deep));
  border: 3px solid var(--av-wood-ink); box-shadow: 0 0 0 2px var(--av-gold-hi), 0 2px 0 var(--av-wood-ink); text-shadow: 0 1px 0 #fff8;
}
html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number.is-match::after {
  content: ""; position: absolute; top: 1px; right: 1px; width: 14px; height: 14px; pointer-events: none; border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5 14.8 8l6.2.9-4.5 4.4 1.1 6.2-5.6-2.9-5.6 2.9 1.1-6.2L3 8.9 9.2 8Z' fill='%23fff' stroke='%236b3a00' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
}
html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number.is-drawn:not(.is-match) {
  color: #5d5862; background: repeating-linear-gradient(135deg, #d9d6dc 0 5px, #cfccd3 5px 10px); border: 2px dashed #8d8794; box-shadow: none;
}
/* Locked during draw: keep picks/hits saturated */
html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number:is(:disabled, .is-disabled) { opacity: 1; filter: none; cursor: default; }
html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number:is(:disabled, .is-disabled):not(.is-selected):not(.is-match):not(.is-drawn) { color: #7a5a38; }

/* Controls marquee + action ledge */
html body[data-theme="adventure"][data-theme] #gameApp .controls-section {
  margin: 0; padding: 12px 14px 14px; gap: 10px;
  background: linear-gradient(180deg, #ffffff40 0 3px, transparent 3px), linear-gradient(180deg, var(--av-wood), var(--av-wood-deep));
  border: 3px solid var(--av-gold); border-radius: 20px; box-shadow: inset 0 6px 8px #4e210855; color: var(--av-cream);
}
html body[data-theme="adventure"][data-theme] #gameApp .bet-label { color: var(--av-cream); font-weight: 700; text-shadow: 0 1px 0 var(--av-wood-ink); }
html body[data-theme="adventure"][data-theme] #gameApp .btn-bet {
  font-family: var(--av-font); font-weight: 700; color: var(--av-wood-ink); min-width: 52px;
  background: linear-gradient(var(--av-cream), var(--av-cream-deep)); border: 2px solid var(--av-gold-deep); border-radius: 12px; box-shadow: 0 3px 0 var(--av-wood-ink);
}
html body[data-theme="adventure"][data-theme] #gameApp .btn-bet.is-active {
  background: linear-gradient(180deg, #fff 0 2px, transparent 2px), linear-gradient(var(--av-gold-hi), var(--av-gold)); color: var(--av-gold-ink);
  border-color: var(--av-wood-ink); box-shadow: inset 0 2px 3px #8a500055, 0 1px 0 var(--av-wood-ink); transform: translateY(2px);
}
html body[data-theme="adventure"][data-theme] #gameApp .btn-bet.is-active:not(.custom-bet-option)::before,
html body[data-theme="adventure"][data-theme] #gameApp .custom-bet-option.is-active > span::before { content: "\2713\00a0"; }
html body[data-theme="adventure"][data-theme] #gameApp .custom-bet-option input { background: #fff; color: var(--av-wood-ink); border: 2px solid var(--av-gold-deep); border-radius: 8px; min-height: 32px; font: 700 1rem var(--av-font); }
html body[data-theme="adventure"][data-theme] #gameApp .custom-bet-option.has-error, html body[data-theme="adventure"][data-theme] #gameApp .custom-bet-option.has-error input { border-color: #b3121f; }
html body[data-theme="adventure"][data-theme] #gameApp .bet-feedback { color: #fff1d6; font-weight: 700; }
html body[data-theme="adventure"][data-theme] #gameApp .btn-bet:focus-visible, html body[data-theme="adventure"][data-theme] #gameApp .custom-bet-option:focus-within { outline: 3px solid var(--av-gold-hi); outline-offset: 3px; }
html body[data-theme="adventure"][data-theme] #gameApp .game-status:not(.sr-only) { background: var(--av-cream); color: var(--av-wood-ink); border: 2px solid var(--av-gold); border-radius: 12px; }
html body[data-theme="adventure"][data-theme] #gameApp .action-panel > .selection-tracker { background: var(--av-berry); color: #fff; border-radius: 999px; font-weight: 700; }
html body[data-theme="adventure"][data-theme] #gameApp .action-panel { display: grid; grid-template-columns: 1fr 1fr 1.7fr; gap: 10px; align-items: end; }
html body[data-theme="adventure"][data-theme] #gameApp .btn-action {
  font-family: var(--av-font); font-weight: 700; color: var(--av-wood-ink); min-height: 48px;
  background: linear-gradient(180deg, #fff 0 2px, transparent 2px), linear-gradient(var(--av-cream), var(--av-cream-deep));
  border: 3px solid var(--av-gold); border-radius: 14px; box-shadow: 0 0 0 2px var(--av-wood-ink), 0 4px 0 var(--av-wood-ink);
}
html body[data-theme="adventure"][data-theme] #gameApp .btn-play {
  min-height: 64px; font-family: var(--av-font); font-weight: 700; font-size: 1.9rem; letter-spacing: .08em; color: #fff;
  -webkit-text-stroke: 1px var(--av-coral-deep); paint-order: stroke fill; text-shadow: 0 3px 0 var(--av-coral-deep);
  background: linear-gradient(180deg, #ffffff88 0 4px, transparent 4px), radial-gradient(120% 60% at 50% 0%, var(--av-coral-hi) 0 40%, transparent 42%), linear-gradient(180deg, #ff6a55, var(--av-coral));
  border: 4px solid #ffe2d6; border-radius: 20px;
  box-shadow: 0 0 0 3px var(--av-coral-deep), 0 8px 0 var(--av-coral-deep), 0 12px 0 var(--av-wood-ink), 0 16px 16px #2a0e0255;
  transition: transform .1s ease, box-shadow .1s ease; animation: none;
}
html body[data-theme="adventure"][data-theme] #gameApp :is(.btn-action, .btn-bet):active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 2px var(--av-wood-ink), 0 1px 0 var(--av-wood-ink); }
html body[data-theme="adventure"][data-theme] #gameApp .btn-play:hover:not(:disabled) { filter: brightness(1.05); }
html body[data-theme="adventure"][data-theme] #gameApp .btn-play:active:not(:disabled) { transform: translateY(7px); box-shadow: 0 0 0 3px var(--av-coral-deep), 0 1px 0 var(--av-coral-deep), 0 5px 0 var(--av-wood-ink); }
html body[data-theme="adventure"][data-theme] #gameApp :is(.btn-play, .btn-action):focus-visible { outline: 4px solid var(--av-gold-hi); outline-offset: 5px; }
html body[data-theme="adventure"][data-theme] #gameApp :is(.btn-play, .btn-action, .btn-bet):disabled { filter: saturate(.45); opacity: .82; cursor: not-allowed; }
html body[data-theme="adventure"][data-theme] #gameApp .reward-event-indicator { color: var(--av-gold-hi); font-weight: 700; }

/* ============ Results panel (adjoining) ============ */
html body[data-theme="adventure"][data-theme] #gameApp .results-section,
html body[data-theme="adventure"][data-theme] #gameApp .paytable-section,
html body[data-theme="adventure"][data-theme] #gameApp .community-panel {
  font-family: var(--av-font); color: var(--av-ink);
  background: linear-gradient(180deg, #ffffffb0 0 3px, transparent 3px), linear-gradient(180deg, var(--av-cream), #f8e2b3);
  border: 4px solid var(--av-gold); border-radius: 22px;
  box-shadow: 0 0 0 3px var(--av-wood-ink), 0 6px 0 var(--av-wood-ink), 0 14px 18px #06375a44;
}
html body[data-theme="adventure"][data-theme] #gameApp .section-title,
html body[data-theme="adventure"][data-theme] #gameApp .community-panel h2 {
  font-family: var(--av-font); font-weight: 700; color: var(--av-wood-ink); -webkit-text-stroke: 0;
  text-shadow: 0 1px 0 #fff, 0 2px 0 #f0c878; background: none;
}
html body[data-theme="adventure"][data-theme] #gameApp .community-eyebrow { color: var(--av-wood-deep); font-weight: 700; letter-spacing: .1em; }
html body[data-theme="adventure"][data-theme] #gameApp .drawn-balls-container {
  background: linear-gradient(180deg, #8a3f14, #6a2c0b); border: 3px solid var(--av-gold); border-radius: 16px; box-shadow: inset 0 4px 8px #2a0e0288;
}
html body[data-theme="adventure"][data-theme] #gameApp .drawn-balls-container::before { color: var(--av-cream); }
html body[data-theme="adventure"][data-theme] #gameApp .draw-ball {
  font-family: var(--av-font); font-weight: 700; color: var(--fx-ball-text); border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, var(--fx-ball-light) 0 22%, var(--fx-ball-core) 60%, var(--fx-ball-dark)); border: 2px solid var(--fx-ball-dark); box-shadow: 0 2px 0 var(--fx-ball-shadow);
}
html body[data-theme="adventure"][data-theme] #gameApp .draw-ball.is-match {
  color: var(--fx-match-text); background: radial-gradient(circle at 35% 28%, var(--fx-match-light) 0 22%, var(--fx-match-core) 60%, var(--fx-match-dark)); border: 3px solid var(--av-wood-ink);
}
html body[data-theme="adventure"][data-theme] #gameApp .stat-box { background: #fff; border: 2px solid var(--av-gold); border-radius: 14px; box-shadow: 0 3px 0 #c9944a; }
html body[data-theme="adventure"][data-theme] #gameApp .stat-title { color: #6a3a14; font-weight: 600; }
html body[data-theme="adventure"][data-theme] #gameApp .stat-value { color: var(--av-wood-ink); font-weight: 700; overflow-wrap: anywhere; }
html body[data-theme="adventure"][data-theme] #gameApp .stat-highlight { background: linear-gradient(var(--av-gold-hi), var(--av-gold)); border-color: var(--av-gold-deep); }
html body[data-theme="adventure"][data-theme] #gameApp .stat-highlight .stat-value { color: var(--av-gold-ink); }
html body[data-theme="adventure"][data-theme] #gameApp .stat-bricks { background: linear-gradient(#ffd2ec, #ff9fd2); border-color: var(--av-berry); }
html body[data-theme="adventure"][data-theme] #gameApp .stat-bricks :is(.stat-title, .stat-value) { color: var(--av-berry-deep); }
html body[data-theme="adventure"][data-theme] #gameApp .results-message { color: var(--av-wood-ink); font-weight: 700; background: none; }
html body[data-theme="adventure"][data-theme] #gameApp .results-message.is-win { color: #8a4a00; }
html body[data-theme="adventure"][data-theme] #gameApp :is(.reward-event-notice, .round-reward-label) { background: #fff; color: var(--av-berry-deep); border: 2px solid var(--av-berry); border-radius: 12px; }

/* Paytable */
html body[data-theme="adventure"][data-theme] #gameApp .paytable { border-collapse: separate; border-spacing: 0 4px; color: var(--av-wood-ink); }
html body[data-theme="adventure"][data-theme] #gameApp .paytable th { background: var(--av-wood); color: var(--av-cream); }
html body[data-theme="adventure"][data-theme] #gameApp .paytable td { background: #fff; border: 0; }
html body[data-theme="adventure"][data-theme] #gameApp .paytable tr.is-zero td { color: #7d7480; }
html body[data-theme="adventure"][data-theme] #gameApp .paytable-boost { background: var(--av-coral); color: #fff; border: 2px solid #fff; }

/* Community / Chat */
html body[data-theme="adventure"][data-theme] #gameApp :is(.community-copy, .community-notice, .community-disclosure) { color: #4e2a10; }
html body[data-theme="adventure"][data-theme] #gameApp .community-feed { background: #fff; border: 2px solid var(--av-cream-deep); border-radius: 14px; }
html body[data-theme="adventure"][data-theme] #gameApp .community-feed-title { color: var(--av-wood-deep); }
html body[data-theme="adventure"][data-theme] #gameApp .community-field { background: #fff; border: 2px solid var(--av-gold-deep); border-radius: 12px; color: var(--av-ink); min-height: 44px; }
html body[data-theme="adventure"][data-theme] #gameApp .community-button,
html body[data-theme="adventure"][data-theme] #gameApp #communityChatLock #communityChatSignIn.community-button {
  background: linear-gradient(#0e5f8c, #08405f); color: #fff; border: 3px solid #bdeeff; border-radius: 14px;
  box-shadow: 0 0 0 2px #0b4a70, 0 3px 0 #0b4a70; font-weight: 700; min-height: 44px; text-shadow: 0 1px 0 #0b4a70;
}
html body[data-theme="adventure"][data-theme] #gameApp #communityChatLock { background: #fff; border-color: var(--av-wood); color: var(--av-ink); }

/* Footer */
html body[data-theme="adventure"][data-theme] #gameApp :is(.btn-pin, .sound-toggle) {
  font-family: var(--av-font); font-weight: 700; color: #0b3a5a; background: var(--av-frost); border: 3px solid #fff; border-radius: 14px; box-shadow: 0 4px 0 #1581b4;
}
html body[data-theme="adventure"][data-theme] #gameApp :is(.btn-pin, .sound-toggle):focus-visible { outline: 4px solid var(--av-focus); outline-offset: 3px; }
html body[data-theme="adventure"][data-theme] #gameApp .source-credit { color: #06324f; }

/* ============ Dialogs ============ */
body[data-theme="adventure"] :is(.coin-shop, .coin-depletion, .community-dialog, .map-confirm) {
  font-family: var(--av-font); color: var(--av-ink);
  background: linear-gradient(180deg, var(--av-cream), #f8e2b3); border: 5px solid var(--av-gold); border-radius: 24px;
  box-shadow: 0 0 0 4px var(--av-wood-ink), 0 10px 0 var(--av-wood-ink), 0 24px 50px #06375a77;
}
body[data-theme="adventure"] :is(.coin-shop, .coin-depletion, .community-dialog, .map-confirm)::backdrop { background: #0a4a70b3; }
body[data-theme="adventure"] :is(.coin-shop, .coin-depletion, .community-dialog, .map-confirm) h2 { color: var(--av-wood-deep); font-family: var(--av-font); }
body[data-theme="adventure"] .coin-depletion .depletion-description strong, body[data-theme="adventure"] .shop-disclosure strong { color: var(--av-coral-deep); }
body[data-theme="adventure"] .shop-pack { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; background: #fff; border: 2px solid var(--av-gold); border-radius: 14px; color: var(--av-ink); box-shadow: 0 3px 0 #c9944a; }
body[data-theme="adventure"] .shop-pack:has(input:checked) { background: linear-gradient(var(--av-gold-hi), var(--av-gold)); border-color: var(--av-wood-ink); }
body[data-theme="adventure"] .shop-pack small { color: #5a3410; }
body[data-theme="adventure"] .shop-pack input:focus-visible { outline: 3px solid var(--av-focus); outline-offset: 3px; }
body[data-theme="adventure"] .shop-message { color: #8a1424; background: #fff1ef; border: 2px solid currentColor; border-radius: 10px; }
body[data-theme="adventure"] :is(.shop-confirm, .community-dialog .community-button, .map-confirm button) {
  background: linear-gradient(#ff6a55, var(--av-coral)); color: #fff; border: 3px solid #ffe2d6; border-radius: 14px;
  box-shadow: 0 0 0 2px var(--av-coral-deep), 0 4px 0 var(--av-coral-deep); font-weight: 700; min-height: 44px;
}
body[data-theme="adventure"] :is(.shop-cancel, .depletion-not-now) { background: #fff; color: var(--av-wood-ink); border: 2px solid var(--av-gold-deep); box-shadow: 0 3px 0 var(--av-wood-deep); border-radius: 14px; }
html body[data-theme="adventure"][data-theme] .coin-depletion .depletion-get-coins { background: linear-gradient(var(--av-gold-hi), var(--av-gold)); color: var(--av-gold-ink); border: 3px solid var(--av-cream); box-shadow: 0 0 0 2px var(--av-gold-deep), 0 4px 0 var(--av-gold-deep); }
body[data-theme="adventure"] :is(.shop-close, .community-close, .depletion-close) { color: var(--av-wood-deep); min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff8; border: 2px solid var(--av-gold-deep); }
body[data-theme="adventure"] .coin-depletion .depletion-close { display: flex; }
body[data-theme="adventure"] dialog button { min-height: 44px; }
body[data-theme="adventure"] .shop-pack input[type=radio] { opacity: 1; position: static; width: 20px; height: 20px; accent-color: var(--av-coral-deep); flex: none; }
body[data-theme="adventure"] :is(dialog) :is(button, input, a):focus-visible { outline: 4px solid var(--av-focus); outline-offset: 3px; }
body[data-theme="adventure"] .community-dialog .community-field { background: #fff; border: 2px solid var(--av-gold-deep); color: var(--av-ink); min-height: 44px; }

/* Map / village / Skins frames: see adventure-surfaces.css */

/* ============ Desktop composition ============ */
@media (min-width: 1025px) {
  html body[data-theme="adventure"] #gameApp.app-container { max-width: 1180px; }
  html body[data-theme="adventure"][data-theme] #gameApp .header {
    grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center;
  }
  html body[data-theme="adventure"][data-theme] #gameApp .main-content { grid-template-columns: minmax(540px, 600px) minmax(320px, 360px); column-gap: 26px; }
  html body[data-theme="adventure"][data-theme] #gameApp .side-rail { margin-top: 24px; }
}
@media (min-width: 1025px) and (max-height: 920px) {
  html body[data-theme="adventure"][data-theme] #gameApp .brand { padding: 4px 22px 6px; }
  html body[data-theme="adventure"][data-theme] #gameApp .main-content { grid-template-columns: minmax(510px, 540px) minmax(310px, 350px); }
  html body[data-theme="adventure"][data-theme] #gameApp .play-column { padding: 10px 10px 0; }
  html body[data-theme="adventure"][data-theme] #gameApp .board-section { padding: 8px; margin: 6px 0 10px; }
  html body[data-theme="adventure"][data-theme] #gameApp .number-grid { gap: 4px; }
  html body[data-theme="adventure"][data-theme] #gameApp .controls-section { padding: 8px 12px 12px; gap: 6px; }
  html body[data-theme="adventure"][data-theme] #gameApp .btn-play { min-height: 54px; font-size: 1.6rem; }
  html body[data-theme="adventure"][data-theme] #gameApp .side-rail { margin-top: 0; }
}
/* ============ Phones: compact wrapping reward row ============ */
@media (max-width: 600px) {
  html body[data-theme="adventure"][data-theme] #gameApp .bonus-group { display: flex; flex-wrap: wrap; gap: 8px; }
  html body[data-theme="adventure"][data-theme] #gameApp .bonus-wrapper { flex: 1 1 130px; }
  html body[data-theme="adventure"][data-theme] #gameApp .play-column { padding: 10px 8px 0; border-radius: 22px; }
  html body[data-theme="adventure"][data-theme] #gameApp .board-section { padding: 6px; }
  html body[data-theme="adventure"][data-theme] #gameApp .action-panel { grid-template-columns: 1fr 1fr; }
  html body[data-theme="adventure"][data-theme] #gameApp .btn-play { grid-column: 1 / -1; }
}
@media (max-width: 400px) {
  html body[data-theme="adventure"][data-theme] #gameApp .number-grid { grid-template-columns: repeat(5, minmax(44px, 1fr)); }
  html body[data-theme="adventure"][data-theme] #gameApp .brand h1 { font-size: 1.8rem; }
}

/* ============ Motion / forced colours ============ */
@media (prefers-reduced-motion: reduce) {
  body[data-theme="adventure"] #gameApp * { transition: none !important; }
  body[data-theme="adventure"] #gameApp :is(button, .number):is(:hover, :active) { transform: none !important; }
}
body[data-theme="adventure"].fx-reduced-motion #gameApp :is(button) { transition: none !important; }
@media (forced-colors: active) {
  html body[data-theme="adventure"][data-theme] #gameApp :is(.brand, .play-column)::before,
  html body[data-theme="adventure"][data-theme] #gameApp :is(.brand, .play-column)::after { display: none; }
  html body[data-theme="adventure"][data-theme] #gameApp :is(.brand, .play-column, .board-section, .controls-section, .results-section, .paytable-section, .community-panel, .header) {
    forced-color-adjust: auto; background: Canvas; color: CanvasText; border: 2px solid CanvasText; box-shadow: none;
  }
  html body[data-theme="adventure"][data-theme] #gameApp :is(button, .btn-bet, #numberGrid button.number) { forced-color-adjust: auto; background: ButtonFace; color: ButtonText; border: 2px solid ButtonText; box-shadow: none; text-shadow: none; -webkit-text-stroke: 0; }
  html body[data-theme="adventure"][data-theme] #gameApp :is(.btn-bet.is-active, #numberGrid button.number.is-selected) { background: Highlight; color: HighlightText; border: 3px double HighlightText; }
  html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number.is-match { border: 4px solid CanvasText; }
  html body[data-theme="adventure"][data-theme] #gameApp #numberGrid button.number.is-drawn:not(.is-match) { border: 2px dashed GrayText; color: GrayText; }
  html body[data-theme="adventure"][data-theme] #gameApp :is(.brand h1, .section-title) { -webkit-text-stroke: 0; text-shadow: none; color: CanvasText; }
  html body[data-theme="adventure"][data-theme] #gameApp :is(button, input):focus-visible { outline: 3px solid Highlight; }
}

/* ============ Keno Quest identity layer ============ */
body[data-theme="adventure"] {
  --av-berry: #0f8f8a; --av-berry-deep: #075452; --av-berry-hi: #5fe3d2;   /* teal gem: selections */
  --kq-brick: #d9673a; --kq-brick-hi: #ffa874; --kq-brick-deep: #7e2c12;   /* terracotta Bricks */
  --kq-plum: #6a2f8f;
}
html body[data-theme="adventure"][data-theme] #gameApp .brand h1 { display: inline-flex; align-items: center; gap: 10px; font-size: clamp(1.6rem, 4.6vw, 2.5rem); letter-spacing: .03em; }
html body[data-theme="adventure"][data-theme] #gameApp .brand h1::before {
  content: ""; flex: none; width: 1.55em; height: 1.55em; margin: -.25em 0;
  background: url("adventure-assets/emblem.webp") center / contain no-repeat;
  filter: drop-shadow(0 3px 0 var(--av-wood-ink)); pointer-events: none;
}
html body[data-theme="adventure"][data-theme] #gameApp .brand h1 span span { color: #7ff0e0; -webkit-text-stroke: 1.5px var(--kq-plum); }
html body[data-theme="adventure"][data-theme] #gameApp .wallet .brick-balance {
  color: #fff6ee;
  background: linear-gradient(180deg, #ffffff66 0 2px, transparent 2px), linear-gradient(160deg, var(--kq-brick-hi), var(--kq-brick) 55%, var(--kq-brick-deep));
  border-color: #ffe0cc; box-shadow: 0 0 0 2px var(--kq-brick-deep), 0 3px 0 var(--kq-brick-deep);
}
html body[data-theme="adventure"][data-theme] #gameApp .wallet .brick-balance .brick-number-surface { color: var(--kq-brick-deep); box-shadow: inset 0 2px 2px #7e2c1233; }
html body[data-theme="adventure"][data-theme] #gameApp .wallet .brick-balance .wallet-unit { color: #fff6ee; text-shadow: 0 1px 0 var(--kq-brick-deep); }
html body[data-theme="adventure"][data-theme] #gameApp .icon-brick { filter: drop-shadow(0 2px 0 #5a1e08); }
html body[data-theme="adventure"][data-theme] #gameApp .stat-bricks { background: linear-gradient(#ffd9c4, #ffad85); border-color: var(--kq-brick); }
html body[data-theme="adventure"][data-theme] #gameApp .stat-bricks :is(.stat-title, .stat-value) { color: var(--kq-brick-deep); }
html body[data-theme="adventure"][data-theme] #gameApp :is(.reward-event-notice, .round-reward-label) { color: var(--kq-plum); border-color: var(--kq-plum); }
@media (forced-colors: active) { html body[data-theme="adventure"][data-theme] #gameApp .brand h1::before { display: none; } }
