:root {
  --bg-deep: #0f291e;
  --bg-mid: #1b4332;
  --bg-card: #2d6a4f;
  --accent: #95d5b2;
  --accent-hot: #d8f3dc;
  --sun: #fefae0;
  --text: #f1faee;
  --shadow: rgba(0, 0, 0, 0.35);
  --egg-w: min(48vw, 220px);
  --egg-h: min(62vw, 290px);
  --font: "Fredoka", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  /* Not inherited — apply everywhere to block double-tap zoom on iOS / Chrome */
  touch-action: manipulation;
}

html {
  height: 100%;
  min-height: 100%;
  min-height: -webkit-fill-available;
  /* iOS Safari: fills safe area behind home indicator / toolbar */
  background-color: var(--bg-deep);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: -webkit-fill-available;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg-deep);
  background-image: radial-gradient(ellipse 120% 80% at 50% -20%, #40916c 0%, transparent 55%),
    linear-gradient(165deg, var(--bg-mid) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

/* iOS zooms focused inputs with computed font-size under 16px */
@media screen and (max-width: 640px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.logo {
  margin: 0;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--sun);
  text-shadow: 0 2px 12px var(--shadow);
}

.tagline {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 400;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.stage {
  background: linear-gradient(145deg, rgba(45, 106, 79, 0.55) 0%, rgba(27, 67, 50, 0.75) 100%);
  border-radius: 1.75rem;
  padding: 1.5rem 1rem 1.75rem;
  border: 2px solid rgba(149, 213, 178, 0.25);
  box-shadow: 0 12px 40px var(--shadow);
}

.stage-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-height: 420px;
}

.ground-shadow {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: min(70%, 200px);
  height: 24px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.45) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.egg-scene {
  position: relative;
  width: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.egg-container {
  position: relative;
  width: var(--egg-w);
  height: var(--egg-h);
  animation: egg-float 3.2s ease-in-out infinite;
}

.egg-container.egg-container--empty {
  animation: none;
}

.egg-container.egg-container--empty .egg-glow,
.egg-container.egg-container--empty .egg-body {
  visibility: hidden;
}

.egg-empty-slot {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.egg-empty-outline {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  border: 3px dashed rgba(149, 213, 178, 0.5);
  background: rgba(27, 67, 50, 0.35);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.12);
}

.egg-empty-hint {
  position: absolute;
  bottom: -2.35rem;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(280px, 92vw);
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
  line-height: 1.35;
  pointer-events: auto;
}

.egg-empty-hint a {
  color: var(--accent-hot);
  font-weight: 700;
}

.egg-container:not(.egg-container--empty) .egg-empty-slot {
  display: none;
}

.egg-container.is-hatching {
  animation: egg-wobble 0.28s ease-in-out infinite;
}

.egg-container.is-burst {
  animation: none;
}

.egg-container.is-hatching .egg-glow {
  animation: glow-pulse 0.55s ease-in-out infinite;
}

.egg-container.is-burst .egg-body {
  animation: egg-burst 0.75s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.egg-container.is-burst .egg-cracks {
  opacity: 1;
}

.egg-container.is-burst .egg-glow {
  animation: glow-burst 0.75s ease-out forwards;
}

.egg-container.is-hidden {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

/* Shiny claw egg — same “lucky” egg as golden pit-egg */
.egg-container.egg-container--golden .egg-glow {
  background: radial-gradient(
    circle,
    rgba(255, 224, 130, 0.62) 0%,
    rgba(255, 180, 60, 0.2) 42%,
    transparent 68%
  );
}

.egg-container.egg-container--golden .egg-body {
  background: radial-gradient(circle at 32% 24%, #fffef5 0%, #ffe066 32%, #e6a800 58%, #a67c00 100%);
  box-shadow:
    inset -12px -10px 26px rgba(100, 65, 15, 0.32),
    inset 8px 12px 22px rgba(255, 255, 255, 0.48),
    0 18px 36px var(--shadow),
    0 0 26px rgba(255, 200, 80, 0.38);
}

.egg-container.egg-container--golden .egg-speckle {
  background: rgba(110, 72, 18, 0.3);
}

.egg-container.egg-container--golden .egg-shine {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), transparent);
}

.egg-container.egg-container--golden .egg-cracks {
  color: rgba(88, 52, 18, 0.58);
}

.egg-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 140%;
  height: 140%;
  background: radial-gradient(
    circle,
    rgba(216, 243, 220, 0.55) 0%,
    rgba(149, 213, 178, 0.15) 40%,
    transparent 65%
  );
  z-index: 0;
  pointer-events: none;
}

.egg-body {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 32% 24%, #fffcef 0%, #f5e6c8 35%, #e2c9a0 65%, #c4a574 100%);
  box-shadow: inset -14px -10px 28px rgba(90, 60, 30, 0.2), inset 8px 12px 24px rgba(255, 255, 255, 0.45),
    0 18px 36px var(--shadow);
  z-index: 1;
  transform-origin: 50% 60%;
}

.egg-speckle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: rgba(120, 85, 50, 0.22);
  z-index: 2;
  pointer-events: none;
}

.egg-shine {
  position: absolute;
  top: 14%;
  left: 18%;
  width: 38%;
  height: 22%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.65), transparent);
  border-radius: 50%;
  transform: rotate(-18deg);
  z-index: 3;
  pointer-events: none;
}

