.tape-arcade-page {
  max-width: 980px;
  padding-top: 46px;
}

.tape-arcade-intro {
  max-width: 860px;
  margin-bottom: 22px;
}
.tape-arcade-intro h1 { max-width: 760px; }
.tape-arcade-intro .lede { max-width: 840px; }

.tape-arcade-challenge {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  max-width: 700px;
  margin: 0 auto 12px;
  padding: 10px 14px;
  border: 1px solid #d7e27b;
  border-radius: 13px;
  background: var(--accent-soft);
}
.tape-arcade-challenge.hidden { display: none; }
.tape-arcade-challenge span {
  color: #5d632e;
  font-size: .6rem;
  font-weight: 950;
  letter-spacing: .1em;
}
.tape-arcade-challenge strong { font-size: .92rem; }
.tape-arcade-challenge strong b { font-size: 1.18rem; }
.tape-arcade-challenge em {
  justify-self: end;
  color: #5d632e;
  font-size: .68rem;
  font-style: normal;
  font-weight: 780;
}

.tape-arcade-shell {
  position: relative;
  max-width: 700px;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #11150f;
  border-radius: 20px;
  background: #1c211a;
  box-shadow: 0 16px 42px rgba(28, 33, 26, .16);
}

.tape-arcade-topbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: #171c16;
}
.tape-arcade-stat {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 9px;
  border-right: 1px solid rgba(255,255,255,.12);
}
.tape-arcade-stat:last-child { border-right: 0; }
.tape-arcade-stat span {
  color: #aab0a4;
  font-size: .6rem;
  font-weight: 950;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.tape-arcade-stat strong {
  margin-top: 2px;
  color: #fff;
  font-size: 1.5rem;
  letter-spacing: -.045em;
}

.tape-arcade-target {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 10px;
  min-height: 70px;
  padding: 12px 18px;
  background: #e5ff50;
  color: #1c211a;
}
.tape-arcade-target span {
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .12em;
}
.tape-arcade-target strong {
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -.055em;
}
.tape-arcade-target em {
  color: #596027;
  font-size: .72rem;
  font-style: normal;
  font-weight: 850;
}

.tape-arcade-round-track {
  height: 7px;
  overflow: hidden;
  background: #343b31;
}
.tape-arcade-round-track span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(1);
  transform-origin: left center;
  background: #e5ff50;
  will-change: transform;
}

