:root {
  --bg: #0e1116;
  --panel: #171b22;
  --panel-2: #1f2530;
  --text: #e7ecf3;
  --muted: #8b95a5;
  --accent: #ffcf33;
  --accent-2: #ff8a3d;
  --good: #38d39f;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
    "Apple SD Gothic Neo", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 138, 61, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(56, 211, 159, 0.1), transparent 55%),
    var(--bg);
  display: flex;
  justify-content: center;
  padding: 32px 20px 56px;
}

.app { width: 100%; max-width: 980px; }

.app__header { text-align: center; margin-bottom: 24px; }
.app__title { font-size: 2.1rem; margin: 0 0 8px; letter-spacing: -0.02em; }
.app__subtitle { margin: 0 auto; max-width: 540px; color: var(--muted); line-height: 1.5; }

.stage {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.stage__video-wrap {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}

.stage__video,
.stage__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* 거울 모드 */
}

.stage__status {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px 14px;
  font-size: 0.85rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: var(--muted);
  text-align: center;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.score { text-align: center; }
.score__emoji { font-size: 3.4rem; line-height: 1; transition: transform 0.15s ease; }
.score__value { font-size: 3.6rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; }
.score__unit { font-size: 1.4rem; color: var(--muted); margin-left: 4px; font-weight: 600; }
.score__label {
  margin-top: 2px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  min-height: 1.4em;
}

.gauge {
  height: 16px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}
.gauge__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--good), var(--accent), var(--accent-2));
  transition: width 0.12s linear;
}

.stats { display: flex; gap: 12px; }
.stats__item {
  flex: 1;
  background: var(--panel-2);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.stats__num { display: block; font-size: 1.5rem; font-weight: 800; }
.stats__cap { font-size: 0.78rem; color: var(--muted); }

.controls { display: flex; gap: 10px; }
.btn {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease;
}
.btn:hover { background: #2a313d; }
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1300;
  border: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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