/* A small town directory, sharing the page's paper, orange accents and rounded controls. */
:root { --nav-width: 224px; }
:root[data-nav-rail="true"] { --nav-width: 64px; }
body { padding-left: var(--nav-width); }
.top { min-height: 64px; gap: 14px; }
body > main .qh-tabs { top: var(--top-height, 64px); }
body > main .ck-left { top: calc(var(--top-height, 64px) + 12px); }
.top > .logo { margin-right: auto; }
.site-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 12; width: var(--nav-width); display: flex; flex-direction: column; background: var(--card); border-right: 1px solid var(--line); }
.nav-head { flex: none; min-height: 64px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.nav-brand { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; text-decoration: none; font-size: 17px; font-weight: 850; white-space: nowrap; }
.nav-brand-mark { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 19px; font-weight: 900; box-shadow: inset 0 -3px 0 rgba(70, 35, 0, .13); }
.nav-control { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.nav-collapse { width: 32px; height: 40px; border: 0; color: var(--muted); }
.nav-symbol { display: grid; place-items: center; width: 23px; height: 23px; flex: none; }
.nav-symbol svg { display: block; width: 100%; height: 100%; }
.site-nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding: 12px 10px 16px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 9px 11px; border-radius: 12px; text-decoration: none; font-size: 14px; font-weight: 650; color: var(--muted); margin-bottom: 3px; }
.nav-icon { width: 23px; height: 23px; flex: none; }
.nav-glyph { display: grid; place-items: center; font-family: system-ui, "Microsoft YaHei", sans-serif; font-size: 23px; line-height: 1; }
.nav-label { min-width: 0; white-space: nowrap; }
.nav-link.on { background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--ink); font-weight: 800; }
.nav-link.on::before { content: ""; position: absolute; left: 0; width: 3px; height: 19px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-link.on > :first-child { color: var(--accent); }
.nav-home { margin-bottom: 14px; }
.nav-group { margin-top: 12px; }
.nav-group-title { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 36px; padding: 4px 10px; margin: 0 0 3px; border: 0; background: none; color: var(--muted); font: 700 12px/1.5 system-ui, sans-serif; cursor: pointer; }
.nav-group-title .nav-symbol { width: 16px; height: 16px; }
.nav-group-title[aria-expanded="false"] .nav-symbol { rotate: -90deg; }
.nav-group-title.current[aria-expanded="false"] { color: var(--accent); }
.nav-hint { position: fixed; z-index: 38; translate: 0 -50%; padding: 7px 10px; border-radius: 9px; background: var(--ink); color: var(--card); box-shadow: var(--shadow); font-size: 13px; pointer-events: none; }
.nav-launch, .nav-backdrop { display: none; }
.site-sidebar .nav-link > .gd-lock { position: static; margin-left: auto; height: 17px; padding: 0 4px; font-size: 10px; }
.site-sidebar .nav-link > .gd-lock .gd-need { display: none; }
.site-sidebar .nav-link > .gd-pip { right: 9px; top: 8px; width: 7px; height: 7px; }
.nav-control:focus-visible, .nav-link:focus-visible, .nav-brand:focus-visible, .nav-group-title:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .nav-link:hover, .nav-group-title:hover, .nav-control:hover { color: var(--ink); background: var(--card2); } }
:root[data-nav-rail="true"] body:not(.nav-drawer) .nav-label,
:root[data-nav-rail="true"] body:not(.nav-drawer) .nav-brand,
:root[data-nav-rail="true"] body:not(.nav-drawer) .nav-group-title { display: none; }
:root[data-nav-rail="true"] body:not(.nav-drawer) .nav-head { padding: 10px; justify-content: center; }
:root[data-nav-rail="true"] body:not(.nav-drawer) .nav-collapse { width: 44px; }
:root[data-nav-rail="true"] body:not(.nav-drawer) .site-nav { padding-inline: 8px; }
:root[data-nav-rail="true"] body:not(.nav-drawer) .nav-group { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line); }
:root[data-nav-rail="true"] body:not(.nav-drawer) .nav-link { justify-content: center; padding-inline: 0; }
:root[data-nav-rail="true"] body:not(.nav-drawer) .nav-link > .gd-lock { position: absolute; right: 0; top: 0; height: 13px; padding: 0 2px; }
:root[data-nav-rail="true"] body:not(.nav-drawer) .nav-link > .gd-lock .gd-ic { width: 9px; height: 9px; }
body:not(.nav-drawer) .notice-btn { left: calc(var(--nav-width) + 16px); }

