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

body {
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Loading Screen ─────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: #fff;
  font-family: system-ui, -apple-system, sans-serif;
}

#loading-screen.hidden {
  display: none;
}

#loading-screen h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

#loading-bar-container {
  width: 300px;
  height: 20px;
  background: #2a2a4e;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}

#loading-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4facfe, #00f2fe);
  border-radius: 10px;
  transition: width 0.3s ease;
}

#loading-status {
  font-size: 1rem;
  opacity: 0.7;
}

/* ── Intro Overlay ──────────────────────────────────────────── */
#intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9998;
  cursor: pointer;
}

/* Skip intro button — small play icon, bottom-right */
#skip-intro-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  padding-left: 4px; /* optical center for ▶ */
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  z-index: 9999;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#skip-intro-btn:hover,
#skip-intro-btn:active {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
  transform: scale(1.1);
}

#intro-overlay.active {
  display: flex;
}

#intro-photo {
  height: 400px;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  border-radius: 20px;
  pointer-events: none;
}

/* Pulsating glow to attract child's attention */
#intro-photo.pulsate {
  animation: introPulsate 1.8s ease-in-out infinite;
}

@keyframes introPulsate {
  0%   { filter: drop-shadow(0 0 8px rgba(79, 172, 254, 0.3)) brightness(0.85); transform: scale(1); }
  50%  { filter: drop-shadow(0 0 40px rgba(79, 172, 254, 0.9)) drop-shadow(0 0 80px rgba(0, 242, 254, 0.5)) brightness(1.1); transform: scale(1.04); }
  100% { filter: drop-shadow(0 0 8px rgba(79, 172, 254, 0.3)) brightness(0.85); transform: scale(1); }
}

/* Gentle side-to-side rocking while audio plays */
#intro-photo.rocking {
  animation: introRock 2.5s ease-in-out infinite;
  filter: brightness(1);
}

@keyframes introRock {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(3deg); }
  50%  { transform: rotate(0deg); }
  75%  { transform: rotate(-3deg); }
  100% { transform: rotate(0deg); }
}

/* Static — no animation */
#intro-photo.static {
  animation: none;
  filter: brightness(1);
}

/* Intro home.png — warm golden glow to invite a tap */
#intro-photo.home-pulsate {
  height: 220px;
  animation: homePulsate 2s ease-in-out infinite;
  border-radius: 50%;
}

@keyframes homePulsate {
  0%   { filter: drop-shadow(0 0 10px rgba(255, 200, 50, 0.4)) brightness(0.9); transform: scale(1); }
  50%  { filter: drop-shadow(0 0 50px rgba(255, 200, 50, 1)) drop-shadow(0 0 100px rgba(255, 160, 0, 0.6)) brightness(1.2); transform: scale(1.08); }
  100% { filter: drop-shadow(0 0 10px rgba(255, 200, 50, 0.4)) brightness(0.9); transform: scale(1); }
}

/* ── Game Container ─────────────────────────────────────────── */
#game-container {
  position: relative;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  display: none;
  background: #000;
}

#game-container.active {
  display: block;
}

#game-container img {
  display: block;
}

/* ── Background layer ───────────────────────────────────────── */
#bg-base {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 720px;
  object-fit: contain;
  z-index: 0;
}

/* ── BG overlay quarters ────────────────────────────────────── */
.bg-overlay {
  position: absolute;
  width: 640px;
  height: 360px;
  object-fit: fill;
  opacity: 1;
  pointer-events: none;
}

.bg-overlay.revealing {
  animation: bgReveal 5s ease forwards;
}

@keyframes bgReveal {
  0%   { opacity: 1; }
  30%  { opacity: 0; }
  70%  { opacity: 0; }
  100% { opacity: 0.8; }
}

.bg-overlay.completed {
  opacity: 0.8;
}

