:root {
  color-scheme: light;
  --bg: #eef2f5;
  --panel: #ffffff;
  --text: #121820;
  --muted: #5b6672;
  --line: #d8e0e7;
  --accent: #1b5d7a;
  --accent-dark: #11485f;
  --ok: #237a57;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}
a { color: inherit; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 42px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand { text-decoration: none; font-weight: 800; font-size: 20px; }
.crumb { color: var(--muted); text-decoration: none; font-size: 14px; }
.hero {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(20, 31, 43, .06);
}
.hero h1 { margin: 0 0 8px; font-size: 36px; line-height: 1.12; letter-spacing: 0; }
.hero p { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.42; }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
.section h2 { margin: 0; font-size: 24px; line-height: 1.18; }
.section-note { margin: 5px 0 0; color: var(--muted); line-height: 1.35; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 12px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 158px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-decoration: none;
}
.card:hover { border-color: #aac0d2; box-shadow: 0 8px 20px rgba(20, 31, 43, .07); }
.card-title { margin: 0; font-size: 20px; line-height: 1.22; }
.card-meta { color: var(--muted); font-size: 14px; line-height: 1.35; }
.badge { display: inline-flex; width: fit-content; padding: 4px 8px; border-radius: 999px; background: #e8f0f5; color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.progress-line { height: 8px; border-radius: 999px; background: #e6ebef; overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0%; background: var(--ok); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #bfd0dc;
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.icon {
  width: 42px;
  min-width: 42px;
  padding: 8px;
  line-height: 1;
}
.btn.icon svg { width: 21px; height: 21px; stroke-width: 2.4; }
.optional-action[hidden] { display: none; }
.player-page { height: 100vh; overflow: hidden; background: #dfe6ec; }
.player-shell { display: grid; grid-template-rows: auto 1fr; height: 100vh; }
.player-page.player-chrome-hidden .player-shell { grid-template-rows: 1fr; }
.player-page.player-chrome-hidden .player-bar { display: none; }
.chrome-peek {
  position: fixed;
  z-index: 5;
  top: 10px;
  right: 10px;
  display: none;
  box-shadow: 0 8px 22px rgba(17, 24, 39, .16);
}
.player-page.player-chrome-hidden .chrome-peek { display: inline-flex; }
.player-page.player-chrome-hidden.deck-image-modal-open .chrome-peek,
.player-page.deck-image-modal-open .chrome-peek { display: none; }
.player-bar {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
}
.player-title { min-width: 0; }
.player-title h1 { margin: 0; font-size: 18px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.player-actions { display: flex; align-items: center; gap: 8px; }
.deck-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.tiny { font-size: 13px; color: var(--muted); }
@media (max-width: 720px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 12px; }
  .topbar { margin-bottom: 12px; }
  .hero { padding: 18px; }
  .hero h1 { font-size: 29px; }
  .hero p { font-size: 16px; }
  .section-head { display: block; }
  .grid, .topic-grid { grid-template-columns: 1fr; }
  .player-bar { grid-template-columns: auto auto auto minmax(0, 1fr) auto auto; gap: 6px; padding: 6px; }
  .player-title h1 { font-size: 14px; }
  .player-title p { font-size: 12px; }
  .btn.icon { width: 36px; min-width: 36px; min-height: 36px; padding: 7px; }
  .btn.icon svg { width: 19px; height: 19px; }
}