:root {
  color-scheme: dark;
  --bg: #0d0906;
  --panel: #17110b;
  --panel-2: #1e160d;
  --gold: #e8c065;
  --gold-2: #b8913f;
  --gold-dim: #7a5a22;
  --text: #e9dcc0;
  --muted: #9b8d70;
  --line: rgba(184, 145, 63, 0.22);
  --tip-bg: rgba(6, 9, 26, 0.96);
  --yellow: #ffd100;
  --green: #1eff00;
  --blue: #0070dd;
  --purple: #a335ee;
  --orange: #ff8000;
  --grey: #9d9d9d;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.45 'Alegreya Sans', system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(232, 160, 60, 0.18), transparent 60%),
    radial-gradient(900px 700px at 100% 100%, rgba(120, 30, 20, 0.18), transparent 60%),
    radial-gradient(900px 700px at 0% 100%, rgba(40, 60, 120, 0.14), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 6px),
    var(--bg);
  overflow-x: hidden;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

#embers {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.fog {
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(40% 30% at 20% 30%, rgba(255, 200, 120, 0.05), transparent 70%),
    radial-gradient(35% 25% at 80% 60%, rgba(160, 120, 255, 0.04), transparent 70%),
    radial-gradient(30% 25% at 50% 90%, rgba(255, 120, 60, 0.05), transparent 70%);
  animation: fog 38s ease-in-out infinite alternate;
}
@keyframes fog {
  to { transform: translate(4%, -3%) scale(1.08) rotate(2deg); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 36px 16px 18px;
}

.crest {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 6px;
  display: grid;
  place-items: center;
  animation: float 6s ease-in-out infinite;
}
.crest img {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  filter: drop-shadow(0 0 18px rgba(255, 120, 60, 0.45)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
  animation: wobble 7s ease-in-out infinite;
}
.rune-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(232, 192, 101, 0.55);
  box-shadow: 0 0 24px rgba(232, 192, 101, 0.3), inset 0 0 18px rgba(232, 192, 101, 0.2);
  background: conic-gradient(from 0deg, transparent 0 8%, rgba(232, 192, 101, 0.5) 9% 10%, transparent 11% 33%,
    rgba(232, 192, 101, 0.5) 34% 35%, transparent 36% 58%, rgba(232, 192, 101, 0.5) 59% 60%, transparent 61% 83%,
    rgba(232, 192, 101, 0.5) 84% 85%, transparent 86%);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%);
  mask: radial-gradient(circle, transparent 60%, #000 61%);
  animation: spin 24s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

.title {
  margin: 0;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(44px, 9vw, 92px);
  line-height: 1;
  letter-spacing: 0.04em;
  background: linear-gradient(100deg, #7a5320 0%, #f5d98c 18%, #fff6d8 24%, #e8c065 32%, #8d6427 50%, #f5d98c 68%, #fff6d8 74%, #e8c065 82%, #7a5320 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #2a1a08) drop-shadow(0 0 22px rgba(232, 160, 60, 0.35));
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.tagline {
  margin: 10px 0 18px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--gold-2);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.stat {
  min-width: 112px;
  padding: 8px 16px;
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(60, 40, 18, 0.65), rgba(20, 13, 6, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.12), 0 4px 14px rgba(0, 0, 0, 0.4);
  animation: rise 0.6s ease-out both;
}
.stat b {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: var(--gold);
}
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- frame ---------- */
.frame {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100% - 24px));
  margin: 8px auto 24px;
  padding: 18px;
  border: 2px solid var(--gold-dim);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 220, 150, 0.04), transparent 120px),
    radial-gradient(120% 80% at 50% 0%, #22180d, var(--panel) 60%);
  box-shadow:
    0 0 0 1px #000,
    0 0 0 4px rgba(60, 40, 15, 0.7),
    0 0 0 5px rgba(232, 192, 101, 0.25),
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 40px rgba(0, 0, 0, 0.6);
}
.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gold);
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(232, 192, 101, 0.5));
}
.corner::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
}
.corner.tl { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.corner.tr { top: -6px; right: -6px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: -6px; left: -6px; border-right: 0; border-top: 0; }
.corner.br { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }
.corner.tl::after { top: -6px; left: -6px; }
.corner.tr::after { top: -6px; right: -6px; }
.corner.bl::after { bottom: -6px; left: -6px; }
.corner.br::after { bottom: -6px; right: -6px; }

.banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 128, 0, 0.5);
  border-radius: 6px;
  background: rgba(255, 128, 0, 0.08);
  color: #ffcf9a;
  font-size: 14px;
}