#bg1 { top: 0;     left: 0;    z-index: 1; }
#bg2 { top: 0;     left: 640px; z-index: 1; }
#bg3 { top: 360px; left: 640px; z-index: 1; }
#bg4 { top: 360px; left: 0;    z-index: 1; }

/* ── Draggable sprites (space objects) ──────────────────────── */
.sprite {
  position: absolute;
  cursor: grab;
  touch-action: none;
  transform: translate(-50%, -50%);
}

.sprite.dragging {
  cursor: grabbing;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.sprite img {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── Family member photo ────────────────────────────────────── */
.family-member {
  position: absolute;
  cursor: grab;
  touch-action: none;
  transform: translate(-50%, -50%);
}

.family-member.dragging {
  cursor: grabbing;
  filter: drop-shadow(0 0 12px rgba(79, 172, 254, 0.8));
}

.family-member img {
  height: 100px;
  width: auto;
  max-width: none;
  pointer-events: none;
}

/* ── Home target ─────────────────────────────────────────────── */
#home-target {
  position: absolute;
  cursor: default;
  touch-action: none;
  transform: translate(-50%, -50%);
  z-index: 500;
  transition: transform 0.3s ease, filter 0.3s ease;
}

#home-target img {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#home-target.glow {
  filter: drop-shadow(0 0 20px rgba(0, 242, 254, 0.9));
  transform: translate(-50%, -50%) scale(1.15);
}

#home-target.pulsate {
  animation: homePulsate 1.8s ease-in-out infinite;
}

@keyframes homePulsate {
  0%   { filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.3)); transform: translate(-50%, -50%) scale(1); }
  50%  { filter: drop-shadow(0 0 25px rgba(0, 242, 254, 0.8)); transform: translate(-50%, -50%) scale(1.1); }
  100% { filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.3)); transform: translate(-50%, -50%) scale(1); }
}

/* ── Post-Game Reveal ───────────────────────────────────────── */
#post-game-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9999;
  display: none;
  font-family: system-ui, -apple-system, sans-serif;
  color: #fff;
  overflow: hidden;
}
#post-game-overlay.active {
  display: block;
}

/* Coloring page wrapper with narrow black border */
#pg-coloring-page-wrapper {
  position: absolute;
  top: 26px;
  left: 15px;
  width: 1000px;
  height: 667px;
  z-index: 1;
  border: 2px solid #000;
}

#pg-coloring-page {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Canvas exactly overlays the coloring page */
#pg-draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1000px;
  height: 667px;
  display: none;
  touch-action: none;
  cursor: crosshair;
  z-index: 10;
}
#pg-draw-canvas.active {
  display: block;
}

/* Grandparent photo container - positioned over coloring page */
#pg-photos {
  position: absolute;
  top: 26px;
  left: 15px;
  width: 1000px;
  height: 667px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#pg-photos.hidden { display: none; }

.pg-photo {
  max-height: 400px;
  width: auto;
  border-radius: 16px;
  object-fit: contain;
  cursor: pointer;
  pointer-events: auto;
}
.pg-photo.pulsate {
  animation: introPulsate 1.8s ease-in-out infinite;
}
.pg-photo.rocking {
  animation: introRock 2.5s ease-in-out infinite;
  filter: brightness(1);
}

/* Drawing UI - crayons and send button */
#pg-drawing-ui {
  display: none;
}
#pg-drawing-ui.active {
  display: block;
}

.pg-crayon {
  position: absolute;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pg-crayon:hover {
  opacity: 0.8;
}
.pg-crayon.pulsate {
  animation: introPulsate 1.8s ease-in-out infinite;
}
.pg-crayon.selected {
  opacity: 1;
  transform: scale(1.1);
}

#pg-crayon-red {
  top: 30px;
  left: 1040px;
  width: 200px;
  height: 51px;
  z-index: 11;
}

#pg-crayon-blue {
  top: 90px;
  left: 1040px;
  width: 200px;
  height: 51px;
  z-index: 11;
}

