
/* ========== DARK ESCAPE ROOM · CORRIDOR & UNLOCK ========== */

.glass-panel-dark {
  background: rgba(6, 8, 14, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 12px 40px rgba(0, 0, 0, 0.6);
}

.corridor-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.corridor-doors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.corridor-doors.static .corridor-door {
  pointer-events: none;
}

.corridor-door {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.4s ease;
}

.door-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  min-height: 88px;
  background: linear-gradient(180deg, #1a1a22 0%, #0c0c10 100%);
  border: 2px solid #2a2a35;
  border-radius: 10px;
  gap: 4px;
}

.corridor-door.locked .door-face {
  opacity: 0.45;
  border-color: #1f1f28;
}

.corridor-door.locked .door-face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(0, 0, 0, 0.15) 4px,
    rgba(0, 0, 0, 0.15) 8px
  );
  pointer-events: none;
}

.corridor-door.current .door-face {
  border-color: var(--accent, #f5a623);
  box-shadow: 0 0 24px var(--accent-glow, rgba(245, 166, 35, 0.25)), inset 0 0 20px rgba(0, 0, 0, 0.5);
  animation: door-pulse 2.5s ease infinite;
}

@keyframes door-pulse {
  0%, 100% { box-shadow: 0 0 16px var(--accent-glow); }
  50% { box-shadow: 0 0 28px var(--accent-glow), 0 0 8px var(--accent); }
}

.corridor-door.cleared .door-face {
  border-color: rgba(0, 180, 166, 0.35);
  background: linear-gradient(180deg, #0f1818 0%, #080c0c 100%);
  opacity: 0.75;
}

.door-num {
  font-size: 18px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.25);
}

.corridor-door.current .door-num {
  color: var(--accent);
}

.corridor-door.cleared .door-num {
  color: rgba(0, 180, 166, 0.6);
}

.door-name {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
}

.door-status,
.door-lock {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.3);
}

.corridor-door.current .door-status {
  color: var(--accent);
}

.corridor-door.cleared .door-status {
  color: rgba(0, 180, 166, 0.8);
}

/* Room HUD — compact, keeps puzzle above the fold */
.room-hud {
  padding: 8px 4px 10px;
  margin-bottom: 8px;
}

.room-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.room-hud-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.room-hud-title .room-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--teal-glow, #00e5d4);
  flex-shrink: 0;
}

.room-hud-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-hud-bar {
  height: 4px;
  margin-bottom: 10px;
}

.door-pips {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.door-pip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.35);
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.door-pip.current {
  color: #0a0a0a;
  background: var(--accent, #f5a623);
  border-color: var(--accent, #f5a623);
  box-shadow: 0 0 14px var(--accent-glow, rgba(245,166,35,0.45));
}

.door-pip.cleared {
  color: #0a0a0a;
  background: #00e5d4;
  border-color: #00e5d4;
}

.door-pip.locked {
  opacity: 0.45;
}

#screen-room .puzzle-mount {
  margin-top: 0;
  padding: 14px 12px 18px;
}

#screen-room .room-story {
  font-size: 13px;
  margin: 0 0 8px;
  line-height: 1.45;
}

#screen-room .simon-tile {
  min-height: 72px;
  font-size: 30px;
}

#screen-room .simon-board.simon-6 {
  gap: 8px;
  margin: 8px auto 6px;
}

#screen-room .search-item {
  min-height: 64px;
  padding: 8px 4px;
}

#screen-room .gem-pile {
  min-height: 40px;
}

body.in-escape #screen-room {
  padding-top: 4px;
}

.chamber-lock-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 80, 80, 0.2);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 120, 100, 0.85);
  transition: all 0.5s ease;
}

.chamber-lock-bar.unlocked {
  border-color: rgba(0, 180, 166, 0.35);
  color: rgba(0, 229, 212, 0.9);
  background: rgba(0, 40, 36, 0.35);
}

.lock-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.progress-bar-dark {
  background: rgba(255, 255, 255, 0.04);
}

.progress-bar-dark .progress-fill {
  box-shadow: 0 0 8px var(--accent-glow);
}

body.in-escape .room-scene {
  height: 130px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8);
}

body.in-escape .puzzle-mount {
  background: rgba(4, 6, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 2px 24px rgba(0, 0, 0, 0.7);
}

body.in-escape .room-header {
  margin-bottom: 10px;
  padding: 12px 14px;
}

body.in-escape .room-meta h2 {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.9);
}

