/* WebVault. Theme tokens first; settings.js overrides them at runtime. */
:root {
  --accent: #7c6cff; --on-accent: #fff; --radius: 12px; --opacity: 72%; --card-w: 170px; --gap: 16px; --dim: 0;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --bg: #0c0e17; --panel: #181b29; --text: #eceefb; --muted: #a3a8c3; --line: rgba(160, 168, 220, .18); --danger: #ff6b7d; --ok: #4fd6a0; --warm: #ffd166;
  color-scheme: dark;
}
:root[data-theme="light"] { --bg: #f3f4fa; --panel: #ffffff; --text: #181a2a; --muted: #555a76; --line: rgba(30, 35, 90, .15); --danger: #b4132f; --ok: #08724a; --warm: #946200; color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); overflow: hidden; }
#bg, #dim { position: fixed; inset: -40px; pointer-events: none; }
#bg { background: radial-gradient(50% 40% at 85% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), radial-gradient(40% 40% at 0% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent); background-size: cover; background-position: center; }
#bg[style*="url"] { background-size: cover; }
#dim { background: var(--bg); opacity: var(--dim); }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: 1.75rem; letter-spacing: -.02em; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: .3rem 0; }
a { color: var(--text); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#main:focus { outline: none; }
.muted { color: var(--muted); } .mono, kbd, pre { font-family: var(--mono); } .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.center { justify-content: center; } .row.end { justify-content: flex-end; }
.column { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; align-items: stretch; }
.column > .btn { align-self: flex-start; } .center-items { align-items: center; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.big { width: 44px; height: 44px; color: var(--accent); }

.glass { background: color-mix(in srgb, var(--panel) var(--opacity), transparent); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.no-glass .glass { backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }

/* controls */
.btn, button, input, select, textarea { font: inherit; color: var(--text); }
.btn, .menu button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 6px 13px; border-radius: calc(var(--radius) * .7); border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 80%, var(--text) 6%); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--panel) 75%, var(--accent) 25%); }
.btn:active { transform: translateY(1px); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; } .btn.primary:hover { filter: brightness(1.12); }
.btn.danger { color: var(--danger); } .btn.danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--panel) 80%, var(--danger) 20%); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.active { border-color: var(--accent); background: color-mix(in srgb, var(--panel) 65%, var(--accent) 35%); }
.btn.big { min-height: 46px; padding: 10px 28px; font-size: 1.05rem; }
.btn.icon-only { padding: 6px; width: 36px; flex: none; }
.btn.fav.on .icon { fill: var(--warm); stroke: var(--warm); }
input:not([type=checkbox]):not([type=range]):not([type=color]), select, textarea { min-height: 36px; padding: 6px 10px; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--line); border-radius: calc(var(--radius) * .6); max-width: 100%; }
option { background: var(--panel); color: var(--text); }
textarea { width: 100%; resize: vertical; }
input[type=checkbox], input[type=range], progress { accent-color: var(--accent); }
input[type=checkbox] { width: 18px; height: 18px; flex: none; }
input[type=color] { width: 54px; height: 36px; padding: 2px; background: none; border: 1px solid var(--line); border-radius: 8px; }
input.tiny { width: 80px; }
progress { width: 100%; }
kbd { border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 5px; padding: 1px 9px; min-width: 32px; text-align: center; }

