/* Game Builder — dark dashboard with an arcade touch. */

@font-face {
  font-family: 'Press Start 2P';
  src: url('/static/fonts/press-start-2p.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('/static/fonts/chakra-petch-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('/static/fonts/chakra-petch-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('/static/fonts/chakra-petch-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #141421;
  --bg-2: #1a1a2b;
  --panel: #232437;
  --panel-2: #2a2b42;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #e9e9f2;
  --muted: #9192ab;

  --blue: #1d8cf8;
  --purple: #a259ff;
  --pink: #fd5d93;
  --teal: #00f2c3;
  --green: #2bdd8a;
  --orange: #ff8d52;
  --yellow: #ffd166;
  --red: #ff4d6d;

  --radius: 14px;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --display: 'Chakra Petch', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.55 var(--body);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(162, 89, 255, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(29, 140, 248, 0.12), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 32px 100%,
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: #5fb0ff; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: 0.01em; }
h2 { font-size: 1.2rem; margin: 0; }
h4 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); margin: 1rem 0 0.3rem;
}
code {
  font-size: 0.82em; background: rgba(255, 255, 255, 0.06); padding: 0.1em 0.4em; border-radius: 5px;
}
.pixel { font-family: var(--pixel); font-weight: 400; letter-spacing: 0.02em; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.nowrap { white-space: nowrap; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- shell ---------- */

.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 232px; flex: none;
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.4rem 1rem;
  background: linear-gradient(175deg, #a259ff 0%, #6a5cff 45%, #1d8cf8 100%);
  box-shadow: 4px 0 30px rgba(98, 80, 255, 0.25);
}
.logo {
  display: flex; align-items: center; gap: 0.7rem; color: #fff;
  padding: 0 0.4rem 1.2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.logo:hover { color: #fff; }
.logo-text { font-family: var(--pixel); font-size: 0.72rem; line-height: 1.6; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25); }
.logo-mark {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  font-size: 0.9rem; color: #6a5cff; background: #fff; border-radius: 10px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);
}
.logo-mark.big { width: 56px; height: 56px; font-size: 1.4rem; border-radius: 14px; }
.side-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.side-nav a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.8rem; border-radius: 10px;
  color: rgba(255, 255, 255, 0.82); font-family: var(--display); font-weight: 600; font-size: 0.95rem;
  transition: background 0.15s, transform 0.15s;
}
.side-nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; transform: translateX(2px); }
.side-nav a.active { background: rgba(255, 255, 255, 0.95); color: #4b45d6; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18); }
.side-foot {
  margin-top: auto; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem; border-radius: 12px; background: rgba(0, 0, 0, 0.18); color: #fff;
}
.side-user { flex: 1; font-family: var(--display); font-weight: 600; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-user small { display: block; font-weight: 500; opacity: 0.7; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }
.side-foot form { margin: 0; }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer;
  border: none; border-radius: 9px; background: rgba(255, 255, 255, 0.14); color: #fff;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.26); }

.content { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.2rem 2rem; border-bottom: 1px solid var(--line);
  background: rgba(20, 20, 33, 0.7); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.page-title { margin: 0; font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.08em; }
.cutoff-pill {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.85rem; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line-2);
}
.cutoff-pill .icon { color: var(--pink); width: 16px; height: 16px; }
.cutoff-pill .countdown { font-family: var(--pixel); font-size: 0.7rem; color: var(--text); }
main { padding: 1.8rem 2rem 4rem; max-width: 1180px; }
main.bare { max-width: none; padding: 0; }

.countdown.urgent { color: var(--red) !important; animation: blink 1s steps(2, start) infinite; }
.countdown.closed { color: var(--muted) !important; }
@keyframes blink { to { opacity: 0.35; } }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  font: 600 0.92rem var(--display); letter-spacing: 0.03em; cursor: pointer;
  padding: 0.55rem 1.1rem; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text);
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { background: #33354f; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn .icon { width: 16px; height: 16px; }
.btn.primary {
  border: none; color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  box-shadow: 0 4px 18px rgba(106, 92, 255, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}
.btn.primary:hover { box-shadow: 0 6px 24px rgba(106, 92, 255, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.2); color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn.big { padding: 0.8rem 1.4rem; font-size: 1rem; }
.btn.small { padding: 0.25rem 0.7rem; font-size: 0.8rem; }
.btn.commit {
  width: 100%; padding: 1rem; border: none; border-radius: 12px; color: #10241b;
  font-family: var(--pixel); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  background: linear-gradient(135deg, var(--teal), var(--green));
  box-shadow: 0 6px 24px rgba(0, 242, 195, 0.3), inset 0 -4px 0 rgba(0, 0, 0, 0.22);
}
.btn.commit:hover { box-shadow: 0 8px 30px rgba(0, 242, 195, 0.5), inset 0 -4px 0 rgba(0, 0, 0, 0.22); color: #10241b; background: linear-gradient(135deg, #3cffd5, #4bf0a0); }

input, textarea {
  font: inherit; width: 100%; padding: 0.6rem 0.75rem; margin-top: 0.35rem;
  color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 10px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(162, 89, 255, 0.22); }
textarea { resize: vertical; }
label, .label { display: block; font-family: var(--display); font-weight: 600; font-size: 0.92rem; }
.req { color: var(--muted); font-family: var(--body); font-size: 0.75rem; font-weight: 400; margin-left: 0.3rem; }
.stack > * + * { margin-top: 1rem; }
.alert {
  padding: 0.7rem 1rem; border-radius: 10px; margin: 0 0 1.2rem;
  background: rgba(29, 140, 248, 0.12); border: 1px solid rgba(29, 140, 248, 0.35);
}
.alert.bad { background: rgba(255, 77, 109, 0.1); border-color: rgba(255, 77, 109, 0.4); color: #ffb3c0; }

/* ---------- panels and tiles ---------- */

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--glow); margin-bottom: 1.5rem;
}
.panel-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.center-panel { text-align: center; padding: 3rem 1.5rem; }
.big-code {
  font-family: var(--pixel); font-size: 2.6rem; margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--purple), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 1.2rem; margin: 0.6rem 0 1.6rem; }
.tile {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 1rem; align-items: center;
  padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--glow);
  container-type: inline-size;
}
.tile-body { min-width: 0; }
.tile-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; color: #fff;
  box-shadow: 0 6px 18px var(--shadow, rgba(0, 0, 0, 0.3)), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}
.tile-icon .icon { width: 24px; height: 24px; }
.t-blue { background: linear-gradient(135deg, #3aa0ff, #1d6cf8); --shadow: rgba(29, 140, 248, 0.45); }
.t-pink { background: linear-gradient(135deg, #ff7aa8, #e8337a); --shadow: rgba(253, 93, 147, 0.45); }
.t-green { background: linear-gradient(135deg, #3ff0a0, #10b26b); --shadow: rgba(43, 221, 138, 0.4); }
.t-orange { background: linear-gradient(135deg, #ffb156, #ff6a3d); --shadow: rgba(255, 141, 82, 0.45); }
.t-purple { background: linear-gradient(135deg, #c084ff, #7b4bff); --shadow: rgba(162, 89, 255, 0.45); }
.t-teal { background: linear-gradient(135deg, #3fffd8, #00b894); --shadow: rgba(0, 242, 195, 0.4); }
.t-red { background: linear-gradient(135deg, #ff7a8e, #e0244a); --shadow: rgba(255, 77, 109, 0.45); }
.tile-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; text-align: right; }
.tile-value { font-size: 1.15rem; text-align: right; margin-top: 0.3rem; white-space: nowrap; }
/* Scale pixel values with the tile width so "00:00:00" always fits next to the icon
   (space left ≈ tile width − padding − icon − gap ≈ 100cqi − 110px, 8 characters). */
.tile-value .pixel { font-size: 1.05rem; }
.tile-value .countdown { font-size: clamp(0.62rem, calc((100cqi - 110px) / 8.6), 1.05rem); }
.tile-text { font-family: var(--display); font-weight: 700; font-size: 1.25rem; }
.tile-foot {
  grid-column: 1 / -1; margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.8rem; display: flex; align-items: center; min-height: 1.6rem;
}

.hpbar { display: flex; gap: 3px; width: 100%; }
.hpbar i {
  flex: 1; height: 10px; border-radius: 2px; background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.hpbar i.on { background: linear-gradient(180deg, #5cffb0, #10b26b); box-shadow: 0 0 8px rgba(43, 221, 138, 0.6), inset 0 -2px 0 rgba(0, 0, 0, 0.2); }

/* ---------- "your move" banner ---------- */

.move {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  padding: 1.1rem 1.3rem; margin-bottom: 2rem; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(162, 89, 255, 0.22), rgba(29, 140, 248, 0.14));
  border: 1px solid rgba(162, 89, 255, 0.45);
  box-shadow: 0 0 30px rgba(162, 89, 255, 0.15);
}
.move.done { background: linear-gradient(120deg, rgba(0, 242, 195, 0.12), rgba(43, 221, 138, 0.06)); border-color: rgba(0, 242, 195, 0.35); box-shadow: none; }
.move-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: rgba(255, 255, 255, 0.1); color: #fff;
}
.move.done .move-icon, .locked .move-icon { color: var(--teal); }
.move-icon .icon { width: 22px; height: 22px; }
.move-text { flex: 1; min-width: 200px; }
.move-label { font-family: var(--pixel); font-size: 0.62rem; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; margin-bottom: 0.35rem; }
.move-title { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }

.pending { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: -1rem 0 2rem; }

/* ---------- days and cards ---------- */

.day { margin: 0 0 2.6rem; }
.day-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.day-chip {
  font-family: var(--pixel); font-size: 0.78rem; padding: 0.65rem 0.8rem; border-radius: 8px; color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
}
.day-chip.d-empty { background: var(--panel-2); color: var(--muted); }
.day-chip.d-in_progress, .day-chip.d-closed { background: linear-gradient(135deg, var(--pink), var(--purple)); }
.day-meta { flex: 1; min-width: 200px; }
.day-date { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.day-status { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.15rem; }
.day-counts { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.count { font-size: 0.78rem; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); color: var(--muted); }
.count b { color: var(--text); font-family: var(--pixel); font-size: 0.65rem; margin-right: 0.2rem; }
.count.c-built b, .count.c-fixedAfterRetry b { color: var(--green); }
.count.c-failed b { color: var(--red); }
.count.c-skipped b, .count.c-usageLimit b { color: var(--yellow); }

.build-order { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.build-order > .muted { margin-right: 0.3rem; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; }
.order-step {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.2rem 0.7rem 0.2rem 0.25rem;
  border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); font-size: 0.85rem;
}
.order-arrow { color: var(--muted); display: inline-flex; }
.order-arrow .icon { width: 14px; height: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 1.1rem; align-items: start; }
.card {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1rem 1.4rem; box-shadow: var(--glow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 16px 36px rgba(0, 0, 0, 0.45); }
.card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent, var(--muted)); box-shadow: 0 0 12px var(--accent, transparent);
}
.card.s-built, .card.s-fixed_after_retry { --accent: var(--green); }
.card.s-failed { --accent: var(--red); }
.card.s-skipped, .card.s-usage_limit { --accent: var(--yellow); }
.card.s-building { --accent: var(--blue); }
.card.s-building::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.card-head { display: flex; align-items: center; gap: 0.5rem 0.7rem; flex-wrap: wrap; }
.card-who { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.card-who { min-width: 7.5rem; }
.card-who > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player { font-family: var(--display); font-weight: 700; color: var(--text); }
.pos { font-family: var(--pixel); font-size: 0.6rem; color: var(--muted); }
.card-title { margin: 0.8rem 0 0.4rem; font-size: 1.12rem; }
.card blockquote {
  margin: 0.5rem 0; padding: 0.55rem 0.8rem; border-radius: 8px;
  background: var(--bg-2); border-left: 3px solid var(--line-2); color: #cfd0e0; font-style: italic;
}
.summary { margin: 0.7rem 0 0.3rem; }
.callout { margin: 0.55rem 0; padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.9rem; }
.callout strong { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; margin-right: 0.4rem; }
.callout.warn { background: rgba(255, 209, 102, 0.08); border: 1px solid rgba(255, 209, 102, 0.3); }
.callout.warn strong { color: var(--yellow); }
.callout.bad { background: rgba(255, 77, 109, 0.08); border: 1px solid rgba(255, 77, 109, 0.3); }
.callout.bad strong { color: var(--red); }
.card details { margin-top: 0.7rem; border-top: 1px solid var(--line); padding-top: 0.5rem; }
.card details summary { cursor: pointer; color: var(--muted); font-size: 0.82rem; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.card details summary:hover { color: var(--text); }
.empty { font-style: italic; }

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap;
  font: 600 0.72rem var(--display); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.18rem 0.6rem; border-radius: 6px;
  color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, #9192ab) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, #9192ab) 45%, transparent);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 1px; background: currentColor; box-shadow: 0 0 6px currentColor; }
.b-built, .b-fixed_after_retry, .d-finished { --c: var(--green); }
.b-failed { --c: var(--red); }
.b-skipped, .b-usage_limit { --c: var(--yellow); }
.b-building, .d-in_progress { --c: var(--blue); }
.d-closed { --c: var(--pink); }
.d-open { --c: var(--teal); }
.d-empty, .b-waiting { --c: var(--muted); }

.avatar {
  --h: 260;
  display: inline-grid; place-items: center; flex: none; color: #fff;
  font-family: var(--pixel); border-radius: 10px;
  background: linear-gradient(135deg, hsl(var(--h) 85% 62%), hsl(calc(var(--h) + 40) 80% 48%));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 3px 10px hsl(var(--h) 80% 50% / 0.35);
}
.avatar.sm { width: 26px; height: 26px; font-size: 0.6rem; border-radius: 7px; }
.avatar.md { width: 38px; height: 38px; font-size: 0.8rem; }
.avatar.lg { width: 76px; height: 76px; font-size: 1.6rem; border-radius: 18px; }
.avatar.bot { background: linear-gradient(135deg, #3fffd8, #1d8cf8); }
.avatar.bot .icon { width: 60%; height: 60%; }

.pager { display: flex; justify-content: space-between; }

/* ---------- plan page ---------- */

.plan-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 1.4rem; align-items: start; }
.chat-panel { display: flex; flex-direction: column; margin: 0; }
.chat {
  display: flex; flex-direction: column; gap: 0.75rem;
  min-height: 260px; max-height: 58vh; overflow-y: auto; padding: 0.4rem 0.2rem 1rem; margin-bottom: 0.8rem;
}
.hint { color: var(--muted); text-align: center; margin: auto; max-width: 380px; }
.msg { display: flex; gap: 0.6rem; align-items: flex-end; max-width: 88%; }
.msg .text { padding: 0.65rem 0.9rem; border-radius: 14px; }
.msg.user { align-self: flex-end; }
.msg.user .text {
  color: #fff; border-bottom-right-radius: 4px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  box-shadow: 0 4px 14px rgba(106, 92, 255, 0.3);
}
.msg.assistant { align-self: flex-start; }
.msg.assistant .text { background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-left-radius: 4px; }
.chat-form .row { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.6rem; flex-wrap: wrap; }
.spec { margin: 0; position: sticky; top: 90px; }
.spec > * + * { margin-top: 1rem; }
.spec .panel-head { margin-bottom: 0.4rem; }
.clear-version {
  margin-top: 0.35rem; padding: 0.65rem 0.8rem; border-radius: 10px; font-size: 0.92rem;
  background: var(--bg-2); border: 1px dashed rgba(162, 89, 255, 0.45); color: #d6d7e6;
  transition: background 0.4s, box-shadow 0.4s;
}
.clear-version.updated { background: rgba(162, 89, 255, 0.18); box-shadow: 0 0 20px rgba(162, 89, 255, 0.35); }
.locked-head { display: flex; gap: 1rem; align-items: flex-start; }
.locked-head h2 { font-size: 1.5rem; margin: 0.2rem 0; }

/* ---------- profile and status ---------- */

.profile-head { display: flex; align-items: center; gap: 1.3rem; }
.profile-head h2 { font-size: 1.6rem; }
.profile-stats { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: 0.4rem; color: var(--muted); }
.profile-stats b { color: var(--text); font-size: 0.9rem; margin-right: 0.3rem; }

.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.4rem; }
.player-list { list-style: none; margin: 0; padding: 0; }
.player-list li { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.player-list li span:nth-child(2) { flex: 1; font-family: var(--display); font-weight: 600; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1.2rem; margin: 0 0 1.2rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th {
  text-align: left; padding: 0.5rem 0.6rem; color: var(--muted);
  font: 600 0.72rem var(--display); text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 1px solid var(--line-2);
}
td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
td form { margin: 0; }
.events code { white-space: pre-wrap; word-break: break-all; background: none; padding: 0; color: var(--muted); }

/* ---------- login ---------- */

.login {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
  background:
    radial-gradient(600px 400px at 50% 30%, rgba(162, 89, 255, 0.28), transparent 70%),
    radial-gradient(500px 300px at 60% 80%, rgba(29, 140, 248, 0.2), transparent 70%);
}
.login-card {
  width: 100%; max-width: 400px; padding: 2.2rem 2rem; border-radius: 18px;
  background: rgba(35, 36, 55, 0.92); border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(162, 89, 255, 0.15), 0 0 60px rgba(162, 89, 255, 0.15);
}
.login-logo { display: flex; align-items: center; gap: 1rem; font-family: var(--pixel); font-size: 1rem; line-height: 1.6; }
.login-logo .logo-mark { color: #fff; background: linear-gradient(135deg, var(--purple), var(--blue)); }
.login-tag { color: var(--muted); margin: 1rem 0 1.6rem; }
.login .btn { width: 100%; font-family: var(--pixel); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 1rem; }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .plan-grid { grid-template-columns: 1fr; }
  .spec { position: static; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: sticky; top: 0; z-index: 10; height: auto; width: 100%;
    flex-direction: row; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem;
  }
  .logo { border: none; padding: 0; }
  .logo-text { display: none; }
  .side-nav { flex-direction: row; flex: 1; overflow-x: auto; gap: 0.1rem; }
  .side-nav a { padding: 0.5rem 0.6rem; }
  .side-nav a span { display: none; }
  .side-foot { margin: 0; padding: 0.3rem; background: none; }
  .side-user { display: none; }
  .topbar { position: static; padding: 1rem 1.1rem; }
  main { padding: 1.2rem 1.1rem 3rem; }
  .cards { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
  .tile { grid-template-columns: 1fr; padding: 0.9rem; }
  .tile-icon { width: 38px; height: 38px; border-radius: 10px; }
  .tile-icon .icon { width: 19px; height: 19px; }
  .tile-label, .tile-value { text-align: left; }
  .tile-value .pixel { font-size: 0.95rem; }
  .tile-value .countdown { font-size: clamp(0.62rem, calc((100cqi - 32px) / 8.6), 0.95rem); }
  .tile-foot { margin-top: 0.5rem; padding-top: 0.5rem; font-size: 0.74rem; }
}
