:root {
  --bg: #0a0e1a;
  --panel: #121a2c;
  --panel-2: #172138;
  --line: #24304a;
  --text: #e8eefc;
  --muted: #8b9ab8;
  --accent: #34d3c4;
  --accent-2: #7c8cff;
  --warn: #f5b455;
  --danger: #f06b6b;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }

.app { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 268px;
  flex: 0 0 268px;
  background: #0d1424;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 20px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06121f; font-weight: 800; font-size: 15px;
  display: grid; place-items: center;
}
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }

.new-btn {
  border: 1px dashed #35506b;
  background: #121d31;
  color: var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
  transition: .15s;
}
.new-btn:hover { border-color: var(--accent); background: #16243d; }
.new-btn .plus { display: inline-block; width: 18px; font-size: 16px; }

.side-label {
  color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: 1.2px; margin: 24px 6px 10px;
  display: flex; justify-content: space-between;
}
.side-label span { color: var(--accent); }

.exp-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.exp-item {
  border: 1px solid transparent;
  background: var(--panel);
  border-radius: 10px;
  padding: 10px 11px;
  cursor: pointer;
  transition: .15s;
  position: relative;
}
.exp-item:hover { background: var(--panel-2); }
.exp-item.active { border-color: var(--accent); background: #16303c; }
.exp-name { font-size: 13px; font-weight: 600; padding-right: 52px; word-break: break-word; }
.exp-info { color: var(--muted); font-size: 11px; margin-top: 4px; }
.exp-actions { position: absolute; right: 7px; top: 8px; display: flex; gap: 2px; }
.exp-actions button {
  background: transparent; border: none; color: var(--muted);
  font-size: 13px; padding: 3px 5px; border-radius: 5px; line-height: 1;
}
.exp-actions button:hover { background: #24324e; color: var(--text); }
.exp-actions button.del:hover { color: var(--danger); }
.exp-rename-input {
  width: calc(100% - 4px); background: #0b1220; border: 1px solid var(--accent);
  color: var(--text); border-radius: 6px; padding: 5px 7px; font-size: 13px;
}
.side-empty { color: var(--muted); font-size: 12px; padding: 10px 6px; line-height: 1.6; }
.side-footer {
  color: var(--muted); font-size: 11px; display: flex; align-items: center;
  gap: 7px; padding: 14px 6px 0; border-top: 1px solid var(--line); margin-top: 12px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; padding: 28px 34px 50px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.eyebrow { color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
h1 { font-size: 25px; margin: 0 0 8px; font-weight: 700; }
.meta { color: var(--muted); font-size: 12px; display: flex; gap: 16px; flex-wrap: wrap; }
.icon-btn {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  width: 34px; height: 34px; border-radius: 9px; font-size: 18px; line-height: 1;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 5px 12px; font-size: 11px; color: var(--muted);
}
.chip b { color: var(--text); font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1200px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .sidebar { width: 100%; flex-basis: auto; height: auto; position: static; }
  .app { flex-direction: column; }
  .main { padding: 20px 16px 40px; }
  .cards { grid-template-columns: 1fr; }
}

.card {
  background: linear-gradient(160deg, var(--panel) 0%, #101728 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: #35506b; transform: translateY(-2px); }
.card-head { padding: 16px 18px 12px; display: flex; justify-content: space-between; align-items: flex-start; }
.game-name { font-size: 15px; font-weight: 700; }
.game-slug { color: var(--muted); font-size: 11px; margin-top: 3px; }
.score { text-align: right; }
.score-value { font-size: 26px; font-weight: 800; color: var(--accent); line-height: 1; }
.score-label { color: var(--muted); font-size: 10px; margin-top: 5px; text-transform: uppercase; letter-spacing: 1px; }

.seed-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 14px; }
.seed-chip {
  background: #0e1727; border: 1px solid var(--line); border-radius: 7px;
  padding: 4px 8px; font-size: 11px; color: var(--muted);
}
.seed-chip b { color: var(--text); }

.video-wrap { background: #060a13; flex: 1; min-height: 150px; position: relative; }
.video-wrap video { width: 100%; height: 100%; max-height: 260px; display: block; background: #000; }
.video-missing {
  height: 100%; min-height: 150px; display: flex; align-items: center; justify-content: center;
  color: #455571; font-size: 12px; gap: 8px;
}
.video-badge {
  position: absolute; top: 8px; left: 8px; background: rgba(6,10,19,.78);
  border: 1px solid #2a3955; border-radius: 5px; padding: 2px 7px;
  font-size: 10px; color: var(--muted);
}
.card-foot { padding: 10px 18px 14px; color: var(--muted); font-size: 11px; border-top: 1px solid #1c273e; }
.card-foot span + span::before { content: "·"; margin: 0 7px; color: #41506c; }

/* ---------- empty / toast / modal ---------- */
.empty { text-align: center; padding: 100px 20px; color: var(--muted); }
.empty-icon {
  width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 18px;
  background: var(--panel); border: 1px solid var(--line); color: var(--accent);
  display: grid; place-items: center; font-size: 20px;
}
.empty h2 { color: var(--text); margin: 0 0 8px; font-size: 18px; }
.empty p { margin: 0 0 18px; }
.ghost-btn {
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  border-radius: 8px; padding: 8px 16px; font-size: 13px;
}
.ghost-btn:hover { background: #16303c; }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: #1b2a42;
  border: 1px solid var(--accent); color: var(--text); padding: 11px 18px;
  border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none;
  transform: translateY(10px); transition: .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: var(--danger); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3,6,12,.75);
  display: grid; place-items: center; z-index: 60; padding: 20px;
}
.modal {
  width: min(720px, 100%); max-height: 86vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 20px 70px rgba(0,0,0,.6);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px 22px 26px; line-height: 1.7; color: var(--muted); }
.modal-body p { margin: 0 0 14px; }
.code-block {
  background: #0a1020; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 13px; margin-bottom: 12px; overflow-x: auto;
}
.code-label { color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
code, pre { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: #cfe3ff; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.hint { font-size: 12px; }
.hint code { color: var(--warn); }
