/* Layout only. Colours, fonts and art come from /theme/<style>.css (CSS variables), so a style pick is a swap. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; padding: 66px 10px 78px; font: var(--font, 16px/1.35 system-ui, sans-serif);
  color: var(--ink, #222); background: var(--bg, #eee); }
a { color: inherit; }
main { max-width: 720px; margin: 0 auto; display: grid; gap: 12px; }

header.top { position: fixed; inset: 0 0 auto 0; height: 56px; z-index: 10; display: flex; align-items: center; gap: 8px;
  padding: 0 10px; background: var(--bar, #ddd); border-bottom: 3px solid var(--edge, #999); }
header.top .back { flex: none; font-size: 22px; text-decoration: none; width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--chip, #ccc); border: 2px solid var(--edge, #999); border-radius: var(--r, 6px); }
.brand { flex: none; display: flex; align-items: center; gap: 6px; text-decoration: none; font: var(--brand-font, 700 20px/1 sans-serif);
  color: var(--brand, inherit); text-transform: uppercase; white-space: nowrap; }
.brand .lure { width: 30px; height: 30px; background: var(--lure, none) center/contain no-repeat; }
.search { flex: 1; min-width: 0; }
.search input { width: 100%; height: 36px; padding: 0 10px; font: inherit; font-size: 15px; color: var(--ink-field, #333);
  background: var(--field, #fff); border: 2px solid var(--edge, #999); border-radius: var(--r, 6px); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--edge, #999);
  background: var(--chip, #ccc) var(--avatar, none) center/cover; }

nav.tabs { position: fixed; inset: auto 0 0 0; height: 64px; z-index: 10; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--bar, #ddd); border-top: 3px solid var(--edge, #999); padding-bottom: env(safe-area-inset-bottom); }
.tab { display: grid; place-items: center; align-content: center; gap: 2px; text-decoration: none; font: var(--tab-font, 600 14px sans-serif);
  border-right: 2px solid var(--edge, #999); }
.tab:last-child { border-right: 0; }
.tab i { width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--icon) center/contain no-repeat; mask: var(--icon) center/contain no-repeat; }
.tab.on { background: var(--tab-on, #bbb); color: var(--tab-on-ink, inherit); }
.tab-home { --icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3 2 12h3v9h5v-6h4v6h5v-9h3z"/></svg>'); }
.tab-friends { --icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="8" cy="8" r="4"/><circle cx="17" cy="9" r="3"/><path d="M0 21c0-5 4-7 8-7s8 2 8 7zM16 21c0-3-1-5-3-6 1-1 3-1 4-1 4 0 7 2 7 7z"/></svg>'); }
.tab-me { --icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="7" r="5"/><path d="M2 23c0-6 5-9 10-9s10 3 10 9z"/></svg>'); }

.panel { background: var(--panel, #fff); border: 3px solid var(--edge, #999); border-radius: var(--r, 6px); padding: 10px;
  box-shadow: var(--panel-shadow, none); }
.panel > h2 { margin: -2px auto 8px; width: fit-content; padding: 2px 14px; font: var(--head-font, 700 20px sans-serif);
  color: var(--head, inherit); background: var(--head-bg, none); border: var(--head-border, 0); border-radius: var(--r, 6px); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; padding: 5px 12px; font: var(--chip-font, 600 14px sans-serif); text-decoration: none; background: var(--chip, #ccc);
  border: 2px solid var(--edge, #999); border-radius: var(--r, 6px); }
.chip.on { background: var(--accent, #4a4); color: var(--accent-ink, #fff); }
.btn { display: block; width: 100%; padding: 10px; text-align: center; font: var(--btn-font, 700 22px sans-serif);
  text-decoration: none; color: var(--accent-ink, #fff); background: var(--accent, #4a4); border: 3px solid var(--edge, #999);
  border-radius: var(--r, 6px); box-shadow: var(--btn-shadow, none); cursor: pointer; }
.hero { position: relative; aspect-ratio: 16/9; overflow: hidden; padding: 0; background: var(--skeleton, #ccc) center/cover; }
.hero .tag { position: absolute; left: 10px; top: 10px; padding: 3px 10px; font: var(--chip-font, 700 13px sans-serif);
  background: var(--hot, #c33); color: #fff; border-radius: var(--r, 6px); }
.hero .btn { position: absolute; right: 10px; bottom: 10px; width: auto; padding: 6px 22px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { display: block; text-decoration: none; background: var(--panel, #fff); border: 3px solid var(--edge, #999);
  border-radius: var(--r, 6px); overflow: hidden; }
.card .art { aspect-ratio: 16/10; background: var(--skeleton, #ccc) center/cover; }
.card .t { padding: 4px 6px; text-align: center; font: var(--card-font, 700 14px sans-serif); text-transform: uppercase; }
.muted { color: var(--ink-2, #666); font-size: 14px; text-align: center; margin: 0; }
.row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-top: 1px solid var(--rule, #ddd); }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; }
