:root {
  --ink: #e9eef8;
  --muted: #9aa6bd;
  --accent: #5cc8ff;
  --warm: #ffb547;
  --glass: rgba(10, 14, 28, 0.55);
  --line: rgba(255, 255, 255, 0.12);
  --ui: -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Segoe UI", sans-serif;
  --display: "Chakra Petch", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05070d; color: var(--ink); font-family: var(--ui); }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.fade { opacity: 0; transition: opacity .6s ease; pointer-events: none; }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 24px; padding: 0 7px;
  border-radius: 7px; background: rgba(255, 255, 255, 0.92); color: #10141f;
  font: 700 12px var(--ui); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

/* ---------- loading & title ---------- */
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 16px;
}
:root { --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace; --boot: #9fe7ff; --boot-dim: rgba(159, 231, 255, .55); }

/* loading: a terminal over the rainy street */
#loading.boot { z-index: 20; display: block; padding: 0; text-align: left; background: #04060b; overflow: hidden; }
.boot-bg {
  position: absolute; inset: -4%; background: url("assets/ui/loading.jpg") center / cover no-repeat;
  filter: saturate(.75) brightness(.42) blur(1.5px); animation: bootDrift 40s ease-in-out infinite alternate;
}
@keyframes bootDrift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.12) translate(-1.5%, 1%); } }
#loading.boot::after {   /* scanlines and a vignette */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px),
              radial-gradient(ellipse at 40% 45%, transparent 35%, rgba(2, 4, 8, .85) 100%);
}
#bootRain { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.boot-panel {
  position: absolute; left: clamp(16px, 5vw, 64px); top: clamp(16px, 6vh, 64px); width: min(820px, calc(100vw - 32px));
  max-height: calc(100vh - 190px); overflow: hidden; font: 500 12.5px/1.65 var(--mono); color: var(--boot); z-index: 1;
  text-shadow: 0 0 8px rgba(92, 200, 255, .35);
}
.boot-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(159, 231, 255, .25); margin-bottom: 10px; }
.boot-logo { display: flex; align-items: baseline; gap: 12px; }
.boot-logo .jp { font: 900 30px "Noto Sans JP", sans-serif; letter-spacing: .12em; color: #fff; text-shadow: 0 0 18px rgba(92, 200, 255, .6); }
.boot-logo .en { font: 700 15px var(--display); letter-spacing: .38em; color: var(--boot); }
.boot-sys { text-align: right; font-size: 11px; color: var(--boot-dim); letter-spacing: .06em; }
.boot-sys b { color: var(--boot); font-weight: 600; }
#bootLog { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: flex-end; }
#bootLog li { display: grid; grid-template-columns: 4.6em auto 1fr auto auto; gap: 10px; align-items: baseline; white-space: nowrap; animation: bootIn .25s ease-out; }
#bootLog li .jp { font-family: "Noto Sans JP", sans-serif; font-weight: 700; color: var(--warm); text-shadow: 0 0 8px rgba(255, 181, 71, .4); }
#bootLog li .what { overflow: hidden; text-overflow: ellipsis; }
#bootLog li .lead { border-bottom: 1px dotted rgba(159, 231, 255, .3); transform: translateY(-4px); min-width: 12px; }
#bootLog li .what i { color: var(--boot-dim); font-style: normal; }
#bootLog li .ok { color: #fff; font-weight: 600; }
#bootLog li .ok::before { content: '[ '; color: var(--boot-dim); } #bootLog li .ok::after { content: ' ]'; color: var(--boot-dim); }
#bootLog li.run .ok { color: var(--warm); animation: blink 1s steps(2) infinite; }
#bootLog li .ms { min-width: 4.5em; text-align: right; color: var(--boot-dim); }
@keyframes bootIn { from { opacity: 0; transform: translateX(-6px); } }
@keyframes blink { 50% { opacity: .25; } }
.boot-foot { position: absolute; left: clamp(16px, 5vw, 64px); right: clamp(16px, 5vw, 64px); bottom: clamp(18px, 6vh, 56px); z-index: 1; font-family: var(--mono); }
.boot-now { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--boot); margin-bottom: 8px; }
#loadpct { color: #fff; font-weight: 600; }
.bar { width: 100%; height: 3px; border-radius: 3px; background: rgba(159, 231, 255, .12); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2a8fe0, var(--accent), #e8f7ff); box-shadow: 0 0 12px var(--accent); transition: width .35s ease; }
#loadhint { margin-top: 10px; font: 500 12px var(--ui); color: var(--muted); min-height: 1.4em; transition: opacity .5s ease; }
#loadhint.out { opacity: 0; }

/* title: brand on the left, the menu under it, the city moving behind */
#title { z-index: 15; align-items: flex-start; justify-content: flex-end; text-align: left; padding: 0 clamp(16px, 6vw, 88px) clamp(70px, 14vh, 140px);
  background: linear-gradient(90deg, rgba(4, 6, 12, .78) 0%, rgba(4, 6, 12, .35) 38%, rgba(4, 6, 12, 0) 60%),
              linear-gradient(0deg, rgba(4, 6, 12, .6) 0%, rgba(4, 6, 12, 0) 35%); }
