*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink: #121826;
  --muted: #667085;
  --paper: #fbf7ef;
  --panel: #fffdf8;
  --line: #d9d2c3;
  --blue: #2563eb;
  --green: #0f9f6e;
  --red: #d14343;
  --shadow: 0 18px 45px rgba(18, 24, 38, 0.14);
}

body {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(18, 24, 38, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(18, 24, 38, 0.05) 1px, transparent 1px),
    #f0e9dc;
  background-size: 42px 42px;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.back-bar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.25rem 0;
}

.back-link {
  color: #475467;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink);
}

.circle-game {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}

.hero-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.eyebrow {
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.7rem);
  line-height: 0.95;
  max-width: 760px;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 0.75rem;
}

.score-item {
  background: rgba(255, 253, 248, 0.84);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  min-width: 112px;
}

.score-label {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-item strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1.1;
  margin-top: 0.18rem;
}

.play-layout {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.canvas-shell,
.result-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.canvas-shell {
  overflow: hidden;
}

.canvas-topline {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: #344054;
  display: flex;
  font-size: 0.84rem;
  font-weight: 800;
  justify-content: space-between;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
}

#circle-canvas {
  aspect-ratio: 1;
  cursor: crosshair;
  display: block;
  touch-action: none;
  width: 100%;
}

.result-panel {
  display: grid;
  gap: 1.25rem;
  padding: 1rem;
  position: sticky;
  top: 1rem;
}

.panel-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.grade {
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 0.25rem;
}

.meter-group {
  display: grid;
  gap: 0.45rem;
}

.meter-row {
  color: #344054;
  display: flex;
  font-size: 0.84rem;
  font-weight: 800;
  justify-content: space-between;
}

.meter-track {
  background: #e8dfcf;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.meter-fill {
  background: linear-gradient(90deg, var(--red), #f59e0b, var(--green));
  border-radius: inherit;
  height: 100%;
  transition: width 0.22s ease;
  width: 0%;
}

.reset-btn {
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 900;
  min-height: 44px;
  padding: 0.75rem 1rem;
}

.reset-btn:hover {
  background: #2d3b4d;
}

@media (max-width: 860px) {
  .hero-panel,
  .play-layout {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    align-items: stretch;
    display: grid;
  }

  .score-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-panel {
    position: static;
  }
}

@media (max-width: 520px) {
  .circle-game {
    padding-inline: 0.75rem;
  }

  .canvas-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .score-strip {
    gap: 0.5rem;
  }

  .score-item {
    min-width: 0;
    padding: 0.65rem 0.75rem;
  }
}