/* ---------- filters ---------- */
.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.search {
  display: flex;
  gap: 8px;
}
select, .search-box {
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  background: linear-gradient(180deg, #0f0a05, #1b130a);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.6);
  color: var(--text);
}
select {
  font: 600 14px 'Cinzel', serif;
  padding: 0 30px 0 12px;
  height: 46px;
  color: var(--gold);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%), linear-gradient(180deg, #0f0a05, #1b130a);
  background-position: calc(100% - 16px) 20px, calc(100% - 11px) 20px, 0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
}
.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  height: 46px;
  transition: border-color 0.2s, box-shadow 0.3s;
}
.search-box:focus-within {
  border-color: var(--gold);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7), 0 0 0 1px #000, 0 0 16px rgba(232, 192, 101, 0.35);
}
.search-box svg { width: 20px; height: 20px; color: var(--gold-2); flex: none; }
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 500 16px 'Alegreya Sans', sans-serif;
}
.search-box input::placeholder { color: #6f6350; }
.search-box input::-webkit-search-cancel-button { display: none; }
.clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
}
.clear:hover { color: var(--gold); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font: 600 13px 'Alegreya Sans', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
}
.chip .ico { width: 24px; height: 24px; }
.chip:hover { transform: translateY(-1px); border-color: var(--gold-dim); color: var(--text); }
.chip.on { border-color: var(--gold); color: var(--gold); background: rgba(232, 192, 101, 0.1); box-shadow: 0 0 10px rgba(232, 192, 101, 0.25); }
.chip small { opacity: 0.7; font-weight: 500; }

.count { font-size: 13px; color: var(--muted); }
.count b { color: var(--gold); }

