/* The Magic Mailroom: everything in the DOM over the 3D room. */
:root { --gold1: #fff6c4; --gold2: #ffd45a; --gold3: #e8962a; --navy: #14204a; --navy2: #0b1233; --cream: #fbf3e1; --red: #c8232f; --blue: #2a4fb0;
  --safeT: env(safe-area-inset-top, 0px); --safeR: env(safe-area-inset-right, 0px); --safeB: env(safe-area-inset-bottom, 0px); --safeL: env(safe-area-inset-left, 0px); }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a0c22; color: #fff; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { font: 600 16px/1.3 'Chakra Petch', system-ui, sans-serif; touch-action: manipulation; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
canvas#room, canvas#warp { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas#warp { z-index: 5; pointer-events: none; }

/* ---- logo + tools ------------------------------------------------------------------------------------------------ */
#hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
#hud > * { pointer-events: auto; }
/* the full-screen hit layer and the speech bubbles must never swallow clicks meant for the icons: only the hit buttons
   themselves take the pointer */
#hud > .hits, #hud > .hint, #hud > .toast, #hud > .logo { pointer-events: none; }
#hud > .tools { position: absolute; z-index: 2; }
#hud.busy > .tools { pointer-events: none; }   /* mid-journey: the icons wait */
.logo { position: absolute; margin: 0; left: calc(var(--safeL) + clamp(8px, 2.2vw, 36px)); top: calc(var(--safeT) + clamp(4px, 1.4vh, 20px)); width: clamp(200px, 27vw, 470px);
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); transform-origin: 20% 30%; animation: logoIn 1.1s cubic-bezier(.2,1.4,.4,1) both .25s; pointer-events: none; }
.logo img { width: 100%; height: auto; display: block; }
@keyframes logoIn { from { opacity: 0; transform: translateY(-14px) scale(.88) rotate(-3deg); } to { opacity: 1; transform: none; } }
.tools { position: absolute; top: calc(var(--safeT) + clamp(8px, 2vh, 24px)); right: calc(var(--safeR) + clamp(8px, 2vw, 30px)); display: flex; gap: clamp(8px, 1vw, 14px); align-items: center;
  animation: toolsIn .9s ease-out both .5s; }
