/* escape.css — Sarah & Sophia: ESCAPE BOARD (iPad Pro Central + 3 iPhones) */
:root {
  --esc-blue: #2563eb;
  --esc-blue-bright: #60a5fa;
  --esc-blue-bg: rgba(37, 99, 235, 0.16);
  --esc-red: #dc2626;
  --esc-red-bright: #f87171;
  --esc-red-bg: rgba(220, 38, 38, 0.16);
  --esc-gold: #eab308;
  --esc-gold-bright: #fde047;
  --esc-uv: #a855f7;
  --esc-uv-glow: #38bdf8;
  --esc-green: #10b981;
}

/* Role-based language visibility: Daughter sees 100% Japanese! */
body[data-esc-role="filha"] .pt-only {
  display: none !important;
}
body:not([data-esc-role="filha"]) .ja-filha-only {
  display: none !important;
}

/* Top Device Role Switcher (4 Modes: iPad + 3 iPhones) */
.esc-role-bar {
  background: linear-gradient(135deg, #0d1629 0%, #16223d 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.esc-role-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
@media (max-width: 900px) {
  .esc-role-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.esc-role-btn {
  background: #0b1222;
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.esc-role-btn small {
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
}
.esc-role-btn:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}
.esc-role-btn.active[data-role="ipad"] {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.35);
}
.esc-role-btn.active[data-role="filha"] {
  background: rgba(59, 130, 246, 0.24);
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.45);
}
.esc-role-btn.active[data-role="mae"] {
  background: rgba(229, 83, 83, 0.24);
  border-color: #f87171;
  color: #fff;
  box-shadow: 0 0 16px rgba(229, 83, 83, 0.4);
}
.esc-role-btn.active[data-role="pai"] {
  background: rgba(16, 185, 129, 0.22);
  border-color: #34d399;
  color: #fff;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

/* Room Sync + Timer Header Bar */
.esc-hud-bar {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.1fr;
  gap: 12px;
  align-items: center;
  background: #0a101f;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
@media (max-width: 860px) {
  .esc-hud-bar {
    grid-template-columns: 1fr;
  }
}
.esc-timer-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #060a14;
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 8px 14px;
}
.esc-timer-digits {
  font-family: "SF Mono", "JetBrains Mono", "Courier New", monospace;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--gold);
}
.esc-timer-digits.penalty-flash {
  color: #ff4444;
  animation: escShake 0.45s ease;
}
@keyframes escShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* iPad Wide Dashboard Layout */
.esc-ipad-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .esc-ipad-grid {
    grid-template-columns: 1fr;
  }
}

/* Interactive Escape Room Map Stage */
.esc-map-wrap {
  background: #090f1d;
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.esc-map-stage {
  position: relative;
  width: 100%;
  background: #050811;
}
.esc-map-stage img {
  width: 100%;
  display: block;
  max-height: 460px;
  object-fit: cover;
  transition: filter 0.3s ease;
}
body.uv-mode-on .esc-map-stage img {
  filter: hue-rotate(230deg) saturate(1.8) brightness(0.85) contrast(1.25);
}
.esc-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%);
  color: #000;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 5;
}
.esc-pin:hover, .esc-pin.active {
  transform: translate(-50%, -50%) scale(1.16);
  box-shadow: 0 0 18px #fde047;
}
.esc-pin.seen {
  border-color: #34d399;
}
.esc-pin-inspector {
  padding: 14px 16px;
  background: #10192e;
  border-top: 1px solid var(--border);
}

/* Unlock! Card Combiner Machine */
.esc-combiner-card {
  background: linear-gradient(145deg, #111c35 0%, #0c1426 100%);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.esc-combo-slots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.esc-slot-box {
  min-width: 92px;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: center;
  font-weight: 900;
  font-size: 20px;
}
.esc-slot-box.blue {
  background: var(--esc-blue-bg);
  border: 2px solid var(--esc-blue-bright);
  color: #93c5fd;
}
.esc-slot-box.red {
  background: var(--esc-red-bg);
  border: 2px solid var(--esc-red-bright);
  color: #fca5a5;
}
.esc-slot-box.sum {
  background: rgba(234, 179, 8, 0.18);
  border: 2px solid var(--esc-gold-bright);
  color: var(--esc-gold-bright);
}
.esc-slot-op {
  font-size: 22px;
  font-weight: 900;
  color: var(--muted);
}

/* Blue & Red Playing Cards (Unlock! Style) */
.esc-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.esc-play-card {
  border-radius: 12px;
  padding: 15px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.esc-play-card.blue-card {
  background: linear-gradient(160deg, #0f2447 0%, #0a162e 100%);
  border: 2px solid #3b82f6;
}
.esc-play-card.red-card {
  background: linear-gradient(160deg, #3b1219 0%, #220a10 100%);
  border: 2px solid #ef4444;
}
.esc-play-card.selected-card {
  transform: translateY(-3px);
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.65);
  border-color: var(--esc-gold-bright) !important;
}
.esc-card-num-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  font-size: 16px;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.blue-card .esc-card-num-badge {
  background: #2563eb;
  color: #fff;
}
.red-card .esc-card-num-badge {
  background: #dc2626;
  color: #fff;
}

/* Daughter's UV Blacklight Flashlight & Secret Ink */
.esc-uv-toggle-btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid #a855f7;
  background: linear-gradient(135deg, #2e1065 0%, #4c1d95 100%);
  color: #f3e8ff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.4);
  transition: all 0.2s ease;
  margin-bottom: 14px;
}
.esc-uv-toggle-btn.uv-on {
  background: linear-gradient(135deg, #7e22ce 0%, #0284c7 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.85), 0 0 50px rgba(168, 85, 247, 0.65);
}
.esc-uv-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(88, 28, 135, 0.35);
  border: 1px dashed #c084fc;
  color: #67e8f9;
  font-weight: 800;
  font-size: 13.5px;
  white-space: pre-line;
  text-shadow: 0 0 8px rgba(103, 232, 249, 0.6);
  display: none;
}
body.uv-mode-on .esc-uv-box {
  display: block;
  animation: uvPulse 1.8s infinite alternate;
}
@keyframes uvPulse {
  from { box-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }
  to { box-shadow: 0 0 18px rgba(56, 189, 248, 0.75); }
}

/* Exit: The Game 3-Ring Concentric Safe */
.esc-safe-card {
  background: linear-gradient(145deg, #131c31 0%, #090e1a 100%);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 16px;
}
.esc-rings-visual {
  position: relative;
  width: 250px;
  height: 250px;
  margin: 14px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.esc-ring-circle {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  font-weight: 900;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}
.esc-ring-circle.r1 {
  width: 244px;
  height: 244px;
  border: 6px solid #3b82f6;
  background: radial-gradient(circle, transparent 58%, rgba(59, 130, 246, 0.22) 60%);
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.35);
}
.esc-ring-circle.r2 {
  width: 176px;
  height: 176px;
  border: 6px solid #ef4444;
  background: radial-gradient(circle, transparent 54%, rgba(239, 68, 68, 0.22) 56%);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.35);
}
.esc-ring-circle.r3 {
  width: 110px;
  height: 110px;
  border: 6px solid #10b981;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.4) 100%);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}
.esc-ring-badge {
  background: #090e1a;
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.esc-ring-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
.esc-ring-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #0b1324;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.esc-ring-row.r1-row { border-left: 4px solid #3b82f6; }
.esc-ring-row.r2-row { border-left: 4px solid #ef4444; }
.esc-ring-row.r3-row { border-left: 4px solid #10b981; }

/* Decoder Table for Mom */
.esc-decoder-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13.5px;
}
.esc-decoder-table th, .esc-decoder-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.esc-decoder-table th {
  background: #0d172a;
  color: var(--gold);
}

/* Victory Modal / Banner */
.esc-victory-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(212, 175, 55, 0.22));
  border: 2px solid #34d399;
  border-radius: 14px;
  padding: 22px;
  margin: 18px 0;
  text-align: center;
  box-shadow: 0 0 32px rgba(16, 185, 129, 0.35);
}

/* Printable A4 Kit */
.esc-print-only {
  display: none;
}
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }
  .topbar, .no-print, .esc-role-bar, .esc-hud-bar, #esc-live-views {
    display: none !important;
  }
  .esc-print-only {
    display: block !important;
  }
  .print-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .print-card {
    border: 1.5px solid #222;
    border-radius: 6px;
    padding: 8px;
    page-break-inside: avoid;
    margin-bottom: 8px;
  }
}
