/* Escape the Tower (/escape, architecture.md §61). The app's own register for everything
   you press — standard buttons, standard type — and the tower in the OBJECTS: a pink
   ticket stub, a navy floor directory, a fence of pastel padlocks, a napkin, a panel of
   lit windows. Clue-side and lock-side cards share one shape so the two screens read as
   two halves of one room. */

.scene.es-brief,
.scene.es-play,
.scene.es-result { width: min(100%, 560px); margin: 0 auto; }
/* Fade in without a transform: a filled transform animation makes the scene the containing
   block for `position: fixed`, and the door-opens moment is fixed to the SCREEN. */
.scene.es-play { animation-name: es-scene-fade; }
@keyframes es-scene-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- BRIEF ------------------------------------------------------------------------ */
.es-brief { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-bottom: 24px; }
.es-brief-art, .es-result-art { width: min(300px, 78vw); height: auto; aspect-ratio: 4 / 3; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(28, 37, 70, 0.16)); }
.es-brief-title { margin: 0; font-size: clamp(26px, 6.4vw, 34px); letter-spacing: -0.025em; line-height: 1.12; }
.es-brief-story { margin: 0; max-width: 36ch; color: var(--ink-soft); font-size: 15.5px; line-height: 1.5; }
.es-rules { list-style: none; margin: 8px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left; }
.es-rules li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-raised);
  font-size: 14.5px; line-height: 1.4;
}
.es-rule-art { flex: none; width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(28, 37, 70, 0.14)); }
.es-rules li:nth-child(1) .es-rule-art { transform: rotate(-8deg); }
.es-rules li:nth-child(3) .es-rule-art { transform: rotate(6deg); }
.es-brief-names { margin: 2px 0 0; color: var(--ink-soft); font-size: 13.5px; }
.es-brief-go { min-height: 54px; padding: 0 26px; gap: 8px; margin-top: 4px; }

/* ---- PLAY: the frame around every room ----------------------------------------------
   (2026-10) The room's picture leads the screen. Riding on it: the five floors as little
   stickers in a glass pill (done = lit with a tick, yours = bigger, ringed, bobbing) and
   the clock beside them. Under it the line of story, then which half you hold — a card
   with its own sticker — then the half itself. */
.es-play { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding-bottom: 28px; position: relative; }

