/* V4 additions: phone, call ring, paper reader and car HUD. Uses the palette and fonts from app.css. */
.phone-btn {
  position: absolute; left: 14px; bottom: 14px; z-index: 6;
  font: 700 0.95rem "Cairo", system-ui, sans-serif; color: #172a32; background: #f7f2e8;
  border: 0; border-radius: 999px; padding: 9px 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); cursor: pointer;
}
.phone-btn:focus-visible { outline: 3px solid #d7b655; outline-offset: 3px; }
.car-hud {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6;
  display: flex; gap: 14px; align-items: center; background: rgba(23, 42, 50, 0.86); color: #f7f2e8;
  border-radius: 14px; padding: 9px 16px; font: 600 0.9rem "Cairo", system-ui, sans-serif;
}
.car-hud[hidden] { display: none; }
.car-speed { font-weight: 700; color: #d7b655; min-width: 6.5em; text-align: center; }
.car-keys { opacity: 0.9; }
.ring {
  position: fixed; inset: auto 0 18vh 0; z-index: 30; display: flex; justify-content: center; padding: 0 16px; pointer-events: none;
}
.ring[hidden] { display: none; }
.ring-card {
  pointer-events: auto; width: min(380px, 92vw); background: #fffdf8; color: #172a32; border-radius: 22px;
  padding: 18px 20px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); border: 2px solid #167c78;
  animation: ring-glow 1.4s ease-in-out infinite;
}
/* The pulse changes only the glow, so the buttons never move under the player's pointer. */
@keyframes ring-glow {
  0%, 100% { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(22, 124, 120, 0.0); }
  50% { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 0 8px rgba(22, 124, 120, 0.25); }
}
@media (prefers-reduced-motion: reduce) { .ring-card { animation: none; } }
.ring-caller { margin: 0; font: 600 0.85rem "Cairo", system-ui, sans-serif; color: #167c78; }
.ring-text { margin: 4px 0 12px; font: 700 1.1rem "Cairo", system-ui, sans-serif; }
.ring-actions { display: flex; gap: 10px; justify-content: flex-start; }
.ring-actions button { min-width: 96px; }
.phone-panel, .reader-panel { width: min(460px, 92vw); max-height: 86vh; overflow: auto; }
.phone-msg { min-height: 3em; font: 600 1rem "Cairo", system-ui, sans-serif; color: #172a32; background: #f3ecdd; border-radius: 12px; padding: 10px 12px; }
.phone-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.phone-list li { background: #ffffff; border: 1px solid #e0d8c7; border-radius: 12px; padding: 9px 11px; font: 500 0.95rem "Cairo", system-ui, sans-serif; color: #172a32; }
.phone-list li.missed { border-color: #f36149; }
.phone-list .tag { display: inline-block; margin-inline-end: 8px; font-weight: 700; color: #167c78; font-size: 0.8rem; }
.phone-list li.missed .tag { color: #f36149; }
.reader-body { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.reader-body li { font: 700 1.25rem "Cairo", system-ui, sans-serif; color: #172a32; background: #fffdf8; border-inline-start: 6px solid #d7b655; padding: 10px 14px; border-radius: 10px; }

/* Side invitation card: a dock at the screen edge. Play continues while it is open. */
.invite-dock {
  position: fixed; right: 12px; top: 50%; transform: translateY(-50%); z-index: 8; width: 172px;
  background: rgba(255, 253, 248, 0.97); border-radius: 18px; padding: 10px; border: 2px solid #d7b655;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35); display: grid; gap: 8px;
  font: 600 0.85rem "Cairo", system-ui, sans-serif; color: #172a32;
}
.invite-dock[hidden] { display: none; }
.invite-dock-title { margin: 0; text-align: center; font-weight: 700; }
.invite-dock img { width: 100%; height: auto; border-radius: 10px; display: block; background: #0e4f4c; }
.invite-dock-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.invite-dock-actions button {
  font: 700 0.85rem "Cairo", system-ui, sans-serif; padding: 7px 4px; border-radius: 10px;
  border: 1px solid #167c78; background: #ffffff; color: #167c78; cursor: pointer;
}
.invite-dock-actions button.primary { background: #167c78; color: #ffffff; }
.invite-dock-actions .wide { grid-column: 1 / -1; }
.invite-btn {
  position: absolute; right: 14px; bottom: 14px; z-index: 6; font: 700 0.95rem "Cairo", system-ui, sans-serif;
  color: #172a32; background: #d7b655; border: 0; border-radius: 999px; padding: 9px 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); cursor: pointer;
}
.invite-btn[hidden] { display: none; }
.invite-btn:focus-visible, .invite-dock button:focus-visible { outline: 3px solid #d7b655; outline-offset: 2px; }

/* Kitchen talk (R4 gate 8) */
.talk-panel { width: min(500px, 94vw); max-height: 86vh; overflow: auto; display: grid; gap: 12px; }
.talk-speaker { margin: 0; font: 800 1.1rem "Cairo", system-ui, sans-serif; color: #6b3f52; }
.talk-line { margin: 0; font: 700 1.2rem/1.7 "Cairo", system-ui, sans-serif; color: #172a32; background: #fffdf8; border-inline-start: 6px solid #7a4e62; padding: 10px 14px; border-radius: 10px; }
.talk-choices { display: grid; gap: 8px; }
.talk-choice { text-align: start; font: 700 1rem "Cairo", system-ui, sans-serif; padding: 10px 14px; border-radius: 10px; border: 1px solid #c9b48a; background: #f7f1e3; color: #172a32; cursor: pointer; }
.talk-choice:disabled { opacity: 0.5; cursor: not-allowed; }
.talk-offer { background: #e6f0ea; border-color: #5e8c6a; }
.talk-quest { background: #f3f7f4; border-radius: 10px; padding: 10px 14px; }
.talk-quest p { margin: 0 0 10px; font: 600 1rem/1.6 "Cairo", system-ui, sans-serif; }
.talk-quest-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Close look at the father's phone or the QR board (R4 gate 9) */
.inspect-panel { width: min(520px, 94vw); max-height: 92vh; display: grid; gap: 10px; }
.inspect-view { max-height: 62vh; overflow: auto; background: #10161a; border-radius: 12px; text-align: center; }
.inspect-view img { width: 100%; height: auto; display: block; margin: 0 auto; }
.inspect-note { margin: 0; font: 600 0.95rem/1.6 "Cairo", system-ui, sans-serif; color: #172a32; }
.inspect-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inspect-tools button { min-width: 44px; min-height: 44px; font: 800 1.3rem "Cairo", system-ui, sans-serif; border-radius: 10px; border: 1px solid #c9b48a; background: #f7f1e3; }
.inspect-link { margin-inline-start: auto; font: 700 1rem "Cairo", system-ui, sans-serif; color: #1d4e5c; }

/* A child's short line in the back yard: shown over the play for a few seconds, never stops the player (gate 10). */
.bubble {
  position: absolute; top: 172px; left: 50%; transform: translateX(-50%); max-width: min(86vw, 460px); text-align: center;
  background: rgba(240, 250, 255, 0.95); color: var(--ink); padding: 10px 16px; border-radius: 16px; box-shadow: var(--shadow);
  line-height: 1.5; border-bottom: 4px solid #2f8fc4; pointer-events: none; display: grid; gap: 2px;
}
.bubble-who { font-size: 0.85rem; color: #2f6f96; }
.bubble-line { font-weight: 600; }