.egg-cracks {
  position: absolute;
  inset: 8% 12%;
  color: rgba(70, 48, 28, 0.65);
  opacity: 0;
  z-index: 4;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.egg-container.is-hatching .egg-cracks {
  opacity: 1;
}

.crack-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.crack-path {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
}

.egg-container.is-hatching .crack-path {
  animation: crack-draw 1.8s ease forwards;
}

.egg-container.is-hatching .crack-path:nth-child(2) {
  animation-delay: 0.35s;
}

.egg-container.is-hatching .crack-path:nth-child(3) {
  animation-delay: 0.55s;
}

@keyframes egg-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes egg-wobble {
  0% {
    transform: rotate(-2deg) translateY(0);
  }
  25% {
    transform: rotate(3deg) translateY(2px);
  }
  50% {
    transform: rotate(-3deg) translateY(-1px);
  }
  75% {
    transform: rotate(2deg) translateY(1px);
  }
  100% {
    transform: rotate(-2deg) translateY(0);
  }
}

@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes glow-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.35);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2);
  }
}

@keyframes crack-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes egg-burst {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: brightness(1);
  }
  25% {
    transform: scale(1.06) rotate(-3deg);
    filter: brightness(1.25);
  }
  55% {
    transform: scale(0.92) rotate(5deg);
    filter: brightness(1.4);
  }
  100% {
    transform: scale(0) rotate(18deg);
    opacity: 0;
    filter: brightness(1.6);
  }
}

.hatch-result {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.hatch-result[hidden] {
  display: none !important;
}

.hatch-result:not([hidden]) {
  pointer-events: auto;
}

.dino-frame {
  width: min(72vw, 260px);
  aspect-ratio: 1;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 4px solid var(--accent);
  box-shadow: 0 12px 40px var(--shadow), 0 0 0 6px rgba(149, 213, 178, 0.2);
  background: var(--accent-hot);
  animation: dino-pop 0.75s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

.hatch-result[hidden] .dino-frame {
  animation: none;
}

.dino-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dino-name {
  margin: 1rem 0 0.15rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sun);
  text-align: center;
  animation: fade-up 0.5s 0.2s ease both;
}

.dino-variant {
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
  font-weight: 700;
  text-align: center;
  animation: fade-up 0.5s 0.28s ease both;
}

.dino-variant--golden {
  color: #ffd166;
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.45);
}

.dino-variant--silver {
  color: #e9ecef;
  text-shadow: 0 0 10px rgba(233, 236, 239, 0.35);
}

.dino-variant--rainbow {
  background: linear-gradient(90deg, #e63946, #f4a261, #e9c46a, #2a9d8f, #4361ee, #7209b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dino-trait {
  margin: 0;
  font-size: 1rem;
  color: var(--accent);
  text-align: center;
  max-width: 280px;
  line-height: 1.35;
  animation: fade-up 0.5s 0.35s ease both;
}

@keyframes dino-pop {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-8deg);
    filter: blur(8px);
  }
  70% {
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: 45%;
  left: 50%;
  opacity: 0;
  border-radius: 2px;
}

.confetti--on .confetti-piece {
  animation: confetti-burst 1.1s ease-out forwards;
}

@keyframes confetti-burst {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.3);
  }
}

.status {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  font-size: 1rem;
  color: var(--accent-hot);
  text-align: center;
}

.btn-hatch {
  margin-top: 1rem;
  font-family: var(--font);
  font-size: max(1.25rem, 16px);
  font-weight: 700;
  color: var(--bg-deep);
  background: linear-gradient(180deg, var(--accent-hot) 0%, var(--accent) 100%);
  border: none;
  border-radius: 999px;
  padding: 1rem 1.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 6px 0 #40916c, 0 10px 24px var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-hatch:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #40916c, 0 14px 28px var(--shadow);
}

.btn-hatch:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #40916c, 0 6px 16px var(--shadow);
}