.tape-arcade-stage {
  position: relative;
  overflow: hidden;
  background: #20261e;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.tape-arcade-svg {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}

.tape-arcade-start-card {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 20px;
  width: min(470px, calc(100% - 34px));
  transform: translateX(-50%);
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 15px;
  background: rgba(23,28,22,.93);
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(6px);
}
.tape-arcade-start-card.is-hidden { display: none; }
.tape-arcade-start-card .section-kicker { margin-bottom: 5px; color: #e5ff50; }
.tape-arcade-start-card strong { display: block; font-size: .9rem; }
.tape-arcade-start-card span { display: block; margin-top: 4px; color: #bdc3b7; font-size: .69rem; }

.tape-arcade-level-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255,255,255,.1);
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: #171c16;
}
.tape-arcade-level-row span {
  padding: 8px 7px;
  border-right: 1px solid rgba(255,255,255,.1);
  color: #aeb5a9;
  font-size: .62rem;
  font-weight: 760;
  text-align: center;
}
.tape-arcade-level-row span:last-child { border-right: 0; }
.tape-arcade-level-row b { color: #e5ff50; }

.tape-arcade-feedback {
  margin: 11px 14px 0;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: .72rem;
  font-weight: 780;
  text-align: center;
}
.tape-arcade-feedback.hidden { display: none; }
.tape-arcade-feedback.is-good {
  border: 1px solid #778725;
  background: #34410d;
  color: #edf4b2;
}
.tape-arcade-primary {
  width: calc(100% - 28px);
  min-height: 50px;
  margin: 12px 14px 14px;
}

/* SVG tape art */
.tape-arcade-svg .tape-arcade-bg { fill: #20261e; }
.tape-arcade-svg .tape-arcade-speed-line {
  fill: none;
  stroke: #343c31;
  stroke-width: 5;
  stroke-linecap: round;
  opacity: .9;
}
.tape-arcade-svg .tape-arcade-stage-label {
  fill: #e5ff50;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: .14em;
  text-anchor: middle;
}
.tape-arcade-svg .tape-arcade-blade-shadow { fill: rgba(0,0,0,.25); }
.tape-arcade-svg .tape-arcade-blade { fill: #f1df54; stroke: #0f120e; stroke-width: 4; }
.tape-arcade-svg .tape-arcade-blade-edge { stroke: #baa41f; stroke-width: 3; }
.tape-arcade-svg .tape-arcade-tick { stroke: #121510; stroke-linecap: square; pointer-events: none; }
.tape-arcade-svg .tape-arcade-aim { pointer-events: none; }
.tape-arcade-svg .tape-arcade-aim path {
  fill: #e5ff50;
  stroke: #11150f;
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.tape-arcade-svg .tape-arcade-inch-number {
  fill: #121510;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 31px;
  font-weight: 950;
  text-anchor: middle;
}
.tape-arcade-svg .tape-arcade-tap-note {
  fill: #aab1a4;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 760;
  text-anchor: middle;
}

.tape-arcade-shell.is-correct .tape-arcade-stage::after,
.tape-arcade-shell.is-wrong .tape-arcade-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  animation: tapeArcadeFlash .2s ease-out both;
}
.tape-arcade-shell.is-correct .tape-arcade-stage::after { background: rgba(229,255,80,.16); }
.tape-arcade-shell.is-wrong .tape-arcade-stage::after { background: rgba(201,96,82,.19); }
@keyframes tapeArcadeFlash {
  from { opacity: 1; }
  to { opacity: 0; }
}
.tape-arcade-shell.is-wrong { animation: tapeArcadeShake .18s linear; }
@keyframes tapeArcadeShake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
}

.tape-arcade-game-over {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(248,249,244,.97);
  backdrop-filter: blur(4px);
}
.tape-arcade-game-over.hidden { display: none; }
.tape-arcade-game-over-card {
  width: min(520px, 100%);
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(28,33,26,.16);
  text-align: center;
}
.tape-arcade-game-over-card h2 { margin: 4px 0 0; font-size: 1.8rem; letter-spacing: -.045em; }
.tape-arcade-game-over-message { margin: 5px 0 0; color: #4d5549; font-size: 1rem; font-weight: 800; }
.tape-arcade-game-over-detail { margin: 10px auto 0; max-width: 430px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.tape-arcade-game-over-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-width: 310px; margin: 15px auto 0; }
.tape-arcade-game-over-stats span { padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: #f7f8f3; color: var(--muted); font-size: .68rem; }
.tape-arcade-game-over-stats strong { display: block; margin-top: 2px; color: var(--text); font-size: 1.28rem; }
.tape-arcade-challenge-result { max-width: 380px; margin: 12px auto 0; padding: 9px 11px; border: 1px solid #d7e27b; border-radius: 10px; background: var(--accent-soft); color: #3e4619; font-size: .73rem; font-weight: 820; }
.tape-arcade-challenge-result.hidden { display: none; }
.tape-arcade-game-over-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.tape-arcade-game-over-actions button { min-height: 47px; }
.tape-arcade-game-over-actions button:disabled { cursor: default; opacity: .5; }
.tape-arcade-share-status { min-height: 18px; margin: 8px 0 0; color: var(--muted); font-size: .68rem; }

@media (max-width: 700px) {
  .tape-arcade-page { padding-top: 24px; }
  .tape-arcade-intro { margin-bottom: 17px; }
  .tape-arcade-challenge { grid-template-columns: auto auto; gap: 5px 8px; padding: 9px 11px; }
  .tape-arcade-challenge em { grid-column: 1 / -1; justify-self: start; }
  .tape-arcade-shell { border-radius: 16px; }
  .tape-arcade-stat { min-height: 57px; padding: 7px; }
  .tape-arcade-stat strong { font-size: 1.25rem; }
  .tape-arcade-target { min-height: 61px; padding: 9px 11px; gap: 7px; }
  .tape-arcade-target strong { font-size: 1.85rem; }
  .tape-arcade-target em { font-size: .62rem; }
  .tape-arcade-round-track { height: 6px; }
  .tape-arcade-start-card { bottom: 12px; padding: 10px 12px; }
  .tape-arcade-start-card strong { font-size: .78rem; }
  .tape-arcade-start-card span { font-size: .63rem; }
  .tape-arcade-level-row span { padding: 7px 4px; font-size: .57rem; }
  .tape-arcade-feedback { margin: 9px 10px 0; }
  .tape-arcade-primary { width: calc(100% - 20px); margin: 10px; }
  .tape-arcade-game-over { padding: 10px; align-items: flex-start; overflow-y: auto; }
  .tape-arcade-game-over-card {
    display: flex;
    flex-direction: column;
    margin: 8px 0;
    padding: 15px 13px;
    border-radius: 16px;
  }
  .tape-arcade-game-over-card > .section-kicker { order: 1; }
  .tape-arcade-game-over-card h2 { order: 2; font-size: 1.5rem; }
  .tape-arcade-game-over-stats { order: 3; margin-top: 10px; }
  .tape-arcade-challenge-result { order: 4; margin-top: 8px; }
  .tape-arcade-game-over-actions {
    order: 5;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 10px;
  }
  .tape-arcade-game-over-actions button { min-height: 45px; padding-left: 8px; padding-right: 8px; font-size: .78rem; }
  .tape-arcade-game-over-message { order: 6; margin-top: 10px; font-size: .86rem; }
  .tape-arcade-game-over-detail { order: 7; margin-top: 6px; }
  .tape-arcade-share-status { order: 8; }
}

@media (max-width: 430px) {
  .tape-arcade-target { grid-template-columns: auto auto; }
  .tape-arcade-target em { grid-column: 1 / -1; margin-top: -4px; }
  .tape-arcade-target strong { font-size: 1.72rem; }
}
