:root {
  color-scheme: light;
  --maroon: #8b1138;
  --maroon-deep: #50051f;
  --maroon-bright: #b51c4f;
  --rose: #f4e4e9;
  --rose-soft: #fbf4f6;
  --paper: #fff;
  --ink: #2f111a;
  --muted: #786169;
  --line: #e7cdd6;
  --shadow: 0 24px 70px rgba(86, 8, 36, .14);
}

* { box-sizing: border-box; }

html { background: var(--rose-soft); }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% -10%, rgba(181, 28, 79, .14), transparent 34rem),
    linear-gradient(180deg, #fff 0, var(--rose-soft) 24rem, #fff 64rem);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
}

button { font: inherit; }

.site-header {
  padding: 18px clamp(18px, 4vw, 48px);
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid rgba(139, 17, 56, .18);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  width: min(1100px, 100%);
  margin: 0 auto;
  align-items: center;
  gap: 16px;
  color: inherit;
  text-decoration: none;
}

.brand img { width: 74px; height: 74px; object-fit: contain; }
.brand-copy { display: grid; }
.eyebrow, .section-kicker, .control-label {
  color: var(--maroon);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.brand strong { color: var(--maroon); font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.035em; line-height: 1.08; }
.brand-note { margin-top: 2px; color: var(--muted); font-size: .82rem; }

main { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 70px; }
.library-heading { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 40px; align-items: end; margin-bottom: 24px; }
.library-heading h1 { max-width: 690px; margin: 6px 0 0; color: var(--maroon-deep); font-size: clamp(2rem, 5vw, 4.4rem); letter-spacing: -.055em; line-height: .98; }
.library-heading > p { max-width: 420px; margin: 0 0 6px; color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
.section-kicker { margin: 0; }

.games { display: grid; gap: 30px; }
.game-card { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.game-topline { display: flex; justify-content: space-between; gap: 24px; align-items: start; padding: 22px 24px 20px; border-left: 6px solid var(--maroon); background: linear-gradient(110deg, #fff 0%, #fff 55%, var(--rose-soft) 100%); }
.game-date { margin: 0; color: var(--maroon); font-size: clamp(1.35rem, 3vw, 1.8rem); letter-spacing: -.025em; }
.opponent { margin: 4px 0 0; color: var(--muted); font-size: 1rem; }
.game-status { padding: 7px 10px; color: var(--maroon); background: var(--rose); border-radius: 999px; font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

.controls { display: grid; gap: 0; border-top: 1px solid var(--line); }
.control-row { display: flex; min-height: 66px; align-items: center; gap: 9px; padding: 11px 18px; overflow-x: auto; scrollbar-width: thin; }
.control-row + .control-row { border-top: 1px solid var(--line); }
.angle-row { background: var(--rose); }
.chapter-row { background: #fffafb; }
.control-label { flex: 0 0 74px; color: var(--muted); }
.choice {
  min-height: 43px;
  flex: 0 0 auto;
  padding: 9px 14px;
  color: var(--maroon);
  background: var(--paper);
  border: 1px solid rgba(139, 17, 56, .34);
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.choice:hover { border-color: var(--maroon); transform: translateY(-1px); }
.choice:focus-visible { outline: 3px solid rgba(181, 28, 79, .3); outline-offset: 2px; }
.choice[aria-pressed="true"] { color: #fff; background: var(--maroon); border-color: var(--maroon); }
.choice-meta { opacity: .72; font-weight: 600; }

.player-shell { position: relative; aspect-ratio: 16 / 9; background: #0d0a0b; }
.player-shell iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-label { position: absolute; z-index: 2; top: 14px; left: 14px; padding: 6px 9px; color: #fff; background: rgba(31, 5, 14, .72); border: 1px solid rgba(255,255,255,.18); border-radius: 8px; font-size: .75rem; font-weight: 800; pointer-events: none; backdrop-filter: blur(8px); }

.notice { min-height: 240px; padding: 54px 24px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); color: var(--muted); }
.notice h2 { margin: 14px 0 6px; color: var(--maroon); }
.notice p { margin: 0; }
.empty-ball { font-size: 2.5rem; }
.error { color: #8b1138; }

footer { display: flex; justify-content: center; gap: 10px 22px; flex-wrap: wrap; padding: 26px; color: var(--muted); background: var(--rose-soft); border-top: 1px solid var(--line); font-size: .85rem; }
[hidden] { display: none !important; }

@media (max-width: 720px) {
  .site-header { padding: 14px 16px; }
  .brand img { width: 62px; height: 62px; }
  main { width: min(100% - 20px, 1100px); padding-top: 30px; }
  .library-heading { grid-template-columns: 1fr; gap: 14px; margin: 0 8px 20px; }
  .library-heading h1 { font-size: clamp(2.2rem, 12vw, 3.5rem); }
  .game-card { border-radius: 18px; }
  .game-topline { padding: 18px 16px; }
  .control-row { align-items: stretch; padding: 10px 12px; }
  .control-label { display: grid; flex-basis: 62px; place-items: center start; font-size: .68rem; }
  .choice { min-height: 46px; }
  .player-label { top: 9px; left: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