.btn-hatch:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 0 #2d6a4f, 0 8px 16px var(--shadow);
}

.btn-hatch__icon {
  width: 1.35rem;
  height: 1.65rem;
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 35% 28%, #fffcef 0%, #e8d4b0 55%, #c4a574 100%);
  box-shadow: inset -2px -2px 4px rgba(90, 60, 30, 0.25);
  flex-shrink: 0;
}

.collection-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.collection-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sun);
}

.collection-count {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(45, 106, 79, 0.6);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.collection-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 540px) {
  .collection-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.collection-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: center;
  cursor: pointer;
  background: rgba(45, 106, 79, 0.45);
  border-radius: 1.15rem;
  overflow: hidden;
  border: 2px solid rgba(149, 213, 178, 0.25);
  box-shadow: 0 6px 16px var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.collection-card:hover {
  transform: translateY(-2px);
  border-color: rgba(149, 213, 178, 0.45);
  box-shadow: 0 10px 24px var(--shadow);
}

.collection-card:focus {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.collection-card:focus:not(:focus-visible) {
  outline: none;
}

.collection-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.collection-card--golden {
  border-color: rgba(255, 209, 102, 0.55);
  box-shadow: 0 6px 20px rgba(255, 209, 102, 0.22), 0 6px 16px var(--shadow);
}

.collection-card--golden:hover {
  border-color: rgba(255, 209, 102, 0.85);
  box-shadow: 0 10px 28px rgba(255, 209, 102, 0.28), 0 10px 24px var(--shadow);
}

.collection-card--silver {
  border-color: rgba(206, 212, 218, 0.55);
  box-shadow: 0 6px 20px rgba(222, 226, 230, 0.14), 0 6px 16px var(--shadow);
}

.collection-card--silver:hover {
  border-color: rgba(233, 236, 239, 0.75);
  box-shadow: 0 10px 28px rgba(222, 226, 230, 0.2), 0 10px 24px var(--shadow);
}

.collection-card--rainbow {
  border-color: rgba(247, 37, 133, 0.55);
  box-shadow: 0 0 22px rgba(247, 37, 133, 0.22), 0 6px 16px var(--shadow);
}

.collection-card--rainbow:hover {
  border-color: rgba(247, 37, 133, 0.85);
  box-shadow: 0 0 28px rgba(247, 37, 133, 0.32), 0 10px 24px var(--shadow);
}

.collection-card__img-wrap {
  aspect-ratio: 1;
  width: 100%;
  background: linear-gradient(145deg, rgba(216, 243, 220, 0.35) 0%, rgba(27, 67, 50, 0.5) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.collection-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.collection-card__caption {
  display: block;
  padding: 0.65rem 0.75rem 0.85rem;
  font-size: max(1rem, 16px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--accent-hot);
}

.dino-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.dino-modal[hidden] {
  display: none !important;
}

.dino-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: rgba(5, 20, 14, 0.82);
  backdrop-filter: blur(6px);
}

.dino-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(165deg, var(--bg-card) 0%, var(--bg-deep) 100%);
  border-radius: 1.25rem;
  border: 2px solid rgba(149, 213, 178, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  padding: 1.25rem 1rem 1.5rem;
  overflow: auto;
}

.dino-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 2px solid rgba(149, 213, 178, 0.4);
  background: rgba(15, 41, 30, 0.85);
  color: var(--sun);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  padding: 0;
  transition: background 0.15s ease, transform 0.12s ease;
}

.dino-modal__close:hover {
  background: rgba(45, 106, 79, 0.95);
}

.dino-modal__close:active {
  transform: scale(0.95);
}

.dino-modal__img-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  max-height: min(72vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(216, 243, 220, 0.2) 0%, transparent 55%),
    linear-gradient(145deg, rgba(27, 67, 50, 0.6) 0%, rgba(15, 41, 30, 0.9) 100%);
  border-radius: 0.85rem;
  padding: 0.75rem;
  margin-top: 0.25rem;
}

.dino-modal__img-wrap img {
  max-width: 100%;
  max-height: min(68vh, 520px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
}

.dino-modal__title {
  margin: 1rem 0 0.35rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  color: var(--sun);
  text-align: center;
}

.dino-modal__variant {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}

.dino-modal__variant--golden {
  color: #ffd166;
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.45);
}

.dino-modal__variant--silver {
  color: #e9ecef;
  text-shadow: 0 0 10px rgba(233, 236, 239, 0.35);
}

.dino-modal__variant--rainbow {
  background: linear-gradient(90deg, #e63946, #f4a261, #e9c46a, #2a9d8f, #4361ee, #7209b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dino-modal__trait {
  margin: 0;
  font-size: 1.05rem;
  color: var(--accent);
  text-align: center;
  line-height: 1.4;
  max-width: 36ch;
}

.dino-modal__delete {
  margin-top: 1.25rem;
  width: 100%;
  max-width: 280px;
  font-family: var(--font);
  font-size: max(0.95rem, 16px);
  font-weight: 600;
  color: #fec5b9;
  background: rgba(231, 111, 81, 0.12);
  border: 2px solid rgba(231, 111, 81, 0.45);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.dino-modal__delete:hover {
  background: rgba(231, 111, 81, 0.22);
  border-color: rgba(244, 162, 97, 0.65);
  color: #ffe4de;
}

.dino-modal__delete:active {
  transform: scale(0.98);
}

.collection-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--accent);
  font-size: 1rem;
  padding: 1.5rem 1rem;
  background: rgba(27, 67, 50, 0.35);
  border-radius: 1rem;
  border: 1px dashed rgba(149, 213, 178, 0.35);
}

.btn-text {
  margin-top: 0.75rem;
  font-family: var(--font);
  font-size: max(0.9rem, 16px);
  color: rgba(241, 250, 238, 0.55);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  width: 100%;
  padding: 0.5rem;
}

.btn-text:hover {
  color: var(--accent);
}

.footer {
  margin-top: auto;
  padding-top: 1.5rem;
  padding-bottom: 0.35rem;
  text-align: center;
}

.footer small {
  font-size: 0.75rem;
  color: rgba(241, 250, 238, 0.4);
}

.app:has(.mode-dock:not(.mode-dock--hidden)) {
  padding-bottom: max(4.25rem, env(safe-area-inset-bottom, 0px));
}

.mode-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem max(0.55rem, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(11, 28, 22, 0.97) 0%, rgba(15, 41, 30, 0.88) 100%);
  border-top: 1px solid rgba(149, 213, 178, 0.28);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.25);
}