.pg-btn-send-drawing {
  position: absolute;
  top: 206px;
  left: 1073px;
  width: 149px;
  height: 294px;
  z-index: 12;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}
.pg-btn-send-drawing img {
  width: 100%;
  height: 100%;
  display: block;
}
.pg-btn-send-drawing:disabled,
.pg-btn-send-drawing.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.pg-btn-send-drawing.active:not(:disabled):not(.disabled) {
  opacity: 1;
}
.pg-btn-send-drawing.pulsate {
  animation: introPulsate 1.8s ease-in-out infinite;
}
.pg-btn-send-drawing:active:not(:disabled):not(.disabled) {
  transform: scale(0.95);
}

/* Audio UI - record button */
#pg-audio-ui {
  display: none;
}
#pg-audio-ui.active {
  display: block;
}

/* Large red record button — positioned where crayons are in drawing scene */
.pg-btn-record {
  position: absolute;
  top: 25px;
  left: 1085px;
  width: 110px;
  height: 110px;
  z-index: 13;
  padding: 0;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #cc0000;
  color: #fff;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(204, 0, 0, 0.5);
}
.pg-btn-record.pulsate {
  animation: introPulsate 1.8s ease-in-out infinite;
}
.pg-btn-record.recording {
  animation: mic-pulse 1s ease-in-out infinite;
  background: #ff2222;
  box-shadow: 0 4px 30px rgba(255, 34, 34, 0.8);
}
.pg-btn-record:active {
  transform: scale(0.92);
}

/* Send audio button — same layout as drawing send button */
.pg-btn-send-audio {
  position: absolute;
  top: 206px;
  left: 1073px;
  width: 149px;
  height: 294px;
  z-index: 12;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.3s ease;
  display: none; /* hidden until recording is done */
}
.pg-btn-send-audio img {
  width: 100%;
  height: 100%;
  display: block;
}
.pg-btn-send-audio:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pg-btn-send-audio.active:not(:disabled) {
  display: block;
  opacity: 1;
}
.pg-btn-send-audio.pulsate {
  animation: introPulsate 1.8s ease-in-out infinite;
}
.pg-btn-send-audio:active:not(:disabled) {
  transform: scale(0.95);
}

#pg-recording-status {
  position: absolute;
  top: 520px;
  left: 1040px;
  width: 200px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  z-index: 13;
}

@keyframes mic-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.2); }
}

/* Print UI container */
#pg-print-ui {
  display: none;
}
#pg-print-ui.active {
  display: block;
}

/* ── Demo-only screens ─────────────────────────────────────────── */
#demo-start-screen {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(11, 16, 38, 0.62);
  font-family: system-ui, -apple-system, sans-serif;
}
#demo-start-screen.active {
  display: flex;
}
.demo-start-inner {
  text-align: center;
  padding: 0 80px;
}
.demo-start-text {
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  margin: 0 0 48px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}
.demo-highlight {
  color: #ffd23f;
}
#demo-start-btn {
  font-size: 3rem;
  font-weight: 800;
  padding: 30px 90px;
  border-radius: 22px;
  border: 5px solid #fff;
  background: #ffd23f;
  color: #1a1a2e;
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(255, 210, 63, 0.55);
}
#demo-start-btn:active {
  transform: scale(0.95);
}

