:root { --or: #ff8a1e; --or2: #ffb547; --pu: #8a9cff; --pu2: #5a6aff; --ink: #fff4e6; --glass: rgba(20, 12, 40, 0.5); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #12051d; color: var(--ink); font-family: "Avenir Next", "Segoe UI", Roboto, system-ui, sans-serif; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#flash { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle, rgba(255,230,190,0.9), rgba(255,140,40,0.5)); opacity: 0; mix-blend-mode: screen; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(10,0,20,0.55) 100%); }
.hidden { display: none !important; }
.glass { background: var(--glass); border: 1px solid rgba(255, 190, 120, 0.28); box-shadow: 0 0 0 1px rgba(176, 77, 255, 0.18) inset, 0 10px 40px rgba(0,0,0,0.45), 0 0 32px rgba(255, 120, 30, 0.12); -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%); border-radius: 22px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
button.big, button.mid { border-radius: 999px; font-weight: 900; letter-spacing: 0.06em; background: linear-gradient(180deg, #ffb547, #ff7a12 55%, #e0540a); color: #2a0a00; box-shadow: 0 0 0 2px rgba(255,220,160,0.5) inset, 0 6px 0 #8a2e00, 0 0 34px rgba(255,140,30,0.55); text-shadow: 0 1px 0 rgba(255,255,255,0.35); transition: transform .08s, filter .15s; }
button.big { font-size: clamp(22px, 3.4vw, 34px); padding: 16px 54px; }
button.mid { font-size: 16px; padding: 11px 20px; background: linear-gradient(180deg, #c27bff, #8a3cff 60%, #6420d0); color: #fff; box-shadow: 0 0 0 2px rgba(230,200,255,0.4) inset, 0 5px 0 #3a1080, 0 0 26px rgba(176,77,255,0.5); text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
button.big:hover, button.mid:hover { filter: brightness(1.1); } button.big:active, button.mid:active { transform: translateY(3px); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,200,140,0.25); font-weight: 700; font-size: 15px; cursor: pointer; }
.pill input { accent-color: var(--or); width: 18px; height: 18px; }
.seg { display: inline-flex; border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,200,140,0.3); background: rgba(0,0,0,0.25); }
.seg button { padding: 8px 14px; font-weight: 800; font-size: 14px; background: transparent; opacity: 0.7; }
.seg button.on { background: linear-gradient(180deg, #ffb547, #ff7a12); color: #2a0a00; opacity: 1; }
.seg.small button { padding: 4px 10px; font-size: 12px; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: max(3vh, env(safe-area-inset-top)) 16px max(3vh, env(safe-area-inset-bottom)); pointer-events: none; }
.screen > * { pointer-events: auto; }
.titleBlock { text-align: center; pointer-events: none !important; margin-top: 2vh; }
.kicker { font-weight: 800; letter-spacing: 0.32em; text-transform: uppercase; font-size: clamp(11px, 1.5vw, 15px); color: #ffd9a8; text-shadow: 0 0 12px rgba(255,140,40,0.8); }
.title { margin: 0.1em 0 0.05em; line-height: 0.86; font-family: "Arial Black", "Avenir Next Heavy", Impact, sans-serif; font-weight: 900; font-size: clamp(56px, 12.5vw, 168px); letter-spacing: -0.01em; }
.title span { display: block; }
.title .t1 { background: linear-gradient(180deg, #fff3c4 0%, #ffb547 35%, #ff6a0a 70%, #b83a00 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(255,120,20,0.85)) drop-shadow(0 6px 0 #5a1600); }
.title .t2 { background: linear-gradient(180deg, #f6e0ff 0%, #c47bff 40%, #7a2cff 80%, #4a10a0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 20px rgba(176,77,255,0.9)) drop-shadow(0 6px 0 #26064a); margin-top: 0.02em; }
.tag { font-weight: 700; font-size: clamp(14px, 2vw, 20px); color: #f3dcff; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
.startCard { padding: 22px 26px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 640px; width: 100%; }
.how { font-size: 14px; opacity: 0.9; text-align: center; }
.row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.best { font-size: 14px; opacity: 0.85; } .best b { color: var(--or2); }
#hud { position: fixed; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: max(12px, env(safe-area-inset-top)) 14px 0; pointer-events: none; }
#hud button { pointer-events: auto; }
.hud-left { padding: 8px 18px 10px; min-width: 150px; border-radius: 18px; }
.lbl { font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase; opacity: 0.8; font-weight: 800; }
#score { font-family: "Arial Black", Impact, sans-serif; font-size: clamp(30px, 4.6vw, 48px); line-height: 1; color: #ffe2a8; text-shadow: 0 0 16px rgba(255,140,30,0.9), 0 3px 0 #6a1e00; }
#score.bump { animation: bump .25s ease-out; } @keyframes bump { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes pulse { to { transform: scale(1.08); } }
.hud-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hud-right { display: flex; gap: 8px; }
.icon { width: 46px; height: 46px; border-radius: 50%; font-size: 20px; display: grid; place-items: center; }
#combo, #banner { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); pointer-events: none; text-align: center; font-family: "Arial Black", Impact, sans-serif; white-space: nowrap; }
#combo { top: 30%; font-size: clamp(36px, 7vw, 84px); color: #fff; opacity: 0; }
#combo.show { animation: comboPop 0.9s ease-out forwards; }
@keyframes comboPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-6deg); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.25) rotate(3deg); } 30% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -62%) scale(1.05); } }
#combo .c { background: linear-gradient(180deg, #fff6c8, #ffb547 45%, #ff5a0a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(255,120,20,0.95)) drop-shadow(0 5px 0 #4a1000); }
#combo.hot .c { background: linear-gradient(180deg, #ffe0fb, #ff4fd8 38%, #9a2cff 80%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 22px rgba(255,90,230,1)) drop-shadow(0 5px 0 #2a0650); }
#banner { font-size: clamp(36px, 8vw, 112px); opacity: 0; }
#banner.show { animation: bannerIn 1.6s ease-out forwards; }
#banner span { background: linear-gradient(180deg, #fff6c8, #ffb547 45%, #ff5a0a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px rgba(255,120,20,1)) drop-shadow(0 7px 0 #4a1000); }
#banner.purple span { background: linear-gradient(180deg, #ffffff, #d49bff 45%, #7a2cff); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 24px rgba(176,77,255,1)) drop-shadow(0 7px 0 #1a0440); }
#banner small { display: block; font-size: 0.32em; letter-spacing: 0.2em; color: #ffe9c8; text-shadow: 0 0 14px #ff7a12; }
@keyframes bannerIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(0.95); } 20% { transform: translate(-50%, -50%) scale(1.03); } 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); } }
.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8,2,16,0.45); }
.panel { padding: 22px 26px; min-width: min(92vw, 460px); display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.panel h2 { margin: 0; text-align: center; font-family: "Arial Black", Impact, sans-serif; letter-spacing: 0.08em; color: #ffd9a8; text-shadow: 0 0 14px rgba(255,120,20,0.8); }
.field { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 700; }
.field input[type=range] { flex: 1; min-width: 160px; accent-color: var(--or); }
.hint { font-size: 13px; opacity: 0.8; text-align: right; margin-top: -8px; min-height: 1em; }
#end { justify-content: center; }
#endCard { width: min(94vw, 560px); padding: 20px 24px 18px; text-align: center; display: flex; flex-direction: column; gap: 10px; animation: cardIn .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes cardIn { from { transform: scale(0.7) translateY(30px); opacity: 0; } }
.endTitle { font-family: "Arial Black", Impact, sans-serif; letter-spacing: 0.3em; font-size: 15px; color: #f2d0ff; text-shadow: 0 0 12px #b04dff; }
#endScore { font-family: "Arial Black", Impact, sans-serif; font-size: clamp(56px, 13vw, 96px); line-height: 1; background: linear-gradient(180deg, #fff3c4, #ffb547 45%, #ff6a0a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(255,120,20,0.9)) drop-shadow(0 5px 0 #4a1000); }
#newBest { font-weight: 900; color: #fff; background: linear-gradient(90deg, #ff6ad5, #b04dff); border-radius: 999px; padding: 4px 14px; align-self: center; box-shadow: 0 0 20px rgba(255,100,220,0.8); animation: pulse .5s infinite alternate; }
#rank { font-size: 24px; font-weight: 900; color: #ffd9a8; text-shadow: 0 0 14px rgba(255,140,30,0.8); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div { background: rgba(255,255,255,0.07); border-radius: 14px; padding: 8px 4px; display: flex; flex-direction: column; }
.stats b { font-size: 22px; color: #fff0d0; } .stats span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.75; }
.nameRow { display: flex; gap: 10px; align-items: center; justify-content: center; font-weight: 700; }
.nameRow input { font: inherit; font-weight: 800; color: #fff; background: rgba(0,0,0,0.35); border: 1px solid rgba(255,190,120,0.45); border-radius: 12px; padding: 8px 12px; width: 200px; -webkit-user-select: text; user-select: text; }
.shareBox { background: rgba(0,0,0,0.28); border-radius: 14px; padding: 10px 12px; text-align: left; }
.shareHead { display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.9; margin-bottom: 6px; }
#shareText { font-size: 14px; line-height: 1.4; white-space: pre-wrap; -webkit-user-select: text; user-select: text; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin-top: 4px; }
#toast { position: fixed; left: 50%; bottom: 7vh; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: rgba(30,10,46,0.85); border: 1px solid rgba(255,190,120,0.4); font-weight: 800; opacity: 0; transition: opacity .3s; pointer-events: none; text-align: center; max-width: 90vw; }
#toast.show { opacity: 1; }
body.playing #vignette { background: radial-gradient(ellipse at center, rgba(0,0,0,0) 60%, rgba(10,0,20,0.5) 100%); }
@media (max-width: 640px) {
  .hud-left { min-width: 104px; padding: 6px 12px; } .icon { width: 40px; height: 40px; font-size: 17px; } #prog { width: 34vw; }
  .stats { grid-template-columns: repeat(2, 1fr); } .startCard { padding: 16px; gap: 10px; } button.big { padding: 14px 40px; }
}
@media (max-height: 560px) { .title { font-size: clamp(40px, 9vw, 90px); } .kicker, .tag { display: none; } }


/* ---------- Haunted Mansion Escape ---------- */
#paint { position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 70%, rgba(255,150,60,0.35) 0, rgba(0,0,0,0) 45%), linear-gradient(#07040e 0%, #1a1024 50%, #2a1810 78%, #0a0606 100%); overflow: hidden; }
#paint .win { position: absolute; top: 14%; width: 9vw; height: 26vh; border-radius: 4.5vw 4.5vw 0 0; background: linear-gradient(#1a2050, #4a4a8a); box-shadow: 0 0 60px 20px rgba(120,140,255,0.25); }
#paint .w1 { left: 22%; } #paint .w2 { right: 22%; }
#paint .glowp { position: absolute; left: 50%; top: 28%; width: 30vmin; height: 30vmin; transform: translate(-50%,-50%); background: radial-gradient(circle, rgba(255,190,110,0.55), rgba(255,120,40,0) 65%); }
#paint .fogp { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(rgba(140,140,200,0), rgba(140,140,200,0.18)); }
#gl { cursor: grab; }
#flash { background: rgba(200,215,255,0.85); mix-blend-mode: normal; z-index: 4; }
#scare { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 30%, rgba(90,0,10,0.75) 100%); transition: opacity .6s; z-index: 4; }
#scare.on { opacity: 1; transition: none; animation: scareShake .35s 2; }
@keyframes scareShake { 25% { transform: translate(-8px, 4px); } 50% { transform: translate(6px, -6px); } 75% { transform: translate(-4px, -2px); } }
#fade { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(40,26,60,0.92), rgba(6,3,12,0.98)); z-index: 3; }
#vignette { background: radial-gradient(ellipse at center, rgba(0,0,0,0) 50%, rgba(6,2,14,0.6) 100%); }
#bars .bt, #bars .bb { position: fixed; left: 0; right: 0; height: 0; background: #030108; z-index: 5; transition: height .6s cubic-bezier(.3,.8,.3,1); pointer-events: none; }
#bars .bt { top: 0; } #bars .bb { bottom: 0; }
body.cine #bars .bt, body.cine #bars .bb { height: 10vh; }
body.cine #hud, body.cine #invBar, body.cine #btnBack { opacity: 0; pointer-events: none; }
#hud, #invBar { transition: opacity .4s; z-index: 6; }
.title { font-family: "Didot", "Bodoni 72", "Playfair Display", Georgia, "Times New Roman", serif; font-weight: 900; letter-spacing: 0.05em; line-height: 0.92; font-size: clamp(54px, 11.5vw, 156px); }
.title .t1 { font-size: 1.0em; background: linear-gradient(180deg, #ffffff 0%, #dfe8ff 35%, #9aaaff 70%, #4a4ab0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 26px rgba(140,170,255,0.85)) drop-shadow(0 4px 0 #0e0a30); }
.title .t2 { font-size: 0.5em; letter-spacing: 0.14em; background: linear-gradient(180deg, #fffbe6 0%, #ffe08a 30%, #ffad3a 60%, #c25a10 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 20px rgba(255,150,40,0.9)) drop-shadow(0 4px 0 #3a1200); margin-top: 0.12em; }
.titleBlock { animation: titleIn 1.4s cubic-bezier(.2,.9,.3,1) both; }
@keyframes titleIn { from { opacity: 0; transform: scale(1.12); filter: blur(10px); } }
.kicker { color: #d8e0ff; text-shadow: 0 0 12px rgba(120,140,255,0.9); }
.tag { color: #ffe8cc; }
.startCard { max-width: 620px; padding: 18px 24px 14px; gap: 11px; animation: cardUp .8s .3s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes cardUp { from { opacity: 0; transform: translateY(40px); } }
#contInfo { font-size: 13px; opacity: 0.8; margin-top: -6px; } #contInfo:empty { display: none; }
#timer { font-family: "Arial Black", Impact, sans-serif; font-size: clamp(28px, 4.2vw, 42px); line-height: 1; color: #ffe2a8; text-shadow: 0 0 16px rgba(255,140,30,0.9), 0 3px 0 #4a1600; }
.hud-left .sub { font-weight: 800; font-size: 14px; opacity: 0.95; margin-top: 4px; } .hud-left .sub b { color: #ffd9a8; }
#roomName { padding: 8px 18px; font-family: "Didot", Georgia, serif; font-weight: 900; letter-spacing: 0.22em; font-size: 13px; color: #e8ecff; border-radius: 999px; }
.hintBtn { font-size: 24px; box-shadow: 0 0 22px rgba(255,170,80,0.55); animation: hintPulse 2.4s infinite; }
body.kids .hintBtn { animation-duration: 1.4s; }
@keyframes hintPulse { 50% { box-shadow: 0 0 34px rgba(255,190,100,0.95); } }
#btnBack { position: fixed; left: 14px; bottom: max(110px, calc(env(safe-area-inset-bottom) + 100px)); padding: 10px 18px; border-radius: 999px; font-weight: 900; font-size: 16px; z-index: 6; }
#invBar { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
#selHint { font-weight: 800; font-size: 13px; color: #ffd9a8; text-shadow: 0 0 10px rgba(255,140,30,0.9), 0 1px 3px #000; min-height: 16px; }
#inv { display: flex; gap: 8px; padding: 8px 10px; border-radius: 20px; }
.slot { width: 74px; height: 74px; border-radius: 16px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,200,140,0.25); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.slot i { font-style: normal; font-size: 30px; filter: drop-shadow(0 0 8px rgba(255,180,90,0.7)); } .slot span { font-size: 10px; font-weight: 800; opacity: 0.9; line-height: 1.1; text-align: center; padding: 0 3px; }
.slot.sel { background: rgba(255,150,40,0.3); border-color: #ffb547; box-shadow: 0 0 22px rgba(255,150,40,0.8), 0 0 0 2px #ffb547 inset; transform: translateY(-4px); }
.slot.new { animation: slotNew 1s ease-out; } @keyframes slotNew { 0% { transform: scale(1.5); box-shadow: 0 0 40px #ffe0a0; } 100% { transform: scale(1); } }
.slot.empty { opacity: 0.35; }
body.holding #gl { cursor: crosshair; }
#msg { position: fixed; left: 50%; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 120px); transform: translate(-50%, 10px); max-width: min(720px, 92vw); padding: 12px 20px; border-radius: 18px; font-size: clamp(15px, 1.8vw, 19px); line-height: 1.4; opacity: 0; transition: opacity .35s, transform .35s; pointer-events: none; text-align: center; z-index: 7; }
#msg.show { opacity: 1; transform: translate(-50%, 0); }
#msg b { display: block; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: #ffd9a8; margin-bottom: 3px; }
#msg em { opacity: 0.6; font-style: normal; font-size: 0.8em; }
body.cine #msg { bottom: 12vh; }
#tip { position: fixed; transform: translate(14px, 14px); padding: 5px 11px; border-radius: 10px; background: rgba(20,10,30,0.85); border: 1px solid rgba(255,190,120,0.4); font-weight: 800; font-size: 13px; pointer-events: none; opacity: 0; transition: opacity .15s; white-space: nowrap; z-index: 8; }
#tip.show { opacity: 1; }
#wisp { position: fixed; right: 22px; top: 80px; font-size: 54px; opacity: 0; transform: translateY(20px) scale(0.6); transition: all .5s cubic-bezier(.2,1.4,.4,1); pointer-events: none; filter: drop-shadow(0 0 18px rgba(160,190,255,0.9)); z-index: 7; }
#wisp.on { opacity: 1; transform: translateY(0) scale(1); animation: wispFloat 1.6s ease-in-out infinite; }
@keyframes wispFloat { 50% { transform: translateY(-8px) rotate(6deg); } }
#chapter { position: fixed; left: 50%; top: 24%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; opacity: 0; z-index: 6; }
#chapter .ck { font-weight: 800; letter-spacing: 0.6em; font-size: clamp(11px, 1.4vw, 16px); color: #d8e0ff; text-shadow: 0 0 10px rgba(120,140,255,0.9); }
#chapter .ct { font-family: "Didot", "Bodoni 72", Georgia, "Times New Roman", serif; font-weight: 900; font-size: clamp(26px, 5.6vw, 82px); letter-spacing: 0.08em; width: 94vw; background: linear-gradient(180deg, #fffbe6, #ffd88a 45%, #e0782a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(255,140,40,0.85)) drop-shadow(0 3px 0 #2a0c00); }
#chapter.show { animation: chapIn 3.2s ease-out forwards; }
@keyframes chapIn { 0% { opacity: 0; letter-spacing: 0.4em; filter: blur(6px); } 15% { opacity: 1; filter: blur(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); } }
.lockPanel { align-items: center; } .wheels { display: flex; gap: 12px; justify-content: center; }
.wheel { display: flex; flex-direction: column; align-items: center; gap: 4px; background: linear-gradient(#5a3a10, #c8963c 50%, #5a3a10); border-radius: 14px; padding: 6px; box-shadow: 0 0 0 2px #3a2008 inset, 0 6px 16px rgba(0,0,0,0.5); }
.wheel b { font-family: Georgia, serif; font-size: 44px; width: 56px; text-align: center; color: #2a1404; background: linear-gradient(#e8d8b0, #fff4dc, #c8b080); border-radius: 8px; }
.wheel button { width: 56px; height: 34px; border-radius: 8px; background: rgba(0,0,0,0.3); font-size: 16px; color: #ffe8c0; }
#lockUI.shake .panel { animation: lockShake .4s; } @keyframes lockShake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
#endCard { width: min(560px, 94vw); max-height: 96vh; overflow: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 9px; text-align: center; margin: auto; }
.endTitle { font-family: "Didot", "Bodoni 72", Georgia, serif; font-size: 22px; letter-spacing: 0.24em; font-weight: 900; color: #e8ecff; text-shadow: 0 0 14px rgba(120,140,255,0.9); }
#endTime { font-family: "Arial Black", Impact, sans-serif; font-size: clamp(56px, 13vw, 92px); line-height: 1; background: linear-gradient(180deg, #fff3c4, #ffb547 45%, #ff6a0a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(255,120,20,0.9)) drop-shadow(0 5px 0 #4a1000); }
#endStars { font-size: 34px; letter-spacing: 6px; filter: drop-shadow(0 0 10px rgba(255,200,60,0.8)); }
.stats { grid-template-columns: repeat(3, 1fr); }
.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(6,2,12,0.45); z-index: 20; }
.panel { padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; min-width: min(420px, 92vw); }
.panel h2 { margin: 0; font-family: "Didot", Georgia, serif; letter-spacing: 0.12em; }
.field { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font-weight: 700; }
.field input[type=range] { flex: 1; min-width: 160px; accent-color: var(--or); }
.hint { font-size: 13px; opacity: 0.8; }
#end { z-index: 9; justify-content: center; }
#start { z-index: 9; }
@media (max-width: 640px) {
  .slot { width: 58px; height: 62px; } .slot i { font-size: 24px; } .slot span { font-size: 9px; }
  #roomName { display: none; } .hud-left { min-width: 96px; }
  #msg { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 96px); }
  #btnBack { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 90px); }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-height: 560px) { .title { font-size: clamp(38px, 8vw, 80px); } .kicker, .tag { display: none; } }

/* ---- controls: tutorial, nav, context, deselect ---- */
#btnHelp { font-size: 22px; font-weight: 900; color: #ffd9a8; }
.invRow { display: flex; align-items: center; gap: 8px; }
#btnDesel { width: 44px; height: 44px; font-size: 20px; color: #ffd9a8; border-color: rgba(255,170,90,0.7); box-shadow: 0 0 16px rgba(255,140,40,0.5); }
#selHint { font-size: 15px; min-height: 20px; padding: 3px 12px; border-radius: 999px; background: rgba(12,6,22,0.55); }
#selHint:empty { background: none; }
#nav { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
#nav button { position: absolute; pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px; font-weight: 900; font-size: 15px; color: #fff4e6;
  background: rgba(24,12,40,0.62); border: 1px solid rgba(255,190,120,0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 4px 20px rgba(0,0,0,0.45); cursor: pointer; }
#nav button:hover { background: rgba(70,36,20,0.75); box-shadow: 0 0 22px rgba(255,150,60,0.6); }
#nav button b { font-size: 22px; line-height: 1; }
#nav button.locked { opacity: 0.75; }
#nav .left { left: 14px; top: 50%; transform: translateY(-50%); }
#nav .right { right: 14px; top: 50%; transform: translateY(-50%); }
#nav .back { left: 50%; top: 66px; transform: translateX(-50%); }
body.cine #nav, body.spot #nav { opacity: 0; pointer-events: none; }
.tutPanel { max-width: 420px; text-align: center; }
.tutHead { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #ffb547; font-weight: 900; }
#tutIcon { font-size: 64px; margin: 10px 0 4px; filter: drop-shadow(0 0 18px rgba(255,170,80,0.8)); animation: tutBob 1.8s ease-in-out infinite; }
@keyframes tutBob { 50% { transform: translateY(-6px) scale(1.06); } }
#tutT { margin: 4px 0 6px; } #tutX { font-size: 16px; line-height: 1.45; opacity: .92; min-height: 70px; }
#tutDots { display: flex; gap: 6px; justify-content: center; margin: 8px 0 14px; } #tutDots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.25); } #tutDots i.on { background: #ffb547; box-shadow: 0 0 8px #ff8a1e; }
body.idle .hintBtn { animation-duration: 0.9s; }
@media (max-width: 700px) { #nav button { padding: 10px 12px; font-size: 13px; } #nav .left, #nav .right { top: 42%; } #nav button span { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* ---- first-person walking ---- */
#xh { position: fixed; left: 50%; top: 50%; width: 0; height: 0; z-index: 5; pointer-events: none; }
#xh i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,240,220,0.85); box-shadow: 0 0 6px rgba(0,0,0,0.9); transition: all .15s; }
#xh.on i { left: -15px; top: -15px; width: 30px; height: 30px; background: none; border: 2px solid #ffb547; box-shadow: 0 0 14px rgba(255,150,40,0.8), inset 0 0 8px rgba(255,150,40,0.5); }
body.walk #tip { transform: translate(-50%, 26px); font-size: 15px; padding: 7px 14px; }
body.cine #xh, body.cine #btnAct { opacity: 0; }
#joy { position: fixed; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 2px solid rgba(255,200,140,0.5); background: rgba(20,10,30,0.35); z-index: 7; pointer-events: none; opacity: 0; transition: opacity .15s; }
#joy.on { opacity: 1; }
#joyK { position: absolute; left: 30px; top: 30px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,180,90,0.75); box-shadow: 0 0 16px rgba(255,140,40,0.7); }
#btnAct { display: none; position: fixed; right: 18px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 100px); width: 72px; height: 72px; border-radius: 50%; font-size: 32px; z-index: 7; }
body.walk.touch.playing #btnAct { display: block; }
body.walk.touch.playing:not(.cine) #invBar { }
#nav .up { right: 14px; top: 30%; }
