:root {
  --bg: #0f172a;
  --card: #111827;
  --card2: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #60a5fa;
  --primary-dark: #2563eb;
  --danger: #ef4444;
  --border: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Pretendard,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.22), transparent 32rem),
    var(--bg);
  color: var(--text);
}

button,
select {
  font: inherit;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow,
.label {
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.subtitle {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}

.player-card,
.log-card {
  border: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.82);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.video-header,
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.video-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: #000;
  aspect-ratio: 16 / 9;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.identity-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.78);
  z-index: 5;
}

.identity-overlay.hidden {
  display: none;
}

.identity-box {
  width: min(360px, calc(100% - 32px));
  padding: 24px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
}

.progress-area {
  margin-top: 16px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #60a5fa, #22c55e);
  border-radius: inherit;
}

.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.controls,
.test-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.primary-btn,
.secondary-btn,
.danger-btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  cursor: pointer;
  color: white;
  font-weight: 700;
}

.primary-btn {
  background: var(--primary-dark);
}

.secondary-btn {
  background: var(--card2);
  border: 1px solid var(--border);
}

.danger-btn {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fecaca;
}

.speed-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 12px;
}

.speed-control select {
  color: var(--text);
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
}

.stats {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.stats div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.stats dt {
  color: var(--muted);
  font-size: 13px;
}

.stats dd {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 800;
}

.log-output {
  min-height: 360px;
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 16px;
  padding: 14px;
  background: #020617;
  color: #bbf7d0;
  border: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .log-card {
    order: 2;
  }
}