#tdim { position: absolute; inset: 0; background: #04060b; opacity: 1; pointer-events: none; transition: none; }
.t-brand { position: relative; animation: tIn 1.4s ease-out both .2s; }
.t-kicker { font: 900 20px "Noto Sans JP", sans-serif; letter-spacing: .35em; color: var(--warm); text-shadow: 0 0 14px rgba(255, 181, 71, .55); }
#title h1 {
  margin: 4px 0 2px; font: 700 clamp(54px, 11vw, 124px) var(--display); letter-spacing: .08em; line-height: .95;
  background: linear-gradient(180deg, #f2fbff 0%, #8fd6ff 50%, #2a8fe0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(92, 200, 255, .45));
}
.t-sub { font-size: 15px; font-weight: 600; letter-spacing: .06em; color: var(--ink); opacity: .85; }
#tmenu { position: relative; display: flex; flex-direction: column; gap: 4px; margin-top: 26px; animation: tIn 1.2s ease-out both .7s; }
#tmenu button {
  display: flex; align-items: baseline; gap: 14px; width: 260px; padding: 9px 14px 9px 18px; border: 0; border-left: 2px solid transparent;
  background: transparent; color: var(--muted); font: 600 18px var(--display); letter-spacing: .14em; text-transform: uppercase; text-align: left; cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease, padding .15s ease;
}
#tmenu button em { font: 700 11px "Noto Sans JP", sans-serif; font-style: normal; letter-spacing: .1em; color: rgba(154, 166, 189, .7); }
#tmenu button.sel, #tmenu button:hover { color: #fff; border-left-color: var(--accent); padding-left: 24px;
  background: linear-gradient(90deg, rgba(92, 200, 255, .16), rgba(92, 200, 255, 0)); }
#tmenu button.sel em { color: var(--accent); }
#tmenu button.sel span::before { content: '▸ '; color: var(--accent); }
#tpanel { position: absolute; right: clamp(16px, 6vw, 88px); bottom: clamp(70px, 14vh, 140px); width: min(440px, calc(100vw - 32px)); max-height: 62vh; overflow: auto;
  padding: 18px 20px; border-radius: 16px; background: rgba(8, 12, 24, .78); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 13px; line-height: 1.6; animation: tIn .35s ease-out; }
#tpanel h3 { margin: 0 0 10px; font: 700 13px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
#tpanel .row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
#tpanel .row span:last-child { color: var(--muted); text-align: right; }
#tpanel p { margin: 0 0 8px; color: var(--muted); }
#tpanel p b { color: var(--ink); }
.t-foot { position: absolute; left: clamp(16px, 6vw, 88px); right: clamp(16px, 6vw, 88px); bottom: 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font: 500 12px var(--mono); color: var(--muted); }
.t-keys { display: flex; align-items: center; gap: 5px; }
.t-keys kbd { min-width: 22px; height: 20px; font-size: 11px; }
@keyframes tIn { from { opacity: 0; transform: translateY(10px); } }

/* the opening shot */
.cine-black { position: absolute; inset: 0; background: #000; animation: cineBlack 1.3s ease-out both .25s; }
@keyframes cineBlack { to { opacity: 0; } }
#cine { position: fixed; inset: 0; z-index: 14; pointer-events: none; }
.cine-bar { position: absolute; left: 0; right: 0; height: 11vh; background: #000; transition: transform 1.1s cubic-bezier(.6, 0, .2, 1); }
.cine-bar.top { top: 0; } .cine-bar.bot { bottom: 0; }
#cine.out .cine-bar.top { transform: translateY(-100%); } #cine.out .cine-bar.bot { transform: translateY(100%); }
#cineCard { position: absolute; left: clamp(16px, 6vw, 88px); bottom: calc(11vh + 28px); opacity: 0; transform: translateY(8px); transition: opacity 1s ease, transform 1s ease; }
#cineCard.on { opacity: 1; transform: none; }
#cineCard .jp { font: 900 clamp(38px, 6vw, 64px) "Noto Sans JP", sans-serif; letter-spacing: .14em; color: #fff; text-shadow: 0 0 22px rgba(92, 200, 255, .5); }
#cineCard .en { font: 700 14px var(--display); letter-spacing: .5em; color: var(--accent); margin-top: 2px; }
#cineCard .sub { font: 500 12px var(--mono); color: var(--muted); margin-top: 8px; letter-spacing: .08em; }
.cine-skip { position: absolute; right: 20px; bottom: calc(11vh - 34px); font: 500 12px var(--mono); color: rgba(233, 238, 248, .6); display: flex; align-items: center; gap: 6px; transition: opacity .6s ease; }
.cine-skip kbd { min-width: 22px; height: 20px; font-size: 11px; }
#cine.out .cine-skip { opacity: 0; }
@media (max-width: 640px) { #tmenu button { width: 100%; } .boot-sys { display: none; } }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.panel {
  background: var(--glass); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
#loc { position: absolute; top: 18px; left: 20px; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
#loc .jp { font: 900 26px "Noto Sans JP", sans-serif; letter-spacing: .12em; }
#loc .sub { font-size: 13px; color: #c9d4e8; margin-top: 2px; }
#wallet { margin-top: 6px; display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: #c9d4e8; }
#wallet b { font: 700 15px var(--display); letter-spacing: .04em; color: var(--warm); }
#wallet span { color: var(--muted); }

/* the controls card: small, quiet, grouped; dark glass keys (not bright pills) */
#controls { position: absolute; top: 16px; right: 16px; width: 206px; padding: 11px 12px 9px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(14, 18, 32, .62), rgba(8, 11, 22, .52));
  border: 1px solid rgba(255, 255, 255, .09); box-shadow: 0 10px 34px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); font-family: var(--ui); }
#controls .ttl { display: flex; align-items: baseline; gap: 6px; margin: 0 0 7px; }
#controls .ttl b { font: 600 10.5px var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--ink); }
#controls .ttl em { font: 500 10px "Noto Sans JP", sans-serif; font-style: normal; color: var(--muted); letter-spacing: .1em; }
#controls .ttl .hint { margin-left: auto; font: 500 9.5px var(--ui); color: var(--muted); letter-spacing: .04em; }
#controls .grp { padding: 5px 0 4px; border-top: 1px solid rgba(255, 255, 255, .06); }
#controls .gl { font: 600 8.5px var(--display); letter-spacing: .24em; text-transform: uppercase; color: rgba(92, 200, 255, .75); margin: 1px 0 3px; }
#controls .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2.5px 0; font: 500 11px/1.25 var(--ui); color: rgba(233, 238, 248, .86); }
#controls .keys { display: inline-flex; gap: 3px; }
#controls kbd { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 5px; font: 600 9.5px var(--ui); letter-spacing: .02em;
  background: rgba(255, 255, 255, .07); color: #e9eef8; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 1px 0 rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .08); }
#controls .hint kbd { min-width: 14px; height: 14px; padding: 0 3px; font-size: 8.5px; border-radius: 4px; vertical-align: 1px; }

#prompt {
  position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 14px; font-weight: 600;
}

