/* Blockade Brigade demo viewer. Colours and fonts come from css/brigade.css (the web theme,
   docs/website-theme.md in the game project); the short names below just point at them. */
:root {
    --bg: var(--bb-bg);
    --panel: var(--bb-panel);
    --panel-2: var(--bb-panel-2);
    --line: var(--bb-line);
    --text: var(--bb-text);
    --muted: var(--bb-muted);
    --amber: var(--bb-amber);
    --amber-hi: var(--bb-amber-hi);
    --gold: var(--bb-gold);
    --blue: var(--bb-blue);
    --red: var(--bb-red);
    --green: var(--bb-green);
    --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font-body);
}
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Top bar */
.bar {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 20px; background: var(--bb-hex), #0a0f1c; border-bottom: 1px solid var(--line);
}
.brand img { display: block; height: 40px; width: auto; }
.bar-title { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--amber); }
.search { margin-left: auto; flex: 0 1 360px; }
.search input {
    width: 100%; padding: 9px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--panel); color: var(--text); outline: none;
}
.search input:focus { border-color: var(--blue); }
.search input:focus-visible { outline: none; box-shadow: 0 0 0 2px rgb(56 189 248 / .35); }

/* Layout: stage + info on top, browser below (wide screens: browser on the left) */
.layout {
    display: grid; gap: 16px; padding: 16px 20px;
    grid-template-columns: 340px minmax(0, 1fr) 360px;
    grid-template-areas: "browser stage info";
    height: calc(100vh - 61px);
}
.browser { grid-area: browser; display: flex; flex-direction: column; min-height: 0; }
.stage-wrap { grid-area: stage; position: relative; min-height: 0; }
.info { grid-area: info; overflow-y: auto; min-height: 0; }

/* 3D stage */
.stage {
    position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden;
    background: radial-gradient(ellipse at 50% 30%, #24345a, #0e1424 75%);
    border: 1px solid var(--line);
}
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage-hint {
    position: absolute; left: 14px; top: 12px; font-size: 12px; color: var(--muted);
    pointer-events: none; text-shadow: 0 1px 2px #000;
}
.stage-actions {
    position: absolute; left: 0; right: 0; bottom: 14px;
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 0 12px;
}
.btn {
    border: 0; border-radius: 6px; padding: 10px 18px; cursor: pointer;
    font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    box-shadow: var(--bb-bevel); transition: transform .12s, background-color .12s;
}
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgb(0 0 0 / .25); }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-fire {
    background: var(--amber); color: #0e1424; padding: 12px 30px; font-size: 17px;
    box-shadow: var(--bb-bevel), 0 6px 20px rgb(245 158 11 / .35);
}
.btn-fire:hover { background: var(--amber-hi); }
.btn-ghost { background: rgb(14 20 36 / .75); border: 1px solid var(--line); }
.btn-ghost[aria-pressed="true"] { border-color: var(--amber); }
.battle-status {
    position: absolute; right: 14px; top: 12px; padding: 6px 12px; border-radius: 8px;
    background: rgb(14 20 36 / .8); border: 1px solid var(--line);
    font-family: var(--font-display); font-weight: 700; letter-spacing: .04em;
}

/* Browser: tabs, chips, card grid */
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab {
    flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--panel); cursor: pointer;
    font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    box-shadow: var(--bb-plate);
}
.tab[aria-selected="true"] { background: var(--amber); color: #0e1424; border-color: var(--amber); box-shadow: var(--bb-bevel); }
.tab span { opacity: .7; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
    padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line);
    background: transparent; cursor: pointer; font-size: 13px; color: var(--muted);
}
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--amber); background: rgb(245 158 11 / .12); }
.grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px;
    grid-auto-rows: max-content; align-content: start;
    overflow-y: auto; padding-right: 4px; min-height: 0;
}
.card {
    display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden;
    border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer;
    box-shadow: var(--bb-plate);
}
.card:hover { border-color: var(--muted); }
.card[aria-current="true"] { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), var(--bb-plate); }
.card-thumb { flex: none; aspect-ratio: 4 / 3; width: 100%; height: auto; background: var(--panel-2); display: block; object-fit: cover; }
.card-name { padding: 6px 9px 0; font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.card-sub { padding: 0 9px 8px; font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); }

/* Info panel */
.info-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--bb-plate); }
.info h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.2; }
/* The page's one hazard underline */
.info h1::after { content: ""; display: block; width: 72px; height: 6px; margin-top: 8px; background: var(--bb-hazard); border-radius: 1px; }
.info .kind { color: var(--muted); font-family: var(--font-display); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.info p { margin: 10px 0; }
.info h2 { margin: 18px 0 8px; font-family: var(--font-display); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--amber); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge { padding: 2px 9px; border-radius: 999px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.badge.yes { border-color: var(--green); color: var(--green); }
.badge.no { color: var(--muted); text-decoration: line-through; }
.stat { display: grid; grid-template-columns: 96px 1fr 56px; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.stat-bar { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.stat-bar i { display: block; height: 100%; border-radius: 4px; background: var(--amber); }
.stat-val { text-align: right; font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
/* Rivet-dot bullets */
.info ul { margin: 6px 0; padding-left: 20px; list-style: none; }
.info ul > li { position: relative; }
.info ul > li::before { content: ""; position: absolute; left: -15px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--bb-rivet); }

/* Phones and narrow screens: stage, then info, then the list; page scrolls */
@media (max-width: 1100px) {
    .layout {
        height: auto; grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "stage" "info" "browser";
    }
    .stage-wrap { height: 62vh; min-height: 340px; }
    .grid { overflow: visible; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .search { flex-basis: 220px; }
}
@media (max-width: 560px) {
    .bar { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
    .brand img { height: 32px; }
    .search { flex: 1 1 100%; }
    .layout { padding: 12px 16px; }
    .btn-fire { padding: 11px 24px; }
}

/* The Clanker walking along the bottom: the shared kit, /media/clanker/clanker.css */

@media (prefers-reduced-motion: reduce) {
    .btn, .btn:hover, .btn:active { transition: none; transform: none; }
}