#demo-capture-screen {
  position: absolute;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(11, 16, 38, 0.96);
  font-family: system-ui, -apple-system, sans-serif;
  padding: 0 100px;
}
#demo-capture-screen.active {
  display: flex;
}
#demo-capture-btn {
  width: 1400px;
  max-width: 92%;
  padding: 60px 70px;
  border-radius: 30px;
  border: 8px solid #ffd23f;
  background: linear-gradient(150deg, #7c3aed, #a855f7);
  color: #fff;
  font-family: inherit;
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: 0 16px 60px rgba(124, 58, 237, 0.65);
}
#demo-capture-btn:active {
  transform: scale(0.97);
}
#demo-capture-form {
  width: 100%;
  max-width: 1100px;
  text-align: center;
}
.demo-capture-text {
  font-size: 2.2rem;
  line-height: 1.5;
  color: #fff;
  margin: 0 0 46px;
}
#demo-email-input {
  width: 100%;
  max-width: 760px;
  padding: 26px 30px;
  font-size: 2.2rem;
  border-radius: 16px;
  border: 4px solid #ffd23f;
  outline: none;
  display: block;
  margin: 0 auto 30px;
}
#demo-email-submit {
  padding: 26px 70px;
  border-radius: 16px;
  border: none;
  background: #ffd23f;
  color: #1a1a2e;
  font-size: 2.4rem;
  font-weight: 800;
  cursor: pointer;
}
#demo-email-submit:disabled {
  opacity: 0.5;
  cursor: default;
}
#demo-capture-msg {
  margin-top: 26px;
  font-size: 2rem;
  color: #fff;
  line-height: 1.5;
}
#demo-capture-msg .demo-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3rem;
  font-weight: 800;
  color: #ffd23f;
  letter-spacing: 4px;
}

/* Generic hidden helper (safe for every element using .hidden) */
.hidden {
  display: none !important;
}

/* Print choice - two pictures (original + drawn-on) side by side */
#pg-print-choice {
  position: absolute;
  top: 170px;
  left: 890px;
  z-index: 15;
  display: none;
  gap: 26px;
}
#pg-print-choice.visible {
  display: flex;
}
.print-choice-tile {
  width: 300px;
  background: rgba(255, 255, 255, 0.94);
  border: 4px solid #ffd23f;
  border-radius: 16px;
  padding: 12px 12px 8px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease;
}
.print-choice-tile:active {
  transform: scale(0.94);
}
.print-choice-tile img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  display: block;
}
.print-choice-label {
  margin-top: 8px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
}

/* Print icon - pulsates to attract attention */
#pg-print-icon {
  position: absolute;
  top: 200px;
  left: 1070px;
  width: 150px;
  height: 150px;
  z-index: 15;
  cursor: pointer;
  display: none;
  transition: transform 0.15s ease;
}
#pg-print-icon.visible {
  display: block;
}
#pg-print-icon.pulsate {
  display: block;
  animation: printPulsate 1.8s ease-in-out infinite;
}
#pg-print-icon:active {
  transform: scale(0.92);
}

@keyframes printPulsate {
  0%   { filter: drop-shadow(0 0 8px rgba(255, 200, 50, 0.3)) brightness(0.85); transform: scale(1); }
  50%  { filter: drop-shadow(0 0 40px rgba(255, 200, 50, 0.9)) drop-shadow(0 0 80px rgba(255, 160, 0, 0.5)) brightness(1.15); transform: scale(1.08); }
  100% { filter: drop-shadow(0 0 8px rgba(255, 200, 50, 0.3)) brightness(0.85); transform: scale(1); }
}

/* Subtle play-again button — doesn't draw attention */
#pg-play-again-btn {
  position: absolute;
  bottom: 20px;
  right: 15px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  padding-left: 4px;
  z-index: 16;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
#pg-play-again-btn.visible {
  display: flex;
}
#pg-play-again-btn:hover,
#pg-play-again-btn:active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.7);
  transform: scale(1.1);
}

/* Base button styles */
.pg-btn {
  font-size: 1.3rem;
  padding: 14px 28px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pg-btn:active { transform: scale(0.95); }

/* ── Consent Modal ──────────────────────────────────────────── */
#consent-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 99999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, sans-serif;
  color: #fff;
}
#consent-modal.active { display: flex; }

#consent-modal-box {
  background: #1e1e3a;
  border-radius: 20px;
  padding: 30px;
  max-width: 420px;
  width: 90vw;
  text-align: center;
}

#consent-modal-box h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

#consent-modal-box p {
  font-size: 1rem;
  margin-bottom: 20px;
  opacity: 0.85;
  line-height: 1.5;
}

