.sky { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

.glow {
  position: absolute;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.35;
  animation: drift 18s ease-in-out infinite;
}

.glow-a { background: #ff3b30; top: -10vw; left: -8vw; }
.glow-b { background: #2fce45; right: -12vw; top: 20vh; animation-delay: -6s; }
.glow-c { background: #ffbf1f; left: 20vw; bottom: -16vw; animation-delay: -12s; }

@keyframes drift {
  50% { transform: translate3d(4vw, 3vh, 0) scale(1.08); }
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  background: #100e0c;
  transition: opacity 0.4s ease;
}

.boot.is-done { opacity: 0; pointer-events: none; }

.boot-lamp {
  width: 54px;
  height: 92px;
  border-radius: 16px;
  background: #241c16;
  border: 3px solid #f6c945;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  box-shadow: 0 8px 0 #070604;
}

.boot-lamp i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: block;
}

.boot-lamp i:nth-child(1) { background: #ff3b30; animation: blink 1.2s steps(1) infinite; }
.boot-lamp i:nth-child(2) { background: #ffbf1f; animation: blink 1.2s steps(1) infinite 0.2s; }
.boot-lamp i:nth-child(3) { background: #2fce45; animation: blink 1.2s steps(1) infinite 0.4s; }

@keyframes blink { 50% { filter: brightness(0.35); } }

.app {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  position: relative;
  z-index: 1;
}

.topbar { grid-row: 1; }
.stage { grid-row: 2; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: calc(8px + var(--safe-top)) 12px 8px;
}

.brand, .brand-text { min-width: 0; }

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

.brand-mark, .play-orb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #fff, #f6c945 45%, #2fce45);
  display: grid;
  place-items: center;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 4px 0 #0c4a16;
}

.brand-mark svg, .play-orb svg { width: 34px; height: 34px; }

.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: clamp(0.82rem, 3.2vw, 1.25rem); line-height: 0.95; }
.brand-text small { color: var(--muted); font-size: 0.75rem; }

.topbar-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.star-chip, .round-btn {
  min-height: 42px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: rgba(20, 16, 12, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.star-chip { padding: 0 12px; color: var(--gold); }
.star-chip svg { width: 18px; height: 18px; fill: currentColor; }
.round-btn { width: 42px; padding: 0; }

.stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 4px 12px calc(136px + var(--safe-bottom));
}

.stage.is-entering { animation: rise 0.35s ease; }

@keyframes rise {
  from { transform: translateY(8px); opacity: 0.4; }
}

.dock {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: calc(8px + var(--safe-bottom));
  width: min(520px, calc(100% - 16px));
  transform: translateX(-50%);
}

.dock-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 2px;
  padding: 8px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 12px 12px, #6b6156 1.5px, transparent 1.7px),
    linear-gradient(180deg, #3a3128, #1a1511);
  border: 2px solid rgba(246, 201, 69, 0.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 10px 0 #070604, 0 16px 24px rgba(0,0,0,0.45);
}

.dock-item {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  padding: 4px 0;
}

.dock-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.dock-item.is-active { color: var(--ink); }

.dock-play {
  transform: translateY(-16px);
  color: var(--ink);
}

.play-orb { width: 58px; height: 58px; background: radial-gradient(circle at 35% 30%, #d8ffb0, #2fce45 46%, #0f6a22); }

.dock-blob {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--blob-w, 0);
  height: var(--blob-h, 0);
  border-radius: 16px;
  background: radial-gradient(circle at 50% 30%, #fff3c4, #ffbf1f 55%, #c48410);
  transform: translate(var(--blob-x, 0), var(--blob-y, 0));
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1), width 0.35s ease, height 0.35s ease;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.7);
}

.dock-blob.is-hidden { opacity: 0; }

#modals, #toasts { position: fixed; z-index: 12; }

#modals { inset: 0; pointer-events: none; }
#modals:empty { display: none; }
#modals .modal { pointer-events: auto; }
#modals .modal.is-coach { pointer-events: none; }

#toasts {
  left: 12px;
  right: 12px;
  top: calc(10px + var(--safe-top));
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
}

@media (min-width: 880px), (orientation: landscape) and (max-height: 520px) {
  .dock {
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: 108px;
    transform: none;
  }
  .dock-track {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 32px;
  }
  .dock-play { transform: none; }
  .topbar, .stage { margin-left: 124px; }
  .stage { padding-bottom: 16px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .dock { width: 76px; }
  .dock-item span, .brand-text small { display: none; }
  .topbar, .stage { margin-left: 92px; }
  .play-orb { width: 48px; height: 48px; }
}

@media (max-width: 350px) {
  .brand-text small { display: none; }
  .dock-item span { font-size: 0.64rem; }
  .stage { padding-left: 8px; padding-right: 8px; }
}

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

body[data-motion="off"] *, body[data-motion="off"] *::before, body[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
}
