html,
body {
  touch-action: manipulation;
}

.aim-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.aim-shell .arcade-hint {
  margin-top: 14px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 14px;
}

.stat-card {
  padding: 8px 10px 10px;
  border-radius: var(--radius-lg);
  border: 2.5px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}

.stat-card--time { background: var(--amber-soft); }
.stat-card--score { background: var(--indigo-soft); }
.stat-card--miss { background: var(--sky-soft); }

.stat-label {
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--ink);
}

.stat-value {
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.stat-sub {
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

.aim-field {
  position: relative;
  flex: 1 1 auto;
  min-height: 380px;
  border-radius: var(--radius-xl);
  border: 2.5px solid var(--border);
  background:
    radial-gradient(circle at 50% 46%, rgba(79, 70, 229, 0.06), transparent 58%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

body.is-live .site-header {
  opacity: 0.78;
}

body.is-result .arcade-hint {
  visibility: hidden;
}

body.is-playing .aim-field {
  cursor: crosshair;
}

.aim-field.is-hit {
  box-shadow: var(--shadow-lg), inset 0 0 0 4px var(--indigo);
}

.aim-field.is-miss {
  box-shadow: var(--shadow-lg), inset 0 0 0 4px var(--amber);
}

.seg-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.aim-target {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.aim-target[hidden] {
  display: none !important;
}

.aim-target-face {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-shadow: 4px 5px 0 var(--border);
  position: relative;
  background: #ff5470;
  overflow: hidden;
}

.aim-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}

.aim-ring--two {
  width: 50%;
  height: 50%;
  background: #4f46e5;
}

.aim-ring--three {
  width: 16.67%;
  height: 16.67%;
  background: #fbbf24;
}

.aim-target-face.is-in {
  animation: aim-pop 0.16s var(--ease-spring);
}

@keyframes aim-pop {
  from { transform: scale(0.72); }
  to { transform: scale(1); }
}

.aim-count {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.aim-count[hidden] {
  display: none !important;
}

.aim-count span {
  min-width: 112px;
  min-height: 112px;
  display: grid;
  place-items: center;
  padding: 8px 16px;
  border-radius: 28px;
  background: var(--amber);
  border: 3px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: clamp(4rem, 16vw, 6.5rem);
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
}

.aim-idle {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 22px 18px;
  background: rgba(255, 255, 255, 0.82);
}

.aim-idle[hidden] {
  display: none !important;
}

.aim-kicker {
  margin: 0;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  background: var(--coral-soft);
  font-size: 0.75rem;
  font-weight: 900;
}

.aim-idle-title {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.aim-idle-sub {
  margin: 0;
  max-width: 28rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.aim-start {
  min-width: 180px;
  min-height: 52px;
  margin-top: 6px;
  font-size: 1.05rem;
}

.aim-best {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink-secondary);
  white-space: pre-line;
}

.aim-best--result {
  margin: 0 0 14px;
}

.floater {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -120%);
  pointer-events: none;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--ink);
  background: var(--amber);
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  box-shadow: var(--shadow-xs);
  animation: float-up 0.48s ease forwards;
}

.floater--hit {
  background: var(--amber);
  color: var(--ink);
  border-width: 2.5px;
  box-shadow: 3px 3px 0 var(--border);
  font-size: 1.2rem;
}

@keyframes float-up {
  from { opacity: 1; transform: translate(-50%, -70%) rotate(-8deg); }
  to { opacity: 0; transform: translate(-50%, -180%) rotate(-8deg); }
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.overlay.hidden {
  display: none;
}

.win-card {
  width: 100%;
  max-width: 400px;
  pointer-events: auto;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 0 var(--border), 0 24px 48px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  text-align: center;
  animation: pop-in 0.35s var(--ease-spring);
}

.win-banner {
  background: linear-gradient(135deg, var(--amber) 0%, #f59e0b 100%);
  border-bottom: 3px solid var(--border);
  padding: 18px 18px 16px;
}

.win-trophy {
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  border-radius: 18px;
  background: var(--surface);
  border: 2.5px solid var(--border);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  font-size: 2rem;
}

.win-card h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 900;
}

.res-new {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: var(--shadow-xs);
}

.res-new[hidden] {
  display: none !important;
}

.win-body {
  padding: 16px 18px 20px;
}

.score-line {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink-secondary);
}

.score-line strong {
  display: block;
  margin-top: 2px;
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.win-stats-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.win-stat-pill {
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface-soft);
  box-shadow: var(--shadow-xs);
}

.win-stat-pill span {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--muted);
}

.win-stat-pill strong {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.aim-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aim-actions .btn-pop {
  width: 100%;
  min-height: 46px;
}

@keyframes pop-in {
  from { transform: scale(0.86); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 520px) {
  .overlay {
    align-items: flex-end;
    padding: 12px 12px 16px;
  }
}

@media (max-width: 480px) {
  .stats-row {
    gap: 8px;
  }

  .stat-card {
    padding: 8px 6px;
  }

  .aim-field {
    min-height: 300px;
  }
}

@media (max-height: 700px) {
  .aim-field {
    min-height: 260px;
  }

  .aim-shell .site-header {
    margin-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aim-target-face.is-in,
  .floater,
  .win-card {
    animation: none;
  }
}
