/* Transit — Journey to Mars  v3
   Lush pastel space, Star Pup-level polish, comfort-first motion. */

:root {
  --navy: #16132E;
  --dusk: #1C1840;
  --cream: #FFF6E8;
  --card: rgba(255, 248, 240, 0.94);
  --ink: #2B2230;
  --ink-soft: #5C5270;
  --line: rgba(255, 236, 210, 0.18);
  --gold: #FFD36B;
  --gold-2: #FFC94D;
  --peach: #FFB36B;
  --pink: #FF9FD0;
  --mint: #8FF0C8;
  --cyan: #9FD4FF;
  --mars: #E89B86;
  --terracotta: #D4795C;
  --shadow: 0 14px 36px rgba(8, 6, 24, 0.35);
  --shadow-sm: 0 8px 20px rgba(8, 6, 24, 0.22);
  --radius: 24px;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --display: "Fredoka", "Plus Jakarta Sans", sans-serif;
  --safe-top: max(14px, env(safe-area-inset-top, 0px));
  --safe-bot: max(14px, env(safe-area-inset-bottom, 0px));
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--navy);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background:
    radial-gradient(120% 80% at 50% -10%, #3a2a6e 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 100%, #4a1a4a 0%, transparent 50%),
    var(--navy);
  padding: var(--safe-top) 10px var(--safe-bot);
}

.bezel {
  position: relative;
  width: min(100%, 430px);
  height: 100%;
  margin: 0 auto;
  background: #120f28;
  border-radius: 32px;
  box-shadow: var(--shadow), inset 0 0 0 3px rgba(255, 236, 210, 0.12);
  overflow: hidden;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 32px;
  touch-action: none;
  z-index: 0;
}

.lcd-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 32px;
  opacity: 0.045;
  background-image: radial-gradient(circle, #fff6e8 0.7px, transparent 0.8px);
  background-size: 5px 5px;
  z-index: 1;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: stretch;
  padding: 12px 12px 0;
  pointer-events: none;
}

.hud-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.55);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 64px;
}

.hud-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}

.hud-value {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hud-of {
  font-size: 13px;
  color: var(--ink-soft);
  margin-left: 1px;
}

.bar-card { padding: 8px 12px 7px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-track {
  flex: 1;
  height: 10px;
  background: #E8DFF0;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #9FD4FF, #FFD36B 45%, #E89B86);
}

.bar-caption { margin-top: 4px; text-align: center; }

.planet {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset -3px -2px 0 rgba(43, 34, 48, 0.16);
}

.planet.earth { background: linear-gradient(135deg, #8FBBD9, #7FB9A8); }
.planet.mars { background: linear-gradient(135deg, #E89B86, #C45C42); }

.side-card {
  gap: 6px;
  padding: 7px 10px 8px;
  min-width: 72px;
}

.score-wrap, .rings-wrap { display: flex; flex-direction: column; }
.score-value { color: #8A5A00; font-size: 18px; font-variant-numeric: tabular-nums; }
.rings-value { color: #1F6B52; font-size: 18px; font-variant-numeric: tabular-nums; }
.score-wrap.pop, .rings-wrap.pop { transform: translateY(-1px); }
.side-card { gap: 5px; }

.lives {
  display: flex;
  gap: 5px;
  margin-top: 3px;
}

.life {
  width: 12px;
  height: 16px;
  border-radius: 8px 8px 5px 5px;
  background: #E8D7D0;
  position: relative;
  display: inline-block;
}

.life::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 251, 247, 0.5);
}

.life.on { background: linear-gradient(180deg, #FFE08A, #E89B86); }

.combo {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 5;
  background: linear-gradient(135deg, #FFE08A, #FF9FD0 60%, #C9A8FF);
  color: #2B1600;
  border-radius: 16px;
  padding: 6px 16px;
  box-shadow: 0 8px 22px rgba(255, 180, 80, 0.28);
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.toast {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 5;
  background: var(--card);
  color: var(--ink);
  border-radius: 16px;
  padding: 8px 16px;
  box-shadow: var(--shadow-sm);
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.btn-skip {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 8;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 248, 240, 0.9);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  background: rgba(12, 10, 32, 0.18);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.overlay-win { background: rgba(12, 10, 32, 0.12); }

.overlay[hidden],
.hud[hidden],
.toast[hidden],
.combo[hidden],
.btn-skip[hidden] { display: none !important; }

.card {
  width: min(100%, 340px);
  background: var(--card);
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 28px 18px 24px;
  text-align: center;
}

.slim-card { padding: 22px 22px 20px; }

.subtitle {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #C45C42;
  font-weight: 800;
  margin-bottom: 6px;
}

.subtitle.under {
  margin-top: 2px;
  margin-bottom: 18px;
  font-size: 13px;
  letter-spacing: 0.20em;
  font-weight: 700;
}

.title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(46px, 12.6vw, 68px);
  line-height: 0.95;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 4px 0 0;
  text-indent: 0.12em;
  margin-right: -0.12em;
  white-space: nowrap;
}

.title.small {
  font-size: 34px;
  letter-spacing: 0.06em;
  text-indent: 0;
  margin-right: 0;
  margin-bottom: 10px;
  text-transform: none;
  font-weight: 600;
}

.win-kicker {
  font-family: var(--display);
  font-size: 26px;
  background: linear-gradient(90deg, #E8A54B, #FF9FD0, #C9A8FF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: -4px 0 10px;
}

.lede {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.legend {
  list-style: none;
  text-align: left;
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ink);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(22, 19, 46, 0.05);
  border-radius: 14px;
  padding: 8px 10px;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: none;
}

.swatch.ring {
  background: transparent;
  box-shadow: inset 0 0 0 3px #7FB9A8, 0 0 8px rgba(127, 185, 168, 0.45);
}
.swatch.star { background: var(--gold); border-radius: 4px; transform: rotate(20deg); box-shadow: 0 0 8px rgba(255, 211, 107, 0.55); }
.swatch.rock { background: #C4B4A8; }

.controls {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 18px;
  line-height: 1.45;
}

.btn {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, #FFE38A 0%, #FFC94D 45%, #FFAB3D 100%);
  color: #3A2200;
  font-family: var(--font);
  font-weight: 800;
  font-size: 16px;
  padding: 15px 22px;
  border-radius: 18px;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 235, 170, 0.7) inset, 0 8px 22px rgba(255, 180, 60, 0.35);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 7;
}

.btn:focus-visible {
  outline: 3px solid #9FD4FF;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-height: 620px) {
  .title { font-size: 44px; letter-spacing: 0.1em; text-indent: 0.1em; margin-right: -0.1em; }
  .lede, .legend { margin-bottom: 10px; }
  .card { padding: 20px 18px 18px; }
}
@media (max-width: 380px) {
  .title { font-size: 46px; letter-spacing: 0.1em; text-indent: 0.1em; margin-right: -0.1em; }
}

