:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --panel: #171a20;
  --panel-2: #222732;
  --line: #303744;
  --text: #f4f0e8;
  --muted: #aaa7a0;
  --accent: #ffcc4d;
  --red: #ff7474;
  --green: #72e39a;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(135deg, rgba(255, 204, 77, .14), transparent 38%),
    linear-gradient(210deg, rgba(114, 227, 154, .10), transparent 42%),
    var(--bg);
}

button, input, select { font: inherit; }
button {
  border: 0;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 15px;
  color: #18140b;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
button.danger { background: #3a1d23; color: var(--text); border: 1px solid #6d2d39; }
input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #11141a;
  outline: none;
}
input[type="file"] {
  padding: 9px 12px;
}
input:focus, select:focus { border-color: var(--accent); }

.shell { max-width: 1280px; margin: 0 auto; padding: 24px; }
.top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
h1 { margin: 0; font-size: clamp(32px, 5vw, 68px); letter-spacing: 0; }
h2 { margin: 0 0 14px; font-size: 20px; }
p { color: var(--muted); line-height: 1.5; }
.hint { margin: 0; font-size: 13px; }
a { color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items: start;
}
.panel {
  background: rgba(23, 26, 32, .92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .34);
}
.field { display: grid; gap: 7px; margin-bottom: 12px; }
label, .muted { color: var(--muted); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stack { display: grid; gap: 12px; }

.room-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.room-code {
  display: block;
  margin-top: 5px;
  font-size: 34px;
  color: var(--accent);
}
.player-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #29303d;
  color: var(--text);
}

.recording {
  display: grid;
  grid-template-columns: 210px minmax(220px, 1fr) 230px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #12161d;
}
.recording p { margin: 4px 0 0; font-size: 13px; }
.recording-actions { display: grid; gap: 8px; }
.playback-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.playback-actions button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
}
.recording-group {
  display: grid;
  gap: 10px;
}
.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}
.group-title h3 {
  margin: 0;
  color: var(--accent);
  font-size: 16px;
  text-transform: uppercase;
}
.group-title span {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 900;
}
.small-empty {
  min-height: 72px;
}
audio { width: 100%; min-width: 220px; }
.empty {
  display: grid;
  place-items: center;
  min-height: 170px;
  color: var(--muted);
  border: 1px dashed #424a58;
  border-radius: 8px;
  text-align: center;
  padding: 20px;
}

.recorder {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #12161d;
}
.upload-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #12161d;
}
.round-manager {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #12161d;
}
.status-manager {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #12161d;
}
.player-status-list {
  display: grid;
  gap: 8px;
}
.player-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}
.player-status-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-status-row select {
  min-height: 36px;
}
.round-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.round-tab {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}
.round-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #18140b;
}
.quick-stages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.quick-stages button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}
.material-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  width: fit-content;
  padding: 0 10px;
  border-radius: 999px;
  color: #101410;
  background: var(--green);
  font-weight: 800;
}

@media (max-width: 900px) {
  .top, .grid, .recording { grid-template-columns: 1fr; }
  .quick-stages { grid-template-columns: 1fr; }
  .material-actions { grid-template-columns: 1fr; }
  .playback-actions { grid-template-columns: 1fr; }
  .room-head { grid-template-columns: 1fr; }
  .player-status-row { grid-template-columns: 1fr; }
}