#dialog {
  position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%);
  width: min(680px, calc(100vw - 32px)); padding: 18px 22px 30px; pointer-events: auto; cursor: pointer;
  background: rgba(8, 12, 24, .78); border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
#who { font: 700 13px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--warm); margin-bottom: 6px; }
#dtext { font-size: 16px; line-height: 1.55; min-height: 50px; }
#dialog .next { position: absolute; right: 18px; bottom: 10px; font-size: 12px; color: var(--muted); }

#hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  font-size: 12px; color: #c9d4e8; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .35);
}
#toast { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); font-size: 13px; padding: 8px 16px; border-radius: 999px; background: rgba(10, 12, 20, .55); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .12); transition: opacity .4s; }
#toast.out { opacity: 0; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .4s ease; z-index: 30; }
#fade.on { opacity: 1; }
#dialog .opt { padding: 3px 0; color: var(--muted); }
#dialog .opt.sel { color: #fff; }
#mute { position: absolute; left: 20px; bottom: 18px; font-size: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .45); }

/* town map: a small round one in the corner, the whole town on Tab */
#minimap {
  position: absolute; right: 20px; bottom: 20px; width: 184px; height: 184px; border-radius: 50%;
  border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .04);
  opacity: .92; pointer-events: none;
}
#bigmap { position: fixed; inset: 0; z-index: 13; pointer-events: auto; display: flex; flex-direction: column; gap: 10px;
  padding: clamp(12px, 3vh, 28px) clamp(12px, 3vw, 36px); background: rgba(4, 6, 12, .86);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: pzIn .2s ease-out; }