.mode-dock.mode-dock--hidden {
  display: none !important;
}

.babe-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  font-family: var(--font);
  font-size: max(0.95rem, 16px);
  font-weight: 600;
  color: var(--accent-hot);
}

.babe-mode-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.babe-mode-toggle__track {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.55);
  border: 2px solid rgba(149, 213, 178, 0.35);
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.babe-mode-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.5rem - 8px);
  height: calc(1.5rem - 8px);
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.babe-mode-toggle input:checked + .babe-mode-toggle__track {
  background: rgba(230, 126, 80, 0.45);
  border-color: rgba(255, 180, 120, 0.55);
}

.babe-mode-toggle input:checked + .babe-mode-toggle__track .babe-mode-toggle__thumb {
  transform: translateX(1.25rem);
}

.babe-mode-toggle input:focus-visible + .babe-mode-toggle__track {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.mode-dock__hint {
  margin: 0;
  max-width: 22rem;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(241, 250, 238, 0.45);
  font-weight: 500;
}

body.pwa-install-banner-visible .app:has(.mode-dock:not(.mode-dock--hidden)) {
  padding-bottom: calc(max(4.25rem, env(safe-area-inset-bottom, 0px)) + 4.5rem);
}

/* Mobile “add to home screen” banner */
@media (min-width: 641px) {
  .pwa-install-banner {
    display: none !important;
  }
}

body.pwa-install-banner-visible .app {
  padding-bottom: 5.5rem;
}

.pwa-install-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4000;
  padding: 0.65rem 0.75rem max(0.65rem, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(15, 41, 30, 0.92) 0%, rgba(11, 28, 22, 0.98) 100%);
  border-top: 2px solid rgba(149, 213, 178, 0.35);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

.pwa-install-banner[hidden] {
  display: none !important;
}

.pwa-install-banner__inner {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pwa-install-banner__copy {
  flex: 1;
  min-width: 0;
}

.pwa-install-banner__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--sun);
  line-height: 1.3;
}

.pwa-install-banner__sub {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.35;
}

.pwa-install-banner__sub[hidden] {
  display: none !important;
}

.pwa-install-banner__add {
  flex-shrink: 0;
  font-family: var(--font);
  font-size: max(0.82rem, 16px);
  font-weight: 700;
  color: var(--bg-deep);
  padding: 0.55rem 0.85rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--accent-hot) 0%, var(--accent) 100%);
  box-shadow: 0 3px 0 #40916c;
  white-space: nowrap;
}

.pwa-install-banner__add:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #40916c;
}

.pwa-install-banner__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--accent);
  background: rgba(149, 213, 178, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-install-banner__close:hover {
  background: rgba(149, 213, 178, 0.22);
  color: var(--sun);
}