/* ---------- table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  -webkit-overflow-scrolling: touch;
}
.roster {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
}
.roster th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0;
  background: linear-gradient(180deg, #2b1f10, #1a120a);
  border-bottom: 2px solid var(--gold-dim);
  text-align: left;
  white-space: nowrap;
}
.roster th button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 11px 10px;
  border: 0;
  background: transparent;
  color: var(--gold-2);
  font: 700 12px 'Cinzel', serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, text-shadow 0.2s;
}
.roster th button:hover,
.roster th[aria-sort] button { color: var(--gold); text-shadow: 0 0 10px rgba(232, 192, 101, 0.5); }
.roster th .arrow {
  display: inline-block;
  width: 10px;
  opacity: 0;
  transition: transform 0.25s, opacity 0.2s;
}
.roster th[aria-sort] .arrow { opacity: 1; }
.roster th[aria-sort='descending'] .arrow { transform: rotate(180deg); }
.roster th.num button { justify-content: flex-end; }

.roster td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(184, 145, 63, 0.1);
  vertical-align: middle;
  white-space: nowrap;
}
.roster td.num { text-align: right; font-variant-numeric: tabular-nums; }
.roster tbody tr {
  position: relative;
  transition: background 0.2s;
}
.roster tbody tr:nth-child(even) { background: rgba(255, 220, 150, 0.022); }
.roster tbody tr:hover {
  background: linear-gradient(90deg, rgba(232, 192, 101, 0.12), rgba(232, 192, 101, 0.03) 60%, transparent);
}
.roster tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.roster tbody tr.enter { animation: rowIn 0.45s cubic-bezier(.2, .7, .3, 1) both; animation-delay: var(--d, 0ms); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-12px); } }

.roster td:first-child,
.roster th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}
.roster th:first-child { z-index: 3; }
.roster td:first-child { background: linear-gradient(90deg, #17110b 85%, rgba(23, 17, 11, 0.85)); }
.roster tbody tr:nth-child(even) td:first-child { background: linear-gradient(90deg, #1a130c 85%, rgba(26, 19, 12, 0.85)); }

.who { display: flex; align-items: center; gap: 6px; }
.name {
  font-weight: 700;
  font-size: 16.5px;
  text-decoration: none;
  text-shadow: 0 1px 0 #000, 0 0 10px currentColor;
  text-shadow: 0 1px 0 #000;
  transition: text-shadow 0.2s;
}
a.name:hover { text-decoration: underline; text-shadow: 0 1px 0 #000, 0 0 12px currentColor; }
.surname { color: var(--muted); font-weight: 500; font-size: 14px; }
.copy {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s;
}
.copy svg { width: 15px; height: 15px; }
.copy:hover, .copy:focus-visible { color: var(--gold); border-color: var(--gold-dim); background: rgba(232, 192, 101, 0.08); outline: none; }
.copy:active { transform: scale(0.88); }
.copy.done { color: var(--green); border-color: rgba(30, 255, 0, 0.4); }

.ico { width: 30px; height: 30px; vertical-align: middle; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7)); transition: transform 0.2s; }
[data-tip]:hover .ico { transform: scale(1.12) rotate(-4deg); }
.ico-g { width: 20px; height: 20px; vertical-align: middle; }
.ico-g.male { color: #6fb3ff; }
.ico-g.female { color: #ff8fc8; }
.cell-icon { display: inline-flex; align-items: center; gap: 8px; cursor: help; }
.cell-icon .lbl { color: var(--text); font-size: 14px; }

.lvl {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 26px;
  padding: 0 6px;
  border-radius: 13px;
  border: 1px solid var(--gold-dim);
  background: radial-gradient(circle at 50% 30%, #3a2a14, #140d06);
  color: var(--yellow);
  font: 700 14px 'Cinzel', serif;
}
.lvl.max { border-color: var(--gold); box-shadow: 0 0 10px rgba(232, 192, 101, 0.4); }

.profs { display: flex; flex-wrap: wrap; gap: 5px; white-space: normal; min-width: 230px; }
.prof {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 8px 4px;
  border: 1px solid rgba(184, 145, 63, 0.3);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 13px;
  cursor: help;
  overflow: hidden;
}
.prof b { color: var(--yellow); font-variant-numeric: tabular-nums; }
.prof.secondary { opacity: 0.72; }
.prof::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: var(--pct, 0%);
  background: linear-gradient(90deg, #6b4a17, var(--gold));
}
.prof.hit { border-color: var(--gold); background: rgba(232, 192, 101, 0.14); box-shadow: 0 0 8px rgba(232, 192, 101, 0.3); }

.gs { font: 700 15px 'Cinzel', serif; cursor: help; }
.q0 { color: var(--grey); } .q1 { color: #fff; } .q2 { color: var(--green); } .q3 { color: var(--blue); } .q4 { color: var(--purple); } .q5 { color: var(--orange); }

.login { cursor: help; color: var(--text); font-size: 14px; }
.login .dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #4a4033; vertical-align: 1px; }
.login.fresh .dot { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.8s ease-in-out infinite; }
.login.recent .dot { background: #e8c065; }
.login.old { color: var(--muted); }
@keyframes pulse { 50% { opacity: 0.4; } }

.rank { font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700; color: var(--gold-2); }
.rank.r0 { color: var(--orange); text-shadow: 0 0 8px rgba(255, 128, 0, 0.45); }
.rank.r1 { color: var(--purple); }

.meter { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; cursor: help; min-width: 70px; }
.meter b { font: 700 14px 'Cinzel', serif; color: var(--text); }
.meter b small { color: var(--muted); font-weight: 500; }
.bar { width: 70px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.55); box-shadow: inset 0 0 0 1px rgba(184, 145, 63, 0.25); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--pct, 0%); background: linear-gradient(90deg, #6b3fa0, #b77cff); transition: width 0.6s ease-out; }
.bar.dj i { background: linear-gradient(90deg, #1d6b2e, #3fe06a); }
.muted { color: var(--muted); }

.loading, .empty { padding: 40px 10px !important; text-align: center; color: var(--muted); font-family: 'Cinzel', serif; }
.empty .nemoji { display: block; font-size: 34px; margin-bottom: 6px; }
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: -3px;
  border: 2px solid var(--gold-dim);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---------- tooltip ---------- */
.tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  max-width: 300px;
  padding: 10px 12px;
  border: 1px solid #8a8aa0;
  border-radius: 5px;
  background: var(--tip-bg);
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s, transform 0.12s;
}
.tip.show { opacity: 1; transform: none; }
.tip .t-title { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.tip .t-sub { color: var(--yellow); font-size: 13px; }
.tip .t-line { color: #fff; }
.tip .t-grey { color: var(--grey); font-size: 13px; }
.tip .t-flavor { color: var(--yellow); font-style: italic; margin-top: 6px; }
.tip ul { list-style: none; margin: 6px 0 0; padding: 0; columns: 1; }
.tip li { padding: 1px 0; font-size: 13px; }
.tip li.ok { color: var(--green); }
.tip li.no { color: #7d7d7d; }
.tip li::before { display: inline-block; width: 16px; }
.tip li.ok::before { content: '✓'; }
.tip li.no::before { content: '·'; text-align: center; }
.tip .t-bar { height: 6px; margin-top: 6px; border-radius: 3px; background: #222433; overflow: hidden; }
.tip .t-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6b4a17, var(--gold)); }
.tip.wide ul { columns: 2; column-gap: 16px; }
.tip.wide { max-width: 440px; }
.tip .t-cat { margin-top: 7px; color: var(--yellow); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.tip .t-cat span { color: var(--grey); }
.tip .t-cat + ul { margin-top: 2px; }
.tip .t-note { margin-top: 8px; font-size: 11.5px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 60;
  padding: 10px 18px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: linear-gradient(180deg, #2b1f10, #160f07);
  color: var(--gold);
  font: 700 14px 'Cinzel', serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(232, 192, 101, 0.3);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s, transform 0.25s cubic-bezier(.3, 1.5, .5, 1);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 16px 28px;
  color: var(--muted);
  font-size: 13px;
}
.foot .disclaimer { font-size: 11.5px; opacity: 0.7; }

@media (max-width: 640px) {
  .hero { padding-top: 22px; }
  .crest { width: 104px; height: 104px; }
  .crest img { width: 82px; height: 82px; }
  .frame { padding: 12px; width: calc(100% - 16px); }
  .search { flex-direction: column; }
  select { width: 100%; }
  .stat { min-width: 0; flex: 1 1 40%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------- sidebar layout: the grid gets the full height ---------- */
body { overflow: hidden; }
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  height: 100vh;
  height: 100dvh;
  padding: 12px;
}
.side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 4px 4px 2px;
  scrollbar-width: thin;
}
.side .hero { padding: 6px 0 0; }
.side .crest { width: 112px; height: 112px; }
.side .crest img { width: 88px; height: 88px; }
.side .title { font-size: 46px; }
.side .tagline { margin: 8px 0 0; }
.side .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side .stat { min-width: 0; padding: 7px 10px; text-align: center; }
.side .stat b { font-size: 20px; }
.side .stat span { font-size: 10.5px; }
.side .filters { display: flex; flex-direction: column; gap: 9px; margin: 0; }
.side select { width: 100%; height: 42px; }
.side .search-box { flex: none; height: 44px; }
.hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.hint code, .hint kbd {
  padding: 0 5px; border-radius: 3px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35);
  color: var(--gold-2); font: 12px ui-monospace, monospace;
}
.side .chips { gap: 5px; }
.side .foot { margin-top: auto; padding: 8px 0 0; text-align: left; }

.layout .frame {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: auto;
  margin: 6px 6px 6px 0;
  padding: 12px;
}
.layout .banner { flex: none; }
.layout .table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-color: var(--gold-dim) rgba(0, 0, 0, 0.3);
  scrollbar-width: thin;
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .layout { display: block; height: auto; padding: 8px; }
  .side { overflow: visible; }
  .side .hero { display: flex; align-items: center; gap: 12px; text-align: left; }
  .side .crest { width: 72px; height: 72px; margin: 0; flex: none; }
  .side .crest img { width: 56px; height: 56px; }
  .side .title { font-size: 34px; }
  .side .stats { grid-template-columns: repeat(4, 1fr); }
  .side .foot { display: none; }
  .layout .frame { margin: 12px 4px 4px; height: 82vh; height: 82dvh; }
}