@keyframes toolsIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.round { --s: clamp(48px, 5.6vw, 84px); width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; box-sizing: border-box; padding: 0; cursor: pointer;
  border: 3px solid transparent; background: radial-gradient(circle at 50% 35%, #2e3f86, #101a46 70%) padding-box, linear-gradient(150deg, var(--gold1), var(--gold2) 35%, var(--gold3) 65%, var(--gold1)) border-box;
  box-shadow: 0 4px 0 rgba(40,20,0,.55), 0 8px 18px rgba(0,0,0,.45), inset 0 2px 6px rgba(255,255,255,.18); transition: transform .15s, filter .15s; }
.round img { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.round:hover { transform: translateY(-2px) scale(1.05); filter: brightness(1.12); }
.round:active { transform: translateY(2px) scale(.97); }
.gear { --s: clamp(40px, 4.2vw, 60px); color: var(--gold2); }
.gear svg { width: 56%; height: 56%; }
.round:focus-visible, .dPlay:focus-visible, .dClose:focus-visible, .setv button:focus-visible, .setv input:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.tokens { display: flex; align-items: center; gap: 8px; height: clamp(44px, 4.8vw, 64px); padding: 0 18px 0 6px; border-radius: 999px; box-sizing: border-box;
  border: 3px solid transparent; background: linear-gradient(#13204e, #0a1236) padding-box, linear-gradient(150deg, var(--gold1), var(--gold2) 35%, var(--gold3) 65%, var(--gold1)) border-box;
  box-shadow: 0 4px 0 rgba(40,20,0,.55), 0 8px 18px rgba(0,0,0,.45); font: 400 clamp(20px, 2.4vw, 32px)/1 'Russo One', sans-serif; color: var(--gold2); }
.tokens img { height: 88%; }
a.tokens { text-decoration: none; }
.tokens .wl { font: 700 .55em/1 'Chakra Petch', sans-serif; letter-spacing: .04em; color: #f4dfa8; margin-left: -2px; }
.tokens.bump { animation: tokBump .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tokBump { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ---- door hit-targets -------------------------------------------------------------------------------------------- */
.hits { position: absolute; inset: 0; pointer-events: none; }
.hit { position: absolute; left: 0; top: 0; pointer-events: auto; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 10px; transform-origin: 0 0; }
.hit:focus-visible { outline: 3px solid rgba(255,230,150,.9); outline-offset: -3px; }
.hit.sealed { cursor: default; }
.busy .hit, .busy .tools { pointer-events: none; }
.hint { position: absolute; margin: 0; left: 0; top: 0; padding: 6px 14px 8px; transform: translate(-50%, -100%) rotate(-4deg); background: #fbf1d6; color: #8a1a14; border-radius: 6px;
  font: 600 clamp(20px, 2vw, 28px)/1 Caveat, cursive; box-shadow: 0 6px 16px rgba(0,0,0,.45); pointer-events: none; animation: bob 1.6s ease-in-out infinite; white-space: nowrap; }
.hint::after { content: ''; position: absolute; left: 50%; bottom: -9px; margin-left: -9px; border: 9px solid transparent; border-bottom: 0; border-top-color: #fbf1d6; }
@keyframes bob { 50% { transform: translate(-50%, calc(-100% - 6px)) rotate(-2deg); } }
.toast { position: absolute; margin: 0; left: 0; top: 0; transform: translate(-50%, -110%); padding: 8px 14px; border-radius: 10px; background: rgba(12,16,48,.92); color: #ffe3a0;
  border: 2px solid #b8862e; font: 700 15px/1.1 'Chakra Petch', sans-serif; letter-spacing: .04em; opacity: 0; transition: opacity .25s; pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; }

/* ---- dispatch card ----------------------------------------------------------------------------------------------- */
.dispatch { position: fixed; z-index: 4; right: calc(var(--safeR) + clamp(10px, 1.6vw, 28px)); top: calc(var(--safeT) + clamp(96px, 15vh, 150px)); bottom: calc(var(--safeB) + clamp(10px, 2vh, 28px));
  width: clamp(300px, 29vw, 470px); display: flex; align-items: center; pointer-events: none; }
.dCard { position: relative; width: 100%; max-height: 100%; overflow: auto; box-sizing: border-box; padding: clamp(18px, 2.2vw, 30px) clamp(16px, 2vw, 28px) clamp(18px, 2vw, 28px); border-radius: 22px; pointer-events: auto;
  color: var(--navy); background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 clamp(8px, .9vw, 12px) transparent, 0 18px 40px rgba(0,0,0,.55); border: clamp(9px, .9vw, 13px) solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--red) 0 16px, var(--cream) 16px 24px, var(--blue) 24px 40px, var(--cream) 40px 48px) 14; border-radius: 0;
  transform: translateX(120%) rotate(4deg); opacity: 0; transition: transform .55s cubic-bezier(.2,1.25,.4,1), opacity .3s; }
.dispatch.open .dCard { transform: none; opacity: 1; }
.dHead { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 400 clamp(15px, 1.4vw, 20px)/1 'Russo One', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--navy); }
.dHead i { flex: 1; height: 0; border-top: 3px double rgba(20,32,74,.5); }
.dHead b { font-weight: 400; color: var(--red); letter-spacing: .06em; }
.dStamp { position: relative; margin: 0 auto 12px; width: 92%; transform: rotate(-2deg); filter: drop-shadow(0 6px 10px rgba(60,30,10,.35)); }
.dStamp canvas { width: 100%; height: auto; display: block; }
.dMark { position: absolute; right: -6%; bottom: -8%; width: 34%; aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(200,35,47,.75);
  background: repeating-radial-gradient(circle, transparent 0 9px, rgba(200,35,47,.0) 9px); transform: rotate(-14deg); }
.dMark::before { content: 'NORTH POLE · POST ·'; position: absolute; inset: 12%; display: grid; place-items: center; text-align: center; border-radius: 50%; border: 2px solid rgba(200,35,47,.6);
  font: 400 clamp(9px, .75vw, 12px)/1.1 'Russo One', sans-serif; color: rgba(200,35,47,.8); letter-spacing: .08em; }
.dTitle { margin: 4px 0 6px; text-align: center; font: 400 clamp(24px, 2.4vw, 38px)/1.05 'Russo One', sans-serif; color: var(--navy); letter-spacing: .01em; }
.dPitch { margin: 0 0 10px; text-align: center; font: 600 clamp(14px, 1.1vw, 17px)/1.3 'Chakra Petch', sans-serif; color: #3a3a5a; }
.dProg { margin: 0 auto 14px; width: fit-content; padding: 6px 18px; border-radius: 999px; background: linear-gradient(#1b2a66, #0d1640); color: var(--gold2); font: 400 clamp(14px, 1.2vw, 18px)/1.1 'Russo One', sans-serif;
  border: 2px solid #c89a3a; letter-spacing: .03em; }
.dPlay { display: flex; width: 100%; align-items: center; justify-content: center; gap: 12px; min-height: clamp(62px, 6.6vw, 92px); border-radius: 999px; cursor: pointer;
  border: 3px solid #fff2b0; color: #3a1c00; font: 400 clamp(30px, 3.4vw, 52px)/1 'Russo One', sans-serif; letter-spacing: .06em; text-transform: uppercase;
  background: linear-gradient(180deg, #fffbe0 0%, #ffe46a 30%, #ffc21e 52%, #f09a10 53%, #ffcf3a 100%);
  box-shadow: 0 6px 0 #9a5200, 0 12px 24px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.9); position: relative; overflow: hidden; transition: transform .12s, filter .12s; }
.dPlay svg { width: .85em; height: .85em; }
.dPlay::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent); animation: shine 2.8s ease-in-out infinite 1s; }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.dPlay:hover { filter: brightness(1.06); transform: translateY(-1px); }
.dPlay:active { transform: translateY(4px); box-shadow: 0 2px 0 #9a5200, 0 6px 12px rgba(0,0,0,.35); }
.dClose { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(20,32,74,.08); color: var(--navy); cursor: pointer; display: grid; place-items: center; }
.dClose svg { width: 20px; height: 20px; }

/* phones (portrait): bottom sheet */
@media (max-aspect-ratio: 4/5) {
  .dispatch { left: calc(var(--safeL) + 8px); right: calc(var(--safeR) + 8px); top: auto; bottom: calc(var(--safeB) + 8px); width: auto; height: auto; max-height: 46vh; align-items: flex-end; }
  .dCard { display: grid; grid-template-columns: 46% 1fr; grid-template-areas: 'head head' 'stamp title' 'stamp pitch' 'stamp prog' 'play play'; column-gap: 12px; align-items: center;
    transform: translateY(115%); padding: 14px 14px 16px; }
  .dHead { grid-area: head; margin-bottom: 6px; } .dStamp { grid-area: stamp; width: 100%; margin: 0; } .dTitle { grid-area: title; text-align: left; font-size: clamp(22px, 6.4vw, 30px); margin: 0; }
  .dPitch { grid-area: pitch; text-align: left; font-size: 13px; margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .dProg { grid-area: prog; margin: 2px 0 0; font-size: 13px; padding: 4px 12px; }
  .dPlay { grid-area: play; margin-top: 12px; min-height: 60px; font-size: 32px; }
  .dCard::before { content: ''; position: absolute; top: 4px; left: 50%; width: 54px; margin-left: -27px; height: 5px; border-radius: 3px; background: rgba(20,32,74,.25); }
  .dMark { display: none; }
}

/* ---- settings (carried over from the classic calendar) ------------------------------------------------------------- */
.setv { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(6,6,30,.66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.setp { box-sizing: border-box; width: min(560px, 94vw); max-height: 92vh; overflow: auto; padding: 22px max(16px, 3vw) 20px; border-radius: 18px; border: 3px solid transparent; text-align: center; color: #fff;
  background: linear-gradient(180deg, #2a3478 0%, #182058 46%, #0c1240 100%) padding-box, linear-gradient(140deg, #fff3c0, #d99a2a 45%, #ffe08a 70%, #b8741a) border-box; box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.setk { margin: 0; font: 700 12px/1 'Chakra Petch', sans-serif; letter-spacing: .22em; text-transform: uppercase; color: #ffd98a; }
.setH { margin: 8px 0 12px; font: 400 36px/1 'Russo One', sans-serif; color: var(--gold2); }
.setNote { margin: 16px 0 10px; font: 600 14px/1.35 'Chakra Petch', sans-serif; color: #d8d6ff; }
.setRows { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.setRow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: rgba(8,6,40,.45); }
.setRow > span { font: 700 15px/1.2 'Chakra Petch', sans-serif; } .setRow small { display: block; font-weight: 600; font-size: 12px; color: #b9b6f2; }
.setRow input[type=range] { width: min(220px, 50vw); accent-color: #ffcf3a; }
.setSeg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 999px; background: #0c0a34; border: 1px solid #5d63a4; }
.setSeg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: #d8d6ff; font: 700 12px/1 'Chakra Petch', sans-serif; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.setSeg button[aria-pressed="true"] { background: linear-gradient(180deg, #fffbd6, #ffe14a 44%, #ff9a1a 54%, #ffca3a); color: #2a1200; }
.setPad { margin: 14px 0 0; font: 600 13px/1.3 'Chakra Petch', sans-serif; color: #b9b6f2; }
.setBtns { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.setBtns button { min-height: 46px; min-width: 150px; padding: 0 20px; border-radius: 9px; font: italic 400 17px/1 'Russo One', sans-serif; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transform: skewX(-10deg); }
.setTest { color: #fff; border: 2px solid #5d63a4; background: linear-gradient(180deg, #4c5180, #1d2048); box-shadow: 0 4px 0 #06061a; }
.setDone { color: #2a1200; border: 2px solid #fff6b0; background: linear-gradient(180deg, #fffbd6 0%, #ffe14a 44%, #ff9a1a 54%, #ffca3a 100%); box-shadow: 0 4px 0 #8a4a00; }
.setReset { margin-top: 16px; }
.setReset label { cursor: pointer; }
.setWipeCtl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; max-width: 100%; }
.setWipeCtl select { min-height: 38px; min-width: 200px; max-width: min(290px, 72vw); padding: 0 30px 0 12px; border-radius: 999px; border: 1px solid #5d63a4; color: #fff; font: 700 13px/1 'Chakra Petch', sans-serif; cursor: pointer;
  -webkit-appearance: none; appearance: none; background: #0c0a34 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ffd98a' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center / 12px 8px; }
.setWipeCtl select option { background: #16134a; color: #fff; }
.setWipeGo { min-height: 38px; padding: 0 16px; border-radius: 999px; border: 2px solid #ff8a7a; background: linear-gradient(180deg, #7a1f2e, #3e0a18); color: #ffe3dc; font: 700 12px/1 'Chakra Petch', sans-serif; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.setWipeGo:hover { background: linear-gradient(180deg, #9a2838, #4e0e1e); }
.setWiped { min-height: 1.3em; margin: 8px 0 0; font: 600 13px/1.3 'Chakra Petch', sans-serif; color: #9df0b4; }
.setv select:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.wipeV { position: fixed; inset: 0; z-index: 41; display: grid; place-items: center; padding: 16px; background: rgba(4,2,20,.6); }
.wipeV[hidden] { display: none; }
.wipeP { box-sizing: border-box; width: min(440px, 92vw); padding: 22px max(16px, 3vw) 20px; border-radius: 16px; text-align: center; color: #fff; border: 3px solid #ff8a7a;
  background: linear-gradient(180deg, #2a1650, #120a32); box-shadow: 0 18px 50px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.08); animation: wipeIn .22s ease-out; }
@keyframes wipeIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.wipeH { margin: 8px 0 10px; font: 400 28px/1.1 'Russo One', sans-serif; color: #ffd0c4; }
.wipeT { margin: 0; font: 600 15px/1.4 'Chakra Petch', sans-serif; color: #e6e2ff; }
.wipeNo { margin: 10px 0 0; font: 700 13px/1.3 'Chakra Petch', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #ff9a8a; }
.wipeYes { color: #fff; border: 2px solid #ffb1a4; background: linear-gradient(180deg, #e0485a 0%, #b81f36 50%, #8c1026 100%); box-shadow: 0 4px 0 #4a0612; }
@media (prefers-reduced-motion: reduce) { .wipeP { animation: none; } }
.setLegacy { margin: 18px 0 0; font: 600 14px/1.3 'Chakra Petch', sans-serif; }
.setLegacy a { color: #ffd98a; }

/* ---- curtain + flash ----------------------------------------------------------------------------------------------- */
.curtain { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #1b2560, #070920 70%); transition: opacity .9s ease; }
.curtain img { width: min(60vw, 520px); animation: pulse 1.6s ease-in-out infinite; filter: drop-shadow(0 8px 20px rgba(0,0,0,.5)); }
.curtain.out { opacity: 0; pointer-events: none; }
@keyframes pulse { 50% { transform: scale(1.03); filter: drop-shadow(0 8px 30px rgba(255,200,90,.35)); } }
.flash { position: fixed; inset: 0; z-index: 6; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, #fffbe8, #ffe6a8 50%, #ffd27a); }

@media (max-aspect-ratio: 4/5) {
  .logo { width: clamp(170px, 52vw, 300px); }
  .round { --s: clamp(46px, 12.5vw, 64px); } .gear { --s: clamp(38px, 10vw, 50px); }
  .tools { gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 46vw; }
  .tokens { order: 2; height: clamp(38px, 10vw, 50px); font-size: 20px; padding-right: 12px; }   /* under the icons, clear of the logo */
}
@media (prefers-reduced-motion: reduce) { .logo, .tools, .hint, .dPlay::after, .curtain img { animation: none !important; } }

/* the shell: speaker and full-screen buttons, the first-visit full-screen note, "Play it like an app" */
.gear svg.off { display: none; }
.gear.isOff svg.on { display: none; } .gear.isOff svg.off { display: block; }
#mute.isOff { color: #b9b6f2; }
.fsTip { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--safeB, 0px) + clamp(12px, 3vh, 28px)); transform: translate(-50%, 20px); opacity: 0; transition: opacity .3s, transform .35s cubic-bezier(.2,1.3,.4,1);
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 24px); box-sizing: border-box; padding: 10px 10px 10px 12px; border-radius: 18px; color: #fff;
  border: 2px solid transparent; background: linear-gradient(180deg, #1d2470, #0e1240) padding-box, linear-gradient(150deg, var(--gold1), var(--gold2) 40%, var(--gold3)) border-box; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.fsTip.on { opacity: 1; transform: translate(-50%, 0); }
.fsTip[hidden] { display: none; }
.fsIcon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #2a1200; background: linear-gradient(180deg, #fffbd6, #ffe14a 44%, #ff9a1a 54%, #ffca3a); }
.fsIcon svg { width: 24px; height: 24px; }
.fsTip p { margin: 0; min-width: 0; }
.fsTip b { display: block; font: 400 17px/1.1 'Russo One', sans-serif; color: var(--gold2); }
.fsTip small { display: block; margin-top: 3px; font: 600 13px/1.25 'Chakra Petch', sans-serif; color: #d8d6ff; }
.fsTip button { flex: none; min-height: 40px; border-radius: 999px; cursor: pointer; font: 700 13px/1 'Chakra Petch', sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.fsGo { padding: 0 16px; color: #2a1200; border: 2px solid #fff6b0; background: linear-gradient(180deg, #fffbd6 0%, #ffe14a 44%, #ff9a1a 54%, #ffca3a 100%); box-shadow: 0 3px 0 #8a4a00; }
.fsNo { padding: 0 12px; color: #d8d6ff; border: 1px solid #5d63a4; background: rgba(8,6,40,.5); }
.fsTip button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-width: 560px) { .fsTip { flex-wrap: wrap; justify-content: flex-end; width: calc(100vw - 24px); } .fsTip p { flex: 1 1 calc(100% - 60px); } }
.a2p { width: min(480px, 94vw); }
.a2Lead { margin: 0 0 14px; font: 600 15px/1.4 'Chakra Petch', sans-serif; color: #d8d6ff; }
.a2Steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.a2Steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(8,6,40,.45); font: 600 15px/1.35 'Chakra Petch', sans-serif; }
.a2Steps li > b { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #ffe14a; background: #0c0a34; border: 1px solid #5d63a4; }
.a2Steps li > b svg { width: 26px; height: 26px; }
.a2Steps i { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; font: 700 12px/1 'Chakra Petch', sans-serif; font-style: normal; color: #2a1200; background: var(--gold2); vertical-align: 1px; }
.a2Steps b b, .a2Steps span b { color: #ffe9a0; }
.setLegacy a + a { margin-left: 2px; }
@media (max-aspect-ratio: 4/5) { #full, #mute { --s: clamp(38px, 10vw, 50px); } }

#hud .mailContact { position:absolute; bottom:calc(var(--safeB) + 6px); right:calc(var(--safeR) + 8px); pointer-events:auto; padding:7px 13px; font:600 14px 'Chakra Petch',sans-serif; color:#fff2cc; text-decoration:none; border:1px solid #dbb66c; border-radius:20px; background:#152344ed; z-index:2; }
#hud .mailContact:focus-visible { outline:3px solid white; }

/* A brass selector on the porch and in the room's free lower-left corner. */
.gfxSwitch { display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; padding: 0 2px 0 10px; border: 1px solid #d7af64; border-radius: 24px;
  background: linear-gradient(#24355a, #101a36); color: #fff2d6; box-shadow: inset 0 1px 0 #fff2c71f, 0 2px 5px #07112b88;
  font: 700 12px/1 'Chakra Petch', system-ui, sans-serif; }
.gfxCaption { margin-right: 4px; letter-spacing: .06em; }
.gfxSwitch button { position: relative; isolation: isolate; width: 44px; height: 44px; border: 0; border-radius: 20px;
  padding: 0; background: transparent; color: #d9e2ee; font: inherit; cursor: pointer; touch-action: manipulation; }
.gfxSwitch button[aria-pressed="true"] { color: #36220d; }
.gfxSwitch button[aria-pressed="true"]::before { content: ''; position: absolute; inset: 7px 1px; z-index: -1;
  border-radius: inherit; background: linear-gradient(#fff1b1, #eeb452); }
.gfxSwitch button:focus-visible { outline: 3px solid #fff2b3; outline-offset: -2px; }
/* PC and iPad: the graphics switch sits in the top-right row beside sound, full screen and settings, brass-rimmed like its
   neighbours. Phones (narrow, or short landscape) show a second copy, #roomGfxPhone, in the free lower-left corner instead,
   so the top row doesn't crowd. entrance.js keeps every [data-gfx] button in step. */
#hud .tools > #roomGfx { --s: clamp(40px, 4.2vw, 60px); height: var(--s); padding: 0 3px 0 clamp(10px, 1vw, 14px); border: 3px solid transparent; border-radius: 999px;
  background: radial-gradient(circle at 50% 35%, #2e3f86, #101a46 70%) padding-box, linear-gradient(150deg, var(--gold1), var(--gold2) 35%, var(--gold3) 65%, var(--gold1)) border-box;
  box-shadow: 0 4px 0 rgba(40,20,0,.55), 0 8px 18px rgba(0,0,0,.45), inset 0 2px 6px rgba(255,255,255,.18); font-size: clamp(12px, .95vw, 15px); color: var(--gold2); }
#hud .tools > #roomGfx button { width: clamp(44px, 3.5vw, 54px); height: calc(var(--s) - 6px); border-radius: 999px; }
#hud .tools > #roomGfx button[aria-pressed="true"]::before { inset: 4px 1px; }
#roomGfxPhone { position: absolute; left: calc(var(--safeL) + 8px); bottom: calc(var(--safeB) + 4px); z-index: 2; display: none; }
@media (max-width: 620px), (max-height: 520px) {
  #hud .tools > #roomGfx { display: none; }
  #hud > #roomGfxPhone { display: inline-flex; }
}
#hud.busy #roomGfxPhone { visibility: hidden; }
#hud.busy #roomGfx { visibility: hidden; }
#full { border-color:#ffdf82; background:linear-gradient(145deg,#724427,#30203a); box-shadow:0 0 0 2px #ffd67b60,0 4px 12px #14132b; }

/* ---- what's selected: home from a game, and gamepad focus ---------------------------------------------------------- */
/* Home from the claw machine or the toy shop, its button glows for a moment (main.js homeToTool). Home from a door, the
   door's cubby does the same in 3D (the rack's outline). */
.round.homeGlow, .tokens.homeGlow { animation: homeGlow 0.95s ease-in-out 3; }
@keyframes homeGlow { 50% { transform: translateY(-3px) scale(1.12); box-shadow: 0 0 0 5px #ffd45a, 0 0 30px 10px rgba(255,212,90,.8), 0 8px 18px rgba(0,0,0,.45); filter: brightness(1.2); } }
/* the selected door's cubby: a clear gold frame for the keyboard. A pad gets the shared pulsing gold ring
   (shared/js/pad-wake.js) on every control here, and the rack's 3D outline pulses and lifts with it (main.js syncOutline). */
.hit:focus-visible { outline: 4px solid #ffd45a; outline-offset: -2px; box-shadow: 0 0 22px 4px rgba(255,212,90,.55); }
/* the cubby buttons are placed with transform from a 0 0 origin, so the shared ring's little scale-up would slide them off
   their cubbies (and throw the pad's next step): they stay put, the 3D outline does the lifting */
html.advent-pad #hits .hit:focus { scale: none; }
/* the mouse moved after we put focus somewhere for you: keep the focus, drop the ring (a pad or a key brings it back) */
html:not(.advent-pad) .quiet:focus-visible { outline: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .round.homeGlow, .tokens.homeGlow { animation: none; } }