#consent-modal-box label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  text-align: left;
  margin-bottom: 20px;
  cursor: pointer;
  line-height: 1.4;
}

#consent-modal-box input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #4facfe;
}

#consent-confirm-btn {
  font-size: 1.1rem;
  padding: 12px 30px;
  border: none;
  border-radius: 12px;
  background: #4facfe;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
#consent-confirm-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#consent-cancel-btn {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  font-family: system-ui, -apple-system, sans-serif;
}
#consent-cancel-btn:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* ── Print-only stylesheet ─────────────────────────────────── */
@media print {
  body * { visibility: hidden !important; }
  #print-frame,
  #print-frame * { visibility: visible !important; }
  #print-frame {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

#install-screen {
  position: fixed;
  inset: 0;
  /* Above rotate overlay so install/skip stay clickable in portrait on phones */
  z-index: 100000;
  background: #1a1a2e;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#install-box {
  background: #2d2d5e;
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  color: #e0e0ff;
  font-family: system-ui, -apple-system, sans-serif;
  /* margin auto keeps it vertically centred when it fits,
     and lets it scroll from the top when taller than the viewport */
  margin: auto;
}

/* Compact layout for short screens (phones in landscape) */
@media (max-height: 500px) {
  #install-box {
    padding: 16px 20px;
  }
  #install-icon {
    font-size: 32px;
    margin-bottom: 6px;
  }
  #install-title {
    font-size: 18px;
    margin-bottom: 8px;
  }
  #install-body {
    font-size: 13px;
    margin-bottom: 12px;
  }
  #install-btn {
    padding: 10px 24px;
    font-size: 16px;
    margin-bottom: 8px;
  }
  #install-ios-steps {
    font-size: 12px;
    margin-bottom: 10px;
  }
}

#install-icon {
  font-size: 64px;
  margin-bottom: 12px;
}

#install-title {
  font-size: 24px;
  margin-bottom: 16px;
  color: #fff;
}

#install-body {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
  text-align: left;
}

#install-body ol {
  margin: 12px 0 0 20px;
  padding: 0;
}

#install-body li {
  margin-bottom: 8px;
}

.ios-share-icon {
  display: inline-block;
  vertical-align: middle;
  font-size: 18px;
}

#install-btn {
  display: inline-block;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.2s;
}

#install-btn:hover {
  background: #5a52d5;
}

#install-ios-steps {
  text-align: left;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: #c0c0e0;
}

#install-skip-btn {
  background: none;
  border: none;
  color: #8888bb;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}

#install-skip-btn:hover {
  color: #aaaadd;
}

/* ── Rotate Device Overlay ─────────────────────────────────── */

#rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #1a1a2e;
  color: #fff;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  font-family: system-ui, sans-serif;
}

#rotate-overlay.show {
  display: flex;
}

#rotate-icon {
  font-size: 64px;
  animation: rotate-hint 2s ease-in-out infinite;
}

#rotate-overlay p {
  font-size: 24px;
  font-weight: 600;
}

@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}

@media (orientation: portrait) {
  #rotate-overlay {
    display: flex;
  }
}
/* ── Family code entry bar (demo-mode fallback) ─────────────── */
#code-entry-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(26, 26, 46, 0.94);
  border-top: 2px solid #6c63ff;
  font-family: system-ui, -apple-system, sans-serif;
}

#code-entry-bar .code-entry-label {
  color: #e0e0ff;
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

#code-entry-input {
  flex: 0 1 180px;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid #6c63ff;
  background: #fff;
  color: #1a1a2e;
  font-size: 16px;
  font-family: monospace;
  letter-spacing: 1px;
}

#code-entry-go {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: #6c63ff;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* Loading aliases (test build uses loading-bar/loading-status ids) */
#loading-bar {
  width: 0%; height: 100%; background: #7c3aed; transition: width 0.3s ease;
}
#loading-status { font-size: 14px; color: #aaa; }
.demo-highlight { color: #ffd23f; }
