:root {
  color-scheme: dark;
  --bg: #0e1116;
  --panel: #171c24;
  --border: #2a3140;
  --text: #e8ecf3;
  --muted: #9aa5b5;
  --accent: #e5a00d;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.hidden { display: none !important; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; letter-spacing: 0.04em; color: var(--accent); }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 420px;
  margin: 3rem auto;
}

.card h1 { margin-top: 0; font-size: 1.3rem; }

form { display: flex; flex-direction: column; gap: 0.9rem; }

label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }

input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font-size: 1rem;
}

button {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #1a1405;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
}

button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: default; }

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.error { color: var(--error); min-height: 1em; margin: 0; font-size: 0.9rem; }

.stage {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #000;
}

.seekbar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 22px;
  margin: 0;
  z-index: 2;
  accent-color: var(--accent);
  cursor: pointer;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.85);
  padding: 1.5rem;
  text-align: center;
}

.player-frame:fullscreen,
.player-frame:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  background: #000;
}

.player-frame:fullscreen .stage,
.player-frame:-webkit-full-screen .stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0;
}

.player-frame:fullscreen video,
.player-frame:-webkit-full-screen video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.player-frame:fullscreen .nowplaying,
.player-frame:fullscreen .controls,
.player-frame:fullscreen .timebar,
.player-frame:-webkit-full-screen .nowplaying,
.player-frame:-webkit-full-screen .controls,
.player-frame:-webkit-full-screen .timebar {
  margin: 0.3rem 0.9rem;
}

.btn-start {
  font-size: 1.4rem;
  padding: 0.9rem 2.2rem;
}

.nowplaying {
  margin: 0.9rem 0 0.4rem;
  font-weight: 600;
  word-break: break-word;
}

.timebar {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.6rem;
}

.time-sep { margin: 0 0.3rem; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.controls button {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}

.controls button:hover { border-color: var(--accent); }

.rating-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.stars { display: inline-flex; gap: 0.15rem; }

.star {
  background: transparent;
  border: none;
  font-size: 1.7rem;
  line-height: 1;
  padding: 0.1rem 0.15rem;
  color: #3a4252;
}

.star.lit { color: var(--accent); }
.star:hover { transform: scale(1.15); }

.rating-label { color: var(--muted); font-size: 0.9rem; }

.hint { color: var(--muted); font-size: 0.8rem; margin-top: 1rem; }

@media (max-width: 600px) {
  main { padding: 0.75rem; }
  .controls button { flex: 1 1 30%; }
}