.watch-page {
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(135deg, rgba(255, 204, 77, .18), transparent 36%),
    linear-gradient(225deg, rgba(114, 227, 154, .14), transparent 42%),
    #090b0f;
}
.watch-shell {
  width: min(1600px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(12px, 2vw, 28px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: clamp(10px, 1.4vw, 18px);
}
.watch-hero {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  margin: calc(clamp(12px, 2vw, 28px) * -1) calc(clamp(12px, 2vw, 28px) * -1) 0;
  padding: clamp(10px, 1.4vw, 18px) clamp(12px, 2vw, 28px);
  background:
    linear-gradient(135deg, rgba(255, 204, 77, .16), transparent 38%),
    linear-gradient(225deg, rgba(114, 227, 154, .10), transparent 46%),
    rgba(9, 11, 15, .96);
  backdrop-filter: blur(10px);
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
.brand-lockup {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
  color: var(--accent);
  text-transform: uppercase;
}
.brand-lockup span {
  font-size: clamp(13px, 1.15vw, 18px);
  font-weight: 800;
}
.brand-lockup strong {
  font-size: clamp(24px, 2.7vw, 44px);
  line-height: 1;
  font-weight: 1000;
}
.watch-hero h1 {
  font-size: clamp(18px, 2vw, 30px);
  line-height: 1;
}
.watch-round {
  min-width: min(230px, 100%);
  border: 1px solid rgba(255, 204, 77, .42);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255, 204, 77, .16);
  color: var(--accent);
  font-size: clamp(16px, 1.7vw, 26px);
  font-weight: 900;
  text-align: center;
}
.watch-grid {
  display: grid;
  grid-template-columns: minmax(260px, .48fr) minmax(560px, 1.52fr);
  gap: 14px;
  min-height: 0;
}
.watch-side {
  display: grid;
  gap: 14px;
  align-content: start;
}
.watch-panel {
  background: rgba(18, 22, 29, .78);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: clamp(14px, 2vw, 24px);
  min-height: 0;
}
.watch-panel h2 {
  color: var(--muted);
  font-size: clamp(16px, 1.55vw, 23px);
  text-transform: uppercase;
  letter-spacing: 0;
}
.watch-players {
  display: grid;
  gap: 12px;
}
.watch-player-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  padding: 12px 14px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 204, 77, .18), transparent 54%),
    #29303d;
  color: var(--text);
  border: 1px solid rgba(255, 204, 77, .24);
}
.watch-player-card.waiting {
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .12);
  color: var(--muted);
}
.watch-player-number {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #141006;
  font-size: 22px;
  font-weight: 900;
}
.watch-player-card.waiting .watch-player-number {
  background: #29303d;
  color: var(--muted);
}
.watch-player-card strong {
  display: block;
  font-size: clamp(24px, 2.4vw, 40px);
  line-height: 1;
}
.watch-player-card small {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-size: clamp(13px, 1.1vw, 18px);
  font-weight: 900;
  text-transform: uppercase;
}
.watch-player-card.waiting small {
  color: var(--muted);
}
.watch-timeline {
  display: grid;
  gap: 12px;
}
.stage-track {
  display: grid;
  gap: 9px;
}
.stage-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
  color: var(--muted);
}
.stage-step span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #29303d;
  color: var(--text);
  font-weight: 900;
}
.stage-step strong {
  font-size: clamp(15px, 1.3vw, 21px);
}
.stage-step.done span,
.stage-step.active span {
  background: var(--accent);
  color: #141006;
}
.stage-step.active {
  color: var(--text);
  outline: 1px solid rgba(255, 204, 77, .36);
  background: rgba(255, 204, 77, .12);
}
.watch-step {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 11px;
  align-items: center;
  padding: 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
}
.watch-step span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #141006;
  font-weight: 900;
}
.watch-step strong {
  font-size: clamp(17px, 1.7vw, 25px);
}
.watch-step p {
  margin: 4px 0 0;
}
.watch-audio-list {
  display: grid;
  gap: 12px;
}
.watch-audio-section {
  display: grid;
  gap: 10px;
}
.watch-audio-section h3 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(15px, 1.3vw, 20px);
  text-transform: uppercase;
}
.watch-audio-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}
.watch-audio-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
}
.watch-audio-card.active {
  border-color: rgba(255, 204, 77, .42);
  background:
    linear-gradient(135deg, rgba(255, 204, 77, .13), transparent 58%),
    rgba(255, 255, 255, .07);
}
.watch-audio-meta {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
}
.watch-audio-meta span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #141006;
  font-weight: 900;
}
.watch-audio-meta strong {
  font-size: clamp(18px, 2vw, 26px);
}
.watch-audio-meta p {
  margin: 3px 0 0;
}

@media (max-width: 900px) {
  .watch-hero, .watch-grid, .watch-audio-section-grid { grid-template-columns: 1fr; }
  .watch-round { text-align: left; }
}
