/* CHICKEN RUST SERVER
   Black / graphite ground, red accent, glass panels over a slow ember-lit background.
   Motion is transform/opacity only and switches off under prefers-reduced-motion. */

:root {
  --bg: #09090b;
  --panel: rgba(22, 22, 26, 0.66);
  --panel-solid: #16161a;
  --raise: rgba(255, 255, 255, 0.05);
  --field: rgba(0, 0, 0, 0.38);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f3f3f4;
  --muted: #a3a6ad;
  --accent: #e03a3a;
  --accent-deep: #a5262a;
  --accent-soft: rgba(224, 58, 58, 0.14);
  --accent-glow: rgba(224, 58, 58, 0.4);
  --ok: #4fc47f;
  --warn: #e2a63d;
  --bad: #ef5a5a;
  --display: Bahnschrift, "DIN Alternate", "Roboto Condensed", "Arial Narrow", sans-serif;
  --body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* derive the glow shades from --accent so a custom accent colour from the admin settings carries through */
@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --accent-deep: color-mix(in srgb, var(--accent) 72%, #000);
    --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
    --accent-glow: color-mix(in srgb, var(--accent) 42%, transparent);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font: 15.5px/1.6 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; transition: color 0.16s var(--ease); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }
h1, h2, h3 { font-family: var(--display); font-stretch: 88%; font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: 0.015em; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h2 { font-size: 1.32rem; }
h3 { font-size: 1.06rem; }
p { margin: 0 0 1em; max-width: 72ch; }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.92em; }
.muted { color: var(--muted); }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--accent); color: #fff; padding: 6px 10px; z-index: 50; border-radius: 6px; }

