/* Campus Life NG — UI layer over the 3D campus. PickinTinz tokens: ink, red, gold. */
:root {
  --ink: #111111; --ink-2: #1d1d1f; --ink-3: #2b2b2e;
  --red: #e01b24; --red-d: #b3121a; --red-soft: #fdecec;
  --gold: #c9a45c; --gold-soft: #f6efe1;
  --text: #191919; --muted: #6f6f73; --line: #e7e7e9;
  --bg: #ffffff; --bg-2: #f5f5f6; --ok: #138a4b;
  --glass: rgba(255, 255, 255, .94);
  --shadow: 0 6px 24px rgba(17, 17, 17, .12);
  --font-head: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #9fd3f0; color: var(--text); font: 14px/1.5 var(--font-body); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#app, #world { position: fixed; inset: 0; }
#world canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; border: 0; font: 700 14px/1 var(--font-head); letter-spacing: -.01em; transition: background .15s, transform .1s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; pointer-events: none; }
.btn-red { background: var(--red); color: #fff; } .btn-red:hover { background: var(--red-d); }
.btn-white { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); } .btn-white:hover { background: var(--bg-2); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 999px; background: var(--bg-2); }

/* top bar */
.topbar { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(1100px, calc(100% - 24px)); display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 16px; background: var(--glass); border-radius: 999px; box-shadow: var(--shadow); backdrop-filter: blur(8px); z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 16px var(--font-head); letter-spacing: -.02em; }
.mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--ink), var(--ink-3)); color: var(--gold); font: 900 12px var(--font-head); }
.stats { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.stats .sep { width: 4px; height: 4px; border-radius: 50%; background: #c9c9cd; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(19, 138, 75, .18); }
.top-actions { margin-left: auto; display: flex; gap: 8px; }

/* landing */
.join-card { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(560px, calc(100% - 24px)); padding: 22px 22px 18px; background: var(--glass); border-radius: 22px; box-shadow: var(--shadow); text-align: center; z-index: 5; }
.join-card h1 { margin: 0 0 6px; font: 900 28px/1.1 var(--font-head); letter-spacing: -.02em; }
.join-card h1 em { font-style: normal; color: var(--red); }
.join-card p { margin: 0 0 14px; color: var(--muted); }
.join-actions { display: flex; gap: 10px; } .join-actions .btn { flex: 1; }
.demo-note { margin: 12px 0 0 !important; padding: 8px 12px; border-radius: 10px; background: var(--gold-soft); color: #6b5525 !important; font-size: 12.5px; }

/* place labels + name tags */
.place-label { position: absolute; top: 0; left: 0; pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); font: 700 11.5px var(--font-head); white-space: nowrap; will-change: transform; visibility: hidden; }
.place-label i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55); }
.place-label:hover { background: #fff; transform-origin: center; }
.place-label.soon { background: #ffd43b; }
.name-tag { position: absolute; top: 0; left: 0; padding: 2px 8px; border-radius: 999px; background: rgba(17, 17, 17, .78); color: #fff; font: 700 11px var(--font-head); white-space: nowrap; will-change: transform; visibility: hidden; }
.name-tag.me { background: var(--red); }

/* hud */
.hud-top { gap: 18px; padding: 8px 8px 8px 18px; font: 600 13px var(--font-head); }
.hud-item { display: flex; align-items: center; gap: 7px; color: var(--ink-3); }
.hud-item svg { width: 16px; height: 16px; color: var(--muted); }
.hud-money { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: #fff; font: 800 14px var(--font-head); }
.hud-money svg { color: var(--gold); width: 16px; height: 16px; }
.avatar-dot { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--red), var(--gold)); }
.bottom-nav { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; background: var(--glass); border-radius: 22px; box-shadow: var(--shadow); z-index: 5; }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 70px; padding: 8px 10px; border: 0; border-radius: 16px; background: transparent; font: 700 11.5px var(--font-head); color: var(--ink-3); }
.bottom-nav button:hover { background: var(--bg-2); }
.bottom-nav button.on { background: var(--ink); color: #fff; }

/* place panel */
.panel { position: fixed; right: 16px; top: 84px; width: min(340px, calc(100% - 32px)); padding: 18px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); z-index: 6; }
.place-head { display: flex; align-items: center; gap: 10px; padding-right: 36px; }
.place-head i { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.place-head h3 { margin: 0; font: 800 18px/1.2 var(--font-head); letter-spacing: -.01em; }
.panel p { margin: 10px 0 14px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 146px; transform: translateX(-50%); max-width: min(520px, calc(100% - 32px)); padding: 12px 16px; background: var(--ink); color: #fff; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; text-align: center; z-index: 9; }

/* loading */
#loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: linear-gradient(100deg, #0d0d0f, #1e1e22 45%, var(--red-d) 78%, var(--red)); color: #fff; font: 700 15px var(--font-head); z-index: 20; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .25); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* auth dialog */
dialog#auth { width: min(400px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 20px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(17, 17, 17, .45); }
#auth-form { position: relative; display: grid; gap: 12px; padding: 24px; }
#auth-form h2 { margin: 0 0 4px; font: 800 22px var(--font-head); letter-spacing: -.02em; }
#auth-form label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
#auth-form input:not([type=checkbox]) { height: 46px; padding: 0 14px; border: 1px solid #d6d6da; border-radius: 10px; font: inherit; font-size: 15px; }
#auth-form input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
#auth-form label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
#auth-form label.check input { width: 18px; height: 18px; accent-color: var(--red); }
.form-error { margin: 0; min-height: 1em; color: var(--red-d); font-weight: 600; font-size: 13px; }
.switch { margin: 0; text-align: center; color: var(--muted); }
.switch button { border: 0; background: none; padding: 0; color: var(--red); font-weight: 700; }

/* creator */
#creator { position: fixed; inset: 0; z-index: 10; background: linear-gradient(180deg, #e9eef5, #f6f3ec); }
.creator { display: grid; grid-template-columns: 1fr minmax(320px, 440px); height: 100%; }
.creator-stage { position: relative; }
.creator-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.creator-stage .hint { position: absolute; bottom: 18px; left: 0; right: 0; margin: 0; text-align: center; color: var(--muted); font-weight: 600; font-size: 12px; }
.creator-panel { display: flex; flex-direction: column; min-height: 0; margin: 16px; background: #fff; border-radius: 22px; box-shadow: var(--shadow); }
.creator-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.creator-head h2 { margin: 0; font: 800 20px var(--font-head); letter-spacing: -.02em; }
.steps { display: flex; gap: 6px; } .steps span { width: 22px; height: 5px; border-radius: 9px; background: var(--line); } .steps span.on { background: var(--red); }
.creator-body { flex: 1; overflow-y: auto; padding: 6px 20px 12px; }
.who { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; margin-bottom: 12px; background: var(--bg-2); border-radius: 12px; font-family: var(--font-head); }
.who span { color: var(--muted); font-size: 12px; font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { padding: 0; margin-bottom: 8px; font: 700 13px var(--font-head); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--bg-2); font: 600 13px var(--font-head); }
.chip.on { background: var(--ink); color: #fff; }
.sw { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.home-card { display: grid; gap: 6px; width: 100%; margin-bottom: 10px; padding: 14px 16px; text-align: left; background: var(--bg-2); border: 2px solid transparent; border-radius: 14px; }
.home-card.on { border-color: var(--ok); background: #eef8f2; }
.home-card:disabled { opacity: .55; cursor: not-allowed; }
.home-top { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-head); }
.home-top em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fff; color: var(--muted); white-space: nowrap; }
.home-meta { display: flex; justify-content: space-between; color: var(--ok); font-weight: 600; font-size: 13px; }
.home-meta span { color: var(--muted); } .home-meta span.start { color: var(--ok); }
.creator-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 20px 6px; border-top: 1px solid var(--line); }
.creator-foot .next { flex: 1; }
.creator-panel .form-error { padding: 0 20px 12px; }

/* phones */
@media (max-width: 720px) {
  .stats .sep, #stat-players { display: none; }
  .brand b { display: none; }
  .hide-sm { display: none !important; }
  .hud-top { gap: 12px; padding-left: 14px; font-size: 12px; }
  .join-card h1 { font-size: 23px; }
  .bottom-nav button { min-width: 56px; padding: 7px 6px; font-size: 10.5px; }
  .creator { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .creator-panel { margin: 0 10px 10px; }
  .panel { top: auto; bottom: 92px; right: 12px; left: 12px; width: auto; }
}

/* ---------- Phase 1 ---------- */
.hud-money { border: 0; cursor: pointer; }
.status-card { position: fixed; left: 16px; bottom: 96px; width: 214px; padding: 10px 12px; background: var(--glass); border-radius: 16px; box-shadow: var(--shadow); z-index: 5; }
.me-row { display: flex; align-items: center; gap: 8px; font: 700 13px var(--font-head); }
.me-row em { margin-left: auto; font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: #6b5525; }
.needs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; width: 100%; margin-top: 8px; padding: 0; border: 0; background: none; text-align: left; }
.need { display: flex; align-items: center; gap: 6px; }
.need svg { width: 14px; height: 14px; color: var(--muted); }
.need span, .need-row .bar { flex: 1; height: 6px; border-radius: 9px; background: var(--line); overflow: hidden; }
.need i, .need-row .bar i { display: block; height: 100%; border-radius: 9px; background: var(--ok); transition: width .6s; }
.need.warn i, .need-row.warn .bar i { background: #e8a33d; }
.need.bad i, .need-row.bad .bar i { background: var(--red); }
.need.bad svg { color: var(--red); }

.bubble { position: absolute; top: 0; left: 0; max-width: 220px; padding: 6px 10px; border-radius: 12px; background: #fff; color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); font: 600 12.5px/1.35 var(--font-body); white-space: normal; visibility: hidden; will-change: transform; }
.place-label.home { background: var(--gold); color: var(--ink); }
.place-label.home i { background: var(--ink); }

.shift { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); width: min(380px, calc(100% - 24px)); padding: 12px 14px; background: var(--ink); color: #fff; border-radius: 16px; box-shadow: var(--shadow); z-index: 6; }
.shift-top { display: flex; justify-content: space-between; gap: 10px; font: 700 13.5px var(--font-head); }
.shift-top span { color: var(--gold); font-variant-numeric: tabular-nums; }
.shift-track { display: block; height: 6px; margin: 10px 0; border-radius: 9px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.shift-track i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 1s linear; }
.shift-actions { display: flex; gap: 8px; justify-content: flex-end; }
.shift .btn-ghost { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }

.place-body { display: grid; gap: 8px; margin-bottom: 12px; max-height: 52vh; overflow-y: auto; }
.act { display: grid; gap: 4px; width: 100%; padding: 10px 12px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.act:hover:not(:disabled) { border-color: var(--ink); }
.act:disabled { opacity: .5; cursor: not-allowed; }
.act-top { display: flex; justify-content: space-between; gap: 8px; font-family: var(--font-head); font-size: 13px; }
.act-top em { font-style: normal; font-weight: 800; color: var(--red); white-space: nowrap; }
.gains { display: flex; flex-wrap: wrap; gap: 4px; }
.gains span { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #eef8f2; color: var(--ok); }
.gains span.neg { background: var(--red-soft); color: var(--red-d); }
.work-card { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--gold-soft); }
.work-card b { font-family: var(--font-head); }
.work-card span { font-size: 12.5px; color: #6b5525; }
.btn-black { background: var(--ink); color: #fff; } .btn-black:hover { background: var(--ink-3); }

.phone { position: fixed; right: 16px; bottom: 96px; width: min(380px, calc(100% - 24px)); height: min(640px, calc(100% - 190px)); display: flex; flex-direction: column; background: #fff; border-radius: 26px; border: 6px solid var(--ink); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); z-index: 8; overflow: hidden; }
.phone-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.phone-head b { flex: 1; font: 800 16px var(--font-head); }
.icon-btn-sm { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 999px; background: var(--bg-2); }
.phone-body { flex: 1; overflow-y: auto; padding: 14px; display: grid; gap: 10px; align-content: start; }
.phone-body h4 { margin: 6px 0 0; font: 800 13px var(--font-head); }
.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; }
.app { display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; font: 600 11.5px var(--font-head); }
.app i { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: #fff; }
.app i svg { width: 24px; height: 24px; }
.app span { display: grid; justify-items: center; }
.app em { font-style: normal; font-size: 9.5px; color: var(--muted); }
.card { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.card small { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.card > b { font: 800 16px var(--font-head); }
.card .big { font-size: 26px; }
.card.dark { background: linear-gradient(120deg, var(--ink), var(--ink-3)); color: #fff; border: 0; }
.card.dark small, .card.dark span { color: rgba(255, 255, 255, .7); }
.card.dark .kv { border-color: rgba(255, 255, 255, .12); }
.card.dark .btn { justify-self: start; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 13px; }
.kv b { font-family: var(--font-head); text-align: right; }
.card.job { grid-template-columns: 1fr auto; align-items: center; }
.card.job span { display: block; font-size: 12px; color: var(--muted); }
.card.job b { font-family: var(--font-head); }
.job-r { display: grid; justify-items: end; gap: 2px; }
.job-r small { font-size: 10.5px; color: var(--muted); }
.pill { font-style: normal; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eef8f2; color: var(--ok); }
.ledger .row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ledger .row small { display: block; color: var(--muted); font-size: 11px; }
.ledger .row b { font-family: var(--font-head); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); } .neg { color: var(--red-d); }
.warn-line { margin: 4px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--red-soft); color: var(--red-d); font-size: 12.5px; font-weight: 600; }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pack { position: relative; display: grid; gap: 4px; padding: 16px 12px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; }
.pack.best { border: 2px solid var(--red); }
.pack em { position: absolute; top: -9px; left: 10px; padding: 1px 8px; border-radius: 999px; background: var(--red); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700; }
.pack b { font: 800 16px var(--font-head); color: var(--ok); }
.pack span { font-size: 12px; color: var(--muted); }
.pack strong { font: 800 14px var(--font-head); }
.pack:disabled { opacity: .55; }
.need-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.need-top { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); }
.need-top span { margin-left: auto; font-weight: 700; }
.need-row small { color: var(--muted); font-size: 12px; }
.place-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.place-row i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.place-row span { flex: 1; display: grid; }
.place-row b { font-family: var(--font-head); font-size: 13.5px; }
.place-row small, .place-row em { color: var(--muted); font-size: 12px; font-style: normal; }

.chat-log { position: fixed; left: 16px; bottom: 250px; width: min(320px, calc(100% - 32px)); display: grid; gap: 4px; z-index: 5; pointer-events: none; }
.chat-log div { padding: 5px 10px; border-radius: 10px; background: rgba(17, 17, 17, .72); color: #fff; font-size: 12.5px; }
.chat-log b { color: var(--gold); font-family: var(--font-head); font-size: 12px; }
.chat-form { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(520px, calc(100% - 24px)); display: flex; gap: 8px; padding: 8px; background: #fff; border-radius: 999px; box-shadow: var(--shadow); z-index: 9; }
.chat-form input { flex: 1; min-width: 0; height: 36px; padding: 0 14px; border: 1px solid #d6d6da; border-radius: 999px; font: inherit; font-size: 14px; }

@media (max-width: 720px) {
  .status-card { left: 10px; bottom: 90px; width: 168px; padding: 8px 10px; }
  .needs { grid-template-columns: 1fr 1fr; gap: 5px 8px; }
  .shift { top: 70px; }
  .phone { right: 8px; left: 8px; width: auto; bottom: 86px; height: calc(100% - 160px); }
  .chat-log { bottom: 230px; left: 10px; }
  .apps { grid-template-columns: repeat(4, 1fr); }
}
.act-top em.free { color: var(--ok); }
.here { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font: 700 13px var(--font-head); z-index: 5; white-space: nowrap; }
.here b { padding: 6px 12px; border-radius: 999px; background: var(--red); }
@media (max-width: 720px) { .here { bottom: 84px; left: auto; right: 10px; transform: none; } }

/* ---------- loading feedback ---------- */
.netbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; overflow: hidden; background: rgba(224, 27, 36, .15); }
.netbar::after { content: ''; position: absolute; top: 0; left: -40%; width: 40%; height: 100%; background: var(--red); animation: netbar 1s ease-in-out infinite; }
@keyframes netbar { to { left: 100%; } }
button.busy { position: relative; color: transparent !important; pointer-events: none; }
button.busy > * { visibility: hidden; }
button.busy::after { content: ''; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(120, 120, 120, .35); border-top-color: var(--red); animation: spin .7s linear infinite; visibility: visible; }
.btn-red.busy::after, .btn-black.busy::after, .hud-money.busy::after { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@media (prefers-reduced-motion: reduce) { .netbar::after, button.busy::after, .spinner { animation-duration: 2.5s; } }
.chat-form .icon-btn-sm { flex: none; }

/* ---------- Phase 2 apps ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-2); }
.tab { flex: 1; height: 32px; border: 0; border-radius: 999px; background: none; font: 700 12px var(--font-head); color: var(--muted); }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.chips-row { display: flex; gap: 6px; } .chips-row.wrap { flex-wrap: wrap; }
.chip-s { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: 700 12px var(--font-head); white-space: nowrap; }
.chips-row.wrap .chip-s { flex: 0 0 auto; }
.chip-s.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-s small { opacity: .6; font-weight: 600; }
.input-s { height: 40px; padding: 0 12px; border: 1px solid #d6d6da; border-radius: 10px; font: inherit; width: 100%; }
.tiny { font-size: 10.5px; line-height: 1.4; word-break: break-all; }
.center { text-align: center; }
.kv.plain { border-top: 0; padding: 0; }
.fx { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fx > span { font: 700 13px var(--font-head); } .fx i { font-style: normal; color: var(--muted); font-weight: 600; }
.odds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.odd { display: grid; gap: 1px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: 800 13.5px var(--font-head); font-variant-numeric: tabular-nums; }
.odd small { font: 600 10px var(--font-body); color: var(--muted); }
.odd.on { background: var(--red); border-color: var(--red); color: #fff; } .odd.on small { color: rgba(255, 255, 255, .8); }
.slip { position: sticky; bottom: -14px; display: grid; gap: 8px; margin: 0 -14px; padding: 12px 14px 14px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(0, 0, 0, .06); }
.slip .kv { border: 0; padding: 0; }
.res { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.res span:last-child { text-align: right; } .res b { font-family: var(--font-head); font-variant-numeric: tabular-nums; }
.hilo-card { justify-self: center; display: grid; place-items: center; width: 110px; height: 150px; margin: 4px auto; border-radius: 14px; background: #fff; border: 2px solid var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); font: 900 46px var(--font-head); }
.hilo-card.idle { background: linear-gradient(135deg, var(--ink), var(--ink-3)); color: var(--gold); border-color: var(--ink); }
.hilo-card.win { border-color: var(--ok); } .hilo-card.lose { border-color: var(--red); }
.hilo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wheel { justify-self: center; display: grid; place-items: center; width: 110px; height: 110px; margin: 4px auto; border-radius: 50%; border: 8px solid var(--gold); background: var(--ink-3); color: #fff; font: 900 38px var(--font-head); }
.wheel.red { background: var(--red); } .wheel.black { background: var(--ink); } .wheel.green { background: var(--ok); }
.cand { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cand > span { flex: 1; display: grid; min-width: 0; } .cand b { font-family: var(--font-head); font-size: 13.5px; }
.cand small { color: var(--muted); font-size: 12px; } .cand > em { font-style: normal; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.run { display: flex; gap: 8px; } .run input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid #d6d6da; border-radius: 999px; font: inherit; }
.card.gold { background: var(--gold-soft); border-color: #ead9b3; } .card.gold span { color: #6b5525; font-size: 12.5px; }
.law { display: grid; gap: 2px; padding: 10px 12px; text-align: left; border: 1px solid #ead9b3; border-radius: 12px; background: #fff; }
.law b { font-family: var(--font-head); font-size: 13px; } .law span { font-size: 12px; color: var(--muted); }
.phase-pill { justify-self: start; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 12px var(--font-head); }
.card.inv { grid-template-columns: 1fr auto; align-items: center; }
.card.inv b { font-family: var(--font-head); } .card.inv span { display: block; font-size: 12px; color: var(--muted); }
.tags { display: flex !important; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pill.bad { background: var(--red-soft); color: var(--red-d); }
.act-top s { color: var(--muted); font-weight: 600; margin-right: 4px; }
.gains .skill { background: #eef1fb; color: #2c5fd1; }
@media (max-height: 700px) { .slip { position: static; margin: 0; padding: 12px 0 0; box-shadow: none; } }

/* ===== Campus Life NG ===== */
.hud-student { display: block; margin-top: 2px; color: var(--muted); font: 700 11.5px var(--font-head); }
.place-label.hall { padding: 3px 8px 3px 5px; font-size: 10.5px; background: rgba(255, 255, 255, .85); }
.place-label.hall i { width: 10px; height: 10px; }
.panel h4.sub { margin: 12px 0 6px; font: 800 13px var(--font-head); }
.extras { display: grid; gap: 8px; margin-top: 8px; }
.extras:empty { display: none; }
.act .own { color: var(--ok); font-weight: 700; }
.mini-course { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.mini-course b { font: 800 13px var(--font-head); min-width: 58px; }
.mini-course .dots { margin-right: auto; }
.mini-course .btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.dots { display: inline-flex; gap: 3px; } .dots i { width: 9px; height: 9px; border-radius: 50%; background: #dcdce0; } .dots i.on { background: var(--ok); }
.btn-black { background: var(--ink); color: #fff; } .btn-black:hover { background: var(--ink-3); }
.pill.ok { background: #eef8f2; color: var(--ok); } .pill.warn { background: var(--gold-soft); color: #6b5525; }
.portal-head { position: relative; }
.portal-head .cgpa { position: absolute; right: 14px; top: 12px; text-align: right; }
.portal-head .cgpa em { display: block; font-style: normal; font-size: 11px; color: rgba(255, 255, 255, .65); }
.portal-head .cgpa strong { font: 900 24px var(--font-head); color: var(--gold); }
.card.cal { grid-template-columns: 1fr; background: var(--bg-2); border: 0; }
.card.cal b { font: 800 15px var(--font-head); display: block; }
.card.cal span { font-size: 12.5px; color: var(--muted); }
.card h4 { margin: 0; font: 800 14px var(--font-head); }
.card p { margin: 0; }
.card.offer { background: #eef8f2; border-color: #cbe8d6; }
.card.course { gap: 8px; }
.course-top b { font: 800 14px var(--font-head); margin-right: 8px; } .course-top span { font-size: 12.5px; color: var(--muted); }
.course-mid { display: flex; align-items: center; gap: 12px; font-size: 12.5px; flex-wrap: wrap; }
.course-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.course-btns .btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.grade { font-style: normal; font: 800 12px var(--font-head); padding: 2px 8px; border-radius: 999px; background: var(--bg-2); }
.grade.gA, .grade.gB { background: #eef8f2; color: var(--ok); } .grade.gF { background: var(--red-soft); color: var(--red-d); }
.transcript summary, .changer summary { cursor: pointer; font: 800 13px var(--font-head); padding: 6px 0; }
.row-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 10px; margin-top: 6px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.row-btn b { display: block; font: 700 13px var(--font-head); } .row-btn small { color: var(--muted); font-size: 11.5px; }
.row-btn em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; } .row-btn em.ok { color: var(--ok); }
.row-btn:disabled { opacity: .5; }
.home-opt { grid-template-columns: 1fr auto; align-items: center; }
.home-opt.on { border-color: var(--ok); background: #eef8f2; }
.home-opt span { display: block; font-size: 12px; color: var(--muted); } .home-opt b { font-family: var(--font-head); }
.home-opt .job-r { display: grid; gap: 6px; justify-items: end; }
.price-in { width: 92px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font: 600 13px var(--font-body); }
.creator fieldset legend { font: 800 13px var(--font-head); }

/* exam hall */
.exam-wrap { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(17, 17, 17, .55); backdrop-filter: blur(4px); }
.exam { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; display: grid; gap: 14px; padding: 18px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); }
.exam header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.exam header small { display: block; color: var(--muted); font: 700 12px var(--font-head); }
.exam header b { font: 900 26px var(--font-head); } .exam header b.low { color: var(--red); }
.exam header span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.exam-q small { color: var(--muted); font: 700 12px var(--font-head); }
.exam-q h3 { margin: 6px 0 12px; font: 700 18px/1.4 var(--font-head); }
.opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: 15px; }
.opt i { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--bg-2); font: 800 13px var(--font-head); font-style: normal; }
.opt.on { border-color: var(--ink); background: var(--bg-2); } .opt.on i { background: var(--ink); color: #fff; }
.opt:disabled { opacity: .3; text-decoration: line-through; }
.exam-nav { display: flex; flex-wrap: wrap; gap: 5px; }
.exam-nav button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 700 12px var(--font-head); }
.exam-nav button.done { background: var(--bg-2); } .exam-nav button.cur { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.exam footer { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.exam footer [data-prev] { margin-right: auto; }
.exam-done { text-align: center; justify-items: center; }
.exam-done h2 { margin: 0; font: 900 52px var(--font-head); } .exam-done h2 span { font-size: 22px; color: var(--muted); }
.exam-done p { margin: 0; } .result-msg { font-weight: 600; }
.exam-done details { width: 100%; text-align: left; } .exam-done summary { cursor: pointer; font: 800 13px var(--font-head); padding: 6px 0; }
.rv { display: grid; gap: 2px; padding: 8px 10px; margin-top: 6px; border-radius: 10px; font-size: 13px; }
.rv.ok { background: #eef8f2; } .rv.bad { background: var(--red-soft); } .rv span { color: var(--muted); }
@media (max-width: 560px) { .exam { padding: 14px; } .exam-q h3 { font-size: 16px; } .opt { padding: 10px 12px; font-size: 14px; } }

/* ---------- Phase 1: SUG, staff room, business, property, events, cup ---------- */
.text-in { width: 100%; min-height: 36px; padding: 7px 10px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: 400 13.5px var(--font-body); color: var(--ink); box-sizing: border-box; }
textarea.text-in { resize: vertical; }
.text-in:focus, .price-in:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.form-row .text-in { flex: 1 1 140px; width: auto; margin-top: 0; }
.form-row .price-in { flex: 0 0 auto; }
.card .btn-block { margin-top: 8px; }
details.race { display: block; }
details.race summary { cursor: pointer; padding: 2px 0 6px; font-family: var(--font-head); list-style-position: inside; }
details.race summary small { font-family: var(--font-body); font-weight: 400; }
details.race .kv span small { display: inline; }
.kv .btn-sm { height: 28px; padding: 0 10px; font-size: 11.5px; margin-left: 4px; }
.extras .btn-block { margin-top: 8px; }
.policy-chip { position: absolute; left: 50%; transform: translateX(-50%); top: calc(8px + env(safe-area-inset-top, 0px)); padding: 4px 12px; border-radius: 999px; background: rgba(112, 72, 232, .92); color: #fff; font: 700 11.5px var(--font-head); white-space: nowrap; pointer-events: none; }
.kv small, .card .kv small { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11.5px; }

/* ---------- Phase 2: smaller labels with icons, photo name tags, inside views, rides, sound ---------- */
.place-label { gap: 4px; padding: 2px 7px 2px 2px; font: 700 9.5px/1.2 var(--font-head); background: rgba(255, 255, 255, .9); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.place-label i { display: grid; place-items: center; width: 15px; height: 15px; box-shadow: none; flex: none; }
.place-label i svg { width: 10px; height: 10px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.place-label.hall { padding: 1px 6px 1px 2px; font-size: 8.5px; background: rgba(255, 255, 255, .78); }
.place-label.hall i { width: 12px; height: 12px; } .place-label.hall i svg { width: 8px; height: 8px; }
.place-label.home { font-size: 9.5px; }
.place-label.home i { width: 12px; height: 12px; border-radius: 50%; }
.place-label.focus { padding: 3px 10px 3px 3px; font-size: 11px; background: #1c3f94; color: #fff; box-shadow: 0 2px 10px rgba(28, 63, 148, .45); }
.place-label.focus i { width: 18px; height: 18px; background: #c9a45c !important; }
.place-label.focus i svg { width: 12px; height: 12px; }
.name-tag { display: flex; align-items: center; gap: 3px; padding: 1px 6px 1px 2px; font: 700 9px/1.3 var(--font-head); }
.name-tag img { width: 14px; height: 14px; border-radius: 50%; object-fit: cover; }
.name-tag img[hidden] { display: none; }
.name-tag:not(:has(img:not([hidden]))) { padding-left: 6px; }
.bubble { max-width: 180px; padding: 4px 8px; border-radius: 10px; font-size: 11px; }

.interior { position: fixed; inset: 0; z-index: 4; background: #111; }
.interior-stage, .interior-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.interior-head { position: absolute; left: 50%; top: calc(70px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; border-radius: 999px; background: rgba(17, 17, 17, .78); color: #fff; backdrop-filter: blur(6px); white-space: nowrap; }
.interior-head small { display: block; font: 600 9.5px var(--font-head); color: rgba(255, 255, 255, .65); text-transform: uppercase; letter-spacing: .05em; }
.interior-head b { font: 800 13px var(--font-head); }

.hud-sound { display: grid; place-items: center; width: 34px; height: 34px; margin-left: auto; border: 0; border-radius: 50%; background: var(--bg-2); color: var(--ink-3); cursor: pointer; }
.hud-sound svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hud-sound .mute { display: none; } .hud-sound.off .mute { display: inline; } .hud-sound.off .wave { display: none; }
.hud-sound.live { background: #7048e8; color: #fff; }
.hud-sound + .hud-money { margin-left: 0; }

.photo-row { display: flex; align-items: center; gap: 12px; }
.photo-row img, .photo-empty { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.photo-empty { display: grid; place-items: center; background: var(--bg-2); color: var(--muted); font-size: 11px; }
.photo-row > div { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-pick small { display: block; margin-top: 6px; font-size: 11.5px; }
.ride-opt { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
@media (max-width: 560px) {
  .bottom-nav button { min-width: 0; padding: 7px 7px; font-size: 10px; }
  .interior-head { top: calc(64px + env(safe-area-inset-top, 0px)); max-width: calc(100% - 24px); }
}
/* calmer titles so names and headings don't crowd the view */
.place-head h3 { font-size: 15px; }
.phone-head b { font-size: 14.5px; }
.card > b { font-size: 14.5px; }
.card h4 { font-size: 13px; }
.status-card #hud-name { font-size: 13px; }
.hud-top { font-size: 12px; }
