/* The Haunted House: candlelight, old print, wax seals. The canvas is the house; everything else floats on it. */
:root {
  --night: #050308; --ink: #1a120e; --paper: #e9dfc6; --paper2: #d8c9a4; --wax: #8e1b1b; --ghost: #cfe0f5;
  --candle: #ffcf8a; --dim: #8c8496;
  --serif: "IM Fell English", Georgia, "Times New Roman", serif; --sc: "IM Fell English SC", Georgia, serif; --hand: "La Belle Aurore", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ghost); font-family: var(--serif); }
#c { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; cursor: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#hud { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 16px; pointer-events: none; text-shadow: 0 1px 6px #000; }
.addr { font-family: var(--sc); font-size: 20px; letter-spacing: .06em; color: var(--candle); opacity: .85; }
.addr span { color: var(--dim); }
#where { font-style: italic; color: var(--dim); font-size: 16px; min-height: 1.2em; }
#souls { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 16px; font-size: 15px; color: var(--dim); text-shadow: 0 1px 6px #000; pointer-events: none; }
#souls .dot { margin: 0 .4em; }
#living { color: var(--candle); }
#dead { color: var(--ghost); }
#mute { position: fixed; top: calc(max(14px, env(safe-area-inset-top)) + 26px); right: 16px; background: none; border: 0; padding: 4px 0; font-style: italic; font-size: 14px; color: var(--dim); cursor: pointer; }
#mute:hover { color: var(--candle); }

#seals { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px 10px; width: max-content; max-width: calc(100vw - 32px); }
#sealRow { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
#sealRow i { font-style: normal; font-family: var(--sc); font-size: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #4a4250; border: 1px dashed #3a3240; transition: transform .3s; }
#sealRow i.on { color: #f3d9c0; background: radial-gradient(circle at 35% 30%, #c0392b, var(--wax) 60%, #4a0c0c); border: 0; box-shadow: 0 0 10px rgba(180,30,30,.5), inset 0 -2px 3px rgba(0,0,0,.4); }
#seals:hover #sealRow i { transform: translateY(-2px); }
#sealCount { font-style: italic; font-size: 13px; color: var(--dim); }

#whisper { position: fixed; left: 50%; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 72px); transform: translateX(-50%); margin: 0; width: min(560px, calc(100vw - 32px)); text-align: center; font-style: italic; font-size: 19px; color: var(--ghost); text-shadow: 0 0 12px rgba(160,200,255,.6), 0 1px 3px #000; opacity: 0; transition: opacity 1.4s, letter-spacing 3s; letter-spacing: .02em; pointer-events: none; }
#whisper.on { opacity: .95; letter-spacing: .06em; }

