/* adventure-dialogs.css — "Village Signboard" dialog system.
   Every modal reads as an object from the sculpted village maps: a rounded
   honey-timber frame (foreground gold lip on top), a hanging signboard header
   with the illustrated crest (quest-ui-assets/dialog-crest.webp), a parchment
   reading area, turquoise enamel chips and green action buttons. Plum is used
   only as ink. Native <dialog> focus, IDs and scroll ownership retained.
   Section A: dialog system.  Section B: preserved map/skins/village rules.
   Frames keep a viewport-bounded fixed size. Content scrolls inside the frame;
   signboard headers stay visible. Battles retains its separate scene scroller. */

html body[data-theme="adventure"] {
  --vs-wood-hi: #e2a65c; --vs-wood: #b06f32; --vs-wood-deep: #7a4519; --vs-wood-ink: #3d200b;
  --vs-gold-hi: #fff0b8; --vs-gold: #efbe48; --vs-gold-deep: #a8731a;
  --vs-teal-hi: #8ff0e2; --vs-teal: #1caaa0; --vs-teal-deep: #0b6c6a; --vs-teal-ink: #073f42;
  --vs-paper-hi: #fffaea; --vs-paper: #fbefcf; --vs-paper-deep: #efd8a2; --vs-paper-edge: #d8b778;
  --vs-ink: #3a2216; --vs-ink-soft: #6a4a35; --vs-plum: #5b2448;
  --vs-moss: #6fae3e; --vs-moss-deep: #3d7425;
  --vs-crest: url("quest-ui-assets/dialog-crest.webp");
  --vs-grain: repeating-linear-gradient(176deg, #ffffff12 0 2px, transparent 2px 9px, #4a250a14 9px 11px, transparent 11px 17px);
  --vs-paper-fibre: radial-gradient(circle at 20% 30%, #c79a5a10 0 1px, transparent 1.5px) 0 0 / 13px 11px;
}

@media (forced-colors: active) {
  :is(.coin-shop, .coin-depletion, .community-dialog, .map-confirm, .battle-dialog, .dc-dialog, .cv-dialog, #inviteDialog, .daily-systems-dialog, #brickWheelDialog) { box-sizing: border-box; margin: auto; max-width: calc(100vw - 32px); max-height: calc(100dvh - 24px); overflow: auto; border: 3px solid CanvasText; }
  :is(dialog, #ageGate) :is(button, input, select, textarea, summary) { min-height: 44px; }
  #dailyCalendarDialog .dc-shell, #dailySystemsDialog :is(.daily-systems-shell, .daily-systems-body) { max-height: none; overflow: visible; }
  #dailyCalendarDialog .dc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dailyCalendarDialog .dc-tile-body { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  #dailyCalendarDialog .dc-tile-body > .dc-art { grid-row: auto; }
  #dailyCalendarDialog .dc-marks { display: flex; flex-wrap: wrap; gap: 8px; height: auto; }
  #dailyCalendarDialog .dc-mark { position: static; transform: none; flex: 1 1 60px; min-width: 0; }
  #dailyCalendarDialog .dc-mark-reward { white-space: normal; text-align: center; overflow-wrap: anywhere; }
  #brickWheelDialog .brick-wheel-stage { box-sizing: border-box; min-width: 0; }
  #brickWheelDialog .brick-wheel-stage::before { display: none; }
  #brickWheelDialog .wheel-spark-layer { display: none; }
  html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .community-dialog-head, .dc-head, .cv-head, #coinShop .shop-heading, .brick-wheel-head, #ageGateTitle) { background: Canvas; color: CanvasText; }
}
/* Closed details must not enter custom focus loops via content-visibility's
   retained layout boxes. Native disclosure state must beat themed form grids.
   The native summary remains accessible. */
.community-legacy-login:not([open]) > :not(summary) { display: none !important; }
/* Stable window geometry is independent of ready/loading/error content.
   Keep the existing width tiers; only a viewport resize can resize the frame.
   Native scrolling/focus and the foreground rounded frame are retained. */
html body[data-theme="adventure"][data-theme][data-theme] :is(.coin-shop, .coin-depletion, .community-dialog, .map-confirm, .battle-dialog, .dc-dialog, .cv-dialog, #inviteDialog, .daily-systems-dialog, #brickWheelDialog) {
  --vs-window-height: 720px;
  height: min(var(--vs-window-height), calc(100dvh - 32px));
  scroll-padding-block: min(360px, 60%) 18px;
  scrollbar-gutter: stable;
}
html body[data-theme="adventure"][data-theme][data-theme] :is(.coin-depletion, .map-confirm, #communityReportDialog, #communityProfileDialog, #communityAuthDialog) { --vs-window-height: 540px; }
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .community-dialog-head, .dc-head, .cv-head, #coinShop .shop-heading, .brick-wheel-head, #ageGateTitle) { position: sticky; top: 0; z-index: 30; }
/* Get Coins hands its store sections to the dynamically-mounted Quest Store
   dialog. Keep the outer frame identical across that handoff. */
html body[data-theme="adventure"][data-theme][data-theme] :is(#coinShop.coin-shop, .cv-dialog) { width: min(680px, calc(100vw - 32px)); }
html body[data-theme="adventure"][data-theme][data-theme] :is(.age-gate-panel, .age-loading-panel) { box-sizing: border-box; height: min(720px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
html body[data-theme="adventure"][data-theme][data-theme] .age-gate-panel > * { flex-shrink: 0; }
/* Keep selection visible in monochrome as well as through enamel colour. */
:is(.cv-dialog, #coinShop) :is(.cv-tab, .cv-link)[aria-pressed="true"],
#battleDialog .battle-menu-tab[aria-selected="true"] { text-decoration: underline; text-underline-offset: .18em; }
@media (forced-colors: none) {
/* ===================== A1. Shell: timber frame + parchment ===================== */
html body[data-theme="adventure"][data-theme][data-theme] :is(.coin-shop, .coin-depletion, .community-dialog, .map-confirm, .battle-dialog, .dc-dialog, .cv-dialog, #inviteDialog, .daily-systems-dialog, #brickWheelDialog) {
  font-family: var(--av-font); color: var(--vs-ink);
  box-sizing: border-box; max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px);
   overflow: auto; overscroll-behavior: contain; margin: auto;
  border: 9px solid transparent; border-radius: 30px;
  background:
    var(--vs-paper-fibre) padding-box,
    radial-gradient(120% 50% at 30% 0%, var(--vs-paper-hi) 0 35%, transparent 70%) padding-box,
    linear-gradient(180deg, var(--vs-paper), var(--vs-paper-deep)) padding-box,
    var(--vs-grain) border-box,
    linear-gradient(160deg, var(--vs-wood-hi), var(--vs-wood) 35%, var(--vs-wood-deep) 80%) border-box;
  /* Foreground frame: inner gold lip drawn on top of scrolled content/scrollbar
     edge at the curve. Decorative, no layout, no pointer input. */
  outline: 3px solid var(--vs-gold); outline-offset: -3px;
  box-shadow: 0 0 0 2px var(--vs-wood-ink), inset 0 0 0 1px #fff6, 0 8px 0 var(--vs-wood-ink), 0 26px 50px #1e2a1499;
}
/* Width tiers — centered compact / standard / wide */
html body[data-theme="adventure"][data-theme][data-theme] :is(.coin-depletion, .map-confirm, #communityReportDialog, #communityProfileDialog, #communityAuthDialog) { width: min(420px, calc(100vw - 20px)); }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog { width: min(450px, calc(100vw - 20px)); padding: 0; }
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-dialog, #inviteDialog, #communityAccountDialog) { width: min(560px, calc(100vw - 20px)); }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog { width: min(680px, calc(100vw - 32px)); }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog { width: min(860px, calc(100vw - 20px)); }
@media (max-width: 420px) {
  html body[data-theme="adventure"][data-theme][data-theme] :is(#coinShop.coin-shop, .coin-depletion, .community-dialog, .map-confirm, .battle-dialog, .dc-dialog, .cv-dialog, #inviteDialog, .daily-systems-dialog, #brickWheelDialog) { border-width: 6px; border-radius: 24px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 24px); width: calc(100vw - 32px); }
}

html body[data-theme="adventure"][data-theme][data-theme] :is(.coin-shop, .coin-depletion, .community-dialog, .map-confirm, .battle-dialog, .dc-dialog, .cv-dialog, #inviteDialog, .daily-systems-dialog, #brickWheelDialog)::backdrop {
  background: radial-gradient(circle at 50% 38%, #1a3a2e66, #10201acc);
}
@media (prefers-reduced-motion: no-preference) {
  html body[data-theme="adventure"][data-theme][data-theme]:not(.fx-reduced-motion) :is(.coin-shop, .coin-depletion, .community-dialog, .map-confirm, .battle-dialog, .dc-dialog, .cv-dialog, #inviteDialog, .daily-systems-dialog, #brickWheelDialog)[open] { animation: vs-sign-in .34s cubic-bezier(.25,1.35,.5,1) 1; }
  html body[data-theme="adventure"][data-theme][data-theme]:not(.fx-reduced-motion) #ageGate:not([hidden]) .age-gate-panel { animation: vs-sign-in .42s cubic-bezier(.25,1.35,.5,1) 1; }
}
@keyframes vs-sign-in { 0% { opacity: 0; transform: translateY(-14px) rotate(-.6deg) scale(.96); } 100% { opacity: 1; transform: none; } }

/* ===================== A2. Signboard headers ===================== */
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .community-dialog-head, .dc-head, .cv-head, #battleDialog .battle-head, #coinShop .shop-heading, #inviteDialog .invite-head) {
  position: sticky; top: 0; z-index: 30; color: var(--vs-paper-hi); text-shadow: 0 2px 0 var(--vs-wood-ink);
  background:
    var(--vs-crest) center top 4px / auto 34px no-repeat,
    radial-gradient(90% 60% at 30% 0%, #ffffff30, transparent 60%),
    var(--vs-grain),
    linear-gradient(180deg, var(--vs-wood-hi), var(--vs-wood) 48%, var(--vs-wood-deep));
  border: 0; border-bottom: 3px solid var(--vs-gold);
  box-shadow: inset 0 -3px 0 #3d200b55, 0 3px 0 var(--vs-wood-ink);
  padding-top: 40px; padding-bottom: 14px; padding-inline: 16px;
  border-radius: 20px 20px 0 0;
}
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .community-dialog-head, .dc-head, .cv-head, #battleDialog .battle-head, #coinShop .shop-heading) :is(h2, .battle-title) {
  color: var(--vs-gold-hi); -webkit-text-stroke: 1px var(--vs-wood-ink); paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--vs-wood-ink), 0 3px 4px #3d200b66; letter-spacing: .01em; overflow-wrap: anywhere;
}
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .community-dialog-head, .dc-head, .cv-head) :is(.community-eyebrow, .daily-systems-eyebrow, .dc-eyebrow, .cv-eyebrow) {
  display: inline-block; padding: 2px 12px; border-radius: 99px; color: #f2fffb; letter-spacing: .1em; text-shadow: 0 1px 0 var(--vs-teal-ink);
  background: linear-gradient(180deg, var(--vs-teal-hi) -40%, var(--vs-teal) 45%, var(--vs-teal-deep));
  box-shadow: 0 0 0 2px var(--vs-gold), 0 2px 0 2px var(--vs-wood-ink);
}
/* Headings inside the parchment: ink, not candy */
html body[data-theme="adventure"][data-theme][data-theme] :is(.coin-depletion, .map-confirm, #brickWheelDialog, #inviteDialog, .community-dialog .community-account-body) :is(h2, .brick-wheel-heading) { color: var(--vs-plum); text-shadow: 0 2px 0 var(--vs-paper-hi); }
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-dialog, .dc-dialog, #battleDialog, .community-dialog, .cv-dialog, #coinShop, #inviteDialog) :is(h3, .battle-menu-list-title, .rd-h) {
  color: var(--vs-wood-ink); text-shadow: none; font-family: var(--av-font); letter-spacing: .02em;
}
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-head .daily-systems-eyebrow { margin-bottom: 8px; line-height: 1.2; }

/* ===================== A3. Close knobs (carved gold medallions) ===================== */
html body[data-theme="adventure"][data-theme][data-theme] :is(#brickWheelClose, #communityAccountClose, #communityAuthClose, #communityProfileClose, #communityReportClose, #depletionClose, #inviteClose, .shop-close, .dc-close, .cv-close, .daily-systems-close, .battle-close, .invite-close, .community-close, .depletion-close, .brick-wheel-close) {
  min-width: 44px; min-height: 44px; border-radius: 50%; padding: 0 10px;
  color: var(--vs-wood-ink); font-weight: 700; font-size: 24px; line-height: 1; text-shadow: 0 1px 0 #fff8;
  background: radial-gradient(circle at 36% 28%, #fffbe2 0 14%, var(--vs-gold) 48%, var(--vs-gold-deep));
  border: 3px solid var(--vs-wood-deep); box-shadow: 0 0 0 2px var(--vs-gold-hi), 0 4px 0 var(--vs-wood-ink);
  transition: transform .14s var(--eq-press);
}
html body[data-theme="adventure"][data-theme][data-theme] .cv-close { border-radius: 999px; }
/* X glyphs behave like fixed-size icons; the spelled-out Close label scales. */
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-close { font-size: 1.35rem; }
html body[data-theme="adventure"][data-theme][data-theme] :is(#brickWheelClose, #communityAccountClose, #communityAuthClose, #communityProfileClose, #communityReportClose, #depletionClose, #inviteClose, .shop-close, .dc-close, .cv-close, .daily-systems-close):active { transform: translateY(3px); box-shadow: 0 0 0 2px var(--vs-gold-hi), 0 1px 0 var(--vs-wood-ink); }

/* ===================== A4. Actions ===================== */
/* Primary: moss-green carved button */
html body[data-theme="adventure"][data-theme][data-theme] :is(.shop-confirm, .community-dialog .community-button:not(.secondary), .map-confirm button, #brickWheelSpin:not(:disabled), .dc-retry, .daily-systems-btn:not(:disabled), #battleDialog .battle-btn:is(.is-primary, .is-attack, .is-revenge), :is(.cv-dialog) :is(.cv-btn, .cv-buy):not(.ckc-secondary), #inviteDialog .invite-actions .invite-btn:first-child, #ageGate #ageGateConfirm.age-gate-confirm:not(:disabled)) {
  min-height: 44px; border-radius: 18px; color: #fff; font-weight: 700; font-family: var(--av-font);
  border: 3px solid #eaffcf; text-shadow: 0 2px 0 #145c12;
  background: radial-gradient(90% 40% at 50% 6%, #ffffffa0 0 40%, transparent 42%), var(--eq-action-surface);
  box-shadow: 0 0 0 2px #145c12, 0 5px 0 #0b3a09, 0 8px 10px #0b3a0933;
  transition: transform .12s var(--eq-press), box-shadow .12s ease;
}
/* Secondary: parchment tab with timber edge */
html body[data-theme="adventure"][data-theme][data-theme] :is(.shop-cancel, .shop-retry, .depletion-not-now, .community-dialog .community-button.secondary, #battleDialog .battle-btn:not(.is-primary, .is-attack, .is-revenge, .is-repair), :is(.cv-dialog, .cv-page) .ckc-secondary, #inviteDialog .invite-btn:not(:first-child), #ageGate :is(.age-gate-leave, #ageGateRetry), .battle-back, .battle-skip) {
  min-height: 44px; border-radius: 16px; color: var(--vs-wood-ink); font-weight: 700; font-family: var(--av-font); text-shadow: none;
  border: 3px solid var(--vs-paper-hi);
  background: radial-gradient(90% 40% at 50% 6%, #fff 0 40%, transparent 42%), linear-gradient(180deg, var(--vs-paper), var(--vs-paper-deep));
  box-shadow: 0 0 0 2px var(--vs-wood-deep), 0 4px 0 var(--vs-wood-ink);
  transition: transform .12s var(--eq-press);
}
/* Turquoise enamel: repair / utility */
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-btn.is-repair {
  min-height: 44px; border-radius: 16px; color: #f2fffb; text-shadow: 0 1px 0 var(--vs-teal-ink); border: 3px solid var(--vs-gold-hi);
  background: radial-gradient(90% 40% at 50% 6%, #ffffff70 0 40%, transparent 42%), linear-gradient(180deg, var(--vs-teal-hi) -30%, var(--vs-teal) 50%, var(--vs-teal-deep));
  box-shadow: 0 0 0 2px var(--vs-teal-ink), 0 4px 0 var(--vs-teal-ink);
}
html body[data-theme="adventure"][data-theme][data-theme] :is(dialog, #ageGate) :is(button, .cv-btn, .cv-buy):active:not(:disabled) { transform: translateY(3px); }
/* Unavailable: dashed stone, readable */
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-btn, #brickWheelSpin, .shop-confirm, .community-dialog .community-button, #battleDialog .battle-btn, .cv-dialog :is(.cv-btn, .cv-buy), #inviteDialog .invite-btn):disabled {
  background: repeating-linear-gradient(135deg, #ece4d2 0 6px, #e1d7c1 6px 12px); color: #4f4536; text-shadow: none;
  border: 2px dashed #8a7e6a; box-shadow: 0 0 0 2px #b9ac90; filter: none; opacity: 1; cursor: not-allowed;
}

/* ===================== A5. Parchment cards & rows ===================== */
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-section, #battleDialog :is(.battle-card, .battle-opponent, .battle-rules, .battle-how, .battle-history, .battle-menu-panel, .battle-join), #inviteDialog :is(.invite-stats, .invite-rule, .invite-receipts), :is(.cv-dialog, .cv-page) :is(.cv-card, .cv-offer, .cv-row, .cv-tier), .community-dialog .community-strip) {
  color: var(--vs-ink); border-radius: 20px; border: 2px solid var(--vs-paper-edge);
  background: var(--vs-paper-fibre), linear-gradient(180deg, var(--vs-paper-hi), #f7e6bd);
  box-shadow: inset 0 2px 0 #fff, inset 0 -3px 0 #d8b77855, 0 3px 0 #b48a4a66;
}
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-item, #battleDialog :is(.battle-history-item, .battle-menu-row)) {
  border-radius: 16px; border: 2px solid var(--vs-paper-edge); border-left: 6px solid var(--vs-teal);
  background: linear-gradient(180deg, #fffdf4, #f8e9c4); box-shadow: 0 2px 0 #c9a46699; color: var(--vs-ink);
}
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog :is(.battle-history-item, .battle-menu-row).is-blocked { border-left-color: var(--vs-gold); }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog :is(.battle-history-item, .battle-menu-row):is(.is-damaged, .is-broken, .is-ruined) { border-left-color: #c8492f; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog :is(.battle-history-item, .battle-menu-row).is-historical { opacity: .88; border-left-color: #8d8794; }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-item.daily-systems-is-ready { border-left-color: var(--vs-moss); background: radial-gradient(80% 60% at 0% 50%, #e3f6c9, transparent 70%), linear-gradient(180deg, #fffdf4, #f4eac2); box-shadow: 0 0 0 2px var(--vs-moss-deep), 0 3px 0 var(--vs-moss-deep); }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-item.daily-systems-is-claimed { opacity: 1; border-left-color: var(--vs-gold-deep); background: linear-gradient(180deg, #f6efdc, #eadfc2); box-shadow: none; color: var(--vs-ink-soft); }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-item.daily-systems-is-claimed .daily-systems-reward::before { content: "\2713\00a0"; color: var(--vs-teal-deep); }

/* Enamel progress troughs */
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-bar, .dc-dialog .dc-track, :is(.cv-dialog, .cv-page) .cv-meter) { background: #6a4a3533; border-radius: 99px; box-shadow: inset 0 2px 3px #3d200b44, 0 1px 0 #fff; }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-bar { height: 14px; }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-bar > i { background: linear-gradient(180deg, var(--vs-teal-hi), var(--vs-teal) 55%, var(--vs-teal-deep)); box-shadow: inset 0 2px 0 #fff8; border-radius: inherit; }

/* Reward chip: minted gold coin label */
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-reward { color: var(--vs-wood-ink); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Status / receipt / error — stays live, stays readable */
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-receipt, .dc-dialog :is(.dc-receipt, .dc-feedback), :is(.cv-dialog, .cv-page) :is(.cv-notice, .cv-banner), #brickWheelResult:not(:empty), #inviteStatus:not(:empty)) {
  background: linear-gradient(180deg, #e6fbf5, #c9efe6); border: 2px solid var(--vs-teal-deep); border-radius: 14px; color: var(--vs-teal-ink); padding: 6px 12px; overflow-wrap: anywhere;
}
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-alert, .dc-dialog .dc-alert, :is(.cv-dialog, .cv-page) .cv-error, #battleDialog :is(.battle-error, .battle-menu-error)) {
  background: #fff0ea; border: 2px solid #9a2a18; border-radius: 14px; color: #7a1a0c; overflow-wrap: anywhere;
}
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-status { background: linear-gradient(var(--vs-paper-hi), var(--vs-paper)); border-color: var(--vs-paper-edge); border-radius: 14px; }
html body[data-theme="adventure"][data-theme][data-theme] :is(#battleDialog :is(.battle-empty, .battle-empty-state, .battle-menu-empty), :is(.cv-dialog, .cv-page) .cv-empty) {
  background: linear-gradient(var(--vs-paper-hi), var(--vs-paper)); border: 2px dashed var(--vs-wood); border-radius: 20px; color: var(--vs-ink);
}
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-skel-line { background: linear-gradient(90deg, var(--vs-paper-deep), var(--vs-paper-hi), var(--vs-paper-deep)); border-radius: 8px; }

/* Fields: inset parchment wells */
html body[data-theme="adventure"][data-theme][data-theme] :is(.community-dialog :is(input, select, textarea), :is(.cv-dialog, .cv-page) .cv-field, #inviteDialog .invite-link) {
  min-height: 44px; border-radius: 14px; border: 2px solid var(--vs-wood); color: var(--vs-ink);
  background: #fffdf5; box-shadow: inset 0 2px 4px #3d200b22;
}

/* ===================== A6. Streak days ===================== */
html body[data-theme="adventure"] .country-trigger {
  min-height: 44px; border-radius: 14px; border: 2px solid var(--vs-wood); color: var(--vs-ink);
  background: #fffdf5; box-shadow: inset 0 2px 4px #3d200b22;
}
html body[data-theme="adventure"] .country-list { border-color: var(--vs-wood); background: #fffdf5; color: var(--vs-ink); }
html body[data-theme="adventure"] .country-option[data-active="true"] { border-color: var(--vs-teal-deep); background: #d9f3ea; color: var(--vs-teal-ink); }

html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-day { border-radius: 14px; background: linear-gradient(180deg, var(--vs-paper-hi), var(--vs-paper)); border: 2px solid var(--vs-paper-edge); box-shadow: 0 3px 0 #b48a4a88; color: var(--vs-ink); }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-day.daily-systems-is-done { background: linear-gradient(180deg, var(--vs-teal-hi) -60%, var(--vs-teal) 60%, var(--vs-teal-deep)); color: #f2fffb; border-color: var(--vs-gold); text-shadow: 0 1px 0 var(--vs-teal-ink); }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-day.daily-systems-is-current { border-color: var(--vs-moss-deep); box-shadow: 0 0 0 3px var(--vs-moss), 0 4px 0 3px var(--vs-moss-deep); }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-day.daily-systems-is-finale { background: radial-gradient(100% 30% at 50% 0%, #fffbe0 0 40%, transparent 42%), linear-gradient(var(--vs-gold-hi), var(--vs-gold)); border-color: var(--vs-wood-deep); color: var(--vs-wood-ink); }

/* ===================== A7. Daily Rewards calendar ===================== */
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile {
  border-radius: 18px; border: 2px solid var(--vs-paper-edge); color: var(--vs-ink); overflow: hidden;
  background: var(--vs-paper-fibre), linear-gradient(180deg, var(--vs-paper-hi), var(--vs-paper));
  box-shadow: inset 0 2px 0 #fff, 0 4px 0 #b48a4a99;
}
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile .dc-tile-top { background: var(--vs-grain), linear-gradient(180deg, var(--vs-wood-hi), var(--vs-wood-deep)); color: var(--vs-paper-hi); text-shadow: 0 1px 0 var(--vs-wood-ink); border-radius: 0; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile.is-claimed { background: linear-gradient(180deg, #e6fbf5, #c9efe6); border-color: var(--vs-teal-deep); box-shadow: 0 3px 0 var(--vs-teal-ink); }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile.is-claimed .dc-tile-top { background: linear-gradient(180deg, var(--vs-teal), var(--vs-teal-deep)); }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile.is-claimed .dc-status { color: var(--vs-teal-ink); }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile:is(.is-ready, .is-next) {
  background: radial-gradient(100% 30% at 50% 0%, #fffbe0 0 40%, transparent 42%), linear-gradient(180deg, var(--vs-gold-hi), var(--vs-gold));
  border-color: var(--vs-wood-deep); box-shadow: 0 0 0 3px var(--vs-moss), 0 5px 0 3px var(--vs-moss-deep);
}
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile:is(.is-ready, .is-next) .dc-tile-top { background: var(--eq-action-surface); color: #fff; text-shadow: 0 1px 0 #145c12; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile:is(.is-ready, .is-next) .dc-status { color: var(--vs-moss-deep); }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile.is-locked { background: repeating-linear-gradient(135deg, #ece4d2 0 6px, #e1d7c1 6px 12px); border-style: dashed; border-color: #a49a88; box-shadow: none; color: #4f4536; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile.is-locked .dc-tile-top { background: #8a7e6a; color: #fff6e0; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-mark { border-radius: 50%; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-mark.is-hit { background: radial-gradient(circle at 35% 28%, #fffbe0 0 16%, var(--vs-gold) 55%, var(--vs-gold-deep)); }

/* ===================== A8. Brick Wheel: stone dais on a timber stage ===================== */
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog .brick-wheel-inner { padding: 0 16px 16px; }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog .brick-wheel-head {
  position: sticky; top: 0; z-index: 30; justify-self: stretch; margin: 0 -16px 6px;
}
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog .brick-wheel-heading {
  max-width: none; margin: 0; padding: 40px 60px 12px 16px; text-align: left;
  color: var(--vs-gold-hi); -webkit-text-stroke: 1px var(--vs-wood-ink); paint-order: stroke fill; text-shadow: 0 2px 0 var(--vs-wood-ink);
  background: var(--vs-crest) center top 4px / auto 34px no-repeat, var(--vs-grain), linear-gradient(180deg, var(--vs-wood-hi), var(--vs-wood) 48%, var(--vs-wood-deep));
  border-bottom: 3px solid var(--vs-gold); border-radius: 20px 20px 0 0;
}
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog #brickWheelClose { position: absolute; top: 46px; right: 12px; }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog #brickWheelExplanation { color: var(--vs-ink-soft); font-weight: 700; }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog .brick-wheel-stage {
  border-radius: 50%; padding: 10px;
  background:
    radial-gradient(circle, transparent 0 66%, var(--vs-gold-hi) 67% 68%, var(--vs-gold) 69% 70.5%, var(--vs-gold-deep) 71% 72%, transparent 72.5%),
    radial-gradient(50% 12% at 50% 98%, #8c8a7a 0 60%, transparent 62%),
    radial-gradient(circle at 50% 104%, var(--vs-moss) 0 20%, transparent 21%);
}
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog .brick-wheel-stage > svg { filter: drop-shadow(0 6px 0 #3d200baa) drop-shadow(0 12px 10px #1e2a1455); }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog #brickWheelPointer { filter: drop-shadow(0 3px 0 #3d200b) drop-shadow(0 0 1px #fff2b0); }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog #brickWheelSpin { border-radius: 999px; min-width: min(220px, 100%); letter-spacing: .06em; }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog #brickWheelStatus { color: var(--vs-ink); font-variant-numeric: tabular-nums; }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog .wheel-win-pop {
  font-family: var(--av-font); border: 4px solid var(--vs-paper-hi); border-radius: 26px;
  background: radial-gradient(100% 40% at 50% 0%, #fffbe0 0 40%, transparent 42%), linear-gradient(180deg, var(--vs-gold-hi), var(--vs-gold));
  box-shadow: 0 0 0 3px var(--vs-wood-ink), 0 6px 0 3px var(--vs-wood-ink), 0 12px 18px #1e2a1455;
}
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog .wheel-win-kicker { color: var(--vs-teal-deep); }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog .wheel-win-amount { color: var(--vs-wood-ink); text-shadow: 0 2px 0 #fffbe0; }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelLauncher .wheel-launch-badge { background: linear-gradient(180deg, var(--eq-lagoon), var(--eq-lagoon-deep)); border-color: var(--eq-brass-hi); font-family: var(--av-font); }

/* ===================== A9. Battles (village scene untouched) ===================== */
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-head { border-radius: 20px 20px 0 0; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-heading { color: var(--vs-wood-ink); text-shadow: 0 2px 0 var(--vs-paper-hi); }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-eyebrow { color: var(--vs-teal-deep); letter-spacing: .1em; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog :is(.battle-inventory, .battle-inv) {
  color: #f2fffb; text-shadow: 0 1px 0 var(--vs-teal-ink); font-variant-numeric: tabular-nums; border-radius: 16px; border: 2px solid var(--vs-gold);
  background: linear-gradient(180deg, var(--vs-teal), var(--vs-teal-deep)); box-shadow: 0 0 0 2px var(--vs-teal-ink), 0 3px 0 var(--vs-teal-ink);
}
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-inventory { background: #3d200b55; box-shadow: inset 0 2px 4px #0004; border-color: transparent; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-tab { min-width: 0; overflow-wrap: anywhere; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-inv {
  background: linear-gradient(#effff7, #c5e5d8); color: #123e36; text-shadow: none;
}
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-inv :is(b, small) { color: #123e36; text-shadow: none; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-history-icon { border-radius: 50%; background: radial-gradient(circle at 35% 28%, #fffbe0 0 16%, var(--vs-gold) 55%, var(--vs-gold-deep)); box-shadow: 0 0 0 2px var(--vs-wood-ink); }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-ribbon { background: linear-gradient(180deg, var(--vs-gold-hi), var(--vs-gold)); color: var(--vs-wood-ink); text-shadow: none; border-radius: 8px; box-shadow: 0 2px 0 var(--vs-wood-deep); }
html body[data-theme="adventure"][data-theme][data-theme] :is(#battleDialog .battle-menu-tabs, :is(.cv-dialog, .cv-page) :is(.cv-tabs, .cv-shopnav), #coinShop .cv-shopnav) { background: #6a4a3533; border-radius: 18px; padding: 4px; box-shadow: inset 0 2px 4px #3d200b33; }
html body[data-theme="adventure"][data-theme][data-theme] :is(#battleDialog .battle-menu-tab, :is(.cv-dialog, .cv-page) :is(.cv-tab, .cv-shopnav .cv-link), #coinShop .cv-shopnav :is(.cv-link, .cv-tab)) {
  min-height: 44px; border-radius: 14px; color: var(--vs-wood-ink); font-family: var(--av-font); font-weight: 700; text-shadow: none;
  background: linear-gradient(var(--vs-paper-hi), var(--vs-paper-deep)); border: 2px solid var(--vs-paper-edge); box-shadow: 0 3px 0 #b48a4a;
}
html body[data-theme="adventure"][data-theme][data-theme] :is(#battleDialog .battle-menu-tab[aria-selected="true"], :is(.cv-dialog, .cv-page) :is(.cv-tab.is-on, .cv-shopnav .cv-link:first-child), #coinShop .cv-shopnav :is(.is-on, [aria-current="page"])) {
  color: #f2fffb; text-shadow: 0 1px 0 var(--vs-teal-ink); border-color: var(--vs-gold);
  background: linear-gradient(180deg, var(--vs-teal-hi) -40%, var(--vs-teal) 50%, var(--vs-teal-deep));
  box-shadow: inset 0 2px 3px #073f4255, 0 1px 0 var(--vs-teal-ink); transform: translateY(2px);
}
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-target { border-radius: 18px; border: 2px solid var(--vs-paper-edge); box-shadow: 0 4px 0 #b48a4a; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-target.is-selected { box-shadow: 0 0 0 3px var(--vs-teal), 0 4px 0 3px var(--vs-teal-ink); }

/* ===================== A10. Get Coins + Quest Store ===================== */
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-status-tag { background: var(--vs-teal-deep); color: #f2fffb; border-color: var(--vs-gold-hi); }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-hero {
  border-radius: 20px; border: 2px solid var(--vs-gold);
  background: radial-gradient(circle at 85% 20%, #fff3c066, transparent 55%), radial-gradient(120% 90% at 0% 100%, var(--vs-moss) 0 30%, transparent 31%), linear-gradient(180deg, var(--vs-teal) , var(--vs-teal-deep));
  box-shadow: 0 0 0 2px var(--vs-teal-ink), 0 4px 0 var(--vs-teal-ink);
}
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-hero-line { color: var(--vs-paper-hi); text-shadow: 0 2px 0 var(--vs-teal-ink); }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-hero-eyebrow { color: var(--vs-gold-hi); }
html body[data-theme="adventure"][data-theme][data-theme] .shop-pack {
  border-radius: 18px; border: 2px solid var(--vs-paper-edge); color: var(--vs-ink);
  background: var(--vs-paper-fibre), linear-gradient(var(--vs-paper-hi), #f2dfae); box-shadow: inset 0 2px 0 #fff, 0 4px 0 #b48a4a;
}
html body[data-theme="adventure"][data-theme][data-theme] .shop-pack:has(input:checked) { background: linear-gradient(180deg, var(--vs-gold-hi), var(--vs-gold)); box-shadow: 0 0 0 3px var(--vs-teal), 0 4px 0 3px var(--vs-teal-ink); }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-pack-price, html body[data-theme="adventure"][data-theme][data-theme] :is(.cv-dialog, .cv-page) .cv-price { color: var(--vs-paper-hi); background: linear-gradient(var(--vs-wood), var(--vs-wood-deep)); border-color: var(--vs-gold-hi); font-weight: 700; font-variant-numeric: tabular-nums; }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-pack-badge { color: var(--vs-paper-hi); background: var(--vs-teal-deep); border-color: var(--vs-paper-hi); }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-fine { color: var(--vs-ink-soft); border-top: 2px dashed var(--vs-paper-edge); padding-top: 8px; }
html body[data-theme="adventure"][data-theme][data-theme] :is(.cv-dialog, .cv-page) .cv-tier.is-done { background: linear-gradient(180deg, #e6fbf5, #c9efe6); border-color: var(--vs-teal-deep); }
html body[data-theme="adventure"][data-theme][data-theme] :is(.cv-dialog, .cv-page) .cv-confirm { background: linear-gradient(180deg, var(--vs-gold-hi), var(--vs-gold)); border: 2px solid var(--vs-wood-deep); border-radius: 20px; box-shadow: 0 4px 0 var(--vs-wood-ink); }
html body[data-theme="adventure"][data-theme][data-theme] :is(.cv-dialog, .cv-page) .cv-ico-jar { border-color: var(--vs-teal-deep); background: linear-gradient(to top, var(--vs-gold) 55%, #e6fbf5 55%); }
/* Hosted store pages share the controls but not the native shell */
html body[data-theme="adventure"][data-theme][data-theme] .cv-page :is(.cv-btn, .cv-buy):not(.ckc-secondary) {
  min-height: 44px; border-radius: 16px; font-family: var(--av-font); font-weight: 700; color: #fff; border: 3px solid #eaffcf; text-shadow: 0 2px 0 #145c12;
  background: radial-gradient(90% 40% at 50% 6%, #ffffffa0 0 40%, transparent 42%), var(--eq-action-surface); box-shadow: 0 0 0 2px #145c12, 0 4px 0 #0b3a09;
}
html body[data-theme="adventure"][data-theme][data-theme] .cv-page :is(.cv-btn, .cv-buy):disabled { background: repeating-linear-gradient(135deg, #ece4d2 0 6px, #e1d7c1 6px 12px); color: #4f4536; text-shadow: none; border: 2px dashed #8a7e6a; box-shadow: none; }

/* ===================== A11. Depletion (dormant) / map confirm / invite / community ===================== */
html body[data-theme="adventure"][data-theme][data-theme] .coin-depletion .depletion-card { text-align: center; }
html body[data-theme="adventure"][data-theme][data-theme] .coin-depletion .depletion-art { filter: drop-shadow(0 4px 0 #3d200b55); }
html body[data-theme="adventure"][data-theme][data-theme] .map-confirm .map-eyebrow { color: var(--vs-teal-deep); letter-spacing: .1em; }
html body[data-theme="adventure"][data-theme][data-theme] .map-confirm .map-building-preview { border-radius: 20px; border: 2px solid var(--vs-paper-edge); background: radial-gradient(70% 60% at 50% 70%, #c7e6a2, #9ccd78 60%, #6fae3e); box-shadow: inset 0 3px 8px #3d200b33; }
html body[data-theme="adventure"][data-theme][data-theme] .map-confirm .map-confirm-disclosure { color: var(--vs-ink-soft); }
html body[data-theme="adventure"][data-theme][data-theme] #inviteDialog .invite-stats { font-variant-numeric: tabular-nums; }
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog .community-dialog-head { margin: 0 0 12px; }

/* ===================== A12. Map guide (in-map card) ===================== */
html body[data-theme="adventure"][data-theme][data-theme] #districtMap .map-guide {
  color: var(--vs-ink); border-radius: 24px; border: 6px solid transparent;
  background: linear-gradient(180deg, var(--vs-paper-hi), var(--vs-paper)) padding-box, var(--vs-grain) border-box, linear-gradient(160deg, var(--vs-wood-hi), var(--vs-wood-deep)) border-box;
  outline: 2px solid var(--vs-gold); outline-offset: -2px;
  box-shadow: 0 0 0 2px var(--vs-wood-ink), 0 6px 0 var(--vs-wood-ink), 0 18px 30px #1e2a1466;
  /* The existing bottom offset reserves 76px for the Help launcher. */
   box-sizing: border-box; height: min(360px, calc(100dvh - max(16px, env(safe-area-inset-bottom)) - 76px)); max-height: calc(100dvh - max(16px, env(safe-area-inset-bottom)) - 76px); overflow: auto;
}
html body[data-theme="adventure"][data-theme][data-theme] #districtMap .map-guide h3 { color: var(--vs-wood-ink); }
html body[data-theme="adventure"][data-theme][data-theme] #districtMap .map-guide :is(#mapGuideDismiss, #mapCurrentNode) { min-height: 44px; }

/* ===================== A13. Age gate + startup: Pip's trail ticket ===================== */
html body[data-theme="adventure"][data-theme][data-theme] :is(#ageGate .age-gate-panel, #ageGateLoading .age-loading-panel) {
  font-family: var(--av-font); color: var(--vs-ink); box-sizing: border-box; max-width: calc(100vw - 20px); height: min(720px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  border: 9px solid transparent; border-radius: 30px; padding-top: 52px;
  background:
    var(--vs-crest) center top 8px / auto 38px no-repeat padding-box,
    var(--vs-paper-fibre) padding-box,
    linear-gradient(180deg, var(--vs-paper-hi), var(--vs-paper-deep)) padding-box,
    var(--vs-grain) border-box,
    linear-gradient(160deg, var(--vs-wood-hi), var(--vs-wood) 35%, var(--vs-wood-deep) 80%) border-box;
  outline: 3px solid var(--vs-gold); outline-offset: -3px;
  box-shadow: 0 0 0 2px var(--vs-wood-ink), 0 8px 0 var(--vs-wood-ink), 0 26px 50px #1e2a1499;
}
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-kicker { display: block; width: fit-content; max-width: 100%; margin-inline: auto; justify-self: center; padding: 4px 16px; border-radius: 99px; color: #f2fffb; text-shadow: 0 1px 0 var(--vs-teal-ink); background: linear-gradient(var(--vs-teal), var(--vs-teal-deep)); box-shadow: 0 0 0 2px var(--vs-gold), 0 2px 0 2px var(--vs-wood-ink); letter-spacing: .1em; }
html body[data-theme="adventure"][data-theme][data-theme] #ageGate #ageGateTitle { position: sticky; top: 0; z-index: 1; background: var(--vs-paper-hi); color: var(--vs-plum); text-shadow: 0 2px 0 var(--vs-paper-hi); }
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-panel > * { flex-shrink: 0; }
html body[data-theme="adventure"][data-theme][data-theme] #ageGate #ageGateConfirm.age-gate-confirm:not(:disabled) { height: auto; min-height: 52px; font-size: clamp(1rem, 5vw, 1.2rem); letter-spacing: .03em; white-space: normal; }

/* Keep the ordinary entry view inside one frame without hiding overflow.
   Expanded disclosures, errors and enlarged text retain accessible scrolling. */
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-panel {
  width: min(100%, 620px); gap: 8px; padding-inline: 24px; padding-bottom: 18px;
}
html body[data-theme="adventure"][data-theme][data-theme] #ageGate #ageGateTitle {
  font-size: clamp(1.4rem, 4vw, 1.75rem); line-height: 1.25;
}
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-statements { gap: 8px; margin-top: 2px; }
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-statements li { font-size: 1rem; line-height: 1.35; padding-left: 22px; }
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-note { font-size: .85rem; line-height: 1.35; }
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-privacy-options { margin: 0; }
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-leave { margin-top: 2px; }
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-panel { gap: 6px; }
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-reporting-choice {
  display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 1rem; line-height: 1.3; font-weight: 700;
}
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-reporting-choice input {
  flex: 0 0 auto; width: 22px; height: 22px; margin: 0; accent-color: #236526;
}
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-footer {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-items: start;
}
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-footer .age-gate-privacy-options[open] { grid-column: 1 / -1; }
html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-footer .age-gate-leave {
  grid-column: 2; justify-self: end; width: auto; max-width: 100%; padding: 8px; min-height: 44px; margin: 0;
}
@media (max-width: 420px) {
  html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-panel {
    padding: 40px 14px 14px; border-radius: 24px; gap: 4px;
    background-size: auto 28px, auto, auto, auto, auto;
  }
  html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-statements li { line-height: 1.3; }
  html body[data-theme="adventure"][data-theme][data-theme] #ageGate .age-gate-note { line-height: 1.3; }
}

/* ===================== A14. Mossy ledge foot + 44px floor ===================== */
/* Scroll owner: each native <dialog> scrolls itself (overflow:auto, bounded by
   the viewport). No inner fixed-height panes; receipts and errors stay in flow
   and reachable by native scrolling. The ledge is the last painted item of
   the parchment so it rides at the end of the scrollable content. */
html body[data-theme="adventure"][data-theme][data-theme] :is(.coin-shop, .coin-depletion, .community-dialog, .map-confirm, .dc-dialog, .cv-dialog, #inviteDialog, .daily-systems-dialog, #brickWheelDialog)::after {
  content: ""; display: block; height: 46px; margin: 10px 0 0; pointer-events: none;
  background: url("quest-ui-assets/dialog-ledge.webp") center bottom / auto 100% no-repeat;
}
html body[data-theme="adventure"][data-theme][data-theme] :is(dialog, #ageGate) :is(button, select, input:not([type="checkbox"], [type="radio"], [type="hidden"]), textarea, summary, .cv-btn, .cv-buy, .cv-link, .cv-tab, label.shop-pack) { min-height: 44px; }
html body[data-theme="adventure"][data-theme][data-theme] :is(dialog, #ageGate) :is(input[type="checkbox"], input[type="radio"]) { min-width: 22px; min-height: 22px; }
html body[data-theme="adventure"][data-theme][data-theme] :is(dialog, #ageGate) :is(input, textarea, select) { font-size: max(1rem, 16px); box-sizing: border-box; max-width: 100%; }
html body[data-theme="adventure"][data-theme][data-theme] :is(dialog, #ageGate) summary { display: flex; align-items: center; cursor: pointer; }
html body[data-theme="adventure"][data-theme][data-theme] :is(dialog, #ageGate) a:not([class]) { color: var(--vs-teal-ink); text-decoration-thickness: 2px; display: inline-block; min-height: 24px; }
html body[data-theme="adventure"][data-theme][data-theme] :is(dialog, #ageGate) :is(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid var(--vs-teal-ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--vs-gold-hi); }
@media (max-height: 560px) {
  html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .community-dialog-head, .dc-head, .cv-head, #battleDialog .battle-head, #coinShop .shop-heading) { padding-top: 12px; background-size: auto 0, auto, auto, auto; }
  html body[data-theme="adventure"][data-theme][data-theme] :is(dialog)::after { height: 24px; }
}

/* ===================== A15. Illustrated headers: village vista + crest ===================== */
/* Header = a window onto the village (scenery-landscape.webp), the carved crest
   hanging over it in a clear non-text zone, and the title on a timber plank. */
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .community-dialog-head, .dc-head, .cv-head, #coinShop .shop-heading) {
  position: sticky; margin: 0; padding: 92px 16px 12px; border-radius: 21px 21px 0 0; min-height: 0;
  background:
    var(--vs-crest) center top 8px / auto 74px no-repeat,
    linear-gradient(180deg, transparent 0 52%, #7a4519e6 70%, var(--vs-wood-deep)),
    var(--vs-grain),
    url("adventure-assets/scenery-landscape.webp") center 38% / cover no-repeat,
    linear-gradient(180deg, #8fd0b8, var(--vs-moss) 60%, var(--vs-wood-deep));
  box-shadow: inset 0 -3px 0 #3d200b55, 0 3px 0 var(--vs-wood-ink);
}
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-head { padding-top: 14px; background: var(--vs-grain), linear-gradient(180deg, var(--vs-wood-hi), var(--vs-wood) 48%, var(--vs-wood-deep)); }
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .community-dialog-head, .dc-head, .cv-head, #coinShop .shop-heading) :is(.daily-systems-close, .community-close, .dc-close, .cv-close, .shop-close) { position: absolute; top: 10px; right: 10px; }
html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .dc-head) .rd-art-head { position: absolute; left: 10px; top: 14px; width: 76px; height: 76px; margin: 0; filter: drop-shadow(0 4px 0 #3d200b99); }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog .brick-wheel-heading { padding-top: 92px; background: var(--vs-crest) center top 8px / auto 74px no-repeat, linear-gradient(180deg, transparent 0 52%, #7a4519e6 70%, var(--vs-wood-deep)), url("adventure-assets/scenery-landscape.webp") center 38% / cover no-repeat, linear-gradient(180deg, #8fd0b8, var(--vs-moss)); }
html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog #brickWheelClose { top: 10px; }
@media (max-width: 420px), (max-height: 600px) {
  html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .community-dialog-head, .dc-head, .cv-head, #coinShop .shop-heading), html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog .brick-wheel-heading { padding-top: 66px; background-size: auto 52px, auto, auto, cover, auto; }
  html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .dc-head) .rd-art-head { width: 54px; height: 54px; top: 8px; }
}
@media (max-height: 460px) {
  html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .community-dialog-head, .dc-head, .cv-head, #coinShop .shop-heading), html body[data-theme="adventure"][data-theme][data-theme] #brickWheelDialog .brick-wheel-heading { padding-top: 12px; padding-right: 64px; background-size: 0 0, auto, auto, cover, auto; }
  html body[data-theme="adventure"][data-theme][data-theme] :is(.daily-systems-head, .dc-head) .rd-art-head { display: none; }
}

/* ===================== A16. Scroll ownership ===================== */
/* One owner per fixed-size frame: the native <dialog> scrolls (all families below),
   except Battles which keeps its legacy .battle-body owner inside a bounded
   .battle-shell so the village scene geometry is unchanged. */
html body[data-theme="adventure"][data-theme][data-theme] :is(.dc-dialog, .daily-systems-dialog) { overflow-x: hidden; overflow-y: auto; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-shell,
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog :is(.daily-systems-shell, .daily-systems-body) { max-height: none; overflow: visible; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-shell { padding: 0 14px 4px; border-radius: 0; min-width: 0; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-head { margin: 0 -14px; position: sticky; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog { overflow: hidden; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-shell { height: 100%; max-height: 100%; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog :is(.battle-head, .battle-status) { flex-shrink: 0; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-body { min-height: 0; flex: 1; }
html body[data-theme="adventure"][data-theme][data-theme] :is(.dc-dialog, .daily-systems-dialog, #coinShop, .community-dialog) :is(div, section, p, span, li, form, label) { min-width: 0; }

/* ===================== A17. Daily Rewards: trail of days + treasure finale ===================== */
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-progress { padding: 10px 12px 8px; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-marks {
  position: static; height: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin: 8px 0 0;
}
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-mark {
  position: static; transform: none; flex: 1 1 0; min-width: 72px; display: grid; grid-template-columns: auto 1fr; gap: 0 6px; align-items: center;
  padding: 4px 8px; border-radius: 14px !important; background: #fffdf5; border: 2px solid var(--vs-paper-edge);
}
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-mark.is-hit { background: linear-gradient(180deg, var(--vs-gold-hi), var(--vs-gold)); border-color: var(--vs-gold-deep); }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-mark:last-child { transform: none; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-mark-ico { grid-row: span 2; width: 24px; height: 24px; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-mark-reward { grid-column: 2; white-space: normal; }
/* Mobile/narrow: 3 day tiles per row; Day 7 is a full-width treasure banner */
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 4px 2px 6px; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-cell-d7 { grid-column: 1 / -1; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile.dc-d7:not(.is-locked) {
  background: linear-gradient(180deg, var(--vs-gold-hi), var(--vs-gold)); min-height: 96px;
}
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-tile.dc-d7 {
  flex-direction: column; flex-wrap: nowrap; padding: 0;
}
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-d7 .dc-tile-top { flex: none; flex-wrap: wrap; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-d7 .dc-tile-body { flex: 1 0 auto; }
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-d7 .dc-tile-body::before {
  content: ""; display: block; flex: 0 0 100%; height: 64px;
  background: url("adventure-assets/daily-reward-chest.webp") center / contain no-repeat;
}
html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-d7 .dc-status { flex: none; }
@media (max-width: 400px) {
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-shell { padding-inline: 8px; }
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-head { margin-inline: -8px; }
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-mark { min-width: 0; flex-basis: 100%; }
}
/* Desktop/tablet: two columns — progress trail left, 4-col days right with
   Day 7 as a tall treasure chest spanning both rows. */
@media (min-width: 720px) and (min-height: 601px) {
  html body[data-theme="adventure"][data-theme][data-theme] #dailyCalendarDialog.dc-dialog { width: min(860px, calc(100vw - 32px)); }
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog[open] .dc-shell { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: 12px 16px; align-items: start; }
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-shell > :not(.dc-progress, .dc-grid) { grid-column: 1 / -1; }
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-progress { grid-column: 1; grid-row: 2; }
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-feedback { grid-row: 3; }
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-marks { flex-direction: column; }
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-grid { grid-column: 2; grid-row: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-cell-d7 { grid-column: 4; grid-row: 1 / span 2; }
  html body[data-theme="adventure"][data-theme][data-theme] .dc-dialog .dc-d7 .dc-tile-body { flex: 1; align-content: end; padding-bottom: 6px; }
}

/* ===================== A18. Daily Missions quest board ===================== */
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-body { padding: 14px; gap: 14px; }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-section > h3.rd-h { font-size: 1.15rem; padding-bottom: 6px; border-bottom: 2px dashed var(--vs-paper-edge); }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-item { grid-template-columns: minmax(0, 1fr); align-items: center; column-gap: 10px; padding: 12px; gap: 12px; }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-item > * { grid-column: 1 / -1; }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-item > .daily-systems-row:first-child { display: grid; gap: 8px; }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-item .daily-systems-reward { justify-self: start; padding: 4px 10px; border-radius: 12px; background: #f6d583; }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-item > .daily-systems-row:last-child { display: grid; gap: 8px; }
html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-item .daily-systems-btn { justify-self: stretch; }
@media (min-width: 860px) and (min-height: 601px) {
  html body[data-theme="adventure"][data-theme][data-theme] #dailySystemsDialog { width: min(900px, calc(100vw - 32px)); }
  html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-body { grid-template-columns: minmax(0, 1fr); align-items: start; }
  html body[data-theme="adventure"][data-theme][data-theme] .daily-systems-dialog .daily-systems-body > :not(.daily-systems-section) { grid-column: 1 / -1; }
}

/* ===================== A19. Battles chooser: war-table layout ===================== */
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu { gap: 12px; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-heading {
  padding: 74px 12px 12px; border-radius: 20px; border: 2px solid var(--vs-paper-edge); color: var(--vs-paper-hi); text-shadow: 0 2px 0 var(--vs-wood-ink);
  background: url("battle-assets/axe.svg") left 18px top 14px / 46px no-repeat, url("battle-assets/shield.svg") right 18px top 14px / 46px no-repeat, linear-gradient(180deg, transparent 0 40%, #3d200bcc 75%), url("adventure-assets/scenery-landscape.webp") center 40% / cover no-repeat, var(--vs-wood);
}
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-heading :is(p, .battle-menu-eyebrow) { color: var(--vs-paper-hi); }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-tabs { grid-template-columns: 1fr 1fr; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-row { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-row.is-random { border-left-color: var(--vs-gold); background: radial-gradient(60% 100% at 100% 50%, #fff3c0, transparent 70%), linear-gradient(180deg, #fffdf4, #f8e9c4); }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-avatar { border-radius: 50%; box-shadow: 0 0 0 3px var(--vs-gold), 0 3px 0 3px var(--vs-wood-ink); }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-action { min-width: 104px; }
html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-footer { padding-top: 8px; border-top: 2px dashed var(--vs-paper-edge); }
@media (min-width: 760px) {
  html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
  html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu > :is(.battle-menu-heading) { grid-column: 1; grid-row: 1 / span 3; min-height: 260px; align-content: end; }
  html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu > :not(.battle-menu-heading) { grid-column: 2; }
}
@media (max-width: 420px) {
  html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-row { grid-template-columns: auto minmax(0, 1fr); }
  html body[data-theme="adventure"][data-theme][data-theme] #battleDialog .battle-menu-row .battle-menu-action { grid-column: 1 / -1; width: 100%; }
}

/* ===================== A20. Get Coins: treasure shelf of pack cards ===================== */
html body[data-theme="adventure"][data-theme][data-theme] #coinShop #coinShopBody { display: grid; gap: 12px; padding: 0 14px 4px; }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-heading { margin: 0 -14px; }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-heading-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-packs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 14px; }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-pack {
  grid-template-columns: 1fr; grid-template-areas: "art" "copy" "value" "price"; justify-items: center; text-align: center; gap: 6px; padding: 12px 10px 14px;
  background: radial-gradient(60% 34% at 50% 26%, #fff6c8, transparent 70%), var(--vs-paper-fibre), linear-gradient(var(--vs-paper-hi), #f2dfae);
}
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-pack-art { width: 96px; height: 96px; }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-pack-copy { justify-items: center; }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-pack-badge { justify-self: center; }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-pack-price { justify-self: stretch; text-align: center; border-radius: 12px; padding: 8px; }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
html body[data-theme="adventure"][data-theme][data-theme] #coinShop .shop-actions > button { flex: 1 1 160px; }
/* Store tabs: bookmark ribbons hanging from the plank */
html body[data-theme="adventure"][data-theme][data-theme] :is(#coinShop, .cv-dialog) :is(.cv-shopnav, .cv-tabs) { display: flex; flex-wrap: wrap; gap: 6px; }
html body[data-theme="adventure"][data-theme][data-theme] :is(#coinShop, .cv-dialog) :is(.cv-shopnav, .cv-tabs) > * { flex: 1 1 110px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 6px 6px 16px 16px !important; }
html body[data-theme="adventure"][data-theme][data-theme] .cv-dialog :is(.cv-offer, .cv-tier) { display: grid; gap: 6px; }
html body[data-theme="adventure"][data-theme][data-theme] .cv-dialog :is(.cv-grid, .cv-offers, .cv-list) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
/* Safety controls are a form, not another product. Give each disclosure its
   natural height and keep the destructive action away from Save. */
html body[data-theme="adventure"][data-theme][data-theme] .cv-dialog form.cv-card { display: flex; flex-direction: column; gap: 18px; padding: 20px; height: auto; min-width: 0; }
html body[data-theme="adventure"][data-theme][data-theme] .cv-dialog form.cv-card > * { flex: none; min-width: 0; }
html body[data-theme="adventure"][data-theme][data-theme] .cv-dialog .cv-field { border: 0; background: none; box-shadow: none; gap: 8px; grid-template-columns: minmax(0, 1fr); }
html body[data-theme="adventure"][data-theme][data-theme] .cv-dialog .cv-field input { min-width: 0; width: 100%; box-sizing: border-box; }
html body[data-theme="adventure"][data-theme][data-theme] .cv-dialog .cv-check { align-items: flex-start; padding: 10px; border-radius: 12px; background: #fffdf3; line-height: 1.5; overflow-wrap: anywhere; }
html body[data-theme="adventure"][data-theme][data-theme] .cv-dialog .cv-check input { flex: none; margin-top: 3px; }
html body[data-theme="adventure"][data-theme][data-theme] .cv-dialog form .cv-row { padding: 10px; gap: 14px; }
html body[data-theme="adventure"][data-theme][data-theme] .cv-dialog .cv-confirm { padding: 20px; display: grid; gap: 12px; background: var(--vs-paper-hi); border: 3px solid var(--vs-teal-deep); box-shadow: 0 4px 0 var(--vs-wood); }
html body[data-theme="adventure"][data-theme][data-theme] .cv-dialog .cv-btn.cv-danger { background: #fff1e8; color: #862c19; border-color: #ac4d29; text-shadow: none; box-shadow: 0 3px 0 #672b18; }
html body[data-theme="adventure"][data-theme][data-theme] #inviteDialog .invite-rule { padding: 16px 18px; line-height: 1.5; border-left: 6px solid var(--vs-teal-deep); }
html body[data-theme="adventure"][data-theme][data-theme] #inviteDialog .invite-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 10px; text-align: center; }
html body[data-theme="adventure"][data-theme][data-theme] #inviteDialog .invite-stats > div { min-width: 0; padding: 10px 4px; background: #e1f3eb; border-radius: 12px; }
html body[data-theme="adventure"][data-theme][data-theme] #inviteDialog .invite-stats dd { margin: 6px 0 0; font-size: 1.4rem; font-weight: 700; color: var(--vs-teal-ink); }
html body[data-theme="adventure"][data-theme][data-theme] #inviteDialog .invite-receipts { padding: 14px 14px 14px 32px; line-height: 1.65; }

/* ===================== A21. Account / sign-in forms: guild ledger ===================== */
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog { padding: 0; }
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog > :not(.community-dialog-head) { margin-inline: 16px; }
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog > :last-child { margin-bottom: 4px; }
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog .community-form { display: grid; gap: 10px; }
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog-head + .community-form { margin-top: 16px; }
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog .community-form label { display: grid; gap: 4px; font-weight: 700; color: var(--vs-wood-ink); }
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog .community-form > .community-button[data-social-provider] { display: flex; align-items: center; justify-content: center; }
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog .community-legacy-login {
  border-radius: 16px; border: 2px dashed var(--vs-paper-edge); background: #fffaf0; padding: 0 12px;
}
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog .community-legacy-login[open] { padding-bottom: 12px; }
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog .community-legacy-login > summary { padding: 8px 0; font-weight: 700; color: var(--vs-teal-ink); }
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog .community-error { background: #fff0ea; border: 2px solid #9a2a18; border-radius: 14px; color: #7a1a0c; padding: 6px 10px; overflow-wrap: anywhere; }
html body[data-theme="adventure"][data-theme][data-theme] .community-dialog .community-button.warn { background: linear-gradient(180deg, #e8835f, #b5432a); color: #fff; border: 3px solid #ffe2d4; box-shadow: 0 0 0 2px #6d2412, 0 4px 0 #6d2412; text-shadow: 0 1px 0 #6d2412; }
html body[data-theme="adventure"][data-theme][data-theme] #communityProfileDialog #communityLinkSection { margin-top: 14px; padding: 12px; border-radius: 18px; border: 2px solid var(--vs-paper-edge); background: #fffaf0; }
@media (min-width: 560px) {
  html body[data-theme="adventure"][data-theme][data-theme] #communityLinkForm { grid-template-columns: 1fr 1fr; }
  html body[data-theme="adventure"][data-theme][data-theme] #communityLinkForm > label { grid-column: 1 / -1; }
}


} /* forced-colors: none */

/* Provider branding stays scoped to the player sign-in action. */
#communityAuthDialog .facebook-sign-in {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
#communityAuthDialog .facebook-sign-in-logo { flex: 0 0 24px; }
#communityAuthDialog #communityFacebookLogin > span { font-size: 18px; }
@media (forced-colors: none) {
  html body[data-theme="adventure"][data-theme][data-theme] #communityAuthDialog #communityFacebookLogin.facebook-sign-in {
    background: #1877f2;
    color: #fff;
    border-color: #fff;
    text-shadow: none;
    box-shadow: 0 0 0 2px #125bb5, 0 4px 0 #104f9c;
  }
  html body[data-theme="adventure"][data-theme][data-theme] #communityAuthDialog #communityFacebookLogin.facebook-sign-in:hover:not(:disabled) {
    background: #166fe5;
  }
  html body[data-theme="adventure"][data-theme][data-theme] #communityAuthDialog #communityFacebookLogin.facebook-sign-in:focus-visible {
    outline: 3px solid #104f9c;
    outline-offset: 5px;
  }
}

/* Motion gates: OS and app overrides */
@media (prefers-reduced-motion: reduce) {
  html body[data-theme="adventure"][data-theme][data-theme] :is(dialog, .age-gate-panel) :is(button, label, a) { transition: none !important; transform: none !important; }
}
html body[data-theme="adventure"][data-theme][data-theme].fx-reduced-motion :is(dialog, .age-gate-panel) :is(button, label, a) { transition: none !important; }
html body[data-theme="adventure"][data-theme][data-theme].fx-reduced-motion :is(dialog) :is(button, a):active { transform: none; }

/* =====================================================================
   B. PRESERVED — map/skins/village shell rules (out of scope; unchanged
   computed visuals from the previous sheet).
   ===================================================================== */
@media (forced-colors: none) {
/* ---------- Map / skins / village shells ---------- */
html body[data-theme="adventure"][data-theme][data-theme] #districtMap :is(#mapBack, #mapRetry, #mapGuideDismiss, #mapCurrentNode, #mapSkip, #mapFeedbackBackToGame),
html body[data-theme="adventure"][data-theme][data-theme] #districtMap #mapSkins button.skin-gallery-back {
  border-radius: 18px; transition: transform .12s var(--eq-press);
  background: radial-gradient(90% 40% at 50% 6%, #fff 0 40%, transparent 42%), linear-gradient(180deg, var(--eq-paper), var(--eq-paper-deep));
}
html body[data-theme="adventure"][data-theme][data-theme] #districtMap :is(#mapBack, #mapGuideDismiss, #mapCurrentNode, #mapSkip):active:not(:disabled) { transform: translateY(3px); }
html body[data-theme="adventure"][data-theme][data-theme] #districtMap :is(#mapBattlesButton, #mapSkinsButton) {
  border-radius: 20px; transition: transform .14s var(--eq-press);
  /* Keep the rebrand's glossy berry/gold finish, with a darker shared face:
     white titles and hints must also pass over the upper glossy highlight. */
  background: radial-gradient(90% 40% at 50% 6%, #ffffff20 0 40%, transparent 42%), linear-gradient(180deg, #b0277f, var(--eq-lagoon-deep) 55%, #6e0f58);
  border: 3px solid var(--eq-brass); box-shadow: 0 0 0 2px var(--eq-lagoon-ink), 0 5px 0 var(--eq-lagoon-ink); color: #fff;
}
html body[data-theme="adventure"][data-theme][data-theme] #districtMap :is(#mapBattlesButton, #mapSkinsButton):hover:not(:disabled) { transform: translateY(-2px); }
html body[data-theme="adventure"][data-theme][data-theme] #districtMap :is(#mapBattlesButton, #mapSkinsButton):active:not(:disabled) { box-shadow: 0 0 0 2px var(--eq-lagoon-ink), 0 1px 0 var(--eq-lagoon-ink); }
html body[data-theme="adventure"][data-theme][data-theme] #districtMap :is(#mapBattlesButton, #mapSkinsButton):focus-visible { box-shadow: 0 0 0 3px var(--sk-cream), 0 5px 0 var(--eq-lagoon-ink); }
html body[data-theme="adventure"][data-theme][data-theme] #districtMap :is(.map-guide, #mapLoadState) { border-radius: 22px; }
html body[data-theme="adventure"][data-theme][data-theme] #districtMap #mapSkins .board-skin-grid button.board-skin-card { border-radius: 22px; transition: transform .14s var(--eq-press); }
html body[data-theme="adventure"][data-theme][data-theme] #districtMap #mapSkins .board-skin-grid button.board-skin-card:hover:not(:disabled) { transform: translateY(-3px); }
html body[data-theme="adventure"][data-theme][data-theme] .village-back {
  min-height: 44px; border-radius: 16px; font-family: var(--av-font); font-weight: 700; color: #2a0838;
  background: radial-gradient(90% 40% at 50% 6%, #fff 0 40%, transparent 42%), linear-gradient(180deg, var(--eq-paper), var(--eq-paper-deep));
  border: 3px solid var(--eq-brass); box-shadow: 0 0 0 2px #2a0838, 0 4px 0 #2a0838;
  transition: transform .12s var(--eq-press);
}
html body[data-theme="adventure"][data-theme][data-theme] .village-back:active { transform: translateY(3px); box-shadow: 0 0 0 2px #2a0838, 0 1px 0 #2a0838; }
/* Preserve the world's pre-existing reduced-motion rules independently of
   the rebuilt dialogs above. */
@media (prefers-reduced-motion: reduce) {
  html body[data-theme="adventure"][data-theme][data-theme] #districtMap :is(button, label) { transition: none !important; transform: none !important; }
}
html body[data-theme="adventure"][data-theme][data-theme].fx-reduced-motion #districtMap :is(button, label) { transition: none !important; }
} /* forced-colors: none */