/* Fullscreen fights retain their existing viewport and gain the same drawer as phones. */
body.nav-drawer { --nav-width: 0px; }
body.nav-drawer .site-sidebar { width: min(292px, calc(100vw - 48px)); z-index: 35; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s .2s; box-shadow: var(--shadow-lg); }
body.nav-drawer.nav-open .site-sidebar { visibility: visible; transform: translateX(0); transition-delay: 0s; }
body.nav-drawer .nav-collapse { width: 44px; height: 44px; }
body.nav-drawer .nav-head { padding-top: max(10px, env(safe-area-inset-top)); }
body.nav-drawer .nav-group-title { min-height: 44px; }
body.nav-drawer .nav-link { min-height: 46px; font-size: 15px; }
body.nav-drawer .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 34; background: rgba(28, 20, 12, .42); touch-action: none; }
body.nav-drawer .nav-launch { display: grid; position: fixed; top: max(10px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); z-index: 33; box-shadow: var(--shadow); }
body.nav-open .nav-launch { visibility: hidden; }
body:is(.q-full, .rd-full, .ar-on) .nav-launch { left: auto; right: max(12px, env(safe-area-inset-right)); }
body:is(.q-full, .rd-full, .ar-on) .site-sidebar .nav-label { display: inline; }

@media (max-width: 900px) {
  body { --nav-width: 0px; }
  .top { padding-left: max(68px, calc(env(safe-area-inset-left) + 56px)); padding-right: max(10px, env(safe-area-inset-right)); gap: 8px; min-height: 64px; }
  .top .logo { font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
  .top .chip .name { display: none; }
  .top .chip { min-height: 44px; padding: 4px 9px 4px 4px; gap: 5px; }
  .top .tool, .top #who .reload { width: 44px; height: 44px; min-width: 44px; }
  #tools { gap: 4px; }
  body:is(.q-full, .rd-full, .ar-on) .nav-launch { top: calc(54px + env(safe-area-inset-top)); }
}
/* At phone widths the wallet keeps its own line, leaving generous targets for theme and sound. */
@media (max-width: 600px) {
  .top { flex-wrap: wrap; padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 8px; gap: 6px; }
  .top > .logo { flex: 1; }
  .top #who { flex-basis: 100%; justify-content: flex-end; min-width: 0; }
  .top #who:has(.chip) { justify-content: flex-end; }
  .top #who > .btn { min-height: 44px; padding: 7px 14px; }
  .top #who .coins b { font-size: 14px; }
  .top #who .chip { max-width: calc(100% - 48px); }
  .top #who .coins { min-width: 0; overflow: hidden; }
  .top #who .coins b { overflow: hidden; text-overflow: ellipsis; }
  .vol-pop { left: 12px; right: 12px; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { body.nav-drawer .site-sidebar { transition: none; } }

.game-card.t-bank { background: linear-gradient(160deg, #e9efdc, #b6c987); color: #344321; }
.bank-tile { position: relative; display: grid; place-items: center; gap: 2px; width: 90px; min-height: 98px; padding: 10px 12px 20px; border: 2px solid #6d7f47; border-radius: 16px 16px 8px 8px; background: #fbf5df; box-shadow: 0 5px 0 #6d7f47, 0 9px 16px rgba(45, 65, 20, .2); color: #526232; }
.bank-tile > span { font-size: 12px; letter-spacing: 5px; margin-left: 5px; }
.bank-tile > b { font-size: 27px; line-height: 1.15; letter-spacing: 3px; }
.game-card .art .bank-tile img { position: absolute; right: -14px; bottom: -7px; width: 40px; height: 40px; animation: none; }
