:root {
  --bg: #000000;
  --surface: #0b0d10;
  --surface2: #16191f;
  --text: #ffffff;
  --text2: #b8c0cc;
  --cyan: #00d4ff;
  --cyan-glow: rgba(0, 212, 255, 0.45);
  --lime: #7cff6b;
  --amber: #ffbf3d;
  --red: #ff4d5e;
  --violet: #a777ff;
}

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

html,
body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

.home-content,
.overlay {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 40px;
  text-align: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border-radius: 54px;
  color: #071014;
  background: radial-gradient(circle at 35% 30%, #ffffff, var(--cyan) 42%, #1260ff);
  box-shadow: 0 0 32px var(--cyan-glow), inset 0 -10px 20px rgba(0, 0, 0, 0.25);
  font-size: 38px;
  font-weight: 900;
}

h1 {
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
}

.tagline,
.credit,
.overlay p,
.meta {
  color: var(--text2);
}

.tagline {
  font-size: 16px;
  line-height: 1.4;
}

.caution {
  width: 100%;
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--amber);
  background: rgba(255, 191, 61, 0.12);
  font-size: 14px;
  line-height: 1.45;
}

.best-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--surface2);
}

.best-pill span {
  color: var(--text2);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 800;
}

.best-pill strong {
  color: var(--cyan);
  font-size: 24px;
}

.actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

button {
  font: inherit;
}

.focusable {
  min-height: 64px;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.6, 0, 0.4, 1), box-shadow 250ms ease, border-color 250ms ease;
}

.focusable:focus {
  outline: none;
  transform: scale(0.96);
  border-color: var(--cyan);
  box-shadow: 0 0 22px var(--cyan-glow);
}

.btn-primary,
.btn-secondary,
.btn-danger {
  width: 100%;
  padding: 16px 18px;
  font-weight: 800;
  font-size: 17px;
}

.btn-primary {
  color: #001017;
  background: var(--cyan);
}

.btn-secondary {
  color: var(--text);
  background: var(--surface2);
}

.btn-danger {
  color: var(--text);
  background: var(--red);
}

.header {
  height: 76px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
}

.header h1 {
  font-size: 24px;
}

.back-btn {
  min-width: 58px;
  min-height: 48px;
  color: var(--text);
  background: transparent;
  font-size: 24px;
}

.content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.help-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.help-row {
  display: flex;
  gap: 14px;
  text-align: left;
}

.help-row span {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  border-radius: 19px;
  color: #001017;
  background: var(--cyan);
  font-weight: 900;
}

.help-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.help-row p {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.45;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 600px;
  height: 600px;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 22px;
  pointer-events: none;
}

.score {
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
}

.center-hud {
  text-align: center;
}

.speed {
  color: var(--lime);
  font-size: 38px;
  line-height: 1;
  font-weight: 900;
  text-shadow: 0 0 16px rgba(124, 255, 107, 0.45);
}

.right-hud {
  text-align: right;
}

.health {
  color: var(--red);
  font-size: 32px;
  letter-spacing: 2px;
  font-weight: 900;
}

.shield {
  color: var(--cyan);
  font-size: 13px;
  letter-spacing: 2px;
  font-weight: 900;
}

.overlay {
  background: rgba(0, 0, 0, 0.86);
}

.skull,
.new-best {
  color: var(--amber);
  font-weight: 900;
  letter-spacing: 2px;
}

.final-score {
  color: var(--cyan);
  font-size: 68px;
  line-height: 1;
  font-weight: 900;
}

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  max-width: 536px;
  transform: translateX(-50%) translateY(-80px);
  padding: 12px 24px;
  border: 1px solid var(--cyan);
  border-radius: 24px;
  color: var(--text);
  background: var(--surface2);
  transition: transform 220ms ease;
  pointer-events: none;
  z-index: 20;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
}
