:root {
  --bg: #070b14;
  --panel: #0d1422;
  --panel-2: #101a2b;
  --line: #29344a;
  --text: #f6f7fb;
  --muted: #9aa6b8;
  --purple: #8a5cff;
  --purple-soft: #b59cff;
  --blue: #4f8cff;
  --green: #59e38c;
  --gold: #dcb760;
  --shadow: 0 16px 40px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body {
  background:
    radial-gradient(circle at 80% 10%, rgba(79,140,255,.10), transparent 26%),
    radial-gradient(circle at 12% 20%, rgba(138,92,255,.09), transparent 24%),
    var(--bg);
}
button { font: inherit; }

.app-shell { max-width: 1500px; margin: 0 auto; padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 14px; display: grid; place-items: center; background: var(--panel); font-size: 25px; box-shadow: var(--shadow); }
h1, h2, h3, p { margin: 0; }
.brand h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: .02em; }
.brand p { color: var(--purple-soft); margin-top: 3px; }
.top-status { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13,20,34,.88); color: var(--text); }
.fresh-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px rgba(89,227,140,.55); }
.muted { color: var(--muted); }

.layout { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 20px; }
.panel { background: linear-gradient(180deg, rgba(16,26,43,.96), rgba(11,18,31,.96)); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.sidebar { padding: 16px; align-self: start; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.eyebrow { display: block; color: var(--purple-soft); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 5px; }
.section-heading h2 { font-size: 20px; }
.puzzle-list { display: grid; gap: 9px; }
.puzzle-item { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #0a111e; color: var(--text); padding: 11px; display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; text-align: left; cursor: pointer; }
.puzzle-item:hover, .puzzle-item.active { border-color: var(--blue); background: #0d1728; }
.puzzle-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: #18243a; border: 1px solid #31415d; font-weight: 900; }
.puzzle-icon.large { width: 64px; height: 64px; border-radius: 14px; font-size: 30px; background: linear-gradient(145deg, #236f3d, #1d4f32); border-color: #2f8e53; }
.puzzle-name { font-weight: 800; }
.puzzle-meta { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.status { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.status.fresh { color: var(--green); }
.status.soon { color: var(--gold); }
.status.done { color: var(--purple-soft); }

.ghost-btn, .secondary-btn, .primary-btn, .add-btn { border-radius: 10px; padding: 10px 13px; cursor: pointer; }
.ghost-btn { border: 1px solid #4a3f78; color: var(--purple-soft); background: rgba(138,92,255,.08); }
.secondary-btn { border: 1px solid var(--line); background: #0b1321; color: var(--text); }
.primary-btn { border: 1px solid #3f9f68; background: #153b27; color: #eafff1; font-weight: 800; }
.add-btn { width: 100%; margin-top: 10px; border: 1px dashed #43506a; background: transparent; color: var(--muted); }

.content { display: grid; gap: 16px; }
.now-playing { display: grid; grid-template-columns: 1.3fr .8fr; overflow: hidden; }
.now-main { padding: 24px; }
.title-row { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.title-row h2 { font-size: clamp(30px, 4vw, 48px); }
.title-row p { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.reset-card { padding: 24px; border-left: 1px solid var(--line); background: rgba(7,12,21,.44); }
dl { margin: 8px 0 0; }
dl > div { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid rgba(41,52,74,.7); }
dl > div:last-child { border-bottom: 0; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 700; text-align: right; }

.next-up { padding: 17px 20px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 18px; align-items: center; }
.next-up h3 { font-size: 24px; }
.next-status { display: grid; gap: 3px; }
.next-status strong { color: var(--green); }
.lower-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stats-panel { padding: 20px; }
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 16px; }
.stats-row > div { display: grid; gap: 4px; padding-right: 16px; border-right: 1px solid var(--line); }
.stats-row > div:last-child { border-right: 0; padding-right: 0; }
.stats-row strong { font-size: 28px; }
.stats-row span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.knight-panel { min-height: 190px; display: grid; grid-template-columns: 1fr 220px; overflow: hidden; }
.knight-copy { padding: 20px; align-self: center; }
.knight-copy h3 { font-size: 26px; margin-bottom: 8px; }
.knight-copy p { color: var(--muted); line-height: 1.5; }
.knight-panel img { width: 100%; height: 100%; object-fit: cover; object-position: 42% 55%; border-left: 1px solid var(--line); filter: saturate(.88) contrast(1.03); }
.ad-slot { min-height: 90px; border: 1px dashed #303a4f; border-radius: 12px; display: grid; place-items: center; text-align: center; color: #69768d; background: #080d16; padding: 12px; }
.ad-slot span { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.ad-slot strong { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .content { order: 1; }
  .topbar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 760px) {
  .app-shell { padding: 14px; }
  .now-playing { grid-template-columns: 1fr; }
  .reset-card { border-left: 0; border-top: 1px solid var(--line); }
  .next-up { grid-template-columns: 1fr; }
  .lower-grid { grid-template-columns: 1fr; }
  .knight-panel { grid-template-columns: 1fr; }
  .knight-panel img { height: 260px; border-left: 0; border-top: 1px solid var(--line); }
}