/* ---------- animated background (fixed, behind everything) ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background:
  radial-gradient(1200px 600px at 50% -10%, rgba(255, 255, 255, 0.045), transparent 60%), var(--bg); }
.bg::after { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); }
.bg-glow { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; opacity: 0.55; will-change: transform;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 62%); }
.bg-glow-a { left: -22vmax; top: -26vmax; animation: drift-a 46s ease-in-out infinite alternate; }
.bg-glow-b { right: -26vmax; top: 18vh; opacity: 0.32; animation: drift-b 58s ease-in-out infinite alternate; }
.bg-glow-c { left: 20vw; bottom: -42vmax; opacity: 0.22; animation: drift-a 70s ease-in-out infinite alternate-reverse; }
.embers i { position: absolute; bottom: -12px; width: 3px; height: 3px; border-radius: 50%; background: #ff8d6b;
  box-shadow: 0 0 8px 2px var(--accent-glow); opacity: 0; animation: ember 18s linear infinite; will-change: transform, opacity; }
.embers i:nth-child(1) { left: 6%; animation-duration: 19s; animation-delay: -3s; }
.embers i:nth-child(2) { left: 17%; animation-duration: 24s; animation-delay: -11s; }
.embers i:nth-child(3) { left: 29%; animation-duration: 17s; animation-delay: -7s; }
.embers i:nth-child(4) { left: 41%; animation-duration: 26s; animation-delay: -18s; }
.embers i:nth-child(5) { left: 54%; animation-duration: 21s; animation-delay: -5s; }
.embers i:nth-child(6) { left: 66%; animation-duration: 23s; animation-delay: -14s; }
.embers i:nth-child(7) { left: 78%; animation-duration: 18s; animation-delay: -9s; }
.embers i:nth-child(8) { left: 91%; animation-duration: 27s; animation-delay: -21s; }
@keyframes drift-a { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(7vw, 5vh, 0) scale(1.12); } }
@keyframes drift-b { from { transform: translate3d(0, 0, 0) scale(1.05); } to { transform: translate3d(-8vw, -6vh, 0) scale(0.94); } }
@keyframes ember {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  12% { opacity: 0.7; }
  80% { opacity: 0.35; }
  100% { transform: translate3d(36px, -105vh, 0); opacity: 0; }
}

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.main { flex: 1; padding-top: 34px; padding-bottom: 72px; }
.stack > * + * { margin-top: 28px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.split-wide { grid-template-columns: 2fr 1fr; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(9, 9, 11, 0.62); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.top.is-scrolled { background: rgba(9, 9, 11, 0.86); box-shadow: 0 10px 30px -18px #000; }
.top-in { display: flex; align-items: center; gap: 26px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 700 1.08rem/1 var(--display); font-stretch: 88%; letter-spacing: 0.06em; white-space: nowrap; }
.brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; filter: drop-shadow(0 0 10px var(--accent-glow)); transition: transform 0.3s var(--ease); }
.brand:hover { color: var(--text); }
.brand:hover img { transform: scale(1.06) rotate(-2deg); }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav > a { position: relative; padding: 9px 12px; text-decoration: none; color: var(--muted); border-radius: 8px; font-weight: 500; }
.nav > a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.28s var(--ease); box-shadow: 0 0 10px var(--accent-glow); }
.nav > a:hover { color: var(--text); }
.nav > a:hover::after, .nav > a[aria-current="page"]::after { transform: scaleX(1); }
.nav > a[aria-current="page"] { color: var(--text); }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-end > a:not(.btn) { color: var(--muted); text-decoration: none; }
.nav-end > a:not(.btn):hover { color: var(--text); }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-user img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); }
.nav-toggle { display: none; margin-left: auto; }

.statusbar { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); color: var(--muted); font-size: 0.87rem; }
.statusbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; padding-top: 8px; padding-bottom: 8px; }
.statusbar strong { color: var(--text); font-weight: 600; }
.dot { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 9px; vertical-align: 1px; }
.dot-on { background: var(--ok); box-shadow: 0 0 10px rgba(79, 196, 127, 0.7); }
.dot-on::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--ok); animation: ping 2.6s var(--ease) infinite; }
.dot-off { background: var(--bad); }
@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 70%, 100% { transform: scale(2.8); opacity: 0; } }

footer { border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); color: var(--muted); font-size: 0.87rem; padding: 22px 0; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { width: 26px; height: 26px; object-fit: contain; opacity: 0.85; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 32px 48px; align-items: center; padding: 26px 0 10px; }
.hero-copy { animation: rise 0.7s var(--ease) both; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 700; font-stretch: 82%; letter-spacing: 0.02em; line-height: 1.02; margin-top: 18px;
  text-shadow: 0 0 34px var(--accent-soft); }
.hero-lead { color: var(--muted); font-size: 1.08rem; margin: 16px 0 0; max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-connect { margin-top: 14px; color: var(--muted); font-size: 0.9rem; }
.hero-connect code { color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; margin-right: 8px; }
.hero-logo { position: relative; display: grid; place-items: center; min-height: 300px; animation: rise 0.8s 0.08s var(--ease) both; }
.hero-logo img { position: relative; width: min(100%, 360px); max-height: 360px; object-fit: contain;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 28px var(--accent-glow)); animation: float 7s ease-in-out infinite; }
.hero-halo { position: absolute; width: min(92%, 440px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, var(--accent-soft) 38%, transparent 68%); animation: breathe 6.5s ease-in-out infinite; }
.hero-halo::after { content: ""; position: absolute; inset: 9%; border-radius: 50%; border: 1px solid var(--accent-soft); }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -10px, 0); } }
@keyframes breathe { 0%, 100% { transform: scale(0.96); opacity: 0.8; } 50% { transform: scale(1.05); opacity: 1; } }

.status-pill { display: inline-flex; align-items: center; padding: 6px 14px 6px 12px; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--raise); }
.status-pill.is-on { border-color: rgba(79, 196, 127, 0.45); background: rgba(79, 196, 127, 0.1); color: #b9f0cf; }
.status-pill.is-off { border-color: rgba(239, 90, 90, 0.4); background: rgba(239, 90, 90, 0.08); color: #ffc2c2; }

.live { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 30px; padding: 0; overflow: hidden; }
.live > div { padding: 16px 20px; border-left: 1px solid var(--line); }
.live > div:first-child { border-left: 0; }
.live-label { color: var(--muted); font-size: 0.84rem; }
.live-value { font: 700 1.9rem/1.15 var(--display); font-variant-numeric: tabular-nums; margin-top: 2px; }
.live-value small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.meter { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 10px; }
.meter span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  box-shadow: 0 0 12px var(--accent-glow); transform-origin: left; animation: grow 1.1s 0.3s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- glass surfaces ---------- */
.panel, .live, .figures, .flash {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 40px -28px #000;
}
.panel { padding: 24px; transition: border-color 0.25s var(--ease); }
.panel:hover { border-color: rgba(255, 255, 255, 0.13); }
.panel > h2, .panel > h3 { margin-bottom: 16px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 16px; }
.panel-head > a { font-size: 0.9rem; color: var(--muted); }
.panel-head > a:hover { color: var(--accent); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 14px 24px; margin-bottom: 24px; }
.page-head h1 { position: relative; padding-left: 16px; }
.page-head h1::before { content: ""; position: absolute; left: 0; top: 0.12em; bottom: 0.12em; width: 4px; border-radius: 3px;
  background: var(--accent); box-shadow: 0 0 14px var(--accent-glow); }