#bigmap.hidden { display: none; }
.mp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.mp-ttl { display: flex; align-items: baseline; gap: 12px; }
.mp-ttl .jp { font: 900 22px "Noto Sans JP", sans-serif; letter-spacing: .14em; color: #fff; }
.mp-ttl b { font: 700 13px var(--display); letter-spacing: .24em; color: var(--accent); }
.mp-mark { font: 500 12px var(--mono); color: var(--muted); }
.mp-mark b { color: var(--warm); font-weight: 600; }
.mp-body { flex: 1; min-height: 0; display: flex; gap: 14px; }
.mp-view { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
#bigmapCanvas { flex: 1; width: 100%; min-height: 0; border-radius: 12px; border: 1px solid var(--line); background: #0b0e15; cursor: crosshair; }
#bigmapCanvas.drag { cursor: grabbing; }
.mp-side { width: 300px; display: flex; flex-direction: column; min-height: 0; border-radius: 12px; border: 1px solid var(--line); background: rgba(8, 12, 24, .7); }
.mp-count { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-bottom: 1px solid var(--line); font: 600 12px var(--mono); color: var(--muted); letter-spacing: .14em; }
.mp-count b { color: #fff; font-size: 14px; }
#mpList { overflow-y: auto; padding: 6px 6px 10px; }
#mpList h4 { margin: 10px 8px 4px; font: 700 11px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); display: flex; justify-content: space-between; }
#mpList h4 span { color: var(--muted); font-family: var(--mono); letter-spacing: 0; }
.mp-pl { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px;
  background: none; color: var(--ink); font: 500 13px var(--ui); text-align: left; cursor: pointer; }
.mp-pl:hover { background: rgba(92, 200, 255, .1); }
.mp-pl .ic { font: 700 12px var(--mono); color: var(--accent); text-align: center; }
.mp-pl .jp { font: 700 11px "Noto Sans JP", sans-serif; color: var(--muted); }
.mp-pl.unk { color: var(--muted); cursor: default; } .mp-pl.unk .ic { color: rgba(154, 166, 189, .5); }
.mp-pl.love .ic { color: #ff5f9e; font-size: 15px; text-shadow: 0 0 6px rgba(255, 95, 160, .7); }
.mp-pl.marked { box-shadow: inset 2px 0 0 var(--warm); }
.mp-keys { font: 500 12px var(--mono); color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mp-keys kbd { height: 20px; font-size: 11px; }
#bigmap .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
#bigmap .legend span { display: inline-flex; align-items: center; gap: 6px; }
#bigmap .legend i { display: inline-block; width: 10px; height: 10px; }
#bigmap .legend .you { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 12px solid var(--warm); }
#bigmap .legend .mk { width: 10px; height: 10px; border: 2px solid var(--warm); transform: rotate(45deg); }
#bigmap .legend .drive { width: 7px; height: 13px; border: 2px solid var(--accent); }
#bigmap .legend .traf { width: 6px; height: 12px; background: #c9d2e0; }
#bigmap .legend .ppl { width: 6px; height: 6px; border-radius: 50%; background: rgba(214, 222, 236, .75); }
#bigmap .legend .k-shop { background: #ffd36b; }
#bigmap .legend .k-food { background: #ffd36b; border-radius: 50%; }
#bigmap .legend .k-play { background: #ffd36b; transform: rotate(45deg) scale(.85); }
#bigmap .legend .k-sight { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid #ffd36b; }
#bigmap .legend .k-transit { width: 13px; height: 6px; background: #ffd36b; }
#bigmap .legend .k-love { width: auto; height: auto; background: none; font-style: normal; font-size: 14px; line-height: 1; color: #ff5f9e; text-shadow: 0 0 6px rgba(255, 95, 160, .7); }
@media (max-width: 760px) { .mp-side { display: none; } }

/* discovered / entering banner */
#banner { position: fixed; left: 50%; top: 14vh; transform: translateX(-50%); z-index: 12; pointer-events: none; text-align: center; animation: bnIn .5s ease-out both; }
#banner.out { animation: bnOut .6s ease-in both; }
@keyframes bnIn { from { opacity: 0; transform: translate(-50%, -8px); letter-spacing: .3em; } }
@keyframes bnOut { to { opacity: 0; transform: translate(-50%, -6px); } }
.bn-kick { font: 600 12px var(--mono); letter-spacing: .4em; color: var(--warm); text-shadow: 0 0 10px rgba(255, 181, 71, .5); }
.bn-kick::before, .bn-kick::after { content: '—'; margin: 0 10px; opacity: .6; }
.bn-name { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin-top: 6px; }
.bn-name span:first-child { font: 700 clamp(22px, 3.2vw, 32px) var(--display); letter-spacing: .12em; text-transform: uppercase; color: #fff; text-shadow: 0 0 20px rgba(92, 200, 255, .5); }
.bn-name .jp { font: 900 clamp(16px, 2vw, 20px) "Noto Sans JP", sans-serif; color: var(--accent); letter-spacing: .14em; }
.bn-sub { margin-top: 4px; font: 500 12px var(--mono); color: var(--muted); letter-spacing: .12em; }

/* ---------- character menu ---------- */
#charMenu { position: fixed; left: 0; right: 0; bottom: 24px; display: flex; justify-content: center; z-index: 12; padding: 0 16px; }
#charMenu .cm { width: min(560px, 100%); padding: 16px 18px 14px; background: rgba(8, 12, 24, 0.72); }
.cm-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cm-head .ttl { font: 700 13px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.cm-hint { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.cm-hint kbd { min-width: 22px; height: 20px; font-size: 11px; }
#cards { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; }
.card {
  position: relative; flex: 0 0 104px; height: 128px; border-radius: 14px; overflow: hidden; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.12); background: #1a1f2e; transition: transform .15s ease, border-color .15s ease;
}
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 13px; font-weight: 700;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); }
.card.sel { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 6px 20px rgba(92, 200, 255, 0.25); }
.card.on::after { content: 'Wearing'; position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 999px; background: var(--accent); color: #06121f; }
.card.busy::before { content: ''; position: absolute; inset: 0; background: rgba(5, 8, 16, 0.55)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%235cc8ff' stroke-width='3' stroke-dasharray='40 20'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.9s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center / 32px no-repeat; }
/* outfits of the selected character */
#skins { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
#skins.hidden { display: none; }
.skin { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; cursor: pointer; font: 600 12px var(--body, inherit);
  color: inherit; background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 255, 255, 0.12); transition: border-color .15s ease, background .15s ease; }
.skin img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; }
.skin.sel { border-color: var(--accent); background: rgba(92, 200, 255, 0.12); }
.skin.on span::after { content: ' · dipakai'; color: var(--accent); }
#cmSkinHint.hidden { display: none; }
#cmInfo { margin-top: 10px; }
#cmInfo .nm { font-size: 16px; font-weight: 700; }
#cmInfo .by { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- audio panel ---------- */


/* the HUD coming in after the opening shot */
#hud.enter { animation: hudIn 1.1s ease-out both; }
@keyframes hudIn { from { opacity: 0; } }

/* ---------- pause (Esc): frosted glass over the stopped town ---------- */
#pause { position: fixed; inset: 0; z-index: 16; display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding: clamp(16px, 5vh, 56px) clamp(16px, 6vw, 88px);
  background: linear-gradient(90deg, rgba(4, 6, 12, .82) 0%, rgba(4, 6, 12, .55) 45%, rgba(4, 6, 12, .35) 100%);
  backdrop-filter: blur(10px) saturate(.8); -webkit-backdrop-filter: blur(10px) saturate(.8); animation: pzIn .25s ease-out; }
@keyframes pzIn { from { opacity: 0; } }
.pz-side { display: flex; flex-direction: column; align-self: stretch; justify-content: center; min-width: 0; }
.pz-kicker { font: 600 12px var(--mono); letter-spacing: .3em; color: var(--warm); }
#pause h2 { margin: 6px 0 2px; font: 900 clamp(30px, 4.6vw, 48px) "Noto Sans JP", sans-serif; letter-spacing: .1em; color: #fff; text-shadow: 0 0 18px rgba(92, 200, 255, .45); }
.pz-sub { font: 500 12px var(--mono); color: var(--muted); letter-spacing: .06em; }
#pzMenu { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; }
#pzMenu button {
  display: flex; align-items: baseline; gap: 14px; width: 300px; max-width: 100%; padding: 9px 14px 9px 18px; border: 0; border-left: 2px solid transparent;
  background: transparent; color: var(--muted); font: 600 17px var(--display); letter-spacing: .14em; text-transform: uppercase; text-align: left; cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease, padding .15s ease;
}
#pzMenu button em { font: 700 11px "Noto Sans JP", sans-serif; font-style: normal; letter-spacing: .1em; color: rgba(154, 166, 189, .7); }
#pzMenu button.sel, #pzMenu button:hover { color: #fff; border-left-color: var(--accent); padding-left: 24px; background: linear-gradient(90deg, rgba(92, 200, 255, .16), rgba(92, 200, 255, 0)); }
#pzMenu button.sel em { color: var(--accent); }
#pzMenu button.sel span::before { content: '▸ '; color: var(--accent); }
.pz-keys { margin-top: 22px; font: 500 12px var(--mono); color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pz-keys kbd, .st-keys kbd { min-width: 22px; height: 20px; font-size: 11px; }
.pz-card { width: min(380px, 40vw); padding: 18px 20px; border-radius: 16px; background: rgba(8, 12, 24, .72); border: 1px solid var(--line);
  font-size: 13px; line-height: 1.55; align-self: center; }
.pz-card h3 { margin: 0 0 10px; font: 700 12px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.pz-card .row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.pz-card .row span:first-child { color: var(--muted); }
.pz-card .job { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; padding: 5px 0; align-items: baseline; }
.pz-card .job b { font-weight: 600; } .pz-card .job i { font-style: normal; color: var(--muted); font-size: 12px; }
.pz-card .job .mk { font: 700 12px var(--mono); color: var(--muted); }
.pz-card .job.done .mk { color: var(--accent); } .pz-card .job.done b { color: var(--muted); text-decoration: line-through; }
@media (max-width: 760px) { .pz-card { display: none; } .pz-card.show { display: block; position: fixed; left: 12px; right: 12px; bottom: 12px; width: auto; max-height: 72vh; overflow: auto; z-index: 17; background: rgba(8, 12, 24, .96); } }
.pz-card { position: relative; }
.pz-card button.x { position: absolute; top: 10px; right: 10px; }

/* ---------- settings ---------- */
#settings { position: fixed; inset: 0; z-index: 17; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(4, 6, 12, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: pzIn .2s ease-out; }
.st-card { width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; border-radius: 18px;
  background: rgba(8, 12, 24, .9); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); overflow: hidden; }
.st-head { padding: 18px 20px 0; border-bottom: 1px solid var(--line); }
.st-ttl { font: 700 15px var(--display); letter-spacing: .2em; text-transform: uppercase; }
.st-ttl em { font: 700 11px "Noto Sans JP", sans-serif; font-style: normal; color: var(--muted); letter-spacing: .1em; margin-left: 8px; }
.st-tabs { display: flex; gap: 2px; margin-top: 12px; overflow-x: auto; }
.st-tabs button { padding: 9px 14px 11px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted);
  font: 600 13px var(--ui); letter-spacing: .04em; cursor: pointer; white-space: nowrap; }
.st-tabs button.on { color: #fff; border-bottom-color: var(--accent); }
#stRows { padding: 10px 12px; overflow-y: auto; }
.st-row { display: grid; grid-template-columns: 1fr minmax(180px, 240px); gap: 16px; align-items: center; padding: 10px 10px; border-radius: 10px; cursor: default; }
.st-row.sel { background: rgba(92, 200, 255, .1); box-shadow: inset 2px 0 0 var(--accent); }
.st-row .lbl b { display: block; font-weight: 600; font-size: 14px; }
.st-row .lbl i { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.st-val { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.st-val .arr { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--ink); cursor: pointer; font: 600 14px var(--ui); }
.st-val .arr:hover { background: rgba(255, 255, 255, .12); }
.st-val .v { min-width: 96px; text-align: center; font: 600 13px var(--mono); }
.st-val input[type=range] { width: 150px; accent-color: var(--accent); }
.st-val .num { min-width: 46px; text-align: right; font: 600 12px var(--mono); color: var(--muted); }
.st-tog { position: relative; width: 46px; height: 26px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); cursor: pointer; padding: 0; }
.st-tog::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: left .15s ease, background .15s ease; }
.st-tog.on { background: rgba(92, 200, 255, .35); border-color: var(--accent); }
.st-tog.on::after { left: 23px; background: #fff; }
.st-tog + .tx { min-width: 54px; font: 600 12px var(--mono); color: var(--muted); }
.st-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line); }
#stReset { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--ink); font: 600 12px var(--ui); cursor: pointer; }
#stReset:hover { background: rgba(255, 255, 255, .12); }
.st-keys { font: 500 12px var(--mono); color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
@media (max-width: 560px) { .st-row { grid-template-columns: 1fr; } .st-val { justify-content: flex-start; } }

#fps { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 12; padding: 3px 10px; border-radius: 999px;
  background: rgba(8, 12, 24, .6); font: 600 11px var(--mono); color: var(--muted); pointer-events: none; }

/* ---------- photo mode ---------- */
#photo { position: fixed; top: 16px; right: 16px; bottom: 16px; z-index: 18; display: flex; align-items: flex-start; pointer-events: none; }
#photo.hidden { display: none; }
.ph-card { pointer-events: auto; width: 300px; max-height: 100%; overflow-y: auto; padding: 16px 16px 12px; border-radius: 18px;
  background: rgba(8, 12, 24, .78); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45); animation: pzIn .2s ease-out; }
.ph-ttl { font: 700 14px var(--display); letter-spacing: .2em; margin-bottom: 6px; }
.ph-ttl em { font: 700 11px "Noto Sans JP", sans-serif; font-style: normal; color: var(--muted); letter-spacing: .1em; margin-left: 6px; }
.ph-sec { font: 700 10px var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin: 12px 0 4px; }
.ph-row { display: grid; grid-template-columns: 1fr 112px 64px; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.ph-row b { font-weight: 600; }
.ph-row input[type=range] { width: 112px; accent-color: var(--accent); }
.ph-row span { font: 600 11px var(--mono); color: var(--muted); text-align: right; }
.ph-row .ph-sm { text-align: left; grid-column: 3; }
.ph-tog { position: relative; width: 42px; height: 24px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); cursor: pointer; padding: 0; justify-self: start; }
.ph-tog::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: left .15s, background .15s; }
.ph-tog.on { background: rgba(92, 200, 255, .35); border-color: var(--accent); }
.ph-tog.on::after { left: 21px; background: #fff; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.ph-chips button { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--ink); font: 600 12px var(--ui); cursor: pointer; }
.ph-chips button i { font-style: normal; color: var(--muted); font-size: 10px; margin-left: 5px; }
.ph-chips button.on { border-color: var(--accent); background: rgba(92, 200, 255, .18); color: #fff; }
.ph-chips button:disabled, .ph-wide:disabled { opacity: .35; cursor: default; }
.ph-wide, .ph-btns button { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--ink); font: 600 12.5px var(--ui); cursor: pointer; }
.ph-btns { display: flex; gap: 8px; margin-top: 8px; }
.ph-btns .ph-shoot { padding: 11px; font-size: 14px; background: rgba(255, 181, 71, .2); border-color: var(--warm); color: #fff; }
.ph-btns kbd { margin-left: 6px; }
.ph-wide:hover, .ph-btns button:hover, .ph-chips button:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
.ph-keys { margin-top: 10px; font: 500 11px var(--mono); color: var(--muted); line-height: 1.9; }
.ph-keys kbd { min-width: 18px; height: 18px; font-size: 10px; }
#phflash { position: fixed; inset: 0; z-index: 19; background: #fff; opacity: 0; pointer-events: none; }
#phflash.go { animation: phFlash .45s ease-out; }
@keyframes phFlash { 0% { opacity: .85; } 100% { opacity: 0; } }
/* photo mode's "For Desy" frame, as you compose (the saved PNG draws its own) */
#phframe { position: fixed; inset: 0; z-index: 18; pointer-events: none; border: 3.5vmin solid #fbf6f2; border-bottom-width: 11vmin; }
#phframe.hidden { display: none; }
#phframe span { position: absolute; left: 1.4vmin; bottom: -7.5vmin; font: italic 600 4.6vmin "Bodoni 72", Didot, Georgia, serif; color: #b8476e; line-height: 1; }
#phframe span i { font-style: normal; }
#phframe em { position: absolute; right: 1.4vmin; bottom: -6.9vmin; font: 500 2.4vmin "Chakra Petch", sans-serif; font-style: normal; color: #8a7a80; letter-spacing: .08em; line-height: 1; }

/* the objective under the location (quests.js) */
#objective { position: absolute; top: 108px; left: 20px; max-width: 360px; padding: 8px 12px; border-radius: 12px;
  background: rgba(8, 12, 24, .55); border: 1px solid rgba(255, 181, 71, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#objective.hidden { display: none; }
#objective b { display: block; font: 700 13px var(--ui); color: var(--warm); }
#objective span { display: block; font: 500 11.5px var(--ui); color: var(--muted); margin-top: 2px; }

/* ---------- touch controls (touch.js) ---------- */
#touch { position: fixed; inset: 0; z-index: 11; pointer-events: none; }
#touch.hidden { display: none; }
#touch .tc-look { position: absolute; inset: 0; pointer-events: auto; touch-action: none; }
#touch .tc-stick { position: absolute; left: 28px; bottom: 28px; width: 140px; height: 140px; border-radius: 50%; pointer-events: auto; touch-action: none;
  background: rgba(10, 14, 28, .35); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#touch .tc-knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: rgba(233, 238, 248, .35); border: 1px solid rgba(255, 255, 255, .45); }
#touch .tc-btns { position: absolute; right: 22px; bottom: 26px; display: grid; grid-template-columns: repeat(2, 64px); gap: 12px; pointer-events: none; }
#touch button { pointer-events: auto; touch-action: none; width: 64px; height: 64px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(10, 14, 28, .45); color: #fff; font: 700 18px var(--display); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
#touch button i { font: 600 9px var(--ui); font-style: normal; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
#touch button.big { grid-column: span 2; width: 100%; border-radius: 32px; background: rgba(255, 181, 71, .25); border-color: var(--warm); }
#touch button.on { background: rgba(92, 200, 255, .35); }
#touch .tc-menu { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; font-size: 13px; }
body.touch #hint, body.touch #controls { display: none !important; }
body.touch #minimap { top: 70px; bottom: auto; right: 14px; width: 120px; height: 120px; }
/* photo mode on a touch screen: only the stick and looking; a bar to shoot, open the panel, leave */
#touch.photo .tc-btns, #touch.photo .tc-menu { display: none; }
#phbar { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 19; display: flex; gap: 12px; }
#phbar.hidden { display: none; }
#phbar button { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: rgba(8, 12, 24, .6); color: #fff; font: 700 20px var(--ui);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#phbar .shoot { width: 64px; height: 64px; margin-top: -6px; background: rgba(255, 181, 71, .3); border-color: var(--warm); font-size: 26px; }
@media (max-width: 560px) { #photo { top: 90px; bottom: auto; max-height: 55vh; } }

/* ---------- touch screens: buttons for what the keys do, and no key hints ---------- */
.touch-only { display: none !important; }
body.touch .touch-only { display: inline-flex !important; }
body.touch .key-only, body.touch .t-keys, body.touch .pz-keys, body.touch .st-keys, body.touch .mp-keys, body.touch .cm-hint { display: none !important; }
/* a round close button, top right of the panel it's in */
button.x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--ink);
  font: 600 15px var(--ui); line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
button.x:hover { background: rgba(255, 255, 255, .14); }
body.touch button.x { width: 42px; height: 42px; font-size: 17px; }
#tpanel { position: absolute; }
#tpanel button.x { position: absolute; top: 10px; right: 10px; }
.cm-head #cmClose { margin-left: auto; }
.st-head { position: relative; }
.st-head #stClose { position: absolute; top: 0; right: 0; }
/* the map's buttons */
.mp-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.mp-tools button:not(.x) { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--ink); font: 600 12px var(--ui); letter-spacing: .04em; cursor: pointer; }
.mp-tools button:not(.x):hover { background: rgba(255, 255, 255, .14); }
.mp-tools button.hidden { display: none; }
#bigmapCanvas { touch-action: none; }
/* small screens: the places list opens over the map (Places) */
@media (max-width: 760px) {
  .mp-body { position: relative; }
  #bigmap.list-open .mp-side { display: flex; position: absolute; inset: 0 0 0 auto; width: min(320px, 100%); z-index: 2; background: rgba(8, 12, 24, .96); }
  .mp-ttl b { display: none; }
  .mp-mark { order: 3; width: 100%; }
  #bigmap .legend { font-size: 11px; gap: 4px 10px; }
}
/* tappable choices */
#dialog .opt { cursor: pointer; }
body.touch #dialog .opt { padding: 7px 0; }
/* the dialog and the "E · …" prompt sit above the on-screen stick and buttons, and over them */
body.touch #hud { z-index: 12; }
body.touch #dialog { bottom: 256px; width: calc(100vw - 24px); padding: 14px 16px 26px; }
body.touch #dtext { font-size: 15px; }
body.touch #prompt { bottom: 256px; pointer-events: auto; cursor: pointer; }
@media (orientation: landscape) and (max-height: 520px) {
  body.touch #dialog { bottom: auto; top: 10px; width: min(560px, calc(100vw - 340px)); }
  body.touch #prompt { bottom: auto; top: 12px; }
}
/* settings tabs: slide sideways when they don't all fit (a phone) */
.st-tabs { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-head { padding-right: 46px; }
@media (max-width: 420px) { .st-tabs button { padding: 9px 9px 11px; } }
/* Desy mode switched (the title screen's secret) */
#desyNote { position: absolute; left: 50%; top: 42%; transform: translateX(-50%); z-index: 5; pointer-events: none;
  font: italic 600 28px "Bodoni 72", Didot, Georgia, serif; color: #ff9cc4; text-shadow: 0 0 18px rgba(255, 95, 160, .8); animation: desyIn 1.4s ease-out both; }
@keyframes desyIn { from { opacity: 0; transform: translate(-50%, 8px); } 30% { opacity: 1; transform: translate(-50%, 0); } }

/* the ALL IN casino: the table panel at the bottom of the screen (casino-games.js) */
#casino { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 17; width: min(640px, calc(100vw - 32px)); padding: 12px 16px 10px; border-radius: 16px;
  background: rgba(10, 6, 10, .8); border: 1px solid rgba(226, 194, 122, .45); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 230, 170, .12); color: var(--ink); pointer-events: none; animation: pzIn .2s ease-out; }
#casino.hidden { display: none; }
.cz-top { display: flex; align-items: baseline; gap: 8px; }
.cz-top b { font: 700 14px var(--display); letter-spacing: .18em; text-transform: uppercase; color: #f2d48a; }
.cz-top em { font: 700 11px "Noto Sans JP", sans-serif; font-style: normal; color: var(--muted); letter-spacing: .08em; }
.cz-bal { margin-left: auto; font: 600 11px var(--mono); color: var(--muted); letter-spacing: .06em; }
.cz-bal i, .cz-bet i { font-style: normal; color: #fff; font-size: 14px; margin-left: 4px; }
.cz-bet { margin-top: 6px; font: 600 11px var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.cz-bet span { font: 500 12.5px var(--ui); color: var(--ink); }
.cz-bet b { color: #fff; }
.cz-msg { margin-top: 6px; min-height: 18px; font: 500 13.5px var(--ui); color: #fff; }
.cz-keys { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 11px var(--mono); color: var(--muted); }
.cz-keys kbd { min-width: 18px; height: 18px; font-size: 10px; margin-right: 4px; }
.cz-card { display: inline-block; min-width: 22px; margin: 0 2px; padding: 1px 4px; border-radius: 4px; background: #fbf9f3; color: #16161a; font: 700 12px Georgia, serif; text-align: center; }
.cz-card.red { color: #c4142c; }
.cz-card.back { background: #7a0f1c; color: #d6aa50; }
.cz-num { display: inline-block; min-width: 18px; margin: 0 1px; padding: 0 3px; border-radius: 3px; font: 700 11px var(--mono); color: #fff; text-align: center; }
.cz-num.r { background: #b0141e; } .cz-num.b { background: #18181c; } .cz-num.g { background: #138a3e; }
.cz-opps { width: 100%; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.cz-opp { font: 500 11.5px var(--mono); color: var(--ink); }
.cz-opp.out { opacity: .4; text-decoration: line-through; }
.cz-opp.turn { color: #f2d48a; }

/* phones play in landscape: held upright, everything waits behind this */
#rotate { display: none; }
@media (orientation: portrait) {
  body.phone #rotate { display: flex; position: fixed; inset: 0; z-index: 100; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    background: #06070c; color: #e9eef8; text-align: center; font-family: "Chakra Petch", system-ui, sans-serif; }
  body.phone #rotate svg { animation: turnPhone 2.4s ease-in-out infinite; color: #7cc7ff; }
  body.phone #rotate b { font-size: 20px; letter-spacing: .04em; }
  body.phone #rotate span { font-size: 14px; color: #8b93a7; }
}
@keyframes turnPhone { 0%, 30% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

/* ---------- phone UI: quiet glass that stays out of the picture ---------- */
/* buttons: small clear glass, a symbol and no label; the act button only appears when there's something to do */
#touch .tc-btns { right: 18px; bottom: 18px; grid-template-columns: repeat(2, 50px); gap: 10px; }
#touch button { width: 50px; height: 50px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .88); font-size: 17px; box-shadow: 0 2px 12px rgba(0, 0, 0, .18); transition: opacity .5s ease, background .15s ease, transform .15s ease; }
#touch button i { display: none; }
#touch button.on { background: rgba(255, 255, 255, .26); transform: scale(.94); }
#touch button.big { display: none; height: 46px; border-radius: 23px; font-size: 16px; color: #fff;
  background: rgba(255, 181, 71, .22); border-color: rgba(255, 181, 71, .55); }
body.can-act #touch button.big { display: flex; animation: actIn .25s ease-out; }
@keyframes actIn { from { opacity: 0; transform: translateY(6px); } }
#touch .tc-menu { top: 14px; right: 14px; width: 38px; height: 38px; font-size: 11px; background: rgba(255, 255, 255, .06); }
/* the stick: an outline and a soft knob */
#touch .tc-stick { left: 22px; bottom: 20px; width: 124px; height: 124px; background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .14);
  backdrop-filter: none; -webkit-backdrop-filter: none; transition: opacity .5s ease; }
#touch .tc-knob { width: 50px; height: 50px; margin: -25px 0 0 -25px; background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .35); }
/* untouched for a few seconds: everything fades to a faint outline (touch.js) */
#touch.idle button, #touch.idle .tc-stick { opacity: .32; }
#touch.idle button.big { opacity: .9; }   /* (the act button stays clear: it only shows when there's something to do) */
/* the HUD, smaller and lighter on a phone */
body.touch #loc { top: 12px; left: 16px; }
body.touch #loc .jp { font-size: 19px; letter-spacing: .1em; }
body.touch #loc .sub { font-size: 11px; opacity: .85; }
body.touch #wallet { margin-top: 3px; font-size: 11px; }
body.touch #wallet b { font-size: 13px; }
body.touch #objective { top: 84px; left: 16px; max-width: 250px; padding: 6px 10px; border-radius: 10px; background: rgba(8, 12, 24, .38); border-color: rgba(255, 181, 71, .25); }
body.touch #objective b { font-size: 11.5px; }
body.touch #objective span { font-size: 10.5px; }
body.touch #minimap { top: 12px; right: 62px; width: 92px; height: 92px; opacity: .88; }
body.touch #prompt { opacity: .92; }
/* a short screen (a phone on its side, Safari's bars showing): smaller still */
@media (orientation: landscape) and (max-height: 360px) {
  #touch .tc-btns { grid-template-columns: repeat(2, 44px); gap: 8px; right: 14px; bottom: 12px; }
  #touch button { width: 44px; height: 44px; font-size: 15px; }
  #touch button.big { height: 40px; }
  #touch .tc-stick { width: 104px; height: 104px; left: 16px; bottom: 12px; }
  #touch .tc-knob { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
  body.touch #minimap { width: 76px; height: 76px; top: 10px; right: 56px; }
  body.touch #objective { top: 80px; max-width: 220px; }
}

/* ---------- phone HUD, round 2: a clean screen; things show while they're needed (main.js phoneHud) ---------- */
:root { --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px); }
/* U7 clear of the notch / Dynamic Island and the home bar */
body.touch #loc { left: calc(16px + var(--sl)); top: calc(10px + var(--st)); }
body.touch #objective { left: calc(16px + var(--sl)); }
body.touch #minimap { right: calc(58px + var(--sr)); top: calc(10px + var(--st)); }
#touch .tc-menu { right: calc(14px + var(--sr)); top: calc(12px + var(--st)); }
#touch .tc-btns { right: calc(16px + var(--sr)); bottom: calc(14px + var(--sb)); }
#touch .tc-stick { left: calc(18px + var(--sl)); bottom: calc(14px + var(--sb)); }
/* U4 the prompt lives in the act button: "E · Look" */
body.touch #prompt { display: none !important; }
#touch button.big { gap: 6px; flex-direction: row; font-size: 15px; padding: 0 14px; }
#touch button.big span { font: 600 12px var(--ui); letter-spacing: .02em; color: rgba(255, 255, 255, .92); text-transform: none; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* U1 the objective: a short chip with the distance; in full for a few seconds */
body.touch #objective { pointer-events: auto; cursor: pointer; transition: opacity .3s ease; }
body.touch #objective.chip { padding: 4px 10px; border-radius: 999px; max-width: 230px; background: rgba(8, 12, 24, .32); }
body.touch #objective.chip b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.touch #objective b i { font-style: normal; font-weight: 500; color: rgba(255, 255, 255, .7); margin-left: 4px; }
/* U3 the place name comes and goes; the money stays */
body.touch #locJp, body.touch #locSub { transition: opacity .8s ease, max-height .8s ease; max-height: 40px; overflow: hidden; }
body.touch:not(.loc-show) #locJp, body.touch:not(.loc-show) #locSub { opacity: 0; max-height: 0; }
body.touch:not(.loc-show) #objective { top: calc(36px + var(--st)); }
body.touch #objective { transition: top .6s ease, opacity .3s ease; }
/* U6 the minimap rests while you stand still or are indoors; a tap opens the map */
body.touch #minimap { pointer-events: auto; cursor: pointer; transition: opacity .6s ease; }
body.touch.map-quiet #minimap { opacity: .22; }
/* U2 notices: small, brief, out of the middle of the picture */
body.touch #toast { top: calc(8px + var(--st)); font-size: 11.5px; padding: 5px 12px; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(10, 12, 20, .42); }
body.touch #banner { top: 9vh; }
body.touch .bn-kick { font-size: 9.5px; letter-spacing: .32em; }
body.touch .bn-name { margin-top: 3px; gap: 8px; }
body.touch .bn-name span:first-child { font-size: 17px; }
body.touch .bn-name .jp { font-size: 13px; }
body.touch .bn-sub { display: none; }
/* U5 the conversation: a slim strip between the stick and the buttons; a tap anywhere goes on */
body.touch #dialog { top: auto; bottom: calc(12px + var(--sb)); width: min(520px, calc(100vw - 2 * (150px + var(--sl)))); padding: 9px 14px 12px; border-radius: 14px; background: rgba(8, 12, 24, .58); }
body.touch #who { font-size: 10.5px; margin-bottom: 3px; }
body.touch #dtext { font-size: 13.5px; line-height: 1.45; min-height: 0; max-height: 4.4em; overflow: hidden; }
body.touch #dialog .next { display: none; }
body.touch #dialog .opt { display: inline-block; margin: 4px 6px 0 0; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #e9eef8; }
body.touch #dialog .opt.sel { background: rgba(255, 181, 71, .22); border-color: rgba(255, 181, 71, .5); }
/* U7 the clean view (two-finger tap): only the picture; the look drag still works */
body.clean #hud > *:not(#toast), body.clean #touch button, body.clean #touch .tc-stick, body.clean #minimap, body.clean #objective { opacity: 0 !important; pointer-events: none !important; }
body.clean #touch .tc-menu { opacity: .25 !important; pointer-events: auto !important; }
