:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0d10;
  --bg-tertiary: #141920;
  --bg-card: #1b2230;
  --text-primary: #ffffff;
  --text-secondary: #c8d0d8;
  --text-muted: #89939f;
  --accent-primary: #00d4ff;
  --accent-secondary: #39ff8f;
  --accent-warm: #ffce3a;
  --danger: #ff4f73;
  --success: #39ff8f;
  --warning: #ff9f43;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.46);
}

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

html,
body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg-primary);
}

body {
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

#app {
  position: relative;
  width: 600px;
  height: 600px;
  padding: 8px;
}

.screen {
  position: absolute;
  inset: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen.hidden,
.hidden {
  display: none !important;
}

.header {
  min-height: 68px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(10, 13, 16, 0.94);
  border: 1px solid rgba(0, 212, 255, 0.22);
  border-radius: 8px;
  flex-shrink: 0;
}

.header.compact {
  min-height: 64px;
  justify-content: flex-start;
}

.header h1,
.calibration-card h1,
.modal-panel h1 {
  font-size: 27px;
  line-height: 1.05;
  font-weight: 800;
}

.eyebrow {
  color: var(--accent-secondary);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mode-pill {
  min-width: 126px;
  padding: 9px 10px;
  color: var(--accent-primary);
  text-align: center;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.menu-content {
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0;
}

.logo-orbit {
  position: relative;
  width: 180px;
  height: 110px;
  border: 2px solid rgba(0, 212, 255, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(0, 212, 255, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(57, 255, 143, 0.08) 1px, transparent 1px),
    rgba(10, 13, 16, 0.78);
  background-size: 28px 28px;
  box-shadow: inset 0 0 32px rgba(0, 212, 255, 0.16);
}

.orbit-wall,
.orbit-star,
.orbit-ball,
.orbit-portal {
  position: absolute;
}

.orbit-wall {
  left: 56px;
  top: 24px;
  width: 64px;
  height: 15px;
  background: #61f7ff;
  box-shadow: 0 0 16px rgba(97, 247, 255, 0.75);
}

.orbit-star {
  right: 34px;
  top: 28px;
  width: 20px;
  height: 20px;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 80% 94%, 50% 70%, 20% 94%, 32% 56%, 2% 35%, 39% 35%);
  background: var(--accent-warm);
  box-shadow: 0 0 18px rgba(255, 206, 58, 0.8);
}

.orbit-ball {
  left: 30px;
  bottom: 24px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0 14%, #72f7ff 36%, #00d4ff 72%);
  box-shadow: 0 0 24px rgba(0, 212, 255, 1);
}

.orbit-portal {
  right: 26px;
  bottom: 20px;
  width: 34px;
  height: 34px;
  border: 5px solid #d95cff;
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(217, 92, 255, 0.9), inset 0 0 20px rgba(217, 92, 255, 0.5);
}

.menu-copy {
  max-width: 466px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.25;
  text-align: center;
}

.stats-strip,
.summary-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats-strip div,
.summary-grid div,
.info-panel {
  background: rgba(27, 34, 48, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px;
}

.stats-strip span,
.summary-grid span,
.hud span {
  display: block;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
}

.stats-strip strong,
.summary-grid strong {
  color: var(--accent-warm);
  font-size: 20px;
}

.nav-bar {
  display: flex;
  gap: 10px;
  padding-top: 10px;
  flex-shrink: 0;
}

.nav-bar.stacked {
  flex-direction: column;
}

.nav-item,
.back-btn {
  min-height: 88px;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  transition:
    transform 475ms cubic-bezier(0.6, 0, 0.4, 1),
    background-color 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
    border-color 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
    box-shadow 300ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

.nav-item {
  flex: 1;
  padding: 12px 14px;
}

.back-btn {
  min-height: 58px;
  width: 58px;
  flex: 0 0 58px;
  font-size: 24px;
}

.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
  transform: scale(0.97);
}

.nav-item.primary {
  color: #031014;
  background: var(--accent-primary);
  border-color: #9cf2ff;
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.26);
}

.nav-item.danger {
  color: #ffffff;
  background: var(--danger);
  border-color: #ff9aae;
}

.info-content,
.records-content {
  gap: 10px;
  padding: 10px 0;
}

.info-panel h2 {
  margin-bottom: 6px;
  color: #ffffff;
  font-size: 20px;
}

.info-panel p,
.calibration-card p,
.modal-panel p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.35;
}

.info-panel.prize {
  border-color: rgba(255, 206, 58, 0.5);
  box-shadow: inset 0 0 18px rgba(255, 206, 58, 0.08);
}

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

.record-row {
  display: grid;
  grid-template-columns: 54px 1fr 96px;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 10px 12px;
  background: rgba(27, 34, 48, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.record-row strong {
  font-size: 18px;
}

.record-row span {
  color: var(--text-secondary);
  font-size: 14px;
}

.calibration-card,
.modal-panel {
  width: 100%;
  height: 100%;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 18px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(0, 212, 255, 0.16), transparent 34%),
    rgba(10, 13, 16, 0.96);
  border: 1px solid rgba(0, 212, 255, 0.28);
  border-radius: 8px;
}

.calibration-card .nav-item {
  flex: 0 0 auto;
  width: 100%;
}

.hud {
  height: 70px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.hud div,
.game-footer {
  background: rgba(10, 13, 16, 0.94);
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 8px;
}

.hud div {
  padding: 9px 8px;
  text-align: center;
}

.hud strong {
  display: block;
  margin-top: 2px;
  color: #ffffff;
  font-size: 20px;
}

#maze {
  width: 568px;
  height: 448px;
  margin-top: 8px;
  display: block;
  background: transparent;
  border-radius: 8px;
}

.game-footer {
  height: 50px;
  margin-top: 8px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 800;
}

.modal-screen {
  padding: 0;
}

.modal-panel {
  margin: auto;
  max-width: 584px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.modal-actions.two {
  grid-template-columns: 1fr 1fr;
}

.badge-visual {
  width: 112px;
  height: 112px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  color: #031014;
  font-size: 30px;
  font-weight: 900;
  background: radial-gradient(circle, #ffffff 0 14%, #ffce3a 38%, #39ff8f 76%);
  border: 4px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(255, 206, 58, 0.78), 0 0 52px rgba(57, 255, 143, 0.42);
}

.prize-panel {
  border-color: rgba(255, 206, 58, 0.5);
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 206, 58, 0.2), transparent 32%),
    rgba(10, 13, 16, 0.96);
}