.page-head p { margin: 8px 0 0; color: var(--muted); }

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); overflow: hidden; margin: 0; padding: 0; }
.figures > div { background: rgba(18, 18, 22, 0.86); padding: 18px 20px; transition: background 0.2s var(--ease); }
.figures > div:hover { background: rgba(30, 30, 36, 0.9); }
.figures dt { color: var(--muted); font-size: 0.85rem; }
.figures dd { margin: 4px 0 0; font: 700 1.65rem/1.2 var(--display); font-variant-numeric: tabular-nums; }

.connect { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.connect code { background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }

/* scroll reveal: classes are added by app.js only to elements that start below the fold */
.reveal { opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 0.84rem; white-space: nowrap; }
tbody tr { transition: background 0.15s var(--ease); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
td.num, th.num { text-align: right; }
.rank { color: var(--muted); width: 2.6rem; }
.rank-top { color: var(--accent); text-shadow: 0 0 12px var(--accent-glow); font-weight: 700; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who img { width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--raise); border: 1px solid var(--line); }
.who a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; font-weight: 500; }
.empty { color: var(--muted); padding: 12px 0; margin: 0; }

/* ---------- forms and buttons ---------- */
label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 5px; }
input[type="text"], input[type="search"], input[type="number"], input[type="password"], input[type="url"],
input[type="datetime-local"], input[type="file"], select, textarea {
  width: 100%; background: var(--field); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; font: inherit; transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
select option { background: var(--panel-solid); color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[disabled] { opacity: 0.6; }
textarea { min-height: 96px; resize: vertical; }
.field { margin-bottom: 16px; }
.field small { display: block; color: var(--muted); margin-top: 5px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 18px; }
.check { display: flex; align-items: flex-start; gap: 9px; color: var(--text); margin-bottom: 10px; }
.check input { margin-top: 5px; accent-color: var(--accent); }
.inline { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.inline .field { margin-bottom: 0; flex: 1 1 170px; }
form.plain { display: inline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--raise); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 16px; font: 600 0.93rem/1.2 var(--body);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); color: var(--text); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); border-color: transparent; color: #fff;
  box-shadow: 0 8px 22px -10px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.btn-primary:hover { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); border-color: transparent; color: #fff;
  box-shadow: 0 12px 30px -8px var(--accent-glow), 0 0 0 1px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28); filter: brightness(1.08); }
