:root {
  --bg: #efefef;
  --panel: rgba(255, 255, 255, 0.96);
  --line: #535353;
  --soft-line: rgba(83, 83, 83, 0.16);
  --accent: #3b3b3b;
  --accent-soft: #d7d7d7;
  --text: #303030;
  --muted: #686868;
  --success: #3b3b3b;
  --shadow: 0 18px 40px rgba(60, 60, 60, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, #fafafa 0%, var(--bg) 100%);
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  display: grid;
  gap: 20px;
}

.hero,
.game-panel,
.camera-panel {
  background: var(--panel);
  border: 2px solid var(--soft-line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
  max-width: 10ch;
}

.intro {
  margin: 16px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--line);
  color: white;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

button:hover:enabled {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#restart-button {
  background: var(--accent);
}

.status {
  margin: 16px 0 0;
  color: var(--muted);
}

.game-panel {
  padding: 18px;
}

.hud {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 0 6px 14px;
  color: var(--muted);
}

.hud strong {
  color: var(--text);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  border: 2px solid var(--soft-line);
  background: #f7f7f7;
}

.camera-panel {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 18px;
  padding: 18px;
}

.camera-frame {
  min-height: 220px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  border: 2px dashed var(--soft-line);
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.camera-frame canvas {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: #000;
}

.prediction-panel {
  border-radius: 20px;
  border: 2px solid var(--soft-line);
  padding: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.prediction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.prediction-header h2 {
  margin: 0;
  font-size: 1rem;
}

#jump-state {
  color: var(--success);
  font-weight: 700;
}

#jump-state[data-tone="danger"] {
  color: #202020;
}

.prediction-list {
  display: grid;
  gap: 10px;
}

.prediction-row {
  display: grid;
  gap: 6px;
}

.prediction-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.prediction-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(43, 37, 33, 0.08);
  overflow: hidden;
}

.prediction-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5b5b5b 0%, #8d8d8d 100%);
  border-radius: 999px;
  transition: width 120ms linear;
}

@media (max-width: 820px) {
  .layout {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .camera-panel {
    grid-template-columns: 1fr;
  }

  .hero,
  .game-panel,
  .camera-panel {
    border-radius: 22px;
  }
}