body.in-escape .room-story {
  color: rgba(255, 255, 255, 0.45);
  border-left-color: var(--accent);
}

.scene-fog {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.7) 100%);
  pointer-events: none;
}

.flicker-light {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  animation: flicker 4s ease infinite;
}

.flicker-light.warm {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 140, 40, 0.15);
}

.flicker-light.red {
  top: 8px;
  right: 20%;
  background: rgba(255, 60, 60, 0.12);
}

.flicker-light.cold {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 180, 166, 0.1);
}

@keyframes flicker {
  0%, 100% { opacity: 0.6; }
  25% { opacity: 1; }
  50% { opacity: 0.4; }
  75% { opacity: 0.85; }
}

/* Door unlock transition */
.door-transition {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.door-transition[hidden] {
  display: none !important;
}

.transition-dark {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.door-transition.active .transition-dark {
  opacity: 1;
}

.transition-door-wrap {
  position: relative;
  width: 200px;
  height: 160px;
  z-index: 1;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.door-transition.active .transition-door-wrap {
  opacity: 1;
  transform: scale(1);
}

.transition-door-left,
.transition-door-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(180deg, #3a3a48 0%, #1a1a22 100%);
  border: 2px solid #555;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.transition-door-left {
  left: 0;
  border-radius: 6px 0 0 6px;
  transform-origin: left center;
}

.transition-door-right {
  right: 0;
  border-radius: 0 6px 6px 0;
  transform-origin: right center;
}

.door-transition.active .transition-door-left {
  transform: perspective(500px) rotateY(-78deg);
}

.door-transition.active .transition-door-right {
  transform: perspective(500px) rotateY(78deg);
}

.transition-door-light {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 100px;
  background: radial-gradient(ellipse, rgba(0, 229, 212, 0.9), transparent 70%);
  opacity: 0;
  transition: opacity 0.8s ease 0.4s;
}

.door-transition.active .transition-door-light {
  opacity: 1;
  animation: light-pulse 1.5s ease infinite;
}

.door-transition.final .transition-door-light {
  background: radial-gradient(ellipse, rgba(255, 220, 100, 0.95), transparent 70%);
}

@keyframes light-pulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

.transition-label {
  position: relative;
  z-index: 2;
  margin-top: 28px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.5s ease 0.3s;
  text-shadow: 0 0 20px rgba(0, 229, 212, 0.4);
}

.door-transition.active .transition-label {
  opacity: 1;
  transform: translateY(0);
}

.transition-sub {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  opacity: 0;
  transition: opacity 0.5s ease 0.6s;
}

.door-transition.active .transition-sub {
  opacity: 1;
}

.puzzle-chamber-intro {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.in-escape .action-card {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

body.in-escape .action-card:active,
body.in-escape .action-card.selected {
  border-color: var(--accent);
  background: rgba(245, 166, 35, 0.15);
  box-shadow: 0 0 20px var(--accent-glow);
}

body.in-escape .key-enter {
  background: linear-gradient(180deg, #00e5d4, #00897b);
  border-color: rgba(0, 229, 212, 0.55);
  box-shadow: 0 4px 16px rgba(0, 229, 212, 0.35);
}

body.in-escape .keypad-wrap {
  background: linear-gradient(180deg, #1a1a1a, #0a0a0a);
  border-color: #333;
}

body.in-escape .crystal-altar {
  background: radial-gradient(circle at 50% 0%, rgba(0,229,212,0.1), rgba(0,0,0,0.4));
  border-color: rgba(0, 180, 166, 0.15);
}

body.in-escape .lock-panel {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(245, 166, 35, 0.2);
}

/* Room 3 submit — same bright CTA as room 2「确认」键 */
.puzzle-action-btn,
body.in-escape .puzzle-action-btn {
  margin-top: 12px;
  background: linear-gradient(180deg, #00e5d4 0%, #00b4a6 45%, #00897b 100%);
  border: 2px solid rgba(0, 229, 212, 0.55);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow:
    0 4px 24px rgba(0, 229, 212, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  animation: btn-glow 3s ease infinite;
}

.puzzle-action-btn:active,
body.in-escape .puzzle-action-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 16px rgba(0, 229, 212, 0.55);
}

/* Welcome — preview corridor in darkness */
.corridor-preview {
  margin-bottom: 20px;
  padding: 14px 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.welcome-scene {
  filter: brightness(0.85);
}

body.in-escape .timer-pill {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}