.btn-danger { color: #ff9a9a; border-color: rgba(239, 90, 90, 0.35); }
.btn-danger:hover { background: rgba(239, 90, 90, 0.14); border-color: rgba(239, 90, 90, 0.6); color: #ffd0d0; }
.btn-small { padding: 6px 11px; font-size: 0.85rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 12px; }
.btn[disabled], .btn.is-busy { opacity: 0.55; cursor: default; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.login-buttons { display: grid; gap: 12px; max-width: 340px; margin-top: 18px; }
.login-buttons .btn { padding: 13px 16px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tabs a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.02); transition: all 0.18s var(--ease); }
.tabs a:hover { color: var(--text); border-color: var(--line-strong); }
.tabs a[aria-current="true"] { color: #fff; border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 16px -6px var(--accent-glow); }

.flash { border-left: 3px solid var(--muted); padding: 12px 16px; margin-bottom: 18px; animation: rise 0.4s var(--ease) both; }
.flash-success { border-left-color: var(--ok); }
.flash-error { border-left-color: var(--bad); }
.flash-info { border-left-color: var(--accent); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.79rem; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge-completed, .badge-active, .badge-online { color: var(--ok); border-color: rgba(79, 196, 127, 0.5); background: rgba(79, 196, 127, 0.09); }
.badge-failed, .badge-rejected, .badge-banned { color: var(--bad); border-color: rgba(239, 90, 90, 0.5); background: rgba(239, 90, 90, 0.09); }
.badge-pending, .badge-processing { color: var(--warn); border-color: rgba(226, 166, 61, 0.5); background: rgba(226, 166, 61, 0.09); }
.badge-vip { color: #ffd27a; border-color: rgba(255, 210, 122, 0.5); background: rgba(255, 210, 122, 0.08); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; font-size: 0.9rem; color: var(--muted); }
.pager-off { opacity: 0.4; }

/* ---------- wipe timeline ---------- */
.strip-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; }
.strip-day { font: 700 clamp(2rem, 5.6vw, 3.2rem)/1 var(--display); font-stretch: 82%; }
.strip { position: relative; height: 48px; margin-top: 16px; }
.strip-track { position: absolute; left: 0; right: 0; top: 10px; height: 8px; background: rgba(255, 255, 255, 0.07); border-radius: 4px; overflow: hidden; }
.strip-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); box-shadow: 0 0 16px var(--accent-glow);
  transform-origin: left; animation: grow 1.1s 0.2s var(--ease) both; }
.strip-now { position: absolute; top: 3px; width: 3px; height: 22px; border-radius: 2px; background: #fff; transform: translateX(-1px); box-shadow: 0 0 12px rgba(255, 255, 255, 0.7); }
.strip-mark { position: absolute; top: 6px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 13px; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.strip-mark::before { content: ""; width: 1px; height: 16px; background: var(--muted); }
.strip-mark.is-open { color: var(--text); }
.strip-mark.is-open::before { background: var(--text); }
.strip-ends { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 0.87rem; }

/* ---------- bar chart ---------- */
.chart { display: flex; align-items: stretch; gap: 5px; height: 180px; }
.chart-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chart-track { flex: 1; display: flex; align-items: flex-end; background: rgba(255, 255, 255, 0.035); border-radius: 4px; }
.chart-bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 0; background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  transform-origin: bottom; animation: bar 0.8s var(--ease) both; transition: filter 0.15s var(--ease); }
.chart-col:hover .chart-bar { filter: brightness(1.25); }
.chart-label { font-size: 0.7rem; color: var(--muted); text-align: center; margin-top: 6px; white-space: nowrap; overflow: hidden; }
@keyframes bar { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ---------- player profile ---------- */
.profile-head { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.profile-head img { width: 92px; height: 92px; border-radius: 16px; background: var(--raise); border: 1px solid var(--line-strong); box-shadow: 0 0 28px -8px var(--accent-glow); }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 0.9rem; margin-top: 8px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.94rem; }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--muted); white-space: nowrap; font-size: 0.85rem; }

/* ---------- shop ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.product { position: relative; background: rgba(20, 20, 24, 0.82); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column;
  text-decoration: none; overflow: hidden; transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.product:hover { color: var(--text); transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 18px 40px -22px var(--accent-glow), 0 0 0 1px var(--accent-soft); }
.product-img { aspect-ratio: 4 / 3; background: rgba(0, 0, 0, 0.4); width: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.product:hover .product-img { transform: scale(1.04); }
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; position: relative; background: inherit; }
.product-price { font: 700 1.2rem var(--display); font-variant-numeric: tabular-nums; margin-top: auto; color: #fff; }
.product-lock { color: var(--warn); font-size: 0.85rem; }
.product.is-locked .product-img { opacity: 0.4; filter: grayscale(0.6); }
.contents { list-style: none; margin: 0; padding: 0; }
.contents li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.contents li:last-child { border-bottom: 0; }
.reasons { margin: 0 0 14px; padding-left: 18px; color: var(--muted); }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 210px 1fr; gap: 30px; align-items: start; }
.admin-nav { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { padding: 8px 12px; border-radius: 9px; text-decoration: none; color: var(--muted); font-size: 0.93rem; transition: all 0.16s var(--ease); }
.admin-nav a:hover { background: var(--raise); color: var(--text); }
.admin-nav a[aria-current="page"] { background: var(--accent-soft); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.admin-main { min-width: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 20px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.secret { background: var(--field); border: 1px dashed var(--accent); border-radius: var(--radius-sm); padding: 12px 14px; font: 0.9rem Consolas, "Cascadia Mono", monospace; word-break: break-all; }
.console { background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0;
  font: 0.87rem/1.5 Consolas, "Cascadia Mono", monospace; white-space: pre-wrap; word-break: break-word; max-height: 480px; overflow: auto; }
.item-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
details > summary { cursor: pointer; color: var(--muted); }
details[open] > summary { margin-bottom: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 8px; }
  .hero-logo { order: -1; min-height: 0; }
  .hero-logo img { width: min(60%, 240px); }
  .hero-halo { width: min(70%, 300px); }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .live { text-align: left; }
}
@media (max-width: 860px) {
  .split, .split-wide, .admin { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .top-in { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; min-height: 0; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-top: 6px; }
  .nav.is-open { display: flex; animation: rise 0.25s var(--ease) both; }
  .nav > a::after { display: none; }
  .nav > a[aria-current="page"] { background: var(--accent-soft); }
  .nav-end { margin-left: 0; padding-top: 10px; flex-wrap: wrap; }
  .strip-mark span { display: none; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .panel { padding: 18px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .live { grid-template-columns: 1fr; }
  .live > div { border-left: 0; border-top: 1px solid var(--line); }
  .live > div:first-child { border-top: 0; }
  .hero-actions .btn { flex: 1 1 100%; }
  .embers { display: none; }
  .bg-glow-c { display: none; }
}

/* no motion for people who ask for none */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .embers { display: none; }
}

/* ---------- language switch and non-Latin scripts ---------- */
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: rgba(255, 255, 255, 0.03); }
.lang a { padding: 3px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; text-decoration: none; color: var(--muted); letter-spacing: 0.04em; }
.lang a:hover { color: var(--text); }
.lang a[aria-current="true"] { background: var(--accent-soft); color: #fff; box-shadow: inset 0 0 0 1px var(--accent); }
:root { --display: Bahnschrift, "DIN Alternate", "Roboto Condensed", "Leelawadee UI", "Noto Sans Thai", Tahoma, "Arial Narrow", sans-serif;
  --body: "Segoe UI Variable Text", "Segoe UI", "Leelawadee UI", "Noto Sans Thai", Tahoma, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
/* Thai stacks vowels and tone marks above the line: give headings room and drop the tracking */
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] h3, html[lang="th"] .strip-day, html[lang="th"] .live-value { line-height: 1.4; letter-spacing: 0; }
html[lang="th"] .hero h1 { line-height: 1.25; }
html[lang="th"] body { line-height: 1.75; }