/* overlays */
.veil { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(3,2,6,.72); opacity: 0; transition: opacity .35s; overflow-y: auto; z-index: 5; }
.veil.on { opacity: 1; }
.veil.thin { background: linear-gradient(to top, rgba(3,2,6,.85), rgba(3,2,6,.1) 55%); place-items: end center; pointer-events: none; }
.veil.thin .endbox { pointer-events: auto; }
#intro { background: radial-gradient(ellipse at 50% 45%, rgba(3,2,6,.55), rgba(3,2,6,.94) 70%); }
.door { max-width: 520px; text-align: center; }
.kicker { font-family: var(--sc); letter-spacing: .2em; color: var(--dim); margin: 0 0 6px; font-size: 15px; }
h1 { font-family: var(--sc); font-weight: 400; font-size: clamp(40px, 9vw, 72px); line-height: 1; margin: 0 0 22px; color: var(--paper); text-shadow: 0 0 30px rgba(255,190,120,.25); animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { text-shadow: 0 0 40px rgba(180,210,255,.35); opacity: .85; } }
.door p { font-size: 18px; line-height: 1.5; color: #c9c0d2; margin: 0 0 12px; }
.door .warn { color: #e0a0a0; font-style: italic; }
.small { font-size: 14px !important; }
.dim { color: var(--dim) !important; }
.btn { margin: 18px 0 14px; background: none; border: 1px solid var(--candle); color: var(--candle); padding: 10px 26px; font-size: 18px; letter-spacing: .08em; font-family: var(--sc); cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.btn:hover, .btn:focus-visible { background: var(--candle); color: var(--night); box-shadow: 0 0 30px rgba(255,190,120,.4); outline: none; }
.btn.ink { border-color: var(--ink); color: var(--ink); margin-bottom: 0; }
.btn.ink:hover { background: var(--ink); color: var(--paper); box-shadow: none; }
.btn.ghost { border-color: var(--dim); color: var(--dim); }

.paper { position: relative; width: min(520px, 100%); padding: 30px 30px 26px; color: var(--ink);
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,240,.35), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(120,80,30,.25), transparent 55%), linear-gradient(var(--paper), var(--paper2));
  box-shadow: 0 30px 80px rgba(0,0,0,.8), inset 0 0 60px rgba(90,60,20,.35); transform: rotate(-.6deg); clip-path: polygon(0 1%, 4% 0, 30% 1%, 60% 0, 96% 1%, 100% 3%, 99% 40%, 100% 97%, 95% 100%, 60% 99%, 30% 100%, 2% 99%, 1% 60%); }
.paper h2 { font-family: var(--sc); font-weight: 400; font-size: 30px; margin: 0 0 14px; line-height: 1.1; }
.paper .num { font-style: italic; color: #6a5440; margin: 0 0 4px; font-size: 15px; }
.paper .text p { font-size: 17.5px; line-height: 1.5; margin: 0 0 12px; }
.paper .stat { font-style: italic; color: var(--wax); margin: 6px 0 14px; min-height: 1.4em; }
.paper.long { width: min(620px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; clip-path: none; transform: none; }
#jList { list-style: none; padding: 0; margin: 0 0 8px; }
#jList li { border-top: 1px solid rgba(26,18,14,.25); padding: 10px 0; color: #8a7a64; }
#jList li b { font-family: var(--sc); font-weight: 400; font-size: 18px; display: block; }
#jList li span { font-style: italic; font-size: 14px; }
#jList li.on { color: var(--ink); }
#jList li.on p { font-size: 16px; line-height: 1.45; margin: 6px 0 0; }

/* close-ups */
#closeup { grid-template-rows: auto auto; align-content: center; gap: 8px; }
.cu { text-align: center; }
.cap { font-style: italic; color: var(--dim); font-size: 18px; margin: 0 0 14px; }
.keys { display: flex; justify-content: center; background: #1e0f0a; padding: 14px 14px 18px; border: 3px solid #0a0504; box-shadow: 0 20px 60px #000, inset 0 4px 10px rgba(0,0,0,.6); }
.keys button { width: min(58px, 12vw); height: min(200px, 44vw); background: linear-gradient(#f0e8d6, #d6ccb4); border: 1px solid #3a2a20; border-radius: 0 0 6px 6px; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; color: #8a7a64; font-family: var(--sc); font-size: 16px; transition: transform .05s, background .1s; }
.keys button:active, .keys button:hover { background: linear-gradient(#e6dcc4, #c6bca4); }
.keys button:active { transform: translateY(3px); }
.played { font-family: var(--sc); letter-spacing: .3em; color: var(--candle); font-size: 20px; margin: 14px 0 0; }
.wheels { display: flex; gap: 12px; justify-content: center; background: linear-gradient(#5a5e62, #3a3e42); padding: 24px; border: 4px solid #1a1c1e; box-shadow: 0 20px 60px #000; }
.wheel { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wheel b { width: 54px; height: 64px; display: grid; place-items: center; background: linear-gradient(#f0e8d6, #c8bea6); color: var(--ink); font-size: 38px; font-family: var(--serif); border: 2px solid #1a1c1e; box-shadow: inset 0 6px 8px rgba(0,0,0,.35); }
.wheel button { background: #2a2c2e; border: 1px solid #111; color: #c8c0b0; width: 54px; height: 34px; cursor: pointer; font-size: 14px; }
.wheel button:hover { background: #3a3c3e; }
.pull { display: block; margin: 16px auto 0; background: #2a2c2e; border: 2px solid #111; color: var(--paper); padding: 10px 22px; font-family: var(--sc); font-size: 17px; cursor: pointer; min-width: 220px; }
.cal { width: min(520px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); padding: 0 0 12px; box-shadow: 0 20px 60px #000; transform: rotate(1deg); }
.cal h3 { margin: 0; background: #8a2020; color: var(--paper); font-family: var(--sc); font-weight: 400; font-size: 26px; padding: 10px; letter-spacing: .1em; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dow span { font-family: var(--sc); font-size: 13px; padding: 6px 0; border-bottom: 1px solid #b8a888; }
.grid div { min-height: 54px; border-right: 1px solid #d0c4a6; border-bottom: 1px solid #d0c4a6; padding: 3px; text-align: left; position: relative; }
.grid b { font-weight: 400; font-size: 14px; color: #6a5a44; }
.grid em { display: block; font-family: var(--hand); font-style: normal; font-size: 11px; line-height: 1.2; color: #3a2a6a; }
.grid .circ b { color: var(--wax); }
.grid .circ::after { content: ""; position: absolute; inset: 2px; border: 2px solid var(--wax); border-radius: 50%; transform: rotate(-8deg); }
.grid .circ em { color: var(--wax); }
.foot { font-family: var(--sc); font-size: 12px; color: #8a7a64; margin: 8px 0 0; }

.endbox { text-align: center; max-width: 520px; padding-bottom: 90px; }
.endbox h2 { font-family: var(--sc); font-weight: 400; font-size: clamp(34px, 7vw, 56px); color: #ffc4a8; margin: 0 0 10px; text-shadow: 0 0 30px rgba(255,120,90,.4); }
.endbox p { font-size: 18px; color: #d8cfe0; margin: 0 0 8px; }

@media (max-width: 560px) {
  .addr { font-size: 17px; } #where { font-size: 14px; } #souls { font-size: 13px; } #mute { font-size: 13px; }
  #sealRow i { width: 21px; height: 21px; font-size: 8px; } #sealRow { gap: 3px; }
  #whisper { font-size: 16px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 66px); }
  .paper { padding: 24px 20px 20px; } .paper h2 { font-size: 25px; } .paper .text p { font-size: 16px; }
  .grid div { min-height: 44px; } .grid em { font-size: 9px; }
  .wheels { gap: 6px; padding: 16px 10px; } .wheel b, .wheel button { width: 46px; }
}
@media (prefers-reduced-motion: reduce) { h1 { animation: none; } #whisper { transition: opacity .3s; } }

/* Honk Party login chip (hub.tomko.dk): a faint candlelit note in the bottom-left corner. Display only: the house
   still knows visitors by their random id, nothing else. Gold + seal = logged in on the hub. */
.sq-badge { background: rgba(10, 8, 6, .55) !important; border: 1px solid rgba(214, 196, 160, .22) !important; color: rgba(214, 196, 160, .8) !important; font: italic 13px/1 'IM Fell English', Georgia, serif !important; letter-spacing: .02em; box-shadow: none !important; padding: 6px 11px !important; }
.sq-badge:hover { color: #e8d9b8 !important; border-color: rgba(214, 196, 160, .45) !important; }
.sq-badge .sq-verified { font-style: normal; }
