@font-face { font-family: 'Anton'; src: url('../fonts/anton-latin.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Anton'; src: url('../fonts/anton-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F; font-display: swap; }
@font-face { font-family: 'Barlow C'; src: url('../fonts/barlow-condensed-700i-latin.woff2') format('woff2'); font-style: italic; font-weight: 700; font-display: swap; }
@font-face { font-family: 'Chakra'; src: url('../fonts/chakra-500-latin.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Chakra'; src: url('../fonts/chakra-700-latin.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #0d0a12;
  --ink2: #1a1324;
  --bone: #f6efe4;
  --bone2: #d9cfc1;
  --amber: #ffb43b;
  --blood: #d4204a;
  --acc: #ffb43b;          /* current speaker / place color */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #050308; color: var(--bone); overflow: hidden;
  font-family: 'Chakra', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; user-select: none; -webkit-user-select: none; }
#app { position: relative; width: 100%; max-width: 560px; height: 100%; margin: 0 auto; overflow: hidden; background: var(--ink); }
.hidden { display: none !important; }

/* ---------- backdrop ---------- */
#bg { position: absolute; inset: 0; overflow: hidden; background: var(--ink2); }
#bg .bg-img { position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity .45s; }
#bg .bg-fx { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(13,10,18,.35), rgba(13,10,18,0) 16%, rgba(13,10,18,0) 70%, rgba(13,10,18,.25)); }
#bg.css-bg .bg-img { background-color: var(--bgc, #2a1d3a);
  background-image:
    radial-gradient(circle, rgba(0,0,0,.28) 1.6px, transparent 1.8px),
    linear-gradient(115deg, transparent 0 38%, rgba(255,255,255,.06) 38% 52%, transparent 52%),
    linear-gradient(160deg, var(--bgc, #2a1d3a) 0%, #0d0a12 85%);
  background-size: 9px 9px, 100% 100%, 100% 100%; }
#bg .bg-label { position: absolute; left: -4%; top: 18%; width: 110%; transform: rotate(-8deg); font-family: 'Anton'; font-size: 17vmin;
  line-height: .9; color: rgba(255,255,255,.07); text-transform: uppercase; white-space: nowrap; pointer-events: none; }
#bg:not(.css-bg) .bg-label { display: none; }

/* ---------- stage / portraits ---------- */
#stage { position: absolute; inset: 0; pointer-events: none; }
.char { position: absolute; bottom: 0; height: 74%; left: 50%; transform: translateX(-50%); transition: transform .35s cubic-bezier(.2,.8,.2,1), filter .25s, opacity .3s; }
.char img { height: 100%; display: block; filter: drop-shadow(0 0 0 #000) drop-shadow(6px 6px 0 rgba(0,0,0,.55));
  /* arms cut by the source frame (e.g. Juni's elbows) fade out softly instead of ending in a hard vertical line */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%); }
.char.left, .char.right { height: 58%; }
.char.left { transform: translateX(-86%); }
.char.right { transform: translateX(-14%); }
.char.left.enter { transform: translateX(-86%) translateY(4%); }
.char.right.enter { transform: translateX(-14%) translateY(4%); }
.char.dim { filter: brightness(.55) saturate(.7); }
.char.enter { opacity: 0; transform: translateX(-50%) translateY(4%); }
.char.shake { animation: shake .35s; }
@keyframes shake { 0%,100% { margin-left: 0 } 25% { margin-left: -10px } 75% { margin-left: 10px } }
.char.sil { width: 62%; height: 64%; }
.char.sil .sil-card { position: absolute; inset: 0; clip-path: polygon(8% 0, 100% 4%, 92% 100%, 0 96%);
  background: linear-gradient(160deg, var(--c), #0d0a12 90%); border: 0; display: flex; align-items: flex-end; justify-content: center; }
.char.sil .sil-card::before { content: ''; position: absolute; left: 50%; top: 14%; width: 46%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: rgba(0,0,0,.55); }
.char.sil .sil-card::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 82%; height: 46%; transform: translateX(-50%); border-radius: 48% 48% 0 0; background: rgba(0,0,0,.55); }
.char.sil .sil-name { position: absolute; bottom: 30%; left: 0; right: 0; text-align: center; font-family: 'Anton'; font-size: 30px; color: var(--bone); text-shadow: 3px 3px 0 #000; z-index: 2; letter-spacing: 1px; }

/* ---------- HUD ---------- */
#hud { position: absolute; top: calc(var(--safe-t) + 10px); left: 10px; right: 10px; display: flex; align-items: flex-start; gap: 8px; z-index: 5; pointer-events: none; }
.hud-date { background: var(--bone); color: var(--ink); padding: 4px 14px 6px 10px; clip-path: polygon(0 0, 100% 0, 90% 100%, 0 100%); display: flex; align-items: baseline; gap: 6px; box-shadow: 4px 4px 0 #000; }
.hud-month { font-family: 'Barlow C'; font-size: 16px; color: var(--blood); }
.hud-day { font-family: 'Anton'; font-size: 34px; line-height: 1; }
.hud-dow { font-family: 'Barlow C'; font-size: 18px; text-transform: uppercase; }
.hud-slot { margin-top: 6px; background: var(--ink); color: var(--amber); border: 2px solid var(--amber); font-family: 'Barlow C'; font-size: 17px; padding: 2px 14px; transform: skewX(-12deg); text-transform: uppercase; letter-spacing: .5px; }
.hud-money { margin-left: auto; margin-top: 6px; font-family: 'Anton'; font-size: 20px; background: var(--ink); padding: 2px 12px; border: 2px solid var(--bone); transform: skewX(-12deg); }

/* ---------- dialogue ---------- */
#dlg { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 9vh); padding: 0 12px; z-index: 6; }
.dlg-name { position: relative; display: inline-block; margin-left: 10px; margin-bottom: -6px; z-index: 2; background: var(--acc); color: var(--ink);
  font-family: 'Anton'; font-size: 28px; letter-spacing: 1px; padding: 2px 22px 2px 14px; transform: rotate(-3deg); clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%); text-transform: uppercase; }
.dlg-name:empty { display: none; }
.dlg-box { position: relative; background: #0d0a12; border: 4px solid var(--bone); min-height: 140px; padding: 20px 20px 28px 24px;
  clip-path: polygon(0 4%, 100% 0, 99% 100%, 1% 96%); box-shadow: inset 0 0 0 2px #000; }
.dlg-box::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--acc); }
.dlg-text { font-size: 21px; font-weight: 500; line-height: 1.45; min-height: 88px; white-space: pre-wrap; color: #fff; }
.dlg-text.narr { color: var(--amber); }
.dlg-text.you { color: #fff6d8; }
.dlg-next { position: absolute; right: 18px; bottom: 6px; color: var(--acc); font-size: 14px; animation: bob 1s infinite; }
@keyframes bob { 50% { transform: translateY(3px) } }

/* ---------- choices ---------- */
#choices { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 9vh); padding: 0 14px; display: flex; flex-direction: column; gap: 10px; z-index: 7; }
#choices .ch-prompt { background: #0d0a12; border-left: 6px solid var(--acc); color: #fff; font-size: 17px; line-height: 1.4; padding: 10px 14px; margin-bottom: 2px; box-shadow: 5px 5px 0 #000; }
.choice { position: relative; background: var(--bone); color: var(--ink); border: 0; font: 700 18px 'Chakra', system-ui; text-align: left;
  padding: 13px 18px 13px 40px; clip-path: polygon(2% 0, 100% 0, 98% 100%, 0 100%); box-shadow: 5px 5px 0 #000; cursor: pointer;
  animation: slidein .25s both; }
.choice::before { content: ''; position: absolute; left: 14px; top: 50%; width: 12px; height: 12px; background: var(--acc); transform: translateY(-50%) rotate(45deg); }
.choice:active, .choice.hot { background: var(--acc); }
.choice:nth-child(2) { animation-delay: .05s } .choice:nth-child(3) { animation-delay: .1s } .choice:nth-child(4) { animation-delay: .15s }
@keyframes slidein { from { transform: translateX(-30px); opacity: 0 } }

/* ---------- screens (map, place, room, title) ---------- */
#screen { position: absolute; inset: 0; z-index: 8; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--safe-t) + 72px) 14px calc(var(--safe-b) + 24px); }
#screen.title-screen { padding: 0; overflow: hidden; }
.scr-head { font-family: 'Anton'; font-size: 40px; line-height: 1; text-transform: uppercase; margin: 6px 0 12px; transform: rotate(-3deg); text-shadow: 4px 4px 0 #000; }
.scr-head small { display: block; font-family: 'Barlow C'; font-size: 18px; color: var(--amber); text-transform: none; letter-spacing: .3px; }

.place { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 12px 14px 12px 18px; border: 0; color: var(--bone);
  background: linear-gradient(100deg, rgba(13,10,18,.92) 60%, color-mix(in srgb, var(--pc) 35%, rgba(13,10,18,.92)));
  clip-path: polygon(0 0, 100% 0, 98% 100%, 1% 100%); text-align: left; cursor: pointer; box-shadow: inset 6px 0 0 var(--pc); }
.place.closed { opacity: .38; }
.place .p-name { font-family: 'Anton'; font-size: 22px; letter-spacing: .5px; text-transform: uppercase; line-height: 1.05; }
.place .p-sub { font-family: 'Barlow C'; font-size: 15px; color: var(--bone2); }
.place .p-who { margin-left: auto; display: flex; gap: 4px; }
.place .p-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--c); background: #000 center 12% / 210% no-repeat; box-shadow: 2px 2px 0 #000; position: relative; }
.place .p-dot.ini { display: flex; align-items: center; justify-content: center; font-family: 'Anton'; font-size: 16px; color: var(--c); }
.place .p-dot .p-star { position: absolute; right: -4px; bottom: -4px; background: var(--c); color: #000; font: 700 10px 'Chakra'; border-radius: 6px; padding: 0 3px; }
.place .p-new { position: absolute; right: 10px; top: 4px; font-family: 'Barlow C'; font-size: 12px; color: var(--amber); }

.panel { background: rgba(13,10,18,.94); border: 3px solid var(--bone); padding: 16px; clip-path: polygon(0 1%, 100% 0, 99% 100%, 0 99%); margin-bottom: 12px; }
.act { display: block; width: 100%; text-align: left; border: 0; margin: 0 0 9px; padding: 11px 14px; background: var(--bone); color: var(--ink); cursor: pointer;
  clip-path: polygon(1% 0, 100% 0, 99% 100%, 0 100%); box-shadow: 4px 4px 0 #000; font-family: 'Chakra'; }
.act b { display: block; font-family: 'Anton'; font-weight: 400; font-size: 19px; letter-spacing: .4px; text-transform: uppercase; }
.act span { font-size: 13.5px; color: #3d3346; }
.act .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.act .tag { font: 700 12px 'Chakra'; padding: 1px 7px; color: #fff; background: #000; }
.act.hang { background: var(--c); }
.act.hang span { color: #1b1020; }
.act.off { opacity: .45; }
.btn { display: inline-block; border: 0; cursor: pointer; font-family: 'Anton'; font-size: 20px; letter-spacing: 1px; text-transform: uppercase; padding: 10px 22px;
  background: var(--amber); color: var(--ink); clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%); box-shadow: 4px 4px 0 #000; }
.btn.ghost { background: transparent; color: var(--bone); outline: 2px solid var(--bone); outline-offset: -2px; }
.btn.small { font-size: 16px; padding: 7px 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.back { position: absolute; top: calc(var(--safe-t) + 14px); right: 12px; z-index: 9; }

/* bottom nav on the map */
.nav { position: fixed; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; bottom: 0; padding: 10px 14px calc(var(--safe-b) + 12px);
  display: flex; gap: 10px; background: linear-gradient(0deg, rgba(5,3,8,.95) 60%, transparent); z-index: 9; }
.nav .btn { flex: 1; text-align: center; }

/* stats */
.stat { margin-bottom: 12px; }
.stat .s-top { display: flex; align-items: baseline; gap: 8px; }
.stat .s-name { font-family: 'Anton'; font-size: 22px; text-transform: uppercase; color: var(--sc); }
.stat .s-lvl { font-family: 'Barlow C'; font-size: 17px; }
.stat .s-bar { height: 12px; background: #2b2233; transform: skewX(-20deg); margin-top: 3px; border: 2px solid #000; }
.stat .s-fill { height: 100%; background: var(--sc); }
.stat .s-pips { margin-left: auto; letter-spacing: 2px; color: var(--sc); }

/* bonds */
.bond { display: flex; gap: 12px; align-items: center; padding: 10px; margin-bottom: 10px; background: rgba(255,255,255,.04); border-left: 6px solid var(--c); }
.bond .b-face { width: 64px; height: 64px; flex: none; border-radius: 4px; background: #000 center 10% / 200% no-repeat; border: 2px solid var(--c); transform: rotate(-4deg); box-shadow: 3px 3px 0 #000; display: flex; align-items: center; justify-content: center; font-family: 'Anton'; font-size: 26px; color: var(--c); }
.bond .b-name { font-family: 'Anton'; font-size: 21px; text-transform: uppercase; }
.bond .b-role { font-family: 'Barlow C'; font-size: 14px; color: var(--bone2); }
.bond .b-stars { color: var(--c); letter-spacing: 1px; font-size: 15px; }
.bond .b-next { font-size: 12.5px; color: var(--bone2); margin-top: 2px; }
.bond .b-next em { color: var(--amber); font-style: normal; }
.bond .b-love { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 14px; }
.bond .b-aff { color: var(--c); letter-spacing: 1px; }
.bond .b-ms { display: flex; gap: 3px; }
.bond .b-ms i { font-style: normal; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; border: 1px solid rgba(255,255,255,.18); color: var(--bone2); transform: rotate(-4deg); }
.bond .b-ms i.on { background: var(--c); border-color: var(--c); color: #000; }
.bond .b-ms i.nx { border-color: var(--c); color: var(--c); }
.bond.locked { opacity: .45; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { flex: 1; border: 0; padding: 8px 4px; font-family: 'Anton'; font-size: 15px; letter-spacing: .5px; text-transform: uppercase; background: #241b2e; color: var(--bone); transform: skewX(-10deg); cursor: pointer; }
.tabs button.on { background: var(--amber); color: var(--ink); }
.fundbar { height: 20px; background: #2b2233; border: 2px solid #000; transform: skewX(-15deg); margin: 8px 0; }
.fundbar div { height: 100%; background: linear-gradient(90deg, var(--blood), var(--amber)); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal div { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #1f1729; font-family: 'Anton'; font-size: 16px; position: relative; }
.cal div small { font: 500 8.5px 'Chakra'; color: var(--bone2); }
.cal .past { opacity: .35; } .cal .today { background: var(--amber); color: var(--ink); } .cal .today small { color: var(--ink); }
.cal .event { outline: 2px solid var(--blood); outline-offset: -2px; }
.cal .head { aspect-ratio: auto; background: none; font-family: 'Barlow C'; font-size: 13px; color: var(--amber); }

/* banners (rank up, stat up) */
#banner { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(5,3,8,.55); pointer-events: auto; }
.bn { position: relative; width: 112%; padding: 18px 0 20px; background: var(--c); color: var(--ink); transform: rotate(-7deg); text-align: center; box-shadow: 0 10px 0 #000; animation: bn-in .4s cubic-bezier(.2,1.4,.4,1) both; }
.bn::before, .bn::after { content: ''; position: absolute; left: 0; right: 0; height: 8px; background: #000; }
.bn::before { top: -14px } .bn::after { bottom: -14px }
.bn .bn-top { font-family: 'Barlow C'; font-size: 20px; letter-spacing: 1px; }
.bn .bn-big { font-family: 'Anton'; font-size: 54px; line-height: 1; text-transform: uppercase; }
.bn .bn-sub { font-family: 'Chakra'; font-weight: 700; font-size: 15px; margin-top: 6px; padding: 0 16%; }
.bn .bn-stars { font-size: 22px; letter-spacing: 3px; }
@keyframes bn-in { from { transform: rotate(-7deg) translateX(-110%) } }
#toast { position: absolute; left: 50%; top: calc(var(--safe-t) + 70px); transform: translateX(-50%); z-index: 21; background: var(--bone); color: var(--ink); font: 700 15px 'Chakra'; padding: 8px 16px; box-shadow: 4px 4px 0 #000; clip-path: polygon(2% 0, 100% 0, 98% 100%, 0 100%); white-space: nowrap; }

/* title */
.title-wrap { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 18px calc(var(--safe-b) + 30px);
  background: linear-gradient(180deg, transparent 0 46%, rgba(13,10,18,.85) 62%, var(--ink) 74%); }
.title-cast { position: absolute; left: 0; right: 0; top: calc(var(--safe-t) + 2%); height: 64%; z-index: 1; overflow: hidden; }
.title-cast img { position: absolute; bottom: 0; filter: drop-shadow(5px 5px 0 rgba(0,0,0,.55)); }
.title-logo { font-family: 'Anton'; font-size: 74px; line-height: .86; text-transform: uppercase; transform: rotate(-6deg); color: var(--bone); text-shadow: 5px 5px 0 var(--blood), 9px 9px 0 #000; margin-bottom: 18px; position: relative; }
.title-logo span { color: var(--amber); }
.title-logo small { display: block; font-size: .4em; line-height: 1; letter-spacing: .12em; margin: 8px 0 0 4px; color: var(--bone); }
.title-tag { font-family: 'Barlow C'; font-size: 19px; color: var(--bone2); margin-bottom: 18px; position: relative; }
.title-btns { display: flex; flex-direction: column; gap: 10px; position: relative; }
.title-btns .btn { font-size: 24px; }
.name-in { width: 100%; font: 700 22px 'Chakra'; padding: 10px 14px; border: 3px solid var(--bone); background: #000; color: var(--bone); margin: 10px 0 14px; }

/* ending */
.end-title { font-family: 'Anton'; font-size: 46px; line-height: 1; text-transform: uppercase; color: var(--c); text-shadow: 4px 4px 0 #000; transform: rotate(-4deg); margin: 18px 0 8px; }
.end-list { columns: 2; font-size: 13px; color: var(--bone2); margin-top: 10px; }
.end-list .got { color: var(--amber); }

.skipbtn { position: absolute; z-index: 9; right: 10px; top: calc(var(--safe-t) + 12px); font-family: 'Barlow C'; font-size: 15px; background: rgba(0,0,0,.6); color: var(--bone); border: 2px solid var(--bone); padding: 3px 10px; transform: skewX(-12deg); }
.fade { animation: fade .35s both; } @keyframes fade { from { opacity: 0 } }
.cg { position: absolute; inset: 0; background: #000 center / cover no-repeat; z-index: 1; }

/* ---------- town map ---------- */
#screen.map-screen { padding-bottom: calc(var(--safe-b) + 80px); }
.town-wrap { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
.town { position: relative; width: 100%; aspect-ratio: 100 / 170; max-height: calc(100vh - 190px); margin: 0 auto; }
.town svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border: 3px solid var(--bone); box-shadow: 6px 6px 0 #000; }
.t-blocks rect { fill: #241a31; stroke: #2f2340; stroke-width: .4; }
.t-roads line { stroke: #f6efe4; stroke-width: 4.2; stroke-linecap: round; opacity: .9; }
.t-roads2 line { stroke: #1a1324; stroke-width: 3; stroke-linecap: round; }
.t-river { fill: #2c6fa8; opacity: .85; }
.t-bridge { fill: #f6efe4; }
.t-park ellipse { fill: #1f3a2e; }
.t-dist { font-family: 'Anton'; font-size: 4.2px; fill: rgba(246,239,228,.32); text-anchor: middle; letter-spacing: .6px; }
.t-pins { position: absolute; inset: 0; }
.t-pin { position: absolute; transform: translate(-50%, -50%) rotate(-4deg); border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; z-index: 2; }
.t-tag { background: var(--pc); color: #0d0a12; font-family: 'Anton'; font-size: 12.5px; line-height: 1; padding: 4px 8px 5px; white-space: nowrap; text-transform: uppercase; letter-spacing: .3px;
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%); box-shadow: 3px 3px 0 #000; }
.t-pin.closed { opacity: .38; filter: grayscale(.6); }
.t-pin.busy .t-tag { outline: 2px solid #fff; outline-offset: 1px; }
.t-faces { display: flex; gap: 2px; margin-bottom: 3px; min-height: 0; }
.t-face { display: block; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--c); background: #000 center 12% / 210% no-repeat; box-shadow: 2px 2px 0 #000; font: 400 13px/22px 'Anton'; color: var(--c); text-align: center; font-style: normal; position: relative; }
.t-face.ready::after { content: '!'; position: absolute; right: -5px; top: -6px; width: 13px; height: 13px; border-radius: 50%; background: #ffb43b; color: #000; font: 700 10px/13px 'Chakra'; text-align: center; }
.t-you { position: absolute; transform: translate(-50%, 30%); z-index: 3; pointer-events: none; }
.t-you span { display: block; background: #fff; color: #0d0a12; font: 700 10px 'Chakra'; padding: 2px 6px; border-radius: 10px; box-shadow: 2px 2px 0 #000; animation: bob 1s infinite; }
.t-you.walk span { animation: bob .3s infinite; }

#ff { top: calc(var(--safe-t) + 58px); font-size: 22px; line-height: 1; padding: 4px 12px; cursor: pointer; }
#ff.on { background: var(--amber); color: var(--ink); }
#app.cg-on #stage { display: none; }
#app.cg-on .cg { background-position: center 30%; }

/* ---------- place cards (map) ---------- */
#screen.map-list { padding-bottom: calc(var(--safe-b) + 96px); background: linear-gradient(180deg, rgba(13,10,18,.55), rgba(13,10,18,.82)); }
.goal { background: var(--amber); color: var(--ink); font-size: 15px; line-height: 1.35; padding: 10px 14px; margin: 0 0 14px; box-shadow: 5px 5px 0 #000; clip-path: polygon(0 0, 100% 0, 98.5% 100%, 0 100%); }
.goal b { font-weight: 700; }
.dist { font-family: 'Anton'; font-size: 15px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink); background: var(--bone); display: inline-block; padding: 1px 12px; margin: 8px 0 8px; transform: skewX(-12deg); }
.pcard { display: flex; width: 100%; gap: 0; margin: 0 0 10px; padding: 0; border: 0; text-align: left; cursor: pointer; background: #0d0a12; color: var(--bone);
  border-left: 8px solid var(--pc); box-shadow: 5px 5px 0 #000; font: inherit; min-height: 96px; }
.pcard:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 #000; }
.pc-thumb { flex: 0 0 84px; background: var(--pc) center / cover no-repeat; border-right: 3px solid #000; }
.pc-main { padding: 9px 12px 10px; min-width: 0; flex: 1; }
.pc-name { font-family: 'Anton'; font-size: 21px; line-height: 1.05; text-transform: uppercase; letter-spacing: .4px; color: #fff; }
.pc-sub { font-family: 'Barlow C'; font-size: 15px; color: var(--bone2); }
.pc-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pc-who { display: inline-flex; align-items: center; gap: 5px; background: var(--c); color: var(--ink); font: 700 13px 'Chakra'; padding: 2px 8px 2px 2px; border-radius: 20px; }
.pc-who i { width: 26px; height: 26px; border-radius: 50%; background: #000 center 12% / 210% no-repeat; border: 2px solid #000; }
.pc-who em { font-style: normal; background: #000; color: var(--amber); font-size: 11px; padding: 0 5px; border-radius: 8px; margin-left: 2px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pc-tags .tag, .act .tag { font: 700 12px 'Chakra'; padding: 1px 7px; color: #000; background: var(--bone); font-style: normal; }
.pc-tags .tag.money { background: #7dff9a; }
.pc-shut { font-size: 12.5px; color: var(--bone2); margin: -2px 0 10px; opacity: .8; }
.pc-shut small { opacity: .7; }
.nav .btn.help { flex: 0 0 52px; padding-left: 0; padding-right: 0; }

/* place screen */
.pl-h { font-family: 'Anton'; font-size: 14px; letter-spacing: 2px; text-transform: uppercase; color: var(--amber); margin: 2px 0 8px; }
.act.hang { display: flex; align-items: center; gap: 12px; }
.act.hang .h-face { flex: 0 0 52px; height: 52px; border-radius: 50%; border: 3px solid #000; background: #000 center 12% / 210% no-repeat; }
.act.hang b small { font-family: 'Chakra'; font-size: 13px; letter-spacing: 0; }

/* confirm sheet */
.sheet-wrap { position: absolute; inset: 0; z-index: 30; background: rgba(5,3,8,.6); display: flex; align-items: flex-end; justify-content: center; animation: fadein .15s; }
.sheet { --c: var(--amber); width: 100%; max-width: 560px; background: #0d0a12; border-top: 6px solid var(--c); padding: 20px 18px calc(var(--safe-b) + 18px); animation: sheetup .2s cubic-bezier(.2,.8,.2,1); }
.sh-title { font-family: 'Anton'; font-size: 30px; line-height: 1.05; text-transform: uppercase; color: #fff; margin-bottom: 8px; }
.sh-body { font-size: 16px; line-height: 1.45; color: var(--bone); }
.sh-body b { color: var(--c); }
.sh-cost { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sh-cost .tag { font: 700 13px 'Chakra'; padding: 2px 8px; color: #000; background: var(--bone); font-style: normal; }
.sh-btns { display: flex; gap: 10px; margin-top: 18px; }
.sh-btns .btn { flex: 1; text-align: center; font-size: 22px; padding: 13px 10px; }
@keyframes sheetup { from { transform: translateY(100%) } }
@keyframes fadein { from { opacity: 0 } }

/* ---------- fine-tune 16.11: legibility on bright backgrounds ---------- */
#hud { z-index: 9; }
#screen:not(.title-screen):not(.map-list) { background: linear-gradient(180deg, rgba(13,10,18,.78) 0, rgba(13,10,18,.45) 190px, rgba(13,10,18,0) 340px); }
.scr-head small { display: inline-block; background: #0d0a12; padding: 2px 10px 3px; margin-top: 6px; text-shadow: none; }
.btn.ghost { background: rgba(13,10,18,.88); }
#screen > p { background: rgba(13,10,18,.88); padding: 10px 12px; }
#stage.at-place .char { height: 62%; }
#stage.at-place .char.left, #stage.at-place .char.right { height: 52%; }

/* ---------- juice ---------- */
#fx { position: absolute; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.fx-float { position: absolute; font-family: 'Anton'; font-size: 40px; color: var(--c); text-shadow: 3px 3px 0 #000, -1px -1px 0 #000; white-space: nowrap; animation: floatup 1.5s cubic-bezier(.2,.8,.3,1) both; }
.fx-float.small { font-size: 22px; }
.fx-float.note { font-size: 46px; }
@keyframes floatup { 0% { opacity: 0; transform: translateY(14px) scale(.6) } 15% { opacity: 1; transform: translateY(0) scale(1.15) } 30% { transform: translateY(-6px) scale(1) } 100% { opacity: 0; transform: translateY(-90px) } }
.fx-p { position: absolute; width: 16px; height: 16px; background: var(--c); border: 2px solid #000; animation: pburst 1.5s cubic-bezier(.15,.8,.3,1) both; }
.fx-p:nth-child(3n) { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border: 0; width: 22px; height: 22px; }
@keyframes pburst { 0% { transform: translate(-50%, -50%) rotate(0) scale(.3); opacity: 1 } 55% { opacity: 1 } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 60px)) rotate(var(--rot)) scale(.6); opacity: 0 } }
#banner .bn.hype::before { box-shadow: 0 0 0 0 transparent; }
#banner:has(.bn.hype) { background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.35), rgba(5,3,8,.6) 55%); animation: flash .5s; }
@keyframes flash { 0% { background-color: rgba(255,255,255,.7) } }
.hud-money.pulse { animation: mpulse .5s; }
@keyframes mpulse { 30% { transform: skewX(-12deg) scale(1.25); background: #7dff9a; color: #000 } }
.char.pop { animation: cpop .28s; }
@keyframes cpop { 40% { transform: translateX(-50%) translateY(-2.5%) } }
.char.left.pop { animation: none } .char.right.pop { animation: none }
.bn.hype .bn-big { animation: bigpunch .5s .15s both; }
@keyframes bigpunch { 0% { transform: scale(2.2); opacity: 0 } 60% { transform: scale(.92); opacity: 1 } }
.bn .bn-stars span { display: inline-block; opacity: .35; }
.bn .bn-stars span.on { opacity: 1; animation: starpop .35s both; }
@keyframes starpop { 0% { transform: scale(0) rotate(-90deg) } 70% { transform: scale(1.5) } }
.bn.hype::after { animation: none; }
.bn-tap { position: absolute; bottom: calc(var(--safe-b) + 14vh); left: 0; right: 0; text-align: center; font: 700 14px 'Chakra'; color: var(--bone); letter-spacing: 2px; text-transform: uppercase; opacity: 0; animation: fadein .3s .9s forwards, bob 1.2s 1.2s infinite; }
@keyframes fadein2 { to { opacity: 1 } }
.bn-tap { animation-name: tapin, bob; }
@keyframes tapin { to { opacity: .85 } }

/* press feedback + entrances */
.btn:active, .act:active, .choice:active { transform: scale(.96); }
.pcard { animation: cardin .3s both; }
@keyframes cardin { from { opacity: 0; transform: translateX(26px) } }
.panel { animation: fadein .2s both; }

/* scene buttons: log / auto / ff */
#logb, #auto { top: calc(var(--safe-t) + 58px); font-family: 'Anton'; font-size: 14px; letter-spacing: 1px; padding: 6px 10px; cursor: pointer; }
#auto { right: 58px; } #logb { right: 118px; }
#auto.on { background: var(--amber); color: var(--ink); }
.log .log-list { max-height: 56vh; overflow-y: auto; margin: 6px 0 14px; }
.log-line { font-size: 15px; line-height: 1.4; padding: 6px 0; border-bottom: 1px solid rgba(246,239,228,.12); color: #fff; }
.log-line .narr { color: var(--amber); }
.log .btn { width: 100%; }

/* guided start */
.goal.guide { background: #fff; outline: 4px solid var(--amber); animation: guidepulse 1.4s infinite; }
.g-step { display: inline-block; background: var(--ink); color: var(--amber); font: 400 13px 'Anton'; letter-spacing: 1px; text-transform: uppercase; padding: 1px 8px; margin-right: 8px; }
@keyframes guidepulse { 50% { outline-color: #fff2c4; } }
.pcard.locked, .act.locked { opacity: .35; filter: grayscale(.7); }
.pcard.target, .act.target, .btn.target { position: relative; outline: 4px solid var(--amber); outline-offset: 2px; animation: cardin .3s both, targetpulse 1.1s .3s infinite; }
@keyframes targetpulse { 50% { outline-color: #fff; transform: scale(1.015); } }
.pcard .go { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: var(--amber); color: var(--ink); font: 400 20px 'Anton'; padding: 4px 12px; box-shadow: 3px 3px 0 #000; animation: gobob .8s infinite; }
@keyframes gobob { 50% { transform: translate(5px, -50%) } }
.pcard { position: relative; }

/* ================= mini-games ================= */
.mg-wrap { position: absolute; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-t) + 56px) 14px calc(var(--safe-b) + 18px); background: rgba(8,5,12,.55); animation: fadein .15s; }
.mg { --c: inherit; position: relative; width: 100%; max-width: 460px; height: min(100%, 640px); display: flex; flex-direction: column; background: #0d0a12; border: 3px solid var(--c); box-shadow: 8px 8px 0 rgba(0,0,0,.6); animation: sheetup .2s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.mg-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 14px; background: var(--c); color: #0d0a12; clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%); font: 600 17px/1.2 'Chakra', sans-serif; }
.mg-head b { font-weight: 800; }
.mg-head .g { color: #0b6b2a; } .mg-head .r { color: #8a0a24; }
.mg-ico { font-size: 30px; line-height: 1; }
.mg-area { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 10px 14px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.mg-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 12px; border-top: 2px solid rgba(255,255,255,.08); }
.mg-pips { display: flex; flex-wrap: wrap; gap: 5px; max-width: 75%; }
.mg-pips i { width: 12px; height: 12px; transform: skewX(-15deg); background: rgba(255,255,255,.15); }
.mg-pips i.on { background: var(--c); } .mg-pips i.bad { background: #d4204a; }
.mg-skip { background: none; border: 2px solid rgba(255,255,255,.3); color: #d9cfc1; font: 600 14px 'Chakra', sans-serif; padding: 7px 12px; }
.mg-hint { font: 600 13px 'Chakra', sans-serif; letter-spacing: .12em; color: rgba(246,239,228,.55); }
.mg-timer { width: 100%; height: 8px; background: rgba(255,255,255,.1); }
.mg-timer i { display: block; height: 100%; background: var(--c); transform-origin: left; animation: mgtime linear forwards; }
@keyframes mgtime { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.mg-result { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(8,5,12,.82); animation: fadein .15s; }
.mg-result b { font: 52px/1 'Anton', sans-serif; color: var(--c); transform: rotate(-6deg); text-shadow: 4px 4px 0 #000; animation: starpop .35s cubic-bezier(.2,1.6,.4,1); }
.mg-result.low b { color: #d9cfc1; } .mg-result small { margin-top: 10px; font: 600 18px 'Chakra', sans-serif; color: #f6efe4; }

/* espresso */
.esp-cup { width: 96px; height: 96px; border: 5px solid #f6efe4; border-top: none; border-radius: 0 0 40px 40px; position: relative; }
.esp-in { position: absolute; inset: 0; border-radius: 0 0 36px 36px; overflow: hidden; }
.esp-cup::after { content: ''; position: absolute; right: -26px; top: 18px; width: 22px; height: 36px; border: 5px solid #f6efe4; border-left: none; border-radius: 0 18px 18px 0; }
.esp-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(#c58a4a, #5a3218); transition: height .3s; }
.esp-bar { position: relative; width: 100%; height: 54px; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.2); }
.esp-near { position: absolute; top: 0; bottom: 0; background: rgba(255,210,63,.25); }
.esp-zone { position: absolute; top: 0; bottom: 0; background: #3ddc84; }
.esp-needle { position: absolute; top: -8px; bottom: -8px; width: 6px; margin-left: -3px; background: #f6efe4; box-shadow: 0 0 10px #fff; }
.esp-needle.hit { background: #3ddc84; } .esp-needle.ok { background: #ffd23f; } .esp-needle.miss { background: #d4204a; }

/* lanterns */
.lt-grid { display: grid; gap: 10px; width: min(100%, 300px); }
.lt { aspect-ratio: 1; border: 3px solid #3a2d4f; background: #1a1324; border-radius: 14px 14px 22px 22px; position: relative; transition: background .15s, box-shadow .15s; }
.lt::before { content: ''; position: absolute; inset: 22%; border-radius: 50%; background: #2a2236; transition: background .15s; }
.lt.on { background: #ffb43b; border-color: #ffd23f; box-shadow: 0 0 22px rgba(255,180,59,.8); }
.lt.on::before { background: #fff3c4; }
.lt:active { transform: scale(.94); }

/* trace */
.tr-pad { position: relative; width: 100%; flex: 1; min-height: 260px; background: #f6efe4; border: 3px solid #1a1324; box-shadow: inset 0 0 40px rgba(0,0,0,.15); }
.tr-pad svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tr-pad line { stroke: #0d0a12; stroke-width: 1.4; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-width: 4px; }
.tr-dot { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid #0d0a12; background: var(--c); color: #0d0a12; font: 22px 'Anton', sans-serif; }
.tr-dot.small { width: 38px; height: 38px; margin: -19px 0 0 -19px; font-size: 18px; }
.tr-dot.done { background: #0d0a12; color: #f6efe4; } .tr-dot.bad { background: #d4204a; }

/* rhythm */
.rh-field { position: relative; width: 100%; flex: 1; min-height: 300px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rh-lane { position: relative; background: rgba(255,255,255,.05); border: 2px solid rgba(255,255,255,.12); overflow: hidden; touch-action: none; }
.rh-lane.press { background: color-mix(in srgb, var(--c) 35%, transparent); }
.rh-line { position: absolute; left: 0; right: 0; top: 85%; height: 6px; margin-top: 14px; background: var(--c); box-shadow: 0 0 14px var(--c); pointer-events: none; }
.rh-note { position: absolute; left: 12%; right: 12%; height: 28px; background: #f6efe4; border: 3px solid var(--c); transform: skewX(-12deg); }
.rh-note.miss { background: #d4204a; opacity: .5; }

/* memory */
.mm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 330px); }
.mm-card { aspect-ratio: 1; background: var(--c); border: 3px solid #0d0a12; box-shadow: 4px 4px 0 rgba(0,0,0,.5); font-size: 38px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.mm-card span { visibility: hidden; }
.mm-card.show { background: #f6efe4; } .mm-card.show span { visibility: visible; }
.mm-card.done { background: #3ddc84; }

/* spot */
.sp-t { font-size: 26px; vertical-align: middle; }
.sp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: min(100%, 340px); }
.sp-it { aspect-ratio: 1; font-size: 30px; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.12); }
.sp-it.found { background: #3ddc84; border-color: #3ddc84; } .sp-it.bad { background: #d4204a; }

/* nerve */
.nv-flame { width: 120px; height: 160px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; background: radial-gradient(circle at 50% 70%, #fff3c4, #ffb43b 45%, rgba(255,120,40,.2) 70%, transparent 72%); filter: blur(.5px); animation: flick .18s infinite alternate; transition: background .08s; }
.nv-flame.light { border-radius: 24px; width: 110px; height: 110px; animation: none; background: #2a2236; border: 6px solid #444; }
.nv-flame.go { background: radial-gradient(circle at 50% 70%, #eaffef, #3ddc84 45%, rgba(61,220,132,.25) 70%, transparent 72%); }
.nv-flame.no { background: radial-gradient(circle at 50% 70%, #ffe0e6, #d4204a 45%, rgba(212,32,74,.25) 70%, transparent 72%); }
.nv-flame.light.go { background: #3ddc84; box-shadow: 0 0 40px #3ddc84; } .nv-flame.light.no { background: #d4204a; box-shadow: 0 0 40px #d4204a; }
.nv-flame.fail { animation: shake .3s; }
@keyframes flick { from { transform: scale(1, 1); } to { transform: scale(.96, 1.04); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }

/* ================= day transition ================= */
.dayx { position: absolute; inset: 0; z-index: 35; background: #000; display: flex; align-items: center; justify-content: center; animation: dxin .6s ease-in both; cursor: pointer; }
@keyframes dxin { from { opacity: 0 } }
.dayx.out { animation: dxout .45s ease-in forwards; }
@keyframes dxout { to { opacity: 0 } }
.dx-sleep { position: absolute; font: 600 16px 'Chakra', sans-serif; letter-spacing: .3em; color: rgba(246,239,228,.45); text-transform: uppercase; animation: dxsleep 1.1s ease both; }
.dayx.show .dx-sleep { display: none; }
@keyframes dxsleep { 0% { opacity: 0 } 40% { opacity: 1 } 100% { opacity: 0 } }
.dx-card { display: none; position: relative; width: min(84%, 360px); padding: 26px 22px 20px; background: #f6efe4; color: #0d0a12; transform: rotate(-4deg); box-shadow: 12px 12px 0 #d4204a; text-align: center; }
.dayx.show .dx-card { display: block; animation: dxslam .45s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes dxslam { 0% { transform: rotate(-20deg) scale(2.4); opacity: 0 } 100% { transform: rotate(-4deg) scale(1); opacity: 1 } }
.dx-dow { font: 600 20px 'Chakra', sans-serif; letter-spacing: .35em; }
.dx-num { font: 150px/0.9 'Anton', sans-serif; margin: 6px 0 2px; }
.dx-mon { display: inline-block; font: 30px 'Anton', sans-serif; letter-spacing: .15em; background: #0d0a12; color: #f6efe4; padding: 2px 16px; transform: skewX(-12deg); }
.dx-left { margin: 18px -22px 0; padding: 9px 10px; background: #0d0a12; color: #ffb43b; font: 22px 'Anton', sans-serif; letter-spacing: .06em; transform: skewY(-3deg); }
.dx-left.hot { background: #d4204a; color: #fff; }
.dx-fund { margin-top: 16px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; font: 600 13px 'Chakra', sans-serif; text-align: left; }
.dx-fund b { grid-column: 1 / -1; text-align: right; font: 600 14px 'Chakra', sans-serif; }
.dx-bar { height: 12px; background: rgba(13,10,18,.15); transform: skewX(-15deg); }
.dx-bar i { display: block; height: 100%; background: #d4204a; animation: dxbar 1s .5s ease-out both; }
@keyframes dxbar { from { width: 0 !important } }
.dx-tap { margin-top: 14px; font: 600 12px 'Chakra', sans-serif; letter-spacing: .25em; text-transform: uppercase; opacity: .5; }

/* date card on the map */
.pcard.datecard { border: 3px solid var(--pc); background: linear-gradient(100deg, color-mix(in srgb, var(--pc) 35%, #0d0a12), #0d0a12 70%); animation: datepulse 1.6s ease-in-out infinite; }
.dc-face { background-size: cover; background-position: 50% 8%; }
.dc-tag { display: inline-block; font: 16px 'Anton', sans-serif; letter-spacing: .08em; background: var(--pc); color: #0d0a12; padding: 1px 10px; transform: skewX(-12deg); margin-bottom: 4px; }
@keyframes datepulse { 50% { box-shadow: 0 0 22px color-mix(in srgb, var(--pc) 70%, transparent); } }

/* ================= gain cards (stat / bond changes) ================= */
#gains { position: absolute; z-index: 38; top: calc(var(--safe-t) + 62px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.gain { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 8px 20px 8px 14px; background: var(--c); color: #0d0a12; transform: skewX(-12deg) rotate(-2deg); box-shadow: 6px 6px 0 #0d0a12, 0 0 0 3px #0d0a12; animation: gainin .45s cubic-bezier(.2,1.6,.4,1) both; }
.gain > * { transform: skewX(12deg); }
.gn-ico { font: 24px/1 'Anton', sans-serif; }
.gn-lbl { flex: 1; font: 22px/1 'Anton', sans-serif; letter-spacing: .05em; }
.gn-val { font: 34px/1 'Anton', sans-serif; color: #fff; text-shadow: 2px 2px 0 #0d0a12, -1px -1px 0 #0d0a12; }
.gain.neg { color: #f6efe4; } .gain.neg .gn-val { color: #f6efe4; }
.gain.out { animation: gainout .4s ease-in forwards; }
@keyframes gainin { 0% { transform: skewX(-12deg) rotate(-2deg) translateX(-120%) scale(1.3); opacity: 0 } 100% { opacity: 1 } }
@keyframes gainout { to { transform: skewX(-12deg) rotate(-2deg) translateX(130%); opacity: 0 } }

/* ================= phone chats ================= */
.ph-wrap { position: absolute; inset: 0; z-index: 32; display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-t) + 20px) 16px calc(var(--safe-b) + 20px); background: rgba(8,5,12,.6); animation: fadein .2s; }
.ph-wrap.out { animation: dxout .3s forwards; }
.phone { width: 100%; max-width: 380px; height: min(100%, 660px); display: flex; flex-direction: column; background: #15101c; border-radius: 30px; border: 1px solid rgba(246,239,228,.14); box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 80px -20px var(--c); animation: phonein .35s cubic-bezier(.2,1,.3,1); overflow: hidden; }
@keyframes phonein { from { transform: translateY(40px); opacity: 0 } }
.ph-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; background: rgba(255,255,255,.03); border-bottom: 1px solid rgba(246,239,228,.08); color: #f6efe4; }
.ph-head i { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 2px var(--c); background: #f6efe4 center 10% / 200% no-repeat; }
.ph-head b { display: block; font: 600 19px/1.1 'Chakra', sans-serif; }
.ph-head small { font: 500 12px 'Chakra', sans-serif; color: var(--c); opacity: .85; }
.ph-log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; background: radial-gradient(120% 60% at 50% 0%, rgba(255,180,59,.07), transparent 70%), #15101c; }
.ph-b { max-width: 78%; align-self: flex-start; padding: 10px 14px; background: #2a2134; color: #f6efe4; font: 400 16.5px/1.4 'Chakra', sans-serif; border-radius: 18px 18px 18px 6px; animation: bubin .22s ease-out; white-space: pre-wrap; }
.ph-b.me { align-self: flex-end; background: var(--c); color: #120d17; border-radius: 18px 18px 6px 18px; }
@keyframes bubin { from { transform: translateY(6px); opacity: 0 } }
.ph-typing { display: flex; gap: 5px; padding: 14px 16px; }
.ph-typing span { width: 7px; height: 7px; border-radius: 50%; background: #f6efe4; opacity: .7; animation: dot 1s infinite; }
.ph-typing span:nth-child(2) { animation-delay: .15s } .ph-typing span:nth-child(3) { animation-delay: .3s }
@keyframes dot { 50% { transform: translateY(-4px); opacity: .3 } }
.ph-opts { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 16px; background: rgba(0,0,0,.25); border-top: 1px solid rgba(246,239,228,.08); }
.ph-opts:empty { display: none; }
.ph-opt { text-align: left; padding: 11px 16px; background: transparent; color: #f6efe4; border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent); border-radius: 22px; font: 500 15.5px/1.3 'Chakra', sans-serif; }
.ph-opt:active { background: var(--c); color: #120d17; }
.ph-close { padding: 12px; background: rgba(246,239,228,.08); color: #f6efe4; border: none; border-radius: 22px; font: 600 15px 'Chakra', sans-serif; }
.note-card { display: block; padding: 10px 12px; margin-bottom: 10px; background: rgba(255,255,255,.04); border-left: 6px solid #6c5a7a; }
.note-card.clue { border-left-color: #ffb43b; }
.note-card b { display: block; font-family: Anton, sans-serif; letter-spacing: .02em; margin-bottom: 4px; }
.note-card span { font-size: 13.5px; color: #d9cfc1; }

/* stopgap night grade when a place has no -night background yet */
#bg.nightfx .bg-img { filter: brightness(.34) saturate(.55) contrast(1.12); }
#bg.nightfx .bg-fx { background: radial-gradient(90% 60% at 50% 35%, rgba(255,170,80,.10), transparent 70%), linear-gradient(rgba(14,18,64,.5), rgba(6,5,22,.55)); mix-blend-mode: normal; }
.cg.nightfx { filter: brightness(.82) saturate(.92) contrast(1.04); }
/* night tint on top of a daylight CG: keeps the characters' own colours (no hue shift), only darkens and cools the light */
.cg.nightfx::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 55% at 50% 40%, rgba(255,170,90,.08), transparent 70%), linear-gradient(rgba(18,26,84,.42), rgba(8,8,34,.46)); mix-blend-mode: multiply; }
.note-card.lead { border-left-style: dashed; border-left-color: #8fb3ff; opacity: .92; }
.note-card.lead b { font-size: 15px; }
.ph-faces { display: flex; }
.ph-faces i { width: 30px; height: 30px; margin-right: -8px; border-radius: 50%; background: #f6efe4 center 10% / 200% no-repeat; border: 2px solid #15101c; }
.grp .ph-head > div:last-child { margin-left: 14px; }
.ph-who { display: block; font: 700 12.5px 'Chakra', sans-serif; letter-spacing: .02em; margin-bottom: 2px; }
.ph-photo { font-style: normal; opacity: .85; font-size: 14.5px; }
.ph-pic { padding: 6px; background: #f6efe4; border-radius: 6px; transform: rotate(-1.5deg); cursor: zoom-in; }
.ph-pic img { display: block; width: 210px; max-width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 2px; }
img.ph-fallback { object-position: center 15%; filter: saturate(1.05) contrast(1.05); }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pcell { position: relative; aspect-ratio: 4/5; background: #1c1524; border: 2px solid var(--c); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.pcell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcell span { position: relative; padding: 3px 5px; font: 600 11px 'Chakra', sans-serif; color: #f6efe4; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.pcell.locked { border-style: dashed; opacity: .55; align-items: center; justify-content: center; text-align: center; }
.pcell.locked b { font: 400 15px Anton, sans-serif; color: var(--c); }
.pcell.locked span { background: none; }
.photo-view { position: absolute; inset: 0; z-index: 40; background: rgba(8,5,12,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px 16px; }
.photo-view img { max-width: 100%; max-height: 78%; border: 8px solid #f6efe4; box-shadow: 0 0 0 2px var(--c); }
.pv-cap { font: 400 20px Anton, sans-serif; color: #f6efe4; }
.sh-col { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sh-col .btn { width: 100%; text-align: left; }
.sh-note { font: 500 14px 'Chakra', sans-serif; color: #d9cfc1; padding: 6px 2px; }

.cal-hearts { position: absolute; top: 2px; right: 3px; display: flex; gap: 1px; }
.cal-date { font-style: normal; font-size: 12px; color: var(--c); text-shadow: 0 0 4px rgba(0,0,0,.8); }
.cal .today .cal-date { text-shadow: none; }
.cal-row { display: flex; flex-direction: column; padding: 8px 10px; margin-top: 6px; background: rgba(255,255,255,.04); border-left: 5px solid var(--c); }
.cal-row b { font: 400 16px Anton, sans-serif; color: var(--c); }
.cal-row span { font: 500 13.5px 'Chakra', sans-serif; color: var(--bone2); }
.cal-row em { color: var(--amber); font-style: normal; }