/* the room: its picture, with where you are on a soft scrim along the foot */
.es-scene {
  position: relative; overflow: hidden; isolation: isolate;
  height: clamp(190px, 56vw, 290px); border-radius: 26px;
  background: #2c3365; box-shadow: 0 16px 34px rgba(28, 37, 70, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.es-scene-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.es-scene.is-new .es-scene-img { animation: es-art-in 1100ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes es-art-in { from { transform: scale(1.1); filter: brightness(0.75); } to { transform: none; filter: none; } }
.es-hero-top {
  position: absolute; left: 10px; right: 10px; top: 10px; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.es-floors {
  display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 6px 16px rgba(20, 24, 60, 0.18);
}
.es-fl {
  position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.35);
  transition: width 260ms ease, height 260ms ease, background-color 260ms ease, box-shadow 260ms ease;
}
.es-fl .es-stk { width: 22px; height: 22px; object-fit: contain; filter: grayscale(1) opacity(0.5); transition: filter 300ms ease; }
.es-fl.is-done { background: #fff; }
.es-fl.is-done .es-stk { filter: none; }
/* the tick on a floor you got through */
.es-fl.is-done::after {
  content: ''; position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%;
  background: #3db37f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 8px no-repeat;
  box-shadow: 0 0 0 2px #fff;
}
.es-fl.is-here { width: 40px; height: 40px; background: #fff; box-shadow: 0 0 0 3px rgba(255, 123, 163, 0.95), 0 6px 14px rgba(20, 24, 60, 0.3); }
.es-fl.is-here .es-stk { width: 30px; height: 30px; filter: none; animation: es-bob 1.8s ease-in-out infinite; }
@keyframes es-bob { 50% { transform: translateY(-2px) rotate(-6deg); } }
.es-timer {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px 4px 5px; border-radius: 999px;
  background: rgba(28, 37, 70, 0.8); color: #f6e9cf;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(20, 24, 60, 0.25);
  font-family: "Space Mono", ui-monospace, monospace; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums;
}
.es-timer-ic { width: 28px; height: 28px; object-fit: contain; }
.es-timer.is-low { background: #b4234a; color: #fff; animation: es-pulse 1s ease-in-out infinite; }
.es-timer.is-low .es-timer-ic { animation: es-ring 0.5s ease-in-out infinite; }
@keyframes es-pulse { 50% { opacity: 0.78; } }
@keyframes es-ring { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.es-scene-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; flex-direction: column; gap: 2px;
  padding: 46px 18px 15px;
  background: linear-gradient(180deg, transparent, rgba(22, 27, 56, 0.78));
  color: #fff;
}
.es-floor { font-family: "Space Mono", ui-monospace, monospace; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.es-scene-cap .es-floor { color: rgba(255, 255, 255, 0.85); }
.es-title { margin: 0; font-size: clamp(23px, 6vw, 30px); letter-spacing: -0.02em; line-height: 1.1; }
.es-scene-cap .es-title { color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); }
.es-story { margin: 0 4px; color: var(--ink-soft); font-size: 15px; line-height: 1.45; text-align: center; }

/* which half you hold: a card with its own sticker, and the "talk to them" bubble */
.es-role {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 58px 12px 12px; border-radius: 20px;
}
.es-role.is-clue { background: linear-gradient(135deg, #e3edff, #f3f7ff); color: #1f3f7a; box-shadow: inset 0 0 0 1.5px #cadcff; }
.es-role.is-lock { background: linear-gradient(135deg, #ffe4ee, #fff3f7); color: #8a2550; box-shadow: inset 0 0 0 1.5px #ffc8db; }
.es-role-art {
  flex: none; width: 54px; height: 54px; object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(28, 37, 70, 0.16));
  animation: es-wiggle 3.4s ease-in-out infinite;
}
@keyframes es-wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(4deg) translateY(-2px); } }
.es-role-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.es-role-copy b { font-size: 16px; }
.es-role-copy span { font-size: 13.5px; opacity: 0.85; line-height: 1.35; }
.es-role-talk { position: absolute; right: 12px; top: 50%; width: 38px; height: 38px; margin-top: -19px; object-fit: contain; }

.es-panel { display: flex; flex-direction: column; }
.es-panel.is-shake { animation: es-shake 420ms ease; }
@keyframes es-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.es-stack { display: flex; flex-direction: column; gap: 12px; }
.es-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px; border: 1px solid rgba(28, 37, 70, 0.07); border-radius: 22px; background: #fff;
  box-shadow: 0 10px 26px rgba(28, 37, 70, 0.08);
}
.es-card-label {
  align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: #f1effa; color: #4b4f7a;
  font-family: "Space Mono", ui-monospace, monospace; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.es-note { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.4; }

/* a symbol: a soft tile with the line icon, its name under it on the clue side */
.es-sym { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.es-sym-ic {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 17px;
  background: linear-gradient(180deg, #fff, #f1effa); color: #2c3365;
  box-shadow: inset 0 0 0 1.5px #e3e0f4, 0 3px 0 #e3e0f4;
}
.es-sym-name { font-size: 12px; font-weight: 700; color: var(--ink); text-align: center; }

/* 1 — the ticket stub (clue) and the price board + keypad (lock) */
.es-ticket {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 18px 16px; border-radius: 18px; background: #ffe3ec; border: 2px solid #e07d9e;
  box-shadow: 0 10px 24px rgba(181, 74, 114, 0.14);
}
.es-ticket::before, .es-ticket::after {
  content: ""; position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
  background: var(--paper, #f8f9fb); border: 2px solid #e07d9e;
}
.es-ticket::before { left: -13px; clip-path: inset(0 0 0 50%); }
.es-ticket::after { right: -13px; clip-path: inset(0 50% 0 0); }
.es-ticket-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: #b54a72; }
.es-ticket-head b { font-size: 16px; letter-spacing: 0.18em; }
.es-ticket-head span { font-size: 11.5px; letter-spacing: 0.08em; }
.es-ticket-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.es-ticket .es-sym-ic { background: #fff; color: #b54a72; }
.es-ticket .es-note { color: #8c5068; }
.es-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.es-price { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px; border-radius: 14px; background: #f6f5fb; }
.es-price .es-sym-ic { width: 44px; height: 44px; border-radius: 12px; }
.es-price b { font-family: "Space Mono", ui-monospace, monospace; font-size: 22px; }

.es-pad { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.es-slots { display: flex; gap: 10px; }
.es-slots span {
  width: 54px; height: 62px; border-radius: 16px; display: grid; place-items: center;
  border: 2px dashed #d4d6ea; background: rgba(255, 255, 255, 0.6);
  font-family: "Space Mono", ui-monospace, monospace; font-size: 23px; font-weight: 700; color: #2c3365;
}
.es-slots span.is-set { border: 2px solid #2c3365; background: #fff; box-shadow: 0 4px 0 #2c3365; animation: es-pop 220ms cubic-bezier(0.2, 0.9, 0.3, 1.4); }
@keyframes es-pop { from { transform: scale(0.8); } }
.es-keys { display: grid; grid-template-columns: repeat(3, 66px); gap: 12px; }
.es-key {
  height: 56px; border: 0; border-radius: 16px; background: #fff;
  box-shadow: inset 0 0 0 1.5px #e3e4f2, 0 4px 0 #d9dbee, 0 8px 16px rgba(28, 37, 70, 0.08);
  font-family: "Space Mono", ui-monospace, monospace; font-size: 22px; font-weight: 700; color: #2c3365; cursor: pointer;
  display: grid; place-items: center; -webkit-tap-highlight-color: transparent;
  transition: transform 80ms ease, box-shadow 80ms ease, background-color 80ms ease;
}
.es-key:active { transform: translateY(3px); background: #f4f3fc; box-shadow: inset 0 0 0 1.5px #e3e4f2, 0 1px 0 #d9dbee; }
.es-key.is-del { color: var(--ink-soft); }
/* the elevator's buttons: round, brass-ringed, and they light up when pressed */
.es-keys.is-elevator { grid-template-columns: repeat(3, 66px); }
.es-keys.is-elevator .es-key {
  width: 66px; height: 66px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #fffdf6, #fbefd6);
  box-shadow: inset 0 0 0 3px #d9c08a, 0 4px 0 #c8ab70, 0 8px 16px rgba(120, 90, 30, 0.14);
}
.es-keys.is-elevator .es-key:active { background: radial-gradient(circle at 50% 35%, #fff8d6, #ffe08a); box-shadow: inset 0 0 0 3px #d9c08a, 0 1px 0 #c8ab70, 0 0 18px rgba(255, 216, 119, 0.8); }

/* 2 — the floor directory (clue) and tonight's plan (lock) */
.es-dir { display: flex; flex-direction: column; gap: 6px; }
.es-dir-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: #f6f5fb; font-weight: 700; font-size: 14.5px; }
.es-floor-badge {
  flex: none; width: 40px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: #1c2546; color: #f6e9cf; font-family: "Space Mono", ui-monospace, monospace; font-size: 13px; font-weight: 700;
}
.es-plan { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 700; }

/* 3 — three facts about the lock (clue) and the fence (lock) */
.es-clues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.es-clues li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f6f5fb; font-size: 15px; font-weight: 700; }
.es-wall {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 10px;
  padding: 16px 12px 14px; border-radius: 18px;
  background:
    repeating-linear-gradient(45deg, rgba(150, 122, 96, 0.18) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(-45deg, rgba(150, 122, 96, 0.18) 0 2px, transparent 2px 18px),
    #fbf4ea;
  border: 1px solid #e8dcc6;
}
.es-lock {
  --lock: #ff9eb8;
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.es-lock-shackle { width: 26px; height: 18px; margin-bottom: -4px; border: 4px solid #a49cb2; border-bottom: 0; border-radius: 14px 14px 0 0; }
.es-lock-body {
  width: 48px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 55%), var(--lock);
  color: rgba(40, 30, 40, 0.75); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08), 0 3px 8px rgba(0, 0, 0, 0.14);
  transition: transform 120ms ease;
}
.es-lock.is-picked .es-lock-body { transform: translateY(-3px) rotate(-4deg); }
.es-lock.is-picked .es-lock-body { outline: 3px solid #2c3365; outline-offset: 3px; }
.es-lock:active .es-lock-body { transform: scale(0.94); }
.es-lock.is-pink { --lock: #ff9eb8; }
.es-lock.is-blue { --lock: #8fc1ff; }
.es-lock.is-mint { --lock: #9ee0be; }
.es-lock.is-yellow { --lock: #ffd877; }
.es-lock.is-lilac { --lock: #c7b2ff; }
.es-lock.is-peach { --lock: #ffc09e; }

/* 4 — the napkin (clue) and the bill (lock) */
.es-napkin-card { background: #fffdf8; border-style: dashed; }
.es-napkin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.es-nap { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; background: #f6f5fb; }
.es-nap .es-sym-ic { width: 42px; height: 42px; border-radius: 12px; background: #fff; }
.es-nap-eq { color: var(--ink-soft); }
.es-nap b { font-family: "Gowun Batang", Georgia, serif; font-size: 24px; }
.es-bill { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.es-word-row { display: flex; align-items: center; gap: 10px; }
.es-word { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.2em; font-weight: 800; font-size: 18px; }

/* 5 — the light card (clue) and the light panel (lock) */
.es-lights {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  padding: 12px; border-radius: 20px; background: linear-gradient(180deg, #1c2546, #2c3365);
  box-shadow: 0 10px 24px rgba(28, 37, 70, 0.2);
}
.es-light {
  aspect-ratio: 1; border: 0; border-radius: 8px; padding: 0; cursor: pointer;
  background: #2f3866; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: background-color 140ms ease, box-shadow 140ms ease;
}
.es-light.is-on { background: #ffd877; box-shadow: 0 0 14px rgba(255, 216, 119, 0.75); }
.es-lights.is-card { max-width: 280px; align-self: center; width: 100%; }
.es-lights.is-card .es-light { cursor: default; }
.es-lit-count { flex: 1; font-size: 14px; color: var(--ink-soft); font-weight: 700; }

.es-try { min-height: 52px; gap: 8px; padding: 0 22px; }
.es-pad .es-try { width: min(100%, 220px); }

/* wrong tries, hints, the door opening */
.es-wrong { margin: 0; min-height: 1.2em; text-align: center; color: #b4234a; font-weight: 700; font-size: 14px; }
.es-hints { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.es-hints:empty { display: none; }
.es-hints li {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 16px;
  background: #fff6d6; color: #6b5310; font-size: 14px; font-weight: 600; line-height: 1.4;
  box-shadow: 0 8px 18px rgba(150, 120, 20, 0.12); transform: rotate(-0.6deg);
  animation: es-note-in 360ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.es-hints li:nth-child(2) { transform: rotate(0.5deg); }
.es-hints li .es-stk { flex: none; width: 34px; height: 34px; object-fit: contain; }
@keyframes es-note-in { from { opacity: 0; transform: translateY(8px) scale(0.96); } }
.es-hint-btn { align-self: center; gap: 6px; padding-left: 10px; }
.es-hint-ic { width: 26px; height: 26px; object-fit: contain; }
.es-hint-btn:disabled .es-hint-ic { filter: grayscale(1) opacity(0.5); }
.es-flash {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  display: grid; place-items: center; opacity: 0; visibility: hidden;
}
.es-flash-card {
  position: relative; display: grid; justify-items: center; gap: 4px;
  padding: 16px 28px 18px; border-radius: 28px; background: rgba(28, 37, 70, 0.92); color: #f6e9cf;
  box-shadow: 0 24px 60px rgba(20, 24, 60, 0.4);
}
.es-flash-confetti { position: absolute; left: 50%; top: 42%; width: 260px; height: 260px; margin: -130px 0 0 -130px; z-index: -1; opacity: 0; }
.es-flash-door { width: 120px; height: 120px; object-fit: contain; }
.es-flash-text { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.es-flash.is-on { visibility: visible; animation: es-flash 1.9s ease both; }
.es-flash.is-on .es-flash-card { animation: es-flash-pop 1.9s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.es-flash.is-on .es-flash-confetti { animation: es-flash-burst 1.9s ease-out both; }
.es-flash.is-on .es-flash-door { animation: es-door-glow 1.9s ease both; }
@keyframes es-flash { 0% { opacity: 0; } 10%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes es-flash-pop { 0% { transform: scale(0.7); } 16% { transform: scale(1.04); } 26%, 100% { transform: scale(1); } }
@keyframes es-flash-burst { 0% { opacity: 0; transform: scale(0.4) rotate(-20deg); } 22% { opacity: 1; transform: scale(1.15) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3) rotate(8deg); } }
@keyframes es-door-glow { 0% { filter: brightness(0.8); } 30%, 100% { filter: drop-shadow(0 0 18px rgba(255, 216, 119, 0.8)); } }

/* ---- RESULT ------------------------------------------------------------------------ */
.es-result { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.es-result-stage { position: relative; display: grid; place-items: center; }
.es-result-stage .es-result-art { position: relative; z-index: 1; }
.es-result-confetti {
  position: absolute; left: 50%; top: 46%; width: min(380px, 96vw); height: auto; z-index: 0;
  transform: translate(-50%, -50%); opacity: 0; pointer-events: none;
}
.es-result.is-out .es-result-confetti { animation: es-result-burst 1100ms cubic-bezier(0.2, 0.8, 0.2, 1) 200ms both; }
@keyframes es-result-burst { from { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(-15deg); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.es-result-title { margin: 0; font-size: clamp(28px, 7vw, 38px); letter-spacing: -0.025em; }
.es-result-sub { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
.es-stars { display: flex; gap: 6px; margin: 4px 0; }
.es-star { color: var(--line); }
.es-star.is-on { color: #f2b632; }
.es-star.is-on svg { fill: #ffd877; }
.es-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
.es-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-raised); }
.es-stat b { font-family: "Space Mono", ui-monospace, monospace; font-size: 18px; }
.es-stat span { font-size: 12px; color: var(--ink-soft); }
.es-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.es-result-actions .btn { gap: 8px; text-decoration: none; }

@media (max-width: 420px) {
  .es-keys, .es-keys.is-elevator { grid-template-columns: repeat(3, 60px); gap: 10px; }
  .es-keys.is-elevator .es-key { width: 60px; height: 60px; }
  .es-sym-ic { width: 48px; height: 48px; }
  .es-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .es-fl { width: 26px; height: 26px; }
  .es-fl .es-stk { width: 19px; height: 19px; }
  .es-fl.is-here { width: 36px; height: 36px; }
  .es-fl.is-here .es-stk { width: 27px; height: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  .es-panel.is-shake, .es-timer.is-low, .es-flash.is-on, .es-flash.is-on *, .es-scene.is-new .es-scene-img,
  .es-fl.is-here .es-stk, .es-role-art, .es-hints li, .es-slots span.is-set, .es-result.is-out .es-result-confetti { animation: none; }
  .es-flash.is-on { opacity: 1; }
  .es-result.is-out .es-result-confetti { opacity: 1; }
}

/* ---- START: how it plays (escape/howto.js) ------------------------------------------
   Higgsfield art over the shared preview frame (.gp): Namsan at night, the clue phone and
   the lock phone, then the lock opening. One 7s loop: step 1 lifts the clue phone, step 2
   the lock phone, step 3 is the call between them and the lock popping open. The steps
   along the foot light up in the same rhythm (each one the same keyframes, a third of
   the loop later). */
.gp.es-how { --es-loop: 7s; border-color: #DCD6F5; background: #9b95e6; box-shadow: 0 10px 30px rgba(110, 96, 200, 0.18); }
.es-how-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 72%; }
.es-how-timer {
  position: absolute; left: 50%; top: 4%; z-index: 3; transform: translateX(-50%);
  padding: 4px 11px; border-radius: 99px; background: rgba(28, 37, 70, 0.82); color: #F6E9CF;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
}
.es-how-phone {
  position: absolute; bottom: 25%; z-index: 2; height: 58%; width: auto;
  transform: rotate(var(--r));
  filter: drop-shadow(0 10px 16px rgba(40, 30, 100, 0.28));
  animation: es-how-lift var(--es-loop) ease-in-out infinite;
  user-select: none; -webkit-user-drag: none;
}
.es-how-phone.is-clue { left: 11%; --r: -7deg; }
.es-how-phone.is-lock { right: 11%; --r: 7deg; animation-delay: calc(var(--es-loop) / 3); }
@keyframes es-how-lift {
  0%, 32%, 100% { transform: rotate(var(--r)); }
  8%, 24%       { transform: rotate(var(--r)) translateY(-8px) scale(1.05); }
}
/* the call between the two phones: a typing bubble */
.es-how-call {
  position: absolute; left: 50%; top: 42%; z-index: 3; transform: translate(-50%, -50%);
  display: flex; gap: 4px; padding: 8px 10px; border-radius: 14px;
  background: #fff; box-shadow: 0 4px 12px rgba(40, 30, 100, 0.2);
  animation: es-how-call var(--es-loop) ease-in-out infinite;
}
.es-how-call span { width: 6px; height: 6px; border-radius: 50%; background: #8a84d6; animation: es-how-dot 1.1s ease-in-out infinite; }
.es-how-call span:nth-child(2) { animation-delay: 0.15s; }
.es-how-call span:nth-child(3) { animation-delay: 0.3s; }
@keyframes es-how-dot { 0%, 60%, 100% { transform: none; opacity: 0.45; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes es-how-call {
  0%, 62%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  68%, 74% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
  80%, 96% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  100%     { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
/* the payoff: the lock opens over a warm glow */
.es-how-glow {
  position: absolute; left: 50%; top: 42%; z-index: 4; width: 66%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 248, 225, 0.95) 0 30%, rgba(255, 236, 190, 0.55) 48%, rgba(255, 236, 190, 0) 70%);
  opacity: 0; animation: es-how-glow var(--es-loop) ease-in-out infinite;
}
.es-how-open {
  position: absolute; left: 50%; top: 42%; z-index: 4; height: 60%; width: auto;
  transform: translate(-50%, -50%) scale(0.6); opacity: 0;
  animation: es-how-open var(--es-loop) cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  user-select: none; -webkit-user-drag: none;
}
@keyframes es-how-glow { 0%, 76% { opacity: 0; } 82%, 95% { opacity: 1; } 100% { opacity: 0; } }
@keyframes es-how-open {
  0%, 76%  { opacity: 0; transform: translate(-50%, -50%) scale(0.6) rotate(-6deg); }
  83%, 95% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  100%     { opacity: 0; transform: translate(-50%, -50%) scale(1.04); }
}
/* the three steps along the foot */
.es-how-steps {
  position: absolute; left: 3%; right: 3%; bottom: 3.5%; z-index: 5;
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
}
.es-how-step {
  display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 6px 8px;
  border-radius: 12px; background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #2a2550; font-size: 12px; font-weight: 700; line-height: 1.2;
  opacity: 0.7;
  animation: es-how-step var(--es-loop) ease-in-out infinite;
}
.es-how-step.is-b   { animation-delay: calc(var(--es-loop) / 3); }
.es-how-step.is-out { animation-delay: calc(var(--es-loop) * 2 / 3); }
.es-how-n {
  flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: #fff; font-size: 11px; font-weight: 800;
}
.es-how-step.is-p   { --c: #FF7BA3; }
.es-how-step.is-b   { --c: #5FA0FF; }
.es-how-step.is-out { --c: #8a6ad8; }
.es-how-text { min-width: 0; }
@keyframes es-how-step {
  0%, 30%  { opacity: 1; background: #fff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(40, 30, 100, 0.18); }
  34%, 100% { opacity: 0.7; background: rgba(255, 255, 255, 0.82); transform: none; box-shadow: none; }
}
@media (min-width: 900px) {
  .es-how-step { font-size: 13px; padding: 8px 10px; }
}
/* Motion off: the finished picture — both phones, the lock open, every step lit. */
@media (prefers-reduced-motion: reduce) {
  .gp.es-how *, .gp.es-how *::before { animation: none !important; }
  .es-how-step { opacity: 1; background: #fff; }
  .es-how-call { opacity: 0; }
  .es-how-glow { opacity: 0.85; }
  .es-how-open { opacity: 1; transform: translate(-50%, -50%) scale(0.9); }
}
