/* ApniNagri: warm limewashed plaster panels, enamel-blue street signs, indigo, terracotta and marigold,
   floating over the 3D city. */
:root {
  --bg: #1a1430;
  --panel: #F8F4EA;
  --panel-2: #EFE9DC;
  --ink: #27322D;
  --ink-soft: #756F64;
  --line: #DED7CA;
  --indigo: #223A70;
  --indigo-2: #182B55;
  --terracotta: #B96842;
  --marigold: #f2b134;
  --saffron: #e0862a;
  --rani: #b8336a;
  --teal: #1c9a8c;
  --gold: #ffd27a;
  --good: #2e8b57;
  --bad: #b84a42;
  --radius: 18px;
  --display: "Baloo 2", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
  font-family: var(--body);
}

* { box-sizing: border-box; }

/* After Enter: a personal welcome, with the original landing screen untouched. */
/* The first-time welcome: the way into the town is the big button, and the three small choices sit under it */
.wc-overlay.is-hero .wc-panel { display: flex; flex-direction: column; }
.is-hero .wc-mark { order: 1; width: 46px; height: 46px; margin: 14px 0 8px; font-size: 26px; border-radius: 14px; }
.is-hero .wc-eyebrow { order: 0; }
.is-hero #wc-title { order: 2; font-size: 27px; }
.is-hero #wc-intro { order: 3; margin: 8px 0 18px; font-size: 13px; }
.is-hero .wc-explore { order: 4; }
.is-hero #wc-content { order: 5; }
.is-hero .wc-footer { order: 6; }
.is-hero .wc-explore { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; width: 100%; min-height: 86px; margin: 0 0 20px; padding: 16px 22px; border-radius: 20px; text-decoration: none; text-align: left;
  color: #fff8e9; background: linear-gradient(135deg, #2c5142 0%, #3b7a59 60%, #4c9468 100%); box-shadow: 0 10px 0 #1d3a2e, 0 18px 34px #2c514255; animation: wc-pulse 2.6s ease-in-out infinite; transition: transform .12s, box-shadow .12s; }
.is-hero .wc-explore:active { transform: translateY(6px); box-shadow: 0 4px 0 #1d3a2e, 0 8px 18px #2c514255; animation: none; }
.is-hero .wc-explore-q { flex-basis: 100%; font-size: 11px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: #d4e6c4; }
.is-hero .wc-explore-go { font: 800 28px/1.05 var(--display); letter-spacing: -.4px; }
.is-hero .wc-explore-arrow { display: grid; place-items: center; width: 46px; height: 46px; margin-left: auto; border-radius: 50%; background: #ffd24a; color: #2a3a1c; font-size: 26px; font-weight: 900; }
.is-hero #wc-content { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.is-hero #wc-content:not(:has(#wc-chat)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.is-hero #wc-content::before { content: 'Ya yahan se shuru karo'; grid-column: 1 / -1; font-size: 10px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; color: #99633c; }
.is-hero .wc-choice { flex-direction: column; justify-content: center; text-align: center; gap: 6px; min-height: 0; padding: 12px 6px 11px; border-radius: 14px; }
.is-hero .wc-choice > span:nth-child(2) { gap: 0; }
.is-hero .wc-choice small, .is-hero .wc-choice .wc-arrow { display: none; }
.is-hero .wc-choice strong { font-size: 12.5px; line-height: 1.2; }
.is-hero .wc-icon { width: 38px; height: 38px; flex-basis: 38px; font-size: 21px; }
.is-hero .wc-shared { grid-column: 1 / -1; }
.is-hero .wc-footer { margin-top: 16px; padding-top: 12px; }
@keyframes wc-pulse { 0%, 100% { box-shadow: 0 10px 0 #1d3a2e, 0 18px 34px #2c514255; } 50% { box-shadow: 0 10px 0 #1d3a2e, 0 18px 44px #4c946888; } }
@media (prefers-reduced-motion: reduce) { .is-hero .wc-explore { animation: none; } }
@media (max-width: 700px) { .is-hero .wc-explore { min-height: 84px; padding: 15px 18px; } .is-hero .wc-explore-go { font-size: 26px; } .is-hero .wc-choice { padding: 11px 4px 10px; } }

.wc-overlay { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 20px; background: rgba(25, 31, 29, .48); backdrop-filter: blur(5px); }
.wc-panel { position: relative; width: min(490px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain; padding: 32px; border: 1px solid #e3d4b5; border-top: 5px solid #cb793d; border-radius: 25px; background: #fbf5e9; box-shadow: 0 28px 100px #18271e55; }
.wc-close { position: absolute; right: 10px; top: 10px; min-width: 44px; min-height: 44px; border-radius: 50%; color: #857462; }
.wc-close:hover { background: #efe4d0; }
.wc-eyebrow { padding-right: 24px; font-size: 9px; font-weight: 900; letter-spacing: 1.5px; color: #99633c; }
.wc-mark { margin: 20px 0 12px; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 19px; background: #e9eddc; font-size: 35px; transform: rotate(-5deg); }
.wc-panel h2 { margin: 0; color: #294a3f; font: 800 29px/1.15 var(--display); letter-spacing: -.6px; overflow-wrap: anywhere; }
#wc-intro { margin: 10px 0 23px; color: #7a6a58; font-size: 14px; line-height: 1.6; }
#wc-content { display: grid; gap: 10px; }
.wc-choice { width: 100%; display: flex; align-items: center; gap: 13px; text-align: left; padding: 15px; border: 1px solid #e0d5bf; border-radius: 15px; background: #fffaf1; min-height: 83px; transition: background .15s, border-color .15s; }
.wc-choice:hover { background: #edf1e2; border-color: #a8ba99; }
.wc-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; background: #efe7d3; border-radius: 13px; font-size: 25px; }
.wc-choice:nth-child(2) .wc-icon { background: #e5ecd9; }
.wc-choice:nth-child(3) .wc-icon { background: #f6e5d7; }
#wc-chat .wc-icon { background: #e0eeea; }
.wc-choice > span:nth-child(2) { display: grid; gap: 4px; }
.wc-choice strong { color: #34493b; font-size: 15px; }
.wc-choice small { color: #80705f; font-size: 11px; line-height: 1.5; }
.wc-arrow { margin-left: auto; color: #9e8d70; font-size: 20px; }
.wc-explore { font-weight: 900; width: 100%; padding: 16px 0 10px; min-height: 44px; margin-top: 7px; font-size: 12px; color: #746650; text-decoration: underline; text-underline-offset: 4px; }
.wc-footer { margin: 13px 0 0; padding-top: 15px; border-top: 1px solid #e6dbc5; text-align: center; font-size: 10px; color: #a38c6d; }
.wc-primary { display: flex; justify-content: space-between; gap: 12px; align-items: center; width: 100%; min-height: 48px; border-radius: 12px; background: #2c5142; color: #fff8e9; font-size: 14px; font-weight: 800; padding: 12px 16px; }
.wc-text { min-height: 44px; font-size: 12px; font-weight: 700; color: #79684f; text-decoration: underline; text-underline-offset: 3px; }
#wc-search { display: grid; gap: 10px; }
#wc-search label { font-size: 12px; font-weight: 800; color: #5b654f; }
#wc-username { width: 100%; min-height: 48px; padding: 12px; border: 1px solid #d8c9ac; border-radius: 11px; background: #fffaf2; color: #314c3d; }
.wc-search-field { position: relative; }
#wc-suggestions { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 2; margin: 0; padding: 5px; list-style: none; background: #fffaf0; border: 1px solid #d6c8ae; border-radius: 12px; box-shadow: 0 12px 28px #35291926; max-height: min(240px, 32vh); overflow-y: auto; overscroll-behavior: contain; }
#wc-suggestions [role="option"] { display: flex; align-items: center; gap: 9px; padding: 10px 8px; min-height: 48px; border-radius: 8px; cursor: pointer; }
#wc-suggestions [role="option"]:hover, #wc-suggestions [aria-selected="true"] { background: #e8eedc; }
#wc-suggestions strong { font-size: 12px; color: #35503d; overflow-wrap: anywhere; min-width: 0; }
#wc-suggestions small { margin-left: auto; flex-shrink: 0; font-size: 10px; color: #8b7558; }
.wc-suggestion-avatar { flex-shrink: 0; font-size: 19px; }
.wc-suggestion-empty { padding: 13px 9px; font-size: 12px; color: #8b7558; }
.wc-sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wc-note, #wc-message { color: #8b775d; font-size: 11px; line-height: 1.6; margin: 0; }
#wc-message { color: #a24335; }
#wc-message:empty { display: none; }
.wc-found { background: #eaf0df; border: 1px solid #ccd9b9; border-radius: 15px; padding: 20px; text-align: center; color: #38533e; }
.wc-found > span { display: block; font-size: 46px; margin-bottom: 10px; }
.wc-found > strong { font-size: 16px; }
.wc-found p { font-size: 12px; line-height: 1.6; margin: 8px 0 0; }
.wc-remember { display: flex; align-items: center; gap: 8px; font-size: 11px; min-height: 44px; color: #79694e; }
.wc-remember input { accent-color: #2c5142; width: 18px; height: 18px; }
.wc-resident { padding: 12px; border-radius: 12px; background: #eaf0df; display: flex; gap: 12px; align-items: center; color: #48613e; }
.wc-resident > span { font-size: 30px; }
.wc-resident div { display: grid; gap: 4px; }
.wc-resident b { font-size: 13px; }
.wc-resident small { font-size: 11px; line-height: 1.5; }
.wc-shared { min-height: 44px; border-radius: 10px; padding: 10px 12px; background: #e5eaf6; color: #344c83; font-size: 12px; font-weight: 800; text-align: left; overflow-wrap: anywhere; }
.wc-overlay.is-tour { background: transparent; backdrop-filter: none; pointer-events: none; align-items: end; padding-bottom: 100px; }
.is-tour .wc-panel { pointer-events: auto; padding: 22px; box-shadow: 0 12px 35px #18271e44; }
.is-tour .wc-mark, .is-tour .wc-eyebrow, .is-tour .wc-explore, .is-tour .wc-footer { display: none; }
.is-tour .wc-panel h2 { font-size: 23px; padding-right: 25px; }
.is-tour #wc-intro { font-size: 12px; margin: 7px 0 13px; }
.wc-tour-count { margin: 0; font-size: 9px; letter-spacing: 1px; color: #8f775a; font-weight: 800; }
.wc-tour-actions { display: flex; gap: 18px; align-items: center; }
.wc-tour-actions .wc-primary { width: auto; margin-left: auto; }
@media (max-width: 700px) {
  .wc-overlay { padding: 12px; padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .wc-panel { padding: 25px 20px; border-radius: 21px; }
  .wc-panel h2 { font-size: 26px; }
  .wc-choice { padding: 12px; gap: 10px; }
  .wc-choice strong { font-size: 14px; }
  .wc-icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 23px; }
  .wc-overlay.is-tour { padding-bottom: 105px; }
}
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }
input, textarea { font: inherit; }

#app { display: flex; flex-direction: column; height: 100%; }
#stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }


/* ---------- Name tags ---------- */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tag {
  position: absolute; left: 0; top: 0;
  pointer-events: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(251, 244, 230, 0.93);
  color: var(--ink);
  font: 800 11px var(--body);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  will-change: transform;
}
.tag::after { content: ""; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); border: 4px solid transparent; border-top-color: rgba(251, 244, 230, 0.93); border-bottom: 0; }
.tag.keeper { background: #ffe1a8; }
.tag.keeper::after { border-top-color: #ffe1a8; }
.tag.kid { background: #d9f2e6; font-size: 10.5px; padding: 1px 7px; }
.tag.kid::after { border-top-color: #d9f2e6; }
.tag.bus { background: #c8302c; color: #fff; }
.tag.bus::after { border-top-color: #c8302c; }
.tag.chant { background: #fff; color: #b8336a; font-style: italic; pointer-events: none; }
.tag.chant::after { border-top-color: #fff; }
.tag.me, .tag.sel { background: var(--gold); font-size: 12.5px; padding: 3px 10px; }
.tag.me::after, .tag.sel::after { border-top-color: var(--gold); }

#flash { position: absolute; inset: 0; pointer-events: none; background: #e8eeff; opacity: 0; }
#flash.on { animation: flash 0.5s ease-out; }
@keyframes flash { 0% { opacity: 0.3; } 40% { opacity: 0.06; } 55% { opacity: 0.18; } 100% { opacity: 0; } }

/* ---------- Floating chrome ---------- */
.chip, #hud-card, .round, .panel, #find-bar { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }

.live-pill {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
  z-index: 4;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
}
.live-pill b { font-family: var(--display); font-weight: 700; letter-spacing: 0.06em; }
.live-pill #live-count { color: var(--ink-soft); font-weight: 800; font-size: 13px; }
.live-pill .chev { color: var(--ink-soft); font-size: 12px; }
.live-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--terracotta); }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(214, 51, 108, 0.55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(214, 51, 108, 0); } }

#hud {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }
#hud-card { border-radius: 16px; padding: 8px 16px 9px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.muted { color: var(--ink-soft); font-weight: 700; font-size: 12.5px; }
#hud-btns { display: flex; gap: 8px; }
.round { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 17px; font-weight: 800; color: var(--ink); }
.round:hover { background: #fffaf0; }
.phone-only { display: none; }
body.find-open #btn-find { background: var(--indigo); color: #fff; border-color: var(--indigo); }

/* ---------- Buttons ---------- */
.primary, .secondary, .ghost { border-radius: 12px; padding: 11px 18px; font-weight: 800; font-size: 15px; text-align: center; text-decoration: none; }
.primary { background: var(--indigo); color: #fff; }
.primary:hover { background: var(--indigo-2); }
.primary:disabled, .secondary:disabled { opacity: 0.5; cursor: not-allowed; }
button:active:not(:disabled) { transform: translateY(1px); }
.primary.big { padding: 14px 22px; font-size: 17px; background: linear-gradient(135deg, var(--saffron), var(--rani)); box-shadow: 0 8px 24px rgba(214, 51, 108, 0.35); }
.secondary { background: var(--panel-2); color: var(--ink); }
.secondary:hover { background: #e9d6b3; }
.ghost { color: var(--ink-soft); }
.ghost:hover { color: var(--ink); }
.wide { width: 100%; display: block; margin-top: 8px; }
.center { display: block; }
.link { min-height: 28px; color: var(--indigo); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; padding: 0; text-align: right; }

/* ---------- Find bar + night progress ---------- */
#find-bar {
  position: absolute;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 8px;
  padding: 7px 7px 7px 14px;
  border-radius: 18px;
  z-index: 5;
  color: var(--ink-soft);
}
#find-bar input { flex: 1; min-width: 0; border: 0; background: transparent; font: 800 16px var(--body); color: var(--ink); outline: none; padding: 9px 2px; }
#find-bar input::placeholder { color: var(--ink-soft); }
/* suggestions open upwards from the search bar */
#find-sugg { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3); max-height: 50vh; overflow: auto; }
#find-sugg li.empty { padding: 10px 12px; font-weight: 700; font-size: 14px; color: var(--ink-soft); }
#find-sugg button { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; text-align: left; font-size: 15px; }
#find-sugg button:hover, #find-sugg button:focus-visible { background: var(--panel-2); }
#find-sugg button span { color: var(--ink-soft); font-weight: 800; font-size: 12.5px; flex: none; }
#find-sugg b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghost-btn { padding: 10px 14px; border-radius: 12px; background: var(--panel-2); font-weight: 800; color: var(--ink); }
.primary.small { padding: 10px 16px; }
#night-bar { position: absolute; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(240px, 50vw); height: 5px; border-radius: 99px; background: rgba(0, 0, 0, 0.35); overflow: hidden; z-index: 2; }
#night-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--saffron), var(--rani)); }

/* ---------- Panels ---------- */
.panel { position: absolute; z-index: 5; border-radius: var(--radius); padding: 16px; color: var(--ink); }
.panel h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.2; padding-right: 36px; }
.panel { border-top: 3px solid var(--terracotta); }
.panel p { margin: 4px 0 0; }
.panel .close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 10px; color: var(--ink-soft); font-size: 16px; }
.panel .close:hover { background: var(--panel-2); }
.panel .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.panel .row > span:first-child { color: var(--ink-soft); font-weight: 700; flex: none; }
.panel .row > span:last-child { font-weight: 800; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.handle { display: none; }

.side { top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); width: min(360px, calc(100% - 28px)); max-height: calc(100% - 110px); overflow: auto; }
.per-head { display: flex; align-items: center; gap: 12px; padding-right: 50px; margin-bottom: 8px; }
.per-head h3 { font-size: 22px; overflow-wrap: anywhere; }
.per-head h3 small { font-size: 13px; color: #c47a1a; font-family: var(--body); font-weight: 800; }
.per-head p { color: var(--ink-soft); font-weight: 700; font-size: 14px; }
.per-av { width: 46px; height: 46px; border-radius: 50%; flex: none; box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.14); border: 3px solid var(--gold); }
.acts { display: flex; gap: 8px; margin-top: 12px; }
.acts > button { flex: 1; padding: 12px; }
.acts.wrap { flex-wrap: wrap; }
.acts.wrap > button { flex: 1 1 calc(33% - 8px); min-width: 92px; padding: 10px 8px; font-size: 14px; }
.badge { font-weight: 800; font-size: 12.5px; color: var(--ink-soft); }
.badge.community { color: #1d6f8c; }
.badge.generated, .badge.visitor { color: #8a6a3a; }
.note { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin: 10px 0 0; line-height: 1.45; }
.tag.home-label { background: var(--gold); font-size: 13.5px; font-weight: 800; padding: 5px 12px 6px; pointer-events: none; box-shadow: 0 6px 16px #0003; }
.tag.home-label .pin-in { display: inline-block; animation: pin-drop .7s cubic-bezier(.34, 1.56, .64, 1) both, pin-float 1.9s ease-in-out .7s infinite; }
.tag.home-label .pin-in::before { content: '🏠 '; }
@keyframes pin-drop { 0% { transform: translateY(-46px) scale(.5); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes pin-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .tag.home-label .pin-in { animation: none; } }
/* After a search the house is shown, not hidden behind a full-screen card: a small welcome sits at the top while the camera glides there */
.overlay.reveal { inset: auto; top: calc(78px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: block; padding: 0; background: none; pointer-events: none; animation: reveal-in .45s cubic-bezier(.34, 1.4, .64, 1) both; }
.overlay.reveal .reveal-card { pointer-events: auto; padding: 10px 16px 12px; text-align: center; border-radius: 16px; box-shadow: 0 10px 26px #0004; }
.overlay.reveal .reveal-card h2 { font-size: 20px; margin: 0; }
.overlay.reveal .reveal-card .eyebrow, .overlay.reveal .reveal-home { display: none; }
.overlay.reveal .reveal-sub { margin: 2px 0 0; font-size: 12px; }
.overlay.reveal #reveal-skip { display: none; }
@keyframes reveal-in { from { transform: translate(-50%, -24px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.tag.home-label::after { border-top-color: var(--gold); }

#people { top: calc(64px + env(safe-area-inset-top, 0px)); left: calc(12px + env(safe-area-inset-left, 0px)); width: min(330px, calc(100% - 24px)); max-height: calc(100% - 160px); display: flex; flex-direction: column; gap: 8px; }
#people-q {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  font: 700 15px var(--body);
  color: var(--ink);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.row.warn > span:last-child { color: var(--bad); }
.rbtns { display: flex; gap: 10px; flex: none; }
#people-list { overflow: auto; min-height: 0; flex: 1; }
.prow { display: grid; grid-template-columns: 10px 1fr; column-gap: 9px; width: 100%; text-align: left; padding: 8px 6px; border-radius: 10px; border-top: 1px solid var(--line); }
.prow:hover { background: var(--panel-2); }
.pdot { width: 9px; height: 9px; border-radius: 50%; background: #d6c7ae; margin-top: 5px; grid-row: span 2; }
.pdot.on { background: var(--good); }
.prow small { color: var(--ink-soft); font-weight: 700; }
.empty { padding: 10px 4px; }
.pn { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd { font-size: 12px; color: var(--ink-soft); font-weight: 700; }

.pop { top: calc(140px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: min(340px, calc(100% - 24px)); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; margin-top: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--rani); }

/* ---------- Admin toolbar ---------- */

/* ---------- Toasts ---------- */
#toasts { position: absolute; top: calc(150px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: max-content; max-width: calc(100% - 24px); z-index: 6; }
.toast { background: rgba(45, 31, 51, 0.93); color: #fbf3e6; border-radius: 12px; padding: 8px 16px; font-size: 14px; font-weight: 800; text-align: center; animation: toast 3.2s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 30%, rgba(90, 30, 60, 0.3), rgba(10, 6, 20, 0.62)); z-index: 10; }
.card { background: var(--panel); border-radius: 24px; padding: 26px; width: min(400px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); color: var(--ink); border-top: 4px solid var(--saffron); }
/* ---------- Welcome screen: text over the live city ---------- */
.splash {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center;
  padding: 32px max(24px, env(safe-area-inset-right, 0px)) 32px max(24px, 6vw, env(safe-area-inset-left, 0px));
  background: linear-gradient(90deg, rgba(18, 11, 28, 0.88) 0%, rgba(18, 11, 28, 0.62) 38%, rgba(18, 11, 28, 0.08) 72%, rgba(18, 11, 28, 0) 100%);
  color: #f8efe2;
}
.splash[hidden] { display: none; }
.splash-inner { max-width: 470px; display: flex; flex-direction: column; align-items: flex-start; }
.splash .mark { color: var(--gold); margin-bottom: 18px; }
.eyebrow { margin: 0 0 6px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.splash h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(48px, 7vw, 76px); line-height: 0.95; letter-spacing: -0.01em; color: #fffaf2; }
.devanagari { margin: 6px 0 18px; font-family: var(--display); font-size: 22px; font-weight: 600; color: rgba(248, 239, 226, 0.7); }
.lede { margin: 0 0 26px; font-size: 16.5px; line-height: 1.55; font-weight: 600; color: rgba(248, 239, 226, 0.86); max-width: 42ch; }
.enter {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 26px; border-radius: 999px;
  background: var(--saffron); color: #1d1208;
  font-family: var(--body); font-weight: 800; font-size: 16px;
  box-shadow: 0 10px 30px rgba(242, 140, 40, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}
.enter span { font-size: 18px; transition: transform 0.15s ease; }
.enter:hover { background: #ffa04a; }
.enter:hover span { transform: translateX(3px); }
.enter:active { transform: scale(0.98); }
.splash-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.follow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 24px; border-radius: 999px;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 28%, #dc2743 55%, #cc2366 78%, #bc1888 100%); color: #fff;
  font-family: var(--body); font-weight: 800; font-size: 16px; text-decoration: none;
  box-shadow: 0 10px 30px rgba(220, 39, 67, 0.3);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.follow:hover { filter: brightness(1.08); }
.follow:active { transform: scale(0.98); }
.stats-row { display: flex; gap: 28px; margin: 30px 0 0; padding-top: 18px; border-top: 1px solid rgba(248, 239, 226, 0.18); }
.stats-row div { display: flex; flex-direction: column-reverse; gap: 2px; }
.stats-row dt { font-size: 11.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(248, 239, 226, 0.55); }
.stats-row dd { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 600; color: #fffaf2; font-variant-numeric: tabular-nums; }
.splash .tip { color: rgba(248, 239, 226, 0.6); margin-top: 18px; min-height: 0; }
.splash .about { margin-top: 14px; max-width: 42ch; color: rgba(248, 239, 226, 0.82); font-size: 14px; line-height: 1.5; font-weight: 600; }
.splash .legal-link { margin: 10px 0 0; font-size: 13px; font-weight: 700; color: rgba(248, 239, 226, 0.6); }
.splash .legal-link a, .splash .about a { color: var(--gold); }
.view-legal { margin: 10px 0 0; text-align: center; }
.view-legal a, .chat-note a { color: var(--indigo); font-weight: 800; }
.splash .about summary { cursor: pointer; color: var(--gold); font-weight: 800; font-size: 13.5px; list-style: none; }
.splash .about summary::-webkit-details-marker { display: none; }
.splash .about summary::after { content: " ▾"; }
.splash .about[open] summary::after { content: " ▴"; }
.splash .about-body { max-height: min(24vh, 200px); overflow-y: auto; margin-top: 8px; padding-right: 6px; }
.splash .about-body p { margin: 0 0 8px; }
body.splash-on #hud, body.splash-on .live-pill, body.splash-on #find-bar, body.splash-on #night-bar, body.splash-on #labels { display: none !important; }
.tip { color: var(--ink-soft); font-size: 13px; font-weight: 700; margin: 6px 0 0; min-height: 2.6em; }
.dialog-card h2 { margin: 0 0 8px; font-family: var(--display); font-weight: 700; font-size: 26px; }
.dialog-card p { color: var(--ink-soft); font-weight: 700; margin: 0 0 14px; }
.bad { color: var(--bad); }

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .live-pill .dot { animation: none; }
  .enter, .enter span, .follow { transition: none; }
  #flash.on { animation: none; }
}

/* ---------- Sponsored spaces (off unless the admin turns them on) ---------- */
.ad-slot { margin-top: 14px; min-height: 104px; border: 1px dashed rgba(90, 50, 30, 0.35); border-radius: 12px; padding: 10px 12px; background: rgba(255, 255, 255, 0.45); position: relative; }
.ad-slot .ad-label { position: absolute; top: 6px; right: 10px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.ad-slot b { display: block; font-family: var(--display); font-size: 17px; margin-top: 8px; }
.ad-slot p { margin: 2px 0 0; font-size: 13px; font-weight: 600; }
.ad-slot a { color: var(--indigo); font-weight: 800; font-size: 13px; }

/* compass, bottom right */
#compass { position: absolute; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 4; display: flex; align-items: center; gap: 4px; color: var(--ink); }
#cmp-dial { width: 60px; height: 60px; padding: 2px; border-radius: 50%; display: grid; place-items: center; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3)); }
#cmp-dial text { font-family: var(--body); }
#cmp-rose { transform-origin: 32px 32px; transform-box: view-box; }
.cmp-turn { width: 34px; height: 34px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25); font-size: 17px; font-weight: 800; color: var(--ink); display: grid; place-items: center; }
.cmp-turn:hover, #cmp-dial:hover circle { filter: brightness(1.04); }
body.splash-on #compass, body.creator-on #compass { display: none; }

/* ---------- Chat (Chowk) ---------- */
#btn-chat { position: relative; }
#btn-chat[data-n]:not([data-n=""])::after { content: attr(data-n); position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #d6336c; color: #fff; font: 800 11px/18px var(--body); text-align: center; box-shadow: 0 0 0 2px var(--panel); }
.chat { display: flex; flex-direction: column; gap: 6px; }
.chat-you { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 2px; vertical-align: baseline; }
.chat-list { display: flex; flex-direction: column; gap: 6px; height: min(300px, 38vh); overflow-y: auto; padding: 8px 2px; margin: 4px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chat-empty { color: var(--ink-soft); text-align: center; margin: auto 0; font-size: 14px; }
.chat-form { display: flex; gap: 8px; margin-top: 4px; }

/* ---------- Noticeboard ---------- */
#btn-notices { position: relative; }
#btn-notices.unread::after { content: ""; position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--rani); box-shadow: 0 0 0 2px var(--panel); }
.nb-sec { margin-top: 14px; }
.nb-sec h4 { margin: 0 0 6px; font-family: var(--display); font-size: 16px; color: #8a3a1e; letter-spacing: 0.02em; }
.nb-item { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.nb-item b { font-weight: 800; }
.nb-item span, .nb-date { color: var(--ink-soft); font-weight: 700; font-size: 13px; }
.nb-item p { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.nb-item .link { align-self: flex-start; text-align: left; font-size: 13.5px; min-height: 32px; }

/* ---------- Creator mode ---------- */
#creator-bar, #cr-show { display: none; }
body.creator-on #creator-bar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center;
  position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  width: min(980px, calc(100% - 24px)); padding: 8px; border-radius: 16px; z-index: 6;
  background: rgba(36, 26, 53, 0.9); border: 1px solid rgba(255, 214, 160, 0.2); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
#creator-bar button { color: #f8ecd8; background: rgba(255, 255, 255, 0.07); border-radius: 10px; padding: 8px 11px; font-weight: 800; font-size: 13px; min-height: 40px; }
#creator-bar button[aria-pressed="true"] { background: var(--saffron); color: #1d1208; }
#creator-bar button.unsupported { opacity: 0.5; }
#creator-bar .sep { width: 1px; align-self: stretch; background: rgba(255, 214, 160, 0.2); }
body.creator-on #find-bar, body.creator-on #night-bar, body.creator-on .live-pill { display: none !important; }
body.creator-hide #hud, body.creator-hide #creator-bar, body.creator-hide .panel, body.creator-hide #labels, body.creator-hide #toasts { display: none !important; }
body.creator-hide #cr-show { display: grid; position: absolute; right: 12px; bottom: 12px; z-index: 7; opacity: 0.35; }
body.creator-hide #cr-show:hover, body.creator-hide #cr-show:focus-visible { opacity: 1; }
#story-guide { position: absolute; inset: 0; pointer-events: none; z-index: 2; display: grid; place-items: center; }
#story-guide .frame { height: 92%; aspect-ratio: 9 / 16; max-width: 92%; border: 2px dashed rgba(255, 255, 255, 0.85); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(10, 6, 20, 0.45); position: relative; }
#story-guide .frame span { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); color: #fff; font-weight: 800; font-size: 12px; background: rgba(0, 0, 0, 0.4); padding: 2px 8px; border-radius: 99px; }
.gl-lost { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 9; background: var(--panel); padding: 14px 18px; border-radius: 14px; font-weight: 800; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }

/* ---------- Barber: the token slip ---------- */
.barber .muted { margin-top: 2px; }
.bb-slip { position: relative; margin-top: 12px; padding: 14px 14px 12px; background: var(--panel-2); border-radius: 14px; border: 2px dashed rgba(196, 90, 42, 0.45); }
.bb-title { display: flex; align-items: center; justify-content: center; gap: 14px; font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1; color: var(--terracotta); }
.bb-pole { width: 12px; height: 34px; border-radius: 6px; background: repeating-linear-gradient(135deg, #d9302c 0 6px, #fff 6px 12px, #23408e 12px 18px, #fff 18px 24px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.bb-tag { text-align: center; font-weight: 800; font-size: 12.5px; letter-spacing: 0.06em; color: var(--ink-soft); margin: 6px 0 10px !important; }
.bb-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid rgba(35, 64, 142, 0.35); border-radius: 10px; overflow: hidden; }
.bb-grid div { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-right: 1.5px solid rgba(35, 64, 142, 0.2); border-bottom: 1.5px solid rgba(35, 64, 142, 0.2); }
.bb-grid div:nth-child(2n) { border-right: 0; }
.bb-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.bb-grid span { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--indigo); }
.bb-grid b { font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--ink); }
.bb-services { border: 0; margin: 10px 0 0; padding: 0; }
.bb-services legend { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--indigo); padding: 0; margin-bottom: 4px; }
.bb-services label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 14.5px; }
.bb-services label:hover { background: rgba(255, 255, 255, 0.5); }
.bb-services input { width: 20px; height: 20px; accent-color: var(--terracotta); flex: none; }
.bb-services label span { flex: 1; }
.bb-services label i { font-style: normal; color: var(--ink-soft); font-size: 13px; margin-left: 4px; }
.bb-services[disabled] label { opacity: 0.75; cursor: default; }
.bb-total { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 6px 2px; border-top: 1.5px dashed rgba(90, 50, 30, 0.25); margin-top: 6px; font-weight: 800; }
.bb-total b { font-family: var(--display); font-size: 22px; }
.bb-note { position: relative; margin: 12px 56px 10px 2px !important; padding: 10px 12px; background: #fff6d6; border-radius: 6px; transform: rotate(-1.2deg); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12); font-family: var(--display); font-size: 15.5px; line-height: 1.3; color: #26336b; }
.bb-note::before { content: ""; position: absolute; top: -7px; left: 50%; width: 52px; height: 14px; transform: translateX(-50%) rotate(2deg); background: rgba(196, 90, 42, 0.75); border-radius: 2px; }
.bb-notewrap { position: relative; }
.bb-stamp { position: absolute; right: 0; top: 50%; margin-top: -32px; width: 64px; height: 64px; border-radius: 50%; border: 2.5px solid rgba(110, 60, 160, 0.65); color: rgba(110, 60, 160, 0.85); display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-14deg); text-align: center; line-height: 1.05; }
.bb-stamp span { font-family: var(--display); font-weight: 700; font-size: 14px; }
.bb-stamp small { font-size: 9px; font-weight: 800; }
.bb-done { margin: 8px 0 0 !important; padding: 10px 12px; border-radius: 12px; background: rgba(46, 139, 87, 0.14); color: #1d5c39; font-weight: 700; font-size: 14.5px; }
.bb-slip .primary.wide, .bb-slip .ghost-btn.wide { width: 100%; display: block; margin-top: 8px; }
.bb-bye { text-align: center; font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--rani); margin: 10px 0 0 !important; }
.bb-closed { text-align: center; padding: 22px 16px 18px; }
.bb-shut { height: 70px; margin: 0 auto 12px; width: 78%; border-radius: 6px 6px 2px 2px; background: repeating-linear-gradient(180deg, #9aa3a8 0 7px, #7f888d 7px 9px); box-shadow: inset 0 -6px 0 #5d7580; }
.bb-big { font-family: var(--display); font-weight: 700; font-size: 32px; color: var(--terracotta); margin: 0 !important; }
.bb-sub { font-weight: 700; color: var(--ink-soft); }

/* ---------- Nagri Radio (the barber shop's radio) ---------- */
.radio { position: absolute; z-index: 6; left: calc(14px + env(safe-area-inset-left, 0px)); top: calc(64px + env(safe-area-inset-top, 0px)); width: min(380px, calc(100% - 28px));
  display: flex; gap: 12px; align-items: stretch; padding: 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--rani); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3); color: var(--ink); }
.rd-art { position: relative; flex: none; width: 128px; aspect-ratio: 8 / 5; align-self: center; border-radius: 10px; overflow: hidden; background: var(--panel); }
.rd-art #rd-video, .rd-art iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rd-cassette { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--panel); pointer-events: none; }
.rd-reel { transform-box: view-box; }
.radio.is-playing .rd-reel { animation: rdSpin 2.4s linear infinite; }
@keyframes rdSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .radio.is-playing .rd-reel { animation: none; } }
.rd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rd-head { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 15px; }
.rd-head b { flex: 1; }
.rd-x { width: 28px; height: 28px; border-radius: 8px; color: var(--ink-soft); }
.rd-x:hover { background: var(--panel-2); }
.rd-eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.rd-eq i { width: 3px; height: 4px; background: var(--rani); border-radius: 1px; }
.radio.is-playing .rd-eq i { animation: rdEq 0.9s ease-in-out infinite; }
.radio.is-playing .rd-eq i:nth-child(2) { animation-delay: -0.3s; }
.radio.is-playing .rd-eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes rdEq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
.rd-title { margin: 4px 0 0; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-artist { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-bar { height: 6px; margin-top: 8px; border-radius: 99px; background: var(--panel-2); cursor: pointer; overflow: hidden; }
.rd-bar div { height: 100%; width: 0; background: linear-gradient(90deg, var(--saffron), var(--rani)); }
.rd-bar:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.rd-times { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; color: var(--ink-soft); margin-top: 2px; font-variant-numeric: tabular-nums; }
.rd-ctrls { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.rd-ctrls button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.rd-ctrls button svg { width: 18px; height: 18px; }
.rd-ctrls button:hover { background: var(--panel-2); }
.rd-ctrls .rd-primary { width: 40px; height: 40px; background: var(--indigo); color: #fff; }
.rd-ctrls .rd-primary:hover { background: var(--indigo-2); }
#rd-shuffle.is-on { color: var(--rani); background: rgba(184, 51, 106, 0.12); }
#rd-vol { flex: 1; min-width: 50px; accent-color: var(--rani); }
.radio.is-empty .rd-ctrls, .radio.is-empty .rd-bar, .radio.is-empty .rd-times { opacity: 0.4; pointer-events: none; }
body.splash-on .radio, body.creator-on .radio { display: none !important; }
.rd-mini-btn { display: none; }
.radio.is-min { width: 52px; height: 52px; padding: 0; border-radius: 50%; border-top-width: 1px; background: var(--panel); }
.radio.is-min .rd-art, .radio.is-min .rd-main { display: none; }
.radio.is-min .rd-mini-btn { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; font-size: 24px; position: relative; }
.rd-mini-eq { position: absolute; top: 6px; right: 7px; display: inline-flex; gap: 2px; align-items: flex-end; height: 11px; }
.rd-mini-eq i { width: 3px; height: 3px; background: var(--rani); border-radius: 1px; }
.radio.is-min.is-playing .rd-mini-eq i { animation: rdEq 0.9s ease-in-out infinite; }
.radio.is-min.is-playing .rd-mini-eq i:nth-child(2) { animation-delay: -0.3s; }
.radio.is-min.is-playing .rd-mini-eq i:nth-child(3) { animation-delay: -0.6s; }
body.radio-on:has(.radio.is-min) .side { max-height: calc(100% - 110px); }
@media (max-width: 700px) { .radio.is-min { left: 10px; right: auto; width: 52px; top: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 700px) {
  .radio { left: 10px; right: 10px; width: auto; top: calc(128px + env(safe-area-inset-top, 0px)); }
  body.find-open .radio { top: calc(196px + env(safe-area-inset-top, 0px)); }
  body.radio-on .side { max-height: calc(100% - 290px - env(safe-area-inset-top, 0px)); }
  .rd-art { width: 96px; }
}

/* ---------- Admin: arrival hall ---------- */
[data-pane="residents"] hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ---------- Weather picker (View panel) ---------- */
.wx-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 10px; }
.wx-pick button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px; min-height: 52px; border-radius: 12px; background: var(--panel-2); font-weight: 800; font-size: 11.5px; line-height: 1.15; color: var(--ink); text-align: center; border: 2px solid transparent; }
.wx-pick button:hover { border-color: var(--line); }
.wx-pick button[aria-checked="true"] { border-color: var(--indigo); background: #fff; }

/* ---------- Postcards ---------- */
.pc-card { width: min(560px, 100%); max-height: calc(100% - 24px); overflow: auto; padding: 20px; }
.post-card { width: min(520px, 100%); max-height: min(760px, calc(100dvh - 32px)); overflow: auto; padding: 22px; }
#post-office { top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100dvh); }
#post-office .post-card { max-height: min(760px, calc(var(--vv-h, 100dvh) - 24px)); }
.post-card .pc-head { align-items: flex-start; }
.post-card h2 { margin: 0; }
.post-intro { color: var(--ink-soft); line-height: 1.5; margin: 10px 0 18px; }
.post-label, .post-choices legend { display: block; font-weight: 800; margin-bottom: 7px; }
#post-to { display: block; width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink); background: #fffdf7; border: 1px solid var(--line); border-radius: 10px; }
#post-sugg { margin: 6px 0 8px; padding: 5px; list-style: none; max-height: 220px; overflow-y: auto; background: #fffdf7; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 16px rgba(37, 25, 20, 0.12); }
#post-sugg li.post-empty { padding: 10px; color: var(--ink-soft); font-size: 14px; }
#post-sugg button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 7px 9px; border-radius: 7px; text-align: left; font-size: 14px; }
#post-sugg button:hover, #post-sugg [aria-selected="true"] button { background: #f9ecd9; }
#post-sugg b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#post-sugg span { flex: none; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.post-address { min-height: 22px; margin: 6px 0 14px; color: var(--ink-soft); font-size: 13px; }
.post-choices { border: 0; padding: 0; margin: 0; }
.post-choices label { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin: 6px 0; border: 1px solid var(--line); border-radius: 10px; background: #fffaf0; line-height: 1.35; cursor: pointer; }
.post-choices input { flex: none; margin-top: 3px; accent-color: #a52c28; }
.post-choices label:has(input:checked) { border-color: #a52c28; background: #fff1e1; }
#post-status { min-height: 22px; margin: 12px 0 0; font-weight: 700; color: #7b2c24; }
.post-mail { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.post-mail h3 { margin: 0; }
.post-mail .muted { margin: 4px 0 12px; }
.post-letter { margin: 8px 0; padding: 12px 14px; border: 1px solid #e2c9a9; border-left: 4px solid #a52c28; background: #fffaf0; border-radius: 5px; }
.post-letter p { margin: 0 0 5px; }
.post-own-box { margin: 2px 0 8px; }
#post-own { display: block; width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink); background: #fffdf7; border: 1px solid var(--line); border-radius: 10px; }
.post-fine { margin: 6px 2px 0; color: var(--ink-soft); font-size: 12.5px; line-height: 1.4; }
.post-letter time { color: var(--ink-soft); font-size: 12px; }
.post-letter .post-route { margin: 0 0 6px; font-weight: 800; font-size: 14px; overflow-wrap: anywhere; }
.post-letter .post-route i { font-style: normal; color: #a52c28; padding: 0 4px; }
.post-letter .post-route .post-anon { font-weight: 600; color: var(--ink-soft); }
#post-feed-more { margin-top: 8px; }
.pc-head { display: flex; justify-content: space-between; align-items: center; }
.pc-head h2 { margin: 0; font-family: var(--display); font-size: 24px; }
.pc-head .close { width: 40px; height: 40px; border-radius: 12px; color: var(--ink-soft); font-size: 18px; }
.seg { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 12px; margin: 12px 0; }
.seg button { flex: 1; padding: 9px; border-radius: 9px; font-weight: 800; font-size: 14px; color: var(--ink-soft); min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); }
.pc-preview { display: grid; place-items: center; min-height: 240px; background: var(--panel-2); border-radius: 14px; padding: 10px; }
.pc-preview img { max-width: 100%; max-height: 52vh; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  #hud { top: calc(8px + env(safe-area-inset-top, 0px)); left: auto; right: 8px; transform: none; align-items: flex-end; }
  #hud-card { padding: 5px 12px 7px; }
  #hud-earned { display: none; }
  .round { width: 40px; height: 40px; font-size: 16px; }
  .live-pill { top: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); left: 12px; padding: 7px 12px; }
  /* cards become bottom sheets */
  .side, #people, .pop {
    top: auto; left: 0; right: 0; bottom: 0; transform: none;
    width: auto;
    border-radius: 22px 22px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-height: 62%;
    overflow: auto;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  }
  #people { max-height: 70%; }
  .handle { display: block; width: 44px; height: 5px; border-radius: 99px; background: rgba(0, 0, 0, 0.15); margin: -6px auto 10px; }
  #toasts { top: calc(118px + env(safe-area-inset-top, 0px)); }
  #find-bar input { font-size: 16px; }
  #compass { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); right: 10px; }
  #cmp-dial { width: 52px; height: 52px; }
  .cmp-turn { width: 32px; height: 32px; }
  /* search lives up with the buttons: the icon opens the bar under the city card, suggestions drop down */
  .phone-only { display: grid; }
  body:not(.find-open) #find-bar { display: none; }
  #find-bar { top: calc(134px + env(safe-area-inset-top, 0px)); bottom: auto; width: calc(100% - 16px); }
  #find-sugg { top: calc(100% + 8px); bottom: auto; }
  .live-pill { bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
  .splash { align-items: flex-end; padding: 24px 20px calc(28px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(0deg, rgba(18, 11, 28, 0.92) 0%, rgba(18, 11, 28, 0.7) 45%, rgba(18, 11, 28, 0) 80%); }
  .splash .mark { width: 34px; height: 40px; margin-bottom: 12px; }
  .lede { font-size: 15px; margin-bottom: 20px; }
  .splash-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .enter, .follow { width: 100%; justify-content: center; }
  .stats-row { gap: 0; justify-content: space-between; width: 100%; margin-top: 22px; }
  .stats-row dd { font-size: 19px; }
  .stats-row dt { font-size: 10px; letter-spacing: 0.06em; }
}

/* ---------- Visual polish: one set of shadows, radii, motion and states across the interface ---------- */
:root {
  --shadow-1: 0 1px 3px rgba(43, 29, 36, 0.18), 0 2px 8px rgba(43, 29, 36, 0.10);
  --shadow-2: 0 6px 18px rgba(43, 29, 36, 0.20), 0 14px 38px rgba(43, 29, 36, 0.14);
  --radius-s: 12px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
.panel { box-shadow: var(--shadow-2); border: 1px solid rgba(90, 50, 30, 0.12); border-top: 3px solid var(--terracotta); background: rgba(251, 245, 233, 0.975); }
#hud-card, .round, .tag { box-shadow: var(--shadow-1); }
.round, .primary, .secondary, .ghost { transition: transform 0.14s var(--ease), box-shadow 0.18s var(--ease), background-color 0.18s var(--ease); }
.round { background: rgba(251, 245, 233, 0.97); border: 1px solid rgba(90, 50, 30, 0.10); }
.round:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.round:active, .primary:active, .secondary:active, .ghost:active { transform: translateY(1px) scale(0.985); box-shadow: none; }
.primary, .secondary, .ghost { min-height: 44px; }
.primary { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), var(--shadow-1); }
.secondary { box-shadow: inset 0 -2px 0 rgba(90, 50, 30, 0.10); border: 1px solid rgba(90, 50, 30, 0.08); }
button:disabled { cursor: not-allowed; }
.panel .row { border-top-color: rgba(90, 50, 30, 0.10); }
.panel .row:first-child { border-top: none; }
.toast { box-shadow: var(--shadow-2); border: 1px solid rgba(255, 255, 255, 0.08); letter-spacing: 0.01em; }
#loader .en { letter-spacing: 0.2em; font-weight: 800; }
@media (prefers-reduced-motion: reduce) {
  .round, .primary, .secondary, .ghost { transition: none; }
  .round:hover { transform: none; }
}

/* ---------- Mini games (Bal Maidan) ---------- */
.mg-pick { margin: 12px 0; padding: 12px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); display: grid; gap: 8px; }
.mg-head { margin: 0 0 2px; font: 700 15px var(--display); color: var(--ink); }
.mg-game { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 12px; border-radius: 14px; text-align: left;
  background: linear-gradient(180deg, #fff6e4, #f6e2bd); border: 2px solid #e6c48c; box-shadow: inset 0 -2px 0 rgba(120, 70, 20, 0.12); }
.mg-game:hover { border-color: var(--saffron); }
.mg-game:active { transform: translateY(1px); }
.mg-ico { font-size: 28px; line-height: 1; flex: none; }
.mg-txt { flex: 1; min-width: 0; display: grid; }
.mg-txt b { font: 700 16px var(--display); }
.mg-txt small { color: var(--ink-soft); font-size: 13px; }
.mg-play { flex: none; padding: 8px 12px; border-radius: 999px; background: var(--terracotta); color: #fff; font-weight: 800; font-size: 14px; white-space: nowrap; }

#mg { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #f3e6c9; color: var(--ink);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#mg[hidden] { display: none !important; }
.mg-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--indigo); color: #fff; box-shadow: 0 2px 0 var(--marigold); }
.mg-top h2 { flex: 1; margin: 0; font: 700 20px var(--display); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-best { flex: none; min-width: 84px; text-align: right; font-weight: 800; font-size: 14px; color: var(--gold); }
.mg-btn { min-height: 48px; padding: 0 18px; border-radius: 14px; font-weight: 800; font-size: 16px; background: #fff6e4; color: var(--ink);
  border: 2px solid #e6c48c; touch-action: manipulation; }
.mg-back { min-width: 84px; background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.mg-hud { margin: 0; padding: 8px 12px; text-align: center; font: 700 17px var(--display); background: #fbf1dc; border-bottom: 1px solid var(--line); }
.mg-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#mg-cv { position: absolute; inset: 0; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.mg-hint { margin: 0; padding: 8px 14px; min-height: 40px; text-align: center; font-weight: 700; font-size: 15px; background: #fbf1dc; border-top: 1px solid var(--line); }
.mg-bar { display: flex; gap: 10px; padding: 10px 12px 12px; background: #fbf1dc; }
.mg-main { flex: 1; min-height: 56px; font-size: 19px; background: var(--terracotta); border-color: #9c4320; color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.mg-main:disabled { background: #cbb89a; border-color: #b6a07e; color: #fff; box-shadow: none; cursor: default; }
.mg-restart { flex: none; }
.mg-over { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(26, 20, 48, 0.55); }
.mg-over[hidden] { display: none !important; }
.mg-card { width: min(380px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border-radius: 22px; padding: 22px; text-align: center; border-top: 5px solid var(--saffron); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); }
.mg-kicker { margin: 0; text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; font-weight: 800; color: var(--terracotta); }
.mg-card h3 { margin: 4px 0 0; font: 700 24px var(--display); }
.mg-score { margin: 6px 0 0; font: 700 34px var(--display); color: var(--indigo); }
.mg-sub { margin: 0; font-weight: 800; color: var(--ink-soft); }
.mg-newbest { margin: 2px 0 10px; font-weight: 800; color: var(--good); }
.mg-card ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--ink-soft); }
.mg-actions { display: grid; gap: 8px; }
@media (min-width: 700px) { .mg-bar { justify-content: center; } .mg-main { flex: 0 1 360px; } }
@media (prefers-reduced-motion: reduce) { .mg-game:active { transform: none; } }

/* ---------- Game interface: toolbar, town settings, noticeboard, Chowk ----------
   Ivory surfaces, dark green-grey text, navy for what is chosen or primary, terracotta only for small accents.
   Every control is at least 44px; the chosen option shows a tick and a filled navy surface, never colour alone. */
:root { --surface: #F8F4EA; --surface-2: #EFE9DC; --text: #27322D; --text-2: #756F64; --navy: #223A70; --accent: #B96842; --border: #DED7CA; --top: 76px; }
#stage :focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
.ico { flex: none; display: block; }

/* the top bar: where you are, then the time and weather; the tools beside it */
#hud { flex-direction: row; align-items: stretch; gap: 8px; }
#hud-card { flex-direction: row; align-items: center; gap: 14px; padding: 6px 14px; min-height: 56px; border-radius: 14px; text-align: left; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.hud-main { display: flex; flex-direction: column; min-width: 0; }
.hud-title { margin: 0; font: 800 17px/1.2 var(--body); color: var(--text); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-sub { margin: 1px 0 0; display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-dot { color: var(--border); }
.hud-wx, .hud-act { display: inline-flex; align-items: center; gap: 4px; }
.hud-act b { font-weight: 800; color: var(--text); }
.hud-act { margin: 0; font-weight: 700; font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-main { flex: 1; }
.hud-status { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; padding-left: 14px; border-left: 1px solid var(--border); align-self: stretch; }
.hud-status .hud-wx { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.hud-online { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.hud-online i { width: 6px; height: 6px; border-radius: 50%; background: #38834e; flex: none; }
.hud-online b { font-weight: 800; }
.hud-online.unavailable { color: var(--text-2); }
.hud-online.unavailable i { background: var(--text-2); opacity: .5; }
#hud-btns { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
#hud-btns .round { width: 44px; height: 44px; border-radius: 10px; background: transparent; border: 0; box-shadow: none; color: var(--text); }
#hud-btns .round:hover { background: var(--surface-2); transform: none; box-shadow: none; }
#hud-btns .round[aria-expanded="true"], body.find-open #btn-find { background: var(--navy); color: #fff; }
#btn-sound.muted { color: var(--text-2); }
#btn-chat[data-n]:not([data-n=""])::after { top: 2px; right: 2px; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
#btn-notices.unread::after { top: 8px; right: 8px; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.live-pill { min-height: 44px; background: var(--surface); border-color: var(--border); color: var(--text); }
.live-pill b { font-family: var(--body); font-weight: 800; letter-spacing: 0; }
.live-pill .dot { background: var(--accent); }

/* panels: one header (title + close) that stays put, and a body that scrolls on its own */
.panel { background: var(--surface); border: 1px solid var(--border); border-top: 1px solid var(--border); color: var(--text); }
.panel .close { width: 44px; height: 44px; top: 8px; right: 8px; z-index: 2; border-radius: 50%; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; }
.panel .close .ico { width: 22px; height: 22px; stroke-width: 2.4; }
.panel .close:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.sheet { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sheet-head { position: relative; flex: none; padding: 14px 56px 12px 18px; border-bottom: 1px solid var(--border); }
.sheet .sheet-head h3 { margin: 0; padding: 0; font: 800 19px/1.3 var(--body); letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sheet .close { top: 8px; right: 10px; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 18px; }
.sheet h4 { margin: 0 0 8px; font: 800 12px/1.3 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.sheet h4 small { margin-left: 4px; font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 700; }

/* town settings */
.set-sec { padding: 14px 0; border-top: 1px solid var(--border); }
.set-sec:first-child { border-top: 0; }
.set-now, .set-hint { margin: 0 0 10px !important; font-size: 13.5px; font-weight: 600; line-height: 1.45; color: var(--text-2); }
.set-hint { margin: 8px 0 0 !important; }
.wx-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.wx-pick button { position: relative; flex-direction: row; justify-content: flex-start; gap: 8px; min-height: 44px; padding: 8px 30px 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--border); font-weight: 700; font-size: 14px; color: var(--text); text-align: left; }
#opt-weather button:first-child { grid-column: 1 / -1; }
.wx-pick.fest { grid-template-columns: repeat(3, 1fr); }
.wx-pick.fest button { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 10px; }
.wx-pick button .ico:last-child { position: absolute; right: 8px; top: 50%; margin-top: -8px; display: none; }
.wx-pick.fest button .ico:last-child { top: 10px; margin-top: 0; }
.wx-pick button:hover { border-color: var(--text-2); }
.wx-pick button[aria-checked="true"] { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 800; }
.wx-pick button[aria-checked="true"] .ico:last-child { display: block; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-weight: 700; font-size: 15px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: #CFC7B8; transition: background-color 0.15s; cursor: pointer; }
.switch input::before { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch input::after { content: ""; position: absolute; top: 8px; left: 10px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: 0; }
.switch input:checked { background: var(--navy); }
.switch input:checked::before { transform: translateX(18px); }
.switch input:checked::after { opacity: 1; }
.sheet .seg { margin: 0; background: var(--surface-2); border: 1px solid var(--border); }
.sheet .seg button { min-height: 40px; color: var(--text); font-weight: 700; }
.sheet .seg button[aria-checked="true"] { background: var(--navy); color: #fff; box-shadow: none; font-weight: 800; }
.place-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.place-btn { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 44px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--border); font-weight: 700; font-size: 13.5px; color: var(--text); text-align: left; line-height: 1.25; }
.place-btn:hover { border-color: var(--navy); color: var(--navy); }
.place-btn .ico { color: var(--text-2); }
.set-more { display: grid; gap: 6px; }
.row-btn { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--border); font-weight: 700; font-size: 14.5px; color: var(--text); text-decoration: none; }
.row-btn:hover { border-color: var(--navy); }
.view-legal { margin: 6px 0 0 !important; font-size: 13px; font-weight: 600; color: var(--text-2); }
.view-legal a, .chat-note a { color: var(--navy); font-weight: 800; white-space: nowrap; }

/* noticeboard */
.nb-sec { margin: 0; padding: 14px 0; border-top: 1px solid var(--border); }
.nb-sec:first-child { border-top: 0; }
.nb-sec h4 { font-family: var(--body); font-size: 12px; color: var(--text-2); }
.nb-item { border-top: 0; padding: 4px 0 8px; }
.nb-item span, .nb-date { color: var(--text-2); }
.nb-empty { margin: 0 !important; font-size: 14px; font-weight: 600; color: var(--text-2); }
.nb-people { list-style: none; margin: 0; padding: 0; }
.nb-person { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 8px; margin: 0 -8px; width: calc(100% + 16px); border-radius: 10px; text-align: left; color: var(--text); }
.nb-person:hover { background: var(--surface-2); }
.nb-mark { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.nb-name { font-weight: 800; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-num { font-weight: 700; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nb-all { margin-top: 8px; width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--navy); color: var(--navy); font-weight: 800; font-size: 14.5px; background: #fff; }
.nb-all:hover { background: var(--navy); color: #fff; }
.nb-places { list-style: none; margin: 0; padding: 0; }
.nb-places li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.nb-places li:first-child { border-top: 0; padding-top: 0; }
.nb-places li > div { flex: 1; min-width: 0; }
.nb-places b { font-size: 14.5px; }
.nb-places p { margin: 2px 0 0 !important; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nb-go { flex: none; min-width: 56px; min-height: 44px; padding: 0 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 800; color: var(--navy); }
.nb-go:hover { background: var(--navy); color: #fff; }
.nb-item .nb-go { align-self: flex-start; margin-top: 4px; }

/* Chowk */
.chat { height: min(640px, calc(100% - var(--top) - 96px)); gap: 0; }
.chat-head { padding-bottom: 10px; }
.chat-live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2); letter-spacing: 0; }
.chat-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2E8B57; }
.chat-id { margin: 4px 0 0 !important; font-size: 13.5px; font-weight: 600; color: var(--text-2); overflow-wrap: anywhere; }
.chat-id b { color: var(--text); font-weight: 800; }
.chat-you { width: 9px; height: 9px; margin: 0 4px 0 2px; }
.chat-list { flex: 1; min-height: 0; height: auto; margin: 0; padding: 10px 14px; gap: 4px; border: 0; overscroll-behavior: contain; }
.chat-list:focus-visible { outline-offset: -3px; box-shadow: none; }
.chat-empty { margin: auto 0; padding: 0 12px; font-weight: 600; color: var(--text-2); }
.chat-jump { position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 18px; background: var(--navy); color: #fff; font-weight: 800; font-size: 13px; box-shadow: var(--shadow-2); z-index: 2; }
.chat-announce { margin: 0 !important; padding: 9px 16px; font-size: 14px; font-weight: 700; color: #6b4a00; background: #fff3cf; border-bottom: 1px solid #f0d98c; }
.chat-owner { margin: 0; padding: 10px 14px; background: #f3efe3; border-bottom: 1px solid var(--border); display: grid; gap: 8px; font-size: 14px; max-height: 46vh; overflow: auto; }
.chat-owner-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chat-owner .grow { flex: 1; min-width: 120px; }
.chat-owner input[type=text], .chat-owner input[type=password], .chat-owner input[type=number] { font: inherit; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: var(--text); min-width: 0; }
.chat-owner input[type=number] { width: 64px; }
.chat-owner button { font: inherit; font-weight: 700; padding: 7px 12px; min-height: 36px; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: var(--text); }
.chat-owner button.go { background: var(--navy); border-color: var(--navy); color: #fff; }
.chat-owner button.danger { background: #b3382a; border-color: #b3382a; color: #fff; }
.owner-sw { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; }
.chat-owner-err { margin: 0; color: #b3382a; font-weight: 700; min-height: 0; }
.chat-owner-err:empty { display: none; }
.chat-owner-bans { display: grid; gap: 4px; }
.chat-owner-none { margin: 0; color: var(--text-2); }
.chat-owner-ban { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chat-owner-ban small { color: var(--text-2); }
.chat-owner-ban-sheet { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--border); }
.chat-owner-ban-sheet p { margin: 0; color: var(--text-2); }
.chat-menu [data-act="hide"], .chat-menu [data-act="ban"] { color: #9A3A22; }
.chat-badge { display: inline-block; margin-left: 6px; padding: 1px 7px 2px; border-radius: 9px; font-size: 10px; font-weight: 900; letter-spacing: .06em; color: #fff; background: linear-gradient(90deg, #f58529, #dd2a7b); vertical-align: 1px; }
.chat-msg.admin .chat-bubble { box-shadow: 0 0 0 2px #f2b134 inset; }
.chat-msg.own.admin .chat-who { text-align: right; margin: 0 12px 3px 0; }
.chat-off { margin: 0 !important; padding: 12px 18px; font-weight: 700; color: var(--text-2); border-top: 1px solid var(--border); }
.chat-form { flex: none; margin: 0; padding: 10px 12px; gap: 8px; border-top: 1px solid var(--border); background: var(--surface); }

/* desktop: one column of panels on the right, under the top bar */
@media (min-width: 701px) {
  #hud { top: calc(12px + env(safe-area-inset-top, 0px)); }
  .side { top: calc(var(--top) + env(safe-area-inset-top, 0px)); max-height: calc(100% - var(--top) - 96px); width: min(380px, calc(100% - 28px)); }
}
/* phones: the top bar fills the width (place and time on the left, tools on the right); panels are bottom sheets */
@media (max-width: 700px) {
  :root { --top: 0px; }
  #hud { left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top, 0px)); flex-direction: column; align-items: stretch; gap: 6px; }
  #hud-card { min-height: 50px; padding: 5px 12px; gap: 10px; justify-content: space-between; }
  .hud-title { font-size: 16px; }
  .hud-sub, .hud-act { font-size: 12.5px; }
  .hud-status { padding-left: 10px; }
  #hud-btns { align-self: flex-end; padding: 4px; gap: 4px; }
  #hud-btns .round { width: 44px; height: 44px; font-size: 16px; }
  #find-bar { top: calc(118px + env(safe-area-inset-top, 0px)); }
  #toasts { top: calc(118px + env(safe-area-inset-top, 0px)); }
  .side.sheet, .sheet { top: auto; left: 0; right: 0; bottom: 0; width: auto; padding: 0; border-radius: 18px 18px 0 0; border-width: 1px 0 0;
    max-height: calc(100% - 124px - env(safe-area-inset-top, 0px)); box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28); }
  .sheet .sheet-body { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .sheet-head { padding-top: 16px; }
  .sheet .handle { position: absolute; top: 6px; left: 50%; margin: 0 0 0 -22px; width: 44px; height: 4px; background: #CFC7B8; }
  .chat { height: calc(100% - 124px - env(safe-area-inset-top, 0px)); }
  /* typing on a phone: the chat fills what the keyboard leaves visible, message box on top of the keyboard */
  body.chat-typing .chat { position: fixed; top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100%); max-height: none; border-radius: 0; border-width: 0; z-index: 30; }
  body.chat-typing .chat .handle { display: none; }
  body.chat-typing .chat .chat-head { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  body.chat-typing .chat .chat-form { padding-bottom: 8px; }
  .chat .chat-form { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  /* while a sheet is up, the corner widgets it would cover step aside */
  body.sheet-open .live-pill, body.sheet-open #compass, body.sheet-open #night-bar { visibility: hidden; }
  .place-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 370px) {
  .hud-act span { display: none; }
  .hud-status { padding-left: 8px; }
  .hud-status .hud-wx span { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  :root { --top: 0px; }
  #hud { flex-direction: row; left: 8px; right: 8px; top: calc(6px + env(safe-area-inset-top, 0px)); transform: none; justify-content: space-between; }
  #hud-card { min-height: 44px; }
  .side.sheet, .sheet { top: calc(6px + env(safe-area-inset-top, 0px)); bottom: 6px; left: auto; right: calc(6px + env(safe-area-inset-right, 0px)); width: min(380px, 60%); max-height: none; border-radius: 14px; border-width: 1px; }
  .chat { height: auto; }
}
@media (prefers-reduced-motion: reduce) { .switch input, .switch input::before { transition: none; } }

.wc-close .ico, .pc-head .close .ico { margin: auto; }
.rd-x { display: grid; place-items: center; }
.panel h3 { padding-right: 52px; }

/* ---------- Chowk, messenger style: bubbles, grouped runs, times, send status, message options ---------- */
.chat-head h3 { gap: 8px; }
.chat-live::before { width: 7px; height: 7px; }
.chat-id { display: flex; align-items: center; gap: 2px; margin: 2px 0 0 !important; }
.chat-info-btn { width: 44px; height: 40px; margin: -10px 0 -10px -6px; display: grid; place-items: center; color: var(--text-2); border-radius: 8px; }
.chat-info-btn:hover, .chat-info-btn[aria-expanded="true"] { color: var(--navy); }
.chat-info { margin: 0; padding: 10px 18px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 600; line-height: 1.45; color: var(--text); }
.chat-info p { margin: 0 0 6px; }
.chat-info p:last-child { margin: 0; }
.chat-info a { color: var(--navy); font-weight: 800; }
.chat-note { flex: none; margin: 0 !important; padding: 8px 18px 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--text-2); }
.chat-note::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.chat-list { padding: 8px 12px 10px; gap: 0; background: var(--surface); }
.chat-empty { font-size: 14px; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; position: relative; }
.chat-msg.cont { margin-top: 3px; }
.chat-av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; margin-bottom: 18px; }
.chat-msg:not(.last) .chat-av { visibility: hidden; }
.chat-msg:not(.own):not(.last) .chat-meta { display: none; }
.chat-msg:not(.last) .chat-av, .chat-msg:not(.own):not(.last) .chat-more { margin-bottom: 0; }
.chat-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: 78%; }
.chat-who { font-size: 12px; font-weight: 800; color: var(--text-2); margin: 0 0 3px 12px; }
.chat-msg.cont .chat-who { display: none; }
.chat-bubble { padding: 8px 12px; border-radius: 18px 18px 18px 6px; background: #ECE6D8; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; transition: transform .12s; }
.chat-msg.cont .chat-bubble { border-top-left-radius: 6px; }
.chat-bubble p { margin: 0; }
.chat-msg.own { justify-content: flex-end; }
.chat-msg.own .chat-col { align-items: flex-end; }
.chat-msg.own .chat-bubble { background: var(--navy); color: #fff; border-radius: 18px 18px 6px 18px; }
.chat-msg.own.cont .chat-bubble { border-top-right-radius: 6px; }
.chat-msg[data-state="sending"] .chat-bubble { opacity: .7; }
.chat-msg[data-state="failed"] .chat-bubble { background: #F3E1DA; color: var(--text); box-shadow: inset 0 0 0 1px #C9826A; }
.chat-msg.held .chat-bubble { transform: scale(.97); box-shadow: 0 0 0 2px var(--navy); }
.chat-msg.reported .chat-bubble { opacity: .55; }
.chat-meta { display: flex; align-items: center; gap: 6px; min-height: 18px; padding: 2px 8px 0; font-size: 11.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chat-state { display: inline-flex; align-items: center; gap: 2px; }
.chat-state .ico { color: var(--navy); }
.chat-retry { min-height: 40px; padding: 0 4px; color: var(--navy); font-weight: 800; text-decoration: underline; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat-place { display: inline; padding: 0; color: var(--navy); font: inherit; font-weight: 800; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.chat-msg.own .chat-place { color: #fff; }
.chat-loc { display: flex; align-items: center; gap: 8px; }
.chat-loc span { display: flex; flex-direction: column; }
.chat-loc small { font-size: 11.5px; font-weight: 700; opacity: .8; }
.chat-loc .chat-place { font-size: 15px; text-align: left; min-height: 24px; }
/* the ⋯ button: shown on hover or keyboard focus with a mouse; on touch, press and hold instead */
.chat-more { flex: none; width: 40px; height: 40px; margin-bottom: 16px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); opacity: 0; }
.chat-msg.own .chat-more { order: -1; }
.chat-msg:hover .chat-more, .chat-more:focus-visible, .chat-msg.held .chat-more { opacity: 1; }
.chat-more:hover { background: var(--surface-2); }
@media (hover: none) { .chat-more { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .chat-more:focus-visible { position: static; width: 40px; height: 40px; clip: auto; } }
.chat-menu { position: absolute; z-index: 6; min-width: 200px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-2); }
.chat-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 9px; font-weight: 700; font-size: 15px; color: var(--text); text-align: left; }
.chat-menu button:hover, .chat-menu button:focus-visible { background: var(--surface-2); }
.chat-menu [data-act="report"] { color: #9A3A22; }
.chat-menu button:disabled { color: var(--text-2); }
.chat-quick { flex: none; display: flex; gap: 6px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 18px; background: #fff; border: 1px solid var(--border); font-weight: 700; font-size: 13.5px; color: var(--text); white-space: nowrap; }
.chat-quick button:hover { border-color: var(--navy); color: var(--navy); }
.chat-err { flex: none; margin: 0 !important; padding: 8px 16px 0; font-size: 13px; font-weight: 700; color: #9A3A22; }
.chat-form { align-items: center; gap: 6px; padding: 8px 10px; border-top: 0; }
.chat-pin { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.chat-pin:hover { color: var(--navy); background: var(--surface-2); }
.chat-box { flex: 1; min-width: 0; position: relative; }
.chat-box input { width: 100%; min-height: 44px; padding: 10px 16px; border-radius: 22px; border: 1px solid #CFC7B8; background: #fff; font: 600 16px var(--body); color: var(--text); }
.chat-box input:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(34, 58, 112, .18); }
#stage .chat-box input:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(34, 58, 112, .25); }
.chat-box input::placeholder { color: #8A8478; }
.chat-left { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 800; color: #9A3A22; pointer-events: none; }
.chat-box:has(.chat-left:not(:empty)) input { padding-right: 64px; }
.chat-send { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; transition: background-color .15s, transform .12s; }
.chat-send:disabled { background: #D8D1C3; color: #fff; cursor: default; }
.chat-send:not(:disabled):active { transform: scale(.94); }
.chat-jump { bottom: 84px; }
@media (prefers-reduced-motion: reduce) { .chat-bubble, .chat-send { transition: none; } }

/* ---------- Galli Cricket, opened from the stadium (src/ui/gallicricket.js) ---------- */
.galli { position: fixed; inset: 0; z-index: 70; background: #f8f1e7; }
.galli iframe { display: block; width: 100%; height: 100%; border: 0; }
.galli-x { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: calc(206px + env(safe-area-inset-right, 0px));   /* left of the game's settings panel */ width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #F8F4EA; color: #27322D; border: 1px solid #DED7CA; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); z-index: 2; }
.galli-x:hover { background: #223A70; border-color: #223A70; color: #fff; }
.galli-x:focus-visible { outline: 3px solid #223A70; outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
.galli-x .ico { width: 22px; height: 22px; stroke-width: 2.4; }
@media (max-width: 820px), (max-height: 500px) { .galli-x { right: calc(62px + env(safe-area-inset-right, 0px)); } }   /* the game folds its panel behind a menu button */

/* Pahadi Rail: a quiet window-seat view, with the moving town kept in sight. */
.hill-train-body p { color: var(--ink-soft); line-height: 1.6; }
.hill-train-body .hill-train-route { color: var(--ink); font-weight: 800; }
.hill-train-route span { margin: 0 8px; color: var(--terracotta); }
#hill-ride-board { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.hill-train-body .hill-train-hint { font-size: 12px; }
.hill-ride { position: absolute; inset: 0; z-index: 25; color: #f8f4ea; pointer-events: none; }
.hill-ride-head { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); left: 20px; right: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-shadow: 0 1px 5px #182a2a; }
.hill-ride-kicker { font-size: 10px; font-weight: 900; letter-spacing: 2px; }
.hill-ride h2 { margin: 1px 0 0; font: 700 25px/1.2 var(--display); }
.hill-ride button { pointer-events: auto; min-height: 46px; padding: 10px 16px; border: 1px solid #f1e9d5; border-radius: 9px; background: #f8f4ea; color: #27322d; font-weight: 800; }
#hill-ride-exit { display: flex; align-items: center; gap: 7px; }
.hill-ride-look { position: absolute; top: 90px; bottom: 170px; left: 0; right: 0; pointer-events: auto; touch-action: none; cursor: grab; }
.hill-ride-look:active { cursor: grabbing; }
.hill-ride-foot { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px; display: grid; justify-items: center; gap: 10px; }
#hill-ride-status { margin: 0; padding: 6px 12px; border-radius: 6px; background: #20332ee6; color: #fff8e9; font-size: 13px; text-align: center; }
.hill-ride-controls { display: flex; gap: 6px; padding: 4px; border: 1px solid #c7bea9; border-radius: 12px; background: #f8f4ea; pointer-events: auto; }
.hill-ride-controls button { border: 0; background: transparent; min-width: 124px; }
.hill-ride-controls button[aria-pressed="true"] { background: #294d42; color: #fff8e9; }
.hill-ride-tip { margin: 0; font-size: 11px; text-shadow: 0 1px 4px #182a2a, 0 0 8px #182a2a; text-align: center; }
body:is(.hill-riding, .town-walking) :is(#hud, #labels, #live-pill, #compass, #find-bar, #night-bar, #toasts, #creator-bar, #guide) { visibility: hidden; pointer-events: none; }
@media (max-height: 500px) {
  .hill-ride-head { top: 8px; }
  .hill-ride h2 { font-size: 19px; }
  .hill-ride-foot { bottom: 8px; gap: 5px; }
  .hill-ride-tip { display: none; }
  .hill-ride-look { top: 65px; bottom: 115px; }
}
/* One-resident character pilot: a close-up of the same model drawn in town. */
.character-preview { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 18px; background: #171624ba; }
.character-preview-card { width: min(100%, 460px); max-height: calc(100dvh - 36px); overflow: hidden; border-radius: 20px; background: #f8f3e9; color: #283a34; box-shadow: 0 22px 80px #10101880; }
.character-preview-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; }
.character-preview-head span { color: #9b6944; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.character-preview-head h2 { margin: 3px 0 0; font-size: 23px; line-height: 1.15; }
.character-preview-close { width: 42px; height: 42px; flex: none; border: 1px solid #d8cbb8; border-radius: 50%; background: #fffaf2; color: #283a34; font-size: 19px; }
.character-preview-stage { height: min(64dvh, 490px); min-height: 310px; }
.character-preview-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.character-preview-card p { margin: 0; padding: 11px 18px 16px; color: #6a665e; text-align: center; font-size: 13px; }

/* After a search on a phone the profile is a short sheet (name, status, home), so the house and its pin stay in view; tap it to open it fully */
@media (max-width: 700px) {
  #person.is-peek { max-height: 176px; overflow: hidden; cursor: pointer; }
  #person.is-peek::after { content: 'Tap for details'; position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 0 calc(8px + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8a7b63; background: linear-gradient(to top, #f7f3e9 55%, #f7f3e900); pointer-events: none; }
}

/* Walk around the town (ui/town-walk.js) */
.town-walk { position: absolute; inset: 0; z-index: 25; color: #f8f4ea; pointer-events: none; touch-action: none; }
.tw-head { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); left: 20px; right: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-shadow: 0 1px 5px #2a1a30; }
.tw-kicker { font-size: 10px; font-weight: 900; letter-spacing: 2px; }
.town-walk h2 { margin: 1px 0 0; font: 700 22px/1.2 var(--display); overflow-wrap: anywhere; }
.town-walk button { pointer-events: auto; min-height: 46px; padding: 10px 16px; border: 1px solid #f1e9d5; border-radius: 9px; background: #f8f4ea; color: #3a2230; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; text-shadow: none; }
.town-walk button[aria-pressed="true"] { background: #ffd24a; }
.town-walk [hidden] { display: none; }
.tw-look { position: absolute; top: 90px; bottom: 0; left: 38%; right: 0; pointer-events: auto; touch-action: none; }
.tw-stick { position: absolute; left: calc(22px + env(safe-area-inset-left, 0px)); bottom: calc(34px + env(safe-area-inset-bottom, 0px)); width: 128px; height: 128px; border-radius: 50%; background: #2a1a3055; border: 2px solid #f8f4ea99; pointer-events: auto; touch-action: none; }
.tw-stick i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: #f8f4eacc; box-shadow: 0 3px 10px #0006; }
.tw-right { position: absolute; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(40px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; justify-items: end; }
#tw-act, #tw-act2 { background: #e0543a; border-color: #fff0d8; color: #fff; font-size: 16px; padding: 12px 20px; box-shadow: 0 4px 14px #0005; }
.tw-hint { position: absolute; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); margin: 0; padding: 5px 12px; border-radius: 6px; background: #2a1a30d9; color: #fff8e9; font-size: 12px; text-align: center; max-width: 92vw; pointer-events: none; }

html, body { touch-action: manipulation; }   /* no double-tap zoom on the page; the city's own pinch zoom is untouched */

/* a long press on a phone must not select text or open the iOS magnifier / Copy / Look Up bar: this is a game, not a page */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, [contenteditable="true"], .selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
#game, .town-walk, .town-walk * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ---- Ride the metro: the view from the front of a train ---- */
.metro-ride { position: absolute; inset: 0; z-index: 25; color: #f8f4ea; pointer-events: none; }
.metro-ride[hidden] { display: none; }
.mr-look { position: absolute; inset: 0; pointer-events: auto; touch-action: none; cursor: grab; }
.mr-head { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-shadow: 0 1px 6px #0a1730; }
.mr-title { display: flex; flex-direction: column; line-height: 1.15; }
.mr-title b { font-size: 18px; letter-spacing: .02em; }
.mr-title span { font-size: 12px; opacity: .9; letter-spacing: .08em; text-transform: uppercase; color: #ffcf5a; }
.mr-btn { pointer-events: auto; min-height: 40px; padding: 8px 16px; border: 0; border-radius: 999px; background: rgba(8, 18, 42, .78); color: #fff; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; backdrop-filter: blur(4px); }
.mr-foot { position: absolute; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; text-shadow: 0 1px 6px #0a1730; }
.mr-status { padding: 10px 16px; border-radius: 999px; background: rgba(8, 18, 42, .78); font-weight: 800; font-size: 16px; backdrop-filter: blur(4px); }
.mr-route { display: flex; gap: 10px; padding: 8px 14px; border-radius: 999px; background: rgba(8, 18, 42, .62); }
.mr-route i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.mr-route i.next { background: #fff; box-shadow: 0 0 0 3px rgba(255, 207, 90, .7); }
.mr-route i.at { background: #ffcf5a; box-shadow: 0 0 0 3px rgba(255, 207, 90, .9); }
.mr-acts { display: flex; align-items: center; gap: 12px; }
.mr-hint { font-size: 12px; opacity: .85; }
body.metro-riding :is(#hud, #labels, #live-pill, #minimap, #compass, #find-bar, #night-bar, #toasts, #creator-bar, #guide) { visibility: hidden; pointer-events: none; }