/* shell */
#app { position: relative; display: flex; height: 100%; height: 100dvh; }
#content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#main { flex: 1; overflow-y: auto; overflow-x: hidden; }
.page { padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1600px; margin: 0 auto; display: flex; flex-direction: column; gap: calc(var(--gap) + 4px); }
#sidebar { width: 224px; flex: none; display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; border-width: 0 1px 0 0; overflow-y: auto; z-index: 30; transition: width .2s; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; text-decoration: none; padding: 0 6px; letter-spacing: -.01em; } .brand img { width: 30px; height: 30px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group small { color: var(--muted); padding: 0 10px; font-size: .72rem; }
.nav-group a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: calc(var(--radius) * .7); text-decoration: none; color: var(--muted); border-left: 3px solid transparent; white-space: nowrap; }
.nav-group a:hover { color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nav-group a.active { color: var(--text); background: color-mix(in srgb, var(--accent) 22%, transparent); border-left-color: var(--accent); }
.collapsed #sidebar { width: 68px; } .collapsed #sidebar span:not(.grow), .collapsed #sidebar small { display: none; } .collapsed .nav-group a { justify-content: center; }
.collapse-btn { align-self: center; }
#tabbar { display: none; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; } .skip:focus { top: 8px; }
.pill { position: fixed; top: 10px; right: 16px; z-index: 40; background: var(--warm); color: var(--bg); border-radius: 99px; padding: 2px 14px; font-weight: 700; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar.glass { padding: 10px; border-radius: var(--radius); }
.search { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; } .search input { flex: 1; width: 100%; }
.segment { display: flex; gap: 2px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); flex: none; }
.tabs a { padding: 8px 14px; text-decoration: none; white-space: nowrap; color: var(--muted); border-bottom: 3px solid transparent; } .tabs a.active { color: var(--text); border-color: var(--accent); }
.panel { border-radius: var(--radius); padding: 18px; min-width: 0; }
.panel.column { gap: 12px; } .panel > h2 { margin-bottom: 10px; } .panel.column > h2 { margin: 0; }
.panel.accent, .widget.accent { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--panel) 85%, var(--accent) 15%); }
.notice.error { border-color: var(--danger); } .notice.ok { border-color: var(--ok); }
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty p { max-width: 52ch; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--card-w), 44vw), 1fr)); gap: var(--gap); }
.card { position: relative; display: flex; flex-direction: column; background: color-mix(in srgb, var(--panel) var(--opacity), transparent); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .18s, border-color .18s, box-shadow .18s; min-width: 0; }
.card:hover, .card:focus-within { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(0,0,0,.28); }
.card.selected { outline: 3px solid var(--accent); }
.card.drop, .coll.drop { outline: 2px dashed var(--accent); }
.art { position: relative; aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden; background: linear-gradient(150deg, hsl(var(--h1) 55% 34%), hsl(var(--h2) 60% 18%)); }
.art::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 4px); }
.art.wide { aspect-ratio: 16 / 9; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.initials { font: 800 2.4rem var(--mono); color: rgba(255,255,255,.82); text-shadow: 3px 3px 0 rgba(0,0,0,.28); }
.card-art { display: block; text-decoration: none; }
.icon.i-more { stroke-width: 3.2; }
.shot:empty::after { content: "Image unavailable"; color: var(--muted); font-size: .8rem; }
.card-body { padding: 9px 10px 4px; flex: 1; min-width: 0; }
.card-title { display: block; font-weight: 650; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.chip { font-size: .74rem; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; }
.label-chip { border-color: var(--accent); color: var(--text); }
.status-playing, .result-ok { color: var(--ok); } .status-completed { color: var(--warm); } .status-dropped, .result-bad { color: var(--danger); } .status-want, .result-unknown { color: var(--text); border-color: var(--accent); }
.card-actions { display: flex; gap: 5px; padding: 6px 8px 9px; } .card-actions .primary { flex: 1; width: auto; }
.cards.list { grid-template-columns: 1fr; gap: 8px; }
.cards.list .card { flex-direction: row; align-items: center; } .cards.list .card:hover { transform: none; }
.cards.list .card-art { width: 56px; flex: none; } .cards.list .initials { font-size: 1.1rem; }
.cards.list .card-body { padding: 6px 12px; } .cards.list .card-actions { padding: 6px 10px; } .cards.list .card-actions .primary { flex: none; width: 52px; }
.cards.compact { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 6px; }
.cards.compact .card { flex-direction: row; align-items: center; } .cards.compact .card-art, .cards.compact .chips { display: none; }
.cards.compact .card-body { padding: 4px 10px; } .cards.compact .card-actions { padding: 4px 6px; } .cards.compact .card-actions .primary { flex: none; width: 36px; }
.cards.row-scroll { display: flex; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; } .cards.row-scroll .card { width: var(--card-w); flex: none; scroll-snap-align: start; }
.bulk { position: sticky; bottom: 8px; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border-radius: var(--radius); border-color: var(--accent); }

.shelf { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--gap); }
.tile { position: relative; border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; border-top: 3px solid var(--accent); }
.tile strong { font: 700 1.6rem var(--mono); overflow-wrap: anywhere; } .tile > .btn { position: absolute; top: 4px; right: 4px; }
.widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--gap); }
.widget { border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; } .widget textarea { flex: 1; }
.clock { font-size: 2rem; }
.feature-grid, .coll-grid, .arcade-grid, .note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: var(--gap); }
.feature { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); text-decoration: none; }
.feature > span { position: absolute; inset: auto 0 0; padding: 30px 14px 10px; background: linear-gradient(transparent, rgba(5,6,12,.9)); color: #fff; display: flex; flex-direction: column; }
.coll { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); border-bottom: 4px solid var(--c); background: color-mix(in srgb, var(--panel) var(--opacity), transparent); }
.coll a { display: flex; flex-direction: column; text-decoration: none; } .coll a > strong, .coll a > small { padding: 2px 12px; } .coll a > strong { padding-top: 10px; } .coll a > small { padding-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coll > .btn { position: absolute; top: 8px; right: 8px; }

/* game page */
.hero { position: relative; isolation: isolate; display: flex; gap: 28px; align-items: flex-end; padding: 32px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: linear-gradient(120deg, color-mix(in srgb, var(--c, var(--accent)) 32%, var(--panel)), var(--panel)); min-height: 260px; }
.hero.small { min-height: 180px; border-left: 5px solid var(--c); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.hero:has(.hero-bg)::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 92%, transparent), color-mix(in srgb, var(--bg) 50%, transparent)); }
.hero-cover { width: 190px; flex: none; border-radius: var(--radius); box-shadow: 0 14px 36px rgba(0,0,0,.45); }
.hero-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; align-items: flex-start; } .hero-info h1 { font-size: clamp(1.6rem, 4vw, 2.8rem); overflow-wrap: anywhere; }
.game-layout { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; } .game-layout.stacked { grid-template-columns: minmax(0, 1fr); }
dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; } dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; }
.list-box { display: flex; flex-direction: column; border-radius: var(--radius); } .list-box.glass { padding: 6px 14px; } .list-box h3 { margin-top: 12px; }
.list-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); } .list-row:last-child { border-bottom: 0; }
.list-row > .grow { flex-basis: 180px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.shot { aspect-ratio: 16 / 10; padding: 0; border: 1px solid var(--line); border-radius: calc(var(--radius) * .6); overflow: hidden; background: var(--panel); cursor: zoom-in; } .shot:hover { border-color: var(--accent); } .shot img { width: 100%; height: 100%; object-fit: cover; }
.lightbox { text-align: center; } .lightbox img { max-width: 100%; max-height: 62vh; object-fit: contain; }
.md > :first-child { margin-top: 0; } .md pre, .viewer { background: color-mix(in srgb, var(--bg) 80%, transparent); padding: 12px; border-radius: 8px; overflow: auto; max-height: 420px; font-size: .82rem; margin: 0; }
.md blockquote { margin: 6px 0; padding-left: 12px; border-left: 3px solid var(--accent); color: var(--muted); } .md { overflow-wrap: anywhere; }
.note-body { max-height: 240px; overflow: auto; } .viewer-img { max-width: 100%; max-height: 400px; align-self: flex-start; }

/* player */
body[data-view=play] .page { max-width: none; height: 100%; padding: 8px; }
.player { display: flex; flex-direction: column; gap: 8px; height: 100%; position: relative; min-height: 0; }
.player-bar { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: var(--radius); flex-wrap: wrap; } .player-bar .grow { flex-basis: 100px; }
.player.bare .player-bar { display: none; } .unhide { display: none; position: absolute; top: 6px; right: 6px; z-index: 5; opacity: .7; } .player.bare .unhide { display: inline-flex; }
.player-main { flex: 1; display: flex; gap: 8px; min-height: 0; }
.stage { flex: 1; min-width: 0; position: relative; display: grid; place-items: center; background: #05060a; border-radius: var(--radius); overflow: hidden; }
.viewport { max-width: 100%; max-height: 100%; background: #000; } .viewport.resizable { resize: both; overflow: hidden; padding: 0 12px 12px 0; }
.viewport iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.stage-panel { margin: 16px; padding: 26px; border-radius: var(--radius); max-width: 560px; text-align: center; max-height: calc(100% - 32px); overflow: auto; color: var(--text); }
.overlay { display: none; position: absolute; top: 10px; right: 10px; gap: 6px; opacity: .35; z-index: 4; } .overlay:hover, .overlay:focus-within { opacity: 1; } .stage:fullscreen .overlay { display: flex; } .stage:fullscreen { border-radius: 0; }
.player-info { width: 270px; flex: none; border-radius: var(--radius); padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }

/* dialogs, menus, forms */
.modal { width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.modal.wide { width: min(760px, calc(100vw - 24px)); }
.modal[open] { display: flex; flex-direction: column; animation: pop .16s ease-out; }
.modal::backdrop { background: rgba(4, 5, 12, .65); backdrop-filter: blur(3px); }
.modal > header, .modal > footer { display: flex; align-items: center; gap: 8px; padding: 12px 18px; } .modal > header { justify-content: space-between; border-bottom: 1px solid var(--line); } .modal > footer { justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.modal-body { padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.modal:not(.wide) .form { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .field.full, .form > .full { grid-column: 1 / -1; } .form > h3 { padding-top: 8px; border-top: 1px solid var(--line); }
.field.inline { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; }
.label { font-size: .85rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; } .checklist label { display: flex; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.menu { position: fixed; z-index: 90; min-width: 210px; max-height: calc(100dvh - 16px); overflow: auto; padding: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 44px rgba(0,0,0,.5); animation: pop .12s ease-out; }
.menu button { width: 100%; justify-content: flex-start; border: 0; background: none; } .menu button:hover, .menu button:focus-visible { background: color-mix(in srgb, var(--accent) 28%, transparent); } .menu button.danger { color: var(--danger); } .menu hr { border: 0; border-top: 1px solid var(--line); }
#toasts { position: fixed; inset: auto 16px 16px auto; margin: 0; padding: 0; border: 0; background: none; overflow: visible; color: var(--text); z-index: 95; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; padding: 11px 15px; background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .2s ease-out; } .toast.error { border-color: var(--danger); } .toast.ok { border-color: var(--ok); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.pick { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; } .pick .art { width: 150px; border-radius: var(--radius); }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; } .dropzone.drop { border-color: var(--accent); }
.swatch { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--sb); cursor: pointer; color: var(--text); } .swatch span { background: var(--panel); padding: 1px 8px; border-radius: 6px; } .swatch i { width: 24px; height: 24px; border-radius: 6px; background: var(--s); } .swatch:hover { border-color: var(--s); }
.switch { position: relative; width: 46px; height: 26px; flex: none; } .switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .2s; } .switch span::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); } .switch input:checked + span::after { transform: translateX(20px); } .switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* charts */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: var(--gap); }
.hbars { display: flex; flex-direction: column; gap: 6px; } .hbar { display: grid; grid-template-columns: minmax(70px, 32%) 1fr auto; gap: 10px; align-items: center; font-size: .85rem; }
.track { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; } .track span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.columns { margin: 0; } .bars { display: flex; align-items: flex-end; gap: 2px; height: 150px; border-bottom: 1px solid var(--line); } .bars span { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; } .bars span.zero { background: var(--line); }
.axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }

/* arcade */
.cabinet { border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--accent); } .cabinet p { margin: 0; } .cabinet h3 + p { flex: 1; }
.arcade-play { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--gap); align-items: start; }
.arcade-host { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(100%, 480px); }
.game-canvas { width: 100%; height: auto; max-height: 65vh; object-fit: contain; background: color-mix(in srgb, var(--panel) 90%, #000); border: 2px solid var(--accent); border-radius: var(--radius); }
.arcade-host.over > :first-child { opacity: .65; }
.tile-game { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; width: min(100%, 400px, 60vh); }
.tile-game > * { aspect-ratio: 1; display: grid; place-items: center; font: 700 clamp(1rem, 4vw, 1.5rem) var(--mono); background: color-mix(in srgb, var(--panel) 80%, var(--text) 8%); border: 1px solid var(--line); border-radius: calc(var(--radius) * .5); padding: 0; cursor: pointer; user-select: none; -webkit-touch-callout: none; }
.tile-game > .matched { background: color-mix(in srgb, var(--panel) 55%, var(--accent) 45%); }
.tile-game > .lit { background: var(--warm); } .tile-game.mines { gap: 3px; } .tile-game.mines > * { font-size: 1rem; }
.reflex { width: 100%; height: 300px; font: 700 1.4rem var(--font); border-radius: var(--radius); border: 2px solid var(--accent); background: var(--panel); cursor: pointer; touch-action: manipulation; } .reflex.waiting { background: #8b1e2d; color: #fff; } .reflex.go { background: #12a866; color: #04140c; }
.status-line { min-height: 1.5em; text-align: center; } .scores { padding-left: 22px; }

.compact-ui { --gap: 9px; } .compact-ui body { font-size: 13.5px; } .compact-ui .panel { padding: 11px; } .compact-ui .page { padding-top: 14px; }

@media (max-width: 960px) { .game-layout, .arcade-play { grid-template-columns: minmax(0, 1fr); } .player-info { position: absolute; right: 0; bottom: 0; top: 56px; z-index: 6; background: var(--panel); } }
@media (max-width: 760px) {
  #sidebar, .collapsed #sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; transform: translateX(-105%); visibility: hidden; transition: transform .22s, visibility .22s; background: var(--panel); }
  .drawer #sidebar { transform: none; visibility: visible; }
  .collapsed #sidebar span:not(.grow), .collapsed #sidebar small { display: initial; } .collapsed .nav-group a { justify-content: flex-start; } .collapse-btn { display: none; }
  #app { flex-direction: column; }
  #content { min-height: 0; }
  #tabbar { display: flex; flex: none; border-width: 1px 0 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); z-index: 31; }
  #tabbar > * { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; padding: 5px 0; text-decoration: none; color: var(--muted); background: none; border: 0; min-width: 0; }
  #tabbar > .active { color: var(--accent); }
  body[data-view=play] #tabbar { display: none; }
  .page { padding: 18px 14px 40px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 18px; } .hero-cover { width: 130px; }
  #toasts { bottom: 76px; }
}
@media (pointer: coarse) { .btn, .nav-group a, input, select { min-height: 42px; } .btn.icon-only { width: 42px; } .card-actions .btn.icon-only { width: 38px; } input[type=range] { min-height: 30px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }
