/* LoveLife — game styles. Mobile-first, no frameworks, CSS-only 3D depth (no WebGL). */
:root {
  --bg: #0a0f1e; --bg2: #0f1629; --panel: #141c31; --panel2: #1a2440; --panel3: #22305a; --line: #ffffff16; --line2: #ffffff26;
  --text: #f3f5ff; --muted: #a8b3cb; --dim: #7a86a3; --gold: #f6be6e; --peach: #ffb38a; --pink: #ff7aa8; --rose: #e8507f;
  --good: #5fd39a; --warn: #ffc861; --bad: #ff6b7d; --blue: #6aa8ff; --violet: #a98bff;
  --r: 14px; --r2: 20px; --shadow: 0 10px 30px #0008; --tab-h: 64px; --top-h: 64px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
/* The page itself never scrolls; .main (and sheets) do. That only works if every ancestor of #app has a height. */
#root, #shell { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--gold); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .gold { color: var(--gold); } .good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.small { font-size: 12px; } .tiny { font-size: 11px; } .center { text-align: center; } .right { text-align: right; }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 10px; }
.stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Text that must always be readable in full: wraps onto the next line instead of being cut off. */
.wrap-text { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.3px; }
h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0; }

/* ---------- buttons, chips, cards ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; background: var(--panel3); border: 1px solid var(--line2); transition: transform .12s, filter .12s, background .12s; min-height: 44px; text-align: center; }
.btn:hover { filter: brightness(1.12); } .btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(120deg, var(--pink), var(--gold)); color: #1a1426; border: 0; }
.btn.ghost { background: transparent; }
.btn.good { background: #1f5a43; border-color: #5fd39a55; }
.btn.danger { background: #4d1f2b; border-color: #ff6b7d55; color: #ffd6dc; }
.btn.sm { padding: 7px 11px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; filter: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 650; background: #ffffff12; color: #d8e0f2; border: 1px solid var(--line); white-space: nowrap; }
.chip.ai { background: #6aa8ff22; color: #bcd6ff; border-color: #6aa8ff44; }
.chip.gold { background: #f6be6e1f; color: var(--gold); border-color: #f6be6e44; }
.chip.pink { background: #ff7aa81f; color: #ffb3cc; border-color: #ff7aa844; }
.chip.good { background: #5fd39a1f; color: #9ff0c6; border-color: #5fd39a44; }
.chip.bad { background: #ff6b7d1f; color: #ffb7c0; border-color: #ff6b7d44; }
.card { background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--r2); padding: 16px; }
.card.tight { padding: 12px; }
.card.click { cursor: pointer; transition: transform .12s, border-color .12s; text-align: left; width: 100%; }
.card.click:hover { border-color: #f6be6e55; transform: translateY(-1px); }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: #ffffff08; border: 1px solid var(--line); text-align: left; width: 100%; }
button.item:hover { background: #ffffff10; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.bar { height: 7px; border-radius: 99px; background: #ffffff14; overflow: hidden; } .bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--pink), var(--gold)); }
.bar.good > i { background: var(--good); } .bar.blue > i { background: var(--blue); } .bar.warn > i { background: var(--warn); }
.meter { display: grid; grid-template-columns: 92px 1fr 30px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.section-title { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); font-weight: 800; margin: 18px 0 8px; }
.notice { font-size: 12px; color: #f2d7ae; background: #2a2235; border: 1px solid #f6be6e33; padding: 10px 12px; border-radius: 12px; }
.empty { color: var(--muted); text-align: center; padding: 24px 12px; font-size: 14px; }
input[type=text], input[type=number], input[type=search], select, textarea { width: 100%; background: #0e1527; border: 1px solid var(--line2); border-radius: 12px; padding: 11px 12px; min-height: 44px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { padding: 8px 12px; border-radius: 10px; background: #ffffff0d; border: 1px solid var(--line); font-size: 13px; font-weight: 650; }
.seg button.on { background: var(--gold); color: #1d1a29; border-color: var(--gold); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } .tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; padding: 8px 13px; border-radius: 99px; background: #ffffff0d; border: 1px solid var(--line); font-size: 13px; font-weight: 650; color: var(--muted); }
.tabs button.on { background: #f6be6e22; color: var(--gold); border-color: #f6be6e66; }

/* ---------- app shell ---------- */
#app { height: 100%; display: flex; flex-direction: column; }
.topbar { height: var(--top-h); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #0c1324ee; border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: relative; z-index: 5; }
.topbar .me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .lvl { font-size: 11px; color: var(--muted); }
.topbar .stats { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.stat { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: #ffffff0c; border: 1px solid var(--line); font-size: 13px; font-weight: 700; white-space: nowrap; }
.stat .k { color: var(--muted); font-weight: 600; font-size: 11px; }
.clock-stat { flex-direction: column; align-items: flex-end; gap: 0; line-height: 1.15; }
.ringwrap { position: relative; width: 42px; height: 42px; flex: none; }
.ringwrap svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ringwrap .av { position: absolute; inset: 4px; }
.lvl-badge { position: absolute; right: -4px; bottom: -4px; background: var(--gold); color: #1d1a29; font-size: 10px; font-weight: 900; border-radius: 99px; padding: 1px 6px; border: 2px solid var(--bg); }
.vitals { display: flex; gap: 6px; }
.vital { width: 52px; } .vital .tiny { display: flex; justify-content: space-between; }
.main { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.page { max-width: 1100px; margin: 0 auto; padding: 16px 14px 28px; }
.tabbar { height: var(--tab-h); flex: none; display: grid; grid-template-columns: repeat(6, 1fr); background: #0c1324f2; border-top: 1px solid var(--line); backdrop-filter: blur(12px); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 650; position: relative; }
.tabbar button .i { font-size: 20px; line-height: 1; filter: grayscale(.6); }
.tabbar button.on { color: var(--gold); } .tabbar button.on .i { filter: none; }
.badge { position: absolute; top: 6px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
@media (min-width: 960px) {
  #app { display: grid; grid-template-columns: 92px minmax(0, 1fr); grid-template-rows: var(--top-h) minmax(0, 1fr); }
  .topbar { grid-column: 1 / -1; grid-row: 1; }
  .tabbar { grid-column: 1; grid-row: 2; height: auto; grid-template-columns: 1fr; grid-auto-rows: 78px; align-content: start; border-top: 0; border-right: 1px solid var(--line); padding-top: 10px; }
  .main { grid-column: 2; grid-row: 2; min-height: 0; }
  .badge { right: 18px; }
}
@media (max-width: 560px) {
  .stat.wallet .k { display: none; }
  .vitals { gap: 3px; } .vital { width: 34px; } .vital .tiny { font-size: 9px; }
  .clock-stat .tiny { font-size: 9px; }
  .grid2.stack-sm { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .topbar .name { max-width: 90px; }
}

/* ---------- portraits & avatars ---------- */
.av { border-radius: 50%; overflow: hidden; background: #26304d; flex: none; position: relative; }
.av img, .av svg { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.portrait { position: relative; border-radius: 18px; overflow: hidden; background: #1a2340; }
.portrait img, .portrait svg { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.portrait .pending { position: absolute; left: 8px; bottom: 8px; }
.ph-sil { width: 100%; height: 100%; }

/* ---------- title & creation ---------- */
.title-screen { position: fixed; inset: 0; overflow-y: auto; background: #070b16; }
.title-hero { position: relative; min-height: 100%; display: grid; place-items: center; padding: 28px 18px; }
.title-hero::before { content: ''; position: absolute; inset: 0; background: var(--hero) center / cover no-repeat; opacity: .5; filter: saturate(1.05); }
.title-hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, #0a0f1e55, #0a0f1ef2 70%); }
.title-card { position: relative; z-index: 1; max-width: 560px; width: 100%; text-align: center; }
.logo { font-size: clamp(42px, 9vw, 76px); font-weight: 900; letter-spacing: -2px; line-height: 1; }
.logo em { font-style: normal; background: linear-gradient(120deg, var(--peach), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo .heart { color: var(--pink); }
.tagline { margin-top: 10px; font-size: 15px; letter-spacing: 4px; text-transform: uppercase; color: #e9dcc8; }
.presented { font-size: 11px; letter-spacing: 3px; color: var(--gold); font-weight: 800; margin-bottom: 14px; }
.title-actions { display: grid; gap: 10px; margin: 26px auto 14px; max-width: 360px; }
.wizard { max-width: 760px; margin: 0 auto; padding: 18px 14px 40px; }
.steps { display: flex; gap: 6px; margin: 8px 0 18px; } .steps i { flex: 1; height: 4px; border-radius: 9px; background: #ffffff1c; } .steps i.on { background: linear-gradient(90deg, var(--pink), var(--gold)); }
.pick { border: 1px solid var(--line2); border-radius: 16px; background: #ffffff08; padding: 14px; text-align: left; transition: border-color .12s, background .12s; width: 100%; }
.pick.on { border-color: var(--gold); background: #f6be6e14; box-shadow: 0 0 0 1px var(--gold) inset; }
.pick-big { display: grid; place-items: center; gap: 8px; padding: 18px; font-weight: 800; font-size: 18px; }
.pick-big .sil { width: 92px; height: 110px; }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; max-height: 360px; overflow: auto; padding-right: 4px; }
.job-grid .pick { padding: 10px 12px; font-size: 13px; }

/* ---------- 2D scenes with 3D depth ---------- */
.scene { position: relative; height: clamp(300px, 52vh, 460px); border-radius: var(--r2); overflow: hidden; perspective: 900px; perspective-origin: 50% 35%; background: #0b1226; isolation: isolate; border: 1px solid var(--line); }
.scene > div { position: absolute; }
.scene .sky { inset: 0; background: var(--sky, linear-gradient(#20335f, #0b1226)); }
.scene .far { left: -6%; right: -6%; top: 6%; height: 46%; background: var(--skyline) center bottom / cover no-repeat; opacity: .55; mix-blend-mode: screen; transform: translate3d(calc(var(--px, 0) * -10px), calc(var(--py, 0) * -4px), -120px) scale(1.15); transition: transform .3s ease-out; }
.scene .photo { left: -8%; right: -8%; top: -6%; bottom: 22%; background: var(--photo) center / cover no-repeat; filter: blur(3px) saturate(1.1) brightness(.8); transform: translate3d(calc(var(--px, 0) * -18px), calc(var(--py, 0) * -8px), -60px) scale(1.12); transition: transform .3s ease-out; }
.scene .floor { left: -30%; right: -30%; bottom: -38%; height: 78%; transform-origin: 50% 0; transform: rotateX(74deg) translateZ(0); background:
  repeating-linear-gradient(90deg, #ffffff10 0 1px, transparent 1px 64px), repeating-linear-gradient(0deg, #ffffff10 0 1px, transparent 1px 64px), radial-gradient(ellipse at 50% 0%, var(--floor, #3b2a55), #0b1226 70%); }
.scene .light { inset: 0; background: var(--tint, transparent); pointer-events: none; mix-blend-mode: multiply; }
.scene .vignette { inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 50%, #050812cc 100%); pointer-events: none; }
.scene .people { left: 2%; right: 2%; bottom: 3%; top: auto; display: flex; justify-content: center; align-items: flex-end; gap: clamp(6px, 1.2vw, 14px); }
.figure { position: relative; flex: 0 1 auto; width: min(150px, calc((100% - (var(--n, 1) - 1) * 12px) / var(--n, 1))); min-width: 0; transform: translate3d(calc(var(--px, 0) * var(--d) * 1px), 0, 0); transition: transform .3s ease-out, filter .15s; cursor: pointer; text-align: center; background: none; border: 0; padding: 0; color: inherit; font: inherit; }
.figure .portrait { aspect-ratio: 3 / 4; border-radius: 16px; box-shadow: 0 14px 24px #000a; border: 1px solid #ffffff30; }
.figure::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: -6px; height: 12px; border-radius: 50%; background: #0009; filter: blur(4px); z-index: -1; }
.figure:hover { filter: brightness(1.12); } .figure:hover .portrait { border-color: var(--gold); }
.figure .tag { display: block; width: max-content; max-width: 100%; margin: 6px auto 0; font-size: 12px; line-height: 1.25; font-weight: 750; background: #0b1226ee; border: 1px solid var(--line2); padding: 3px 8px; border-radius: 10px; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 560px) { .scene .people .figure:nth-child(n+5) { display: none; } .scene .people { --n: min(var(--n), 4); } }
.figure.you .portrait { border-color: var(--gold); }
.scene-label { position: absolute; left: 14px; top: 12px; z-index: 3; }
.scene-label h2 { text-shadow: 0 2px 10px #000; } .scene-label .chip { margin-top: 6px; }
.scene-more { position: absolute; right: 12px; top: 12px; z-index: 3; }
.lite .scene .photo { filter: brightness(.75); } .lite .scene .far, .lite .scene .floor { display: none; }
@media (prefers-reduced-motion: reduce) { .scene .far, .scene .photo, .figure { transition: none; } }

/* ---------- 3D map ---------- */
.map3d { position: relative; height: clamp(360px, 58vh, 540px); border-radius: var(--r2); overflow: hidden; perspective: 1100px; background: radial-gradient(ellipse at 50% 20%, #1c2b55, #070b16 75%); border: 1px solid var(--line); }
.map-plane { position: absolute; left: 50%; top: 50%; width: min(92vw, 720px); aspect-ratio: 1 / 1; transform: translate(-50%, -46%) rotateX(52deg) rotateZ(-10deg); transform-style: preserve-3d; transition: transform .6s ease; }
.lite .map-plane { transform: translate(-50%, -50%) scale(.8); }
.map-plane svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin { position: absolute; transform-style: preserve-3d; transform: translate(-50%, -50%); }
.pin button { transform: rotateZ(10deg) rotateX(-52deg) translateY(-50%); transform-origin: 50% 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lite .pin button { transform: none; }
.pin .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 6px #f6be6e33, 0 0 22px #f6be6e; }
.pin.here .dot { background: var(--pink); box-shadow: 0 0 0 6px #ff7aa833, 0 0 26px var(--pink); animation: pulse 1.6s infinite; }
.pin .lbl { font-size: 12px; font-weight: 800; background: #0b1226e8; border: 1px solid var(--line2); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.pin.sel .lbl { border-color: var(--gold); color: var(--gold); }
.pin .cnt { font-size: 10px; color: var(--muted); }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px #ff7aa811, 0 0 30px var(--pink); } }
.travel-anim { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #050812cc; backdrop-filter: blur(6px); }
.travel-anim .road { width: min(420px, 80vw); height: 6px; border-radius: 9px; background: #ffffff18; position: relative; margin: 18px 0; overflow: visible; }
.travel-anim .road i { position: absolute; top: 50%; left: 0; font-size: 26px; transform: translate(-50%, -60%); animation: drive 1.1s ease-in-out forwards; }
@keyframes drive { to { left: 100%; } }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: #050812d9; backdrop-filter: blur(8px); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
@media (min-width: 720px) { .overlay { align-items: center; } }
.sheet { width: min(980px, 100%); max-height: 94vh; overflow-y: auto; background: linear-gradient(170deg, #18213b, #0e1528); border: 1px solid var(--line2); border-radius: 24px 24px 0 0; padding: 18px; box-shadow: var(--shadow); animation: up .22s ease-out; }
@media (min-width: 720px) { .sheet { border-radius: 24px; } }
.sheet.narrow { width: min(560px, 100%); }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.x { margin-left: auto; width: 40px; height: 40px; border-radius: 12px; background: #ffffff10; font-size: 20px; flex: none; }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(24px); opacity: 0; } }
.convo { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 18px; }
.convo .portrait.big { aspect-ratio: 3 / 4; }
@media (max-width: 720px) { .convo { grid-template-columns: 1fr; } .convo .portrait.big { aspect-ratio: 4 / 3.4; max-height: 46vh; } }
.speech { position: relative; background: #ffffff0e; border: 1px solid var(--line2); border-radius: 18px; padding: 14px 16px; font-size: 15px; min-height: 64px; }
.speech .who { font-size: 11px; color: var(--gold); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.speech.you { background: #f6be6e12; border-color: #f6be6e33; }
.typing span { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; } .typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }
.opts { display: grid; gap: 8px; } .opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt { text-align: left; padding: 11px 14px; border-radius: 14px; background: #ffffff0b; border: 1px solid var(--line2); font-weight: 600; font-size: 14px; min-height: 44px; }
.opt:hover { border-color: var(--gold); background: #f6be6e12; } .opt[disabled] { opacity: .45; cursor: not-allowed; }
.opt small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 2px; }
.reaction { padding: 12px 14px; border-radius: 14px; font-size: 14px; } .reaction.good { background: #5fd39a18; border: 1px solid #5fd39a40; } .reaction.ok { background: #ffffff0d; border: 1px solid var(--line2); } .reaction.bad, .reaction.severe { background: #ff6b7d18; border: 1px solid #ff6b7d40; }
.toasts { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); transform: translateX(-50%); flex-direction: column-reverse; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(440px, 92vw); pointer-events: none; }
.toast { pointer-events: none; background: #18213bf5; border: 1px solid var(--line2); border-left: 4px solid var(--blue); padding: 10px 14px; border-radius: 12px; font-size: 13px; box-shadow: var(--shadow); animation: up .2s ease-out; }
.toast.good { border-left-color: var(--good); } .toast.warn { border-left-color: var(--warn); } .toast.bad { border-left-color: var(--bad); }

/* ---------- misc ---------- */
.hero-today { position: relative; overflow: hidden; border-radius: var(--r2); padding: 18px; background: linear-gradient(120deg, #2c1f45, #142142); border: 1px solid var(--line); }
.hero-today::after { content: ''; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, #ff7aa833, transparent 70%); }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.action-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 16px; background: #ffffff0a; border: 1px solid var(--line); text-align: left; min-height: 96px; transition: border-color .12s, transform .12s; }
.action-tile:hover { border-color: #f6be6e66; transform: translateY(-1px); } .action-tile .i { font-size: 24px; } .action-tile b { font-size: 14px; } .action-tile span { font-size: 12px; color: var(--muted); }
.feed-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; } .feed-item:last-child { border: 0; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pcard { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 16px; background: #ffffff09; border: 1px solid var(--line); text-align: left; }
.pcard .portrait { aspect-ratio: 1 / 1.05; border-radius: 12px; }
.pcard b { font-size: 13px; } .pcard .small { line-height: 1.3; }
.inbox-item { padding: 12px 14px; border-radius: 16px; background: #ffffff08; border: 1px solid var(--line); }
.inbox-item.unread { border-color: #ff7aa855; background: #ff7aa80c; }
.calendar-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: #ffffff08; border: 1px solid var(--line); }
.when { min-width: 74px; text-align: center; font-size: 11px; color: var(--muted); } .when b { display: block; color: var(--text); font-size: 15px; }
.stars { color: var(--gold); letter-spacing: 2px; }
.hpn-cta { border-radius: 18px; padding: 16px; background: linear-gradient(120deg, #2d1a2e, #1d2245); border: 1px solid #ff7aa844; }
.fine { font-size: 11px; color: var(--dim); }
.loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; }
.loading .bar { width: 220px; margin-top: 14px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.kpi div { padding: 10px 12px; border-radius: 14px; background: #ffffff09; border: 1px solid var(--line); } .kpi b { display: block; font-size: 18px; } .kpi span { font-size: 11px; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; } .table td, .table th { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; } .table th { color: var(--muted); font-weight: 600; font-size: 12px; } .table td.n { text-align: right; font-variant-numeric: tabular-nums; }
/* 2D home interior (ui/rooms.js) */
.rooms { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.room { position: relative; border-radius: 14px; padding: 10px; min-height: 140px; border: 1px solid var(--line2); overflow: hidden;
  background: linear-gradient(180deg, var(--wall) 0 58%, var(--floor) 58% 100%); box-shadow: inset 0 0 40px var(--glow, transparent); }
.room::after { content: ''; position: absolute; left: 0; right: 0; top: 58%; height: 2px; background: #00000040; }
.room-head { position: relative; z-index: 1; display: flex; gap: 6px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.wall-art { position: relative; z-index: 1; display: flex; gap: 8px; font-size: 18px; margin-top: 4px; }
.furns { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; align-items: flex-end; }
.furn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 4px 6px; border-radius: 10px; background: #0000002e; }
.furn .fi { font-size: 30px; line-height: 1; filter: drop-shadow(0 3px 2px #0006); }
.furn .fl { font-size: 10px; color: #e9edf8; text-align: center; max-width: 86px; }
.furn.missing { background: transparent; border: 1px dashed #ffffff55; }
.furn.missing .fi { opacity: .35; filter: grayscale(1); }
.furn .btn.sm { min-height: 28px; padding: 3px 8px; font-size: 11px; }
/* Events → Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: 11px; color: var(--dim); text-align: center; font-weight: 700; }
.cal-cell { min-height: 74px; padding: 4px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); text-align: left; display: flex; flex-direction: column; gap: 2px; overflow: hidden; color: var(--text); }
.cal-cell.empty { background: transparent; border: 0; }
.cal-cell.past { opacity: .55; }
.cal-cell.today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.cal-cell b { font-size: 12px; }
.cal-hol { font-size: 9.5px; color: var(--pink); line-height: 1.2; }
.cal-ev { font-size: 9.5px; color: var(--muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.mine { color: var(--gold); }
@media (max-width: 520px) { .cal-cell { min-height: 56px; } .cal-ev { display: none; } .cal-ev.mine { display: block; } }
.linklike { background: none; border: 0; padding: 0; color: var(--text); font: inherit; text-decoration: underline dotted; cursor: pointer; }
/* ---------- celebration effects (ui/fx.js) & motion ---------- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 120; overflow: hidden; }
.fx-pop { position: absolute; transform: translate(-50%, -50%); animation: fx-fly 1.4s cubic-bezier(.2,.7,.3,1) forwards; will-change: transform, opacity; }
@keyframes fx-fly { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 120px)) rotate(var(--rot)) scale(1); } }
.page.enter { animation: page-in .28s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.btn, .opt, .pick, .action-tile, .item { transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease; }
.btn:active, .opt:active, .pick:active, .action-tile:active { transform: scale(.97); }
@media (hover: hover) { .action-tile:hover, .pick:hover, .pcard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px #0006; } }
.stat.wallet.bump { animation: wallet-bump .6s ease; }
@keyframes wallet-bump { 30% { transform: scale(1.12); box-shadow: 0 0 0 3px #f6be6e55; } }
@media (prefers-reduced-motion: reduce) { .page.enter, .fx-pop { animation: none !important; } }
/* character look store */
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.look { position: relative; border-radius: 14px; overflow: hidden; border: 2px solid transparent; background: var(--panel2); padding: 0; aspect-ratio: 1; }
.look img { width: 100%; height: 100%; object-fit: cover; display: block; }
.look span { position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 800; background: #000a; color: #fff; border-radius: 99px; padding: 1px 6px; }
.look.on { border-color: var(--gold); box-shadow: 0 0 0 3px #f6be6e44; }
.look:hover img { transform: scale(1.05); transition: transform .2s; }
/* hero carousel on the title screen */
.hero-carousel { position: absolute; inset: 0; overflow: hidden; }
.hero-carousel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: hero-fade 24s infinite; }
.hero-carousel img:nth-child(1) { animation-delay: 0s; } .hero-carousel img:nth-child(2) { animation-delay: 6s; }
.hero-carousel img:nth-child(3) { animation-delay: 12s; } .hero-carousel img:nth-child(4) { animation-delay: 18s; }
@keyframes hero-fade { 0% { opacity: 0; transform: scale(1.06); } 4% { opacity: 1; } 25% { opacity: 1; } 29% { opacity: 0; transform: scale(1); } 100% { opacity: 0; } }
.hero-carousel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #0a0f1e55 0%, #0a0f1ecc 70%, #0a0f1e 100%); }
.hero-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.hero-dots i { width: 7px; height: 7px; border-radius: 99px; background: #fff6; animation: dot 24s infinite; }
.hero-dots i:nth-child(2) { animation-delay: 6s; } .hero-dots i:nth-child(3) { animation-delay: 12s; } .hero-dots i:nth-child(4) { animation-delay: 18s; }
@keyframes dot { 0%, 25% { background: var(--gold); width: 18px; } 29%, 100% { background: #fff6; width: 7px; } }
@media (prefers-reduced-motion: reduce) { .hero-carousel img { animation: none; } .hero-carousel img:first-child { opacity: 1; } .hero-dots { display: none; } }
.title-hero.hero-on::before, .title-hero.hero-on::after { display: none; }
.title-hero.hero-on .title-card { position: relative; z-index: 1; background: #0a0f1eb3; backdrop-filter: blur(6px); border: 1px solid var(--line2); border-radius: 22px; padding: 22px 18px; }
@media (max-width: 560px) { .title-hero.hero-on { align-items: end; padding-bottom: 40px; } .title-hero.hero-on .title-card { padding: 18px 14px; } }
@media (max-width: 560px) { .title-hero.hero-on .title-actions a.btn.ghost { display: none; } }
@media (max-width: 560px) {
  .topbar .lvl { display: none; }
  .topbar .name { max-width: 64px; font-size: 13px; }
  .topbar .stats { gap: 4px; }
  .topbar .stat { padding: 4px 7px; font-size: 12px; }
}
@media (max-width: 380px) { .vitals .vital:nth-child(3) { display: none; } }
@media (max-width: 560px) {
  .look-preview { width: 110px !important; margin: 0 auto; }
  .look-preview + .col { flex-basis: 100%; }
  .look-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
}
/* career path (Associate → Team Lead → Manager → Director → Chief Executive Officer) */
.career-path { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.career-path .step { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; border-radius: 99px; font-size: 12px; font-weight: 650; color: var(--muted); background: #ffffff0a; border: 1px solid var(--line); }
.career-path .step b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 99px; font-size: 11px; background: #ffffff14; color: var(--text); }
.career-path .step.done { color: #cfe9dc; border-color: #5fd39a55; } .career-path .step.done b { background: #5fd39a33; }
.career-path .step.now { color: var(--gold); border-color: #f6be6e88; background: #f6be6e14; } .career-path .step.now b { background: var(--gold); color: #1a1426; }
/* ---------- icons (Lucide line icons, ui/icons.js) ---------- */
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; flex: none; stroke-width: 2; }
.ic-gold { color: var(--gold); } .ic-pink { color: var(--pink); } .ic-blue { color: #7fb4ff; } .ic-green { color: var(--good); }
.ic-amber { color: #ffc35a; } .ic-red { color: #ff7d7d; } .ic-muted { color: var(--muted); }
.btn .ic, .chip .ic, .opt .ic { margin-right: 1px; }
.tabbar button .i { display: grid; place-items: center; height: 24px; filter: none !important; }
.tabbar button .i .ic { width: 22px; height: 22px; color: var(--muted); stroke-width: 1.8; }
.tabbar button.on .i .ic { color: var(--gold); }
.tabs button .ic { width: 1em; height: 1em; }
.action-tile .ic { width: 26px; height: 26px; }
.furn .fi .ic { width: 30px; height: 30px; stroke-width: 1.6; }
.furn.missing .fi .ic { opacity: .45; }
.section-title .ic { width: 1.05em; height: 1.05em; }
h2 .ic, h3 .ic { vertical-align: -0.15em; }
.chip.ai .ic { color: inherit; }
/* ---------- top bar: level, XP and Jewels at a glance ---------- */
.topbar .who { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.topbar .xpline { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.topbar .lvl-name { font-weight: 700; color: #ffd9a8; white-space: nowrap; }
.topbar .xpbar { position: relative; width: 92px; height: 7px; border-radius: 99px; background: #ffffff14; overflow: hidden; box-shadow: inset 0 0 0 1px #ffffff10; }
.topbar .xpbar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, var(--pink), var(--gold)); box-shadow: 0 0 10px #f6be6e66; transition: width .5s ease; }
.topbar .xptext { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lvl-badge { right: -8px; bottom: -6px; font-size: 9.5px; padding: 1px 5px; background: linear-gradient(120deg, var(--pink), var(--gold)); box-shadow: 0 2px 6px #0007; }
.stat.wallet { position: relative; gap: 6px; padding: 6px 12px; background: linear-gradient(135deg, #f6be6e26, #ff7aa81a); border-color: #f6be6e66; box-shadow: 0 0 0 1px #f6be6e1f inset, 0 4px 14px #f6be6e14; }
.stat.wallet .ic { width: 18px; height: 18px; filter: drop-shadow(0 0 6px #f6be6e88); }
.stat.wallet .amt { font-size: 15px; color: #ffe2b0; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.stat.wallet .k { color: #f6be6ecc; text-transform: uppercase; letter-spacing: .6px; font-size: 9.5px; }
.stat.wallet .delta { position: absolute; right: 8px; top: -6px; font-size: 11px; font-weight: 800; padding: 0 6px; border-radius: 99px; animation: delta-float 1.6s ease-out forwards; pointer-events: none; }
.stat.wallet .delta.up { color: #0f2a1d; background: var(--good); }
.stat.wallet .delta.down { color: #fff; background: #e05a6a; }
@keyframes delta-float { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; transform: translateY(0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.stat.wallet.spend { animation: wallet-spend .5s ease; }
@keyframes wallet-spend { 30% { transform: scale(.96); } }
.vital .tiny .ic { width: 12px; height: 12px; }
@media (max-width: 760px) { .topbar .xpbar { width: 64px; } .topbar .lvl-name { display: none; } }
@media (max-width: 560px) {
  .topbar .xptext { font-size: 10px; } .topbar .xpbar { width: 52px; height: 6px; }
  .stat.wallet { padding: 5px 9px; } .stat.wallet .amt { font-size: 13px; }
  .topbar .name { max-width: 72px; }
}

/* phones: two-row top bar — you & level | Jewels & time, then a full-width vitals row */
@media (max-width: 560px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 10px 6px; row-gap: 6px; }
  .topbar .me { flex: 1 1 auto; }
  .topbar .name { max-width: 120px; }
  .topbar .xpbar { width: 70px; }
  .topbar .xptext { display: inline; }
  .topbar .stats { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  .topbar .vitals { order: 3; flex: 1 0 100%; justify-content: space-between; gap: 10px; }
  .topbar .vitals .vital { flex: 1; width: auto; }
  .topbar .stats { display: contents; }
  .topbar .stat.wallet { margin-left: auto; }
}
@media (max-width: 380px) {
  .topbar .xptext { font-size: 9.5px; } .topbar .xpbar { width: 44px; } .topbar .name { max-width: 90px; }
  .topbar .clock-stat .tiny { display: none; } .stat { padding: 5px 7px; } .stat.wallet .amt { font-size: 12.5px; }
  .vitals .vital:nth-child(3) { display: block; }
}
@media (max-width: 560px) {
  .topbar .me { flex: 1 1 0; min-width: 0; order: 1; }
  .topbar .stat.wallet { order: 2; }
  .topbar .vitals { order: 3; flex: 1 1 0; min-width: 0; }
  .topbar .clock-stat { order: 4; }
}
@media (max-width: 560px) {
  .topbar::after { content: ''; order: 3; flex: 0 0 100%; height: 0; }
  .topbar .vitals { order: 4; flex: 1 1 0; }
  .topbar .clock-stat { order: 5; }
}
/* ---------- game-style conversation (visual-novel layout) ---------- */
.sheet.vn { position: relative; width: min(1120px, 100%); padding: 0; overflow: hidden auto; display: grid; grid-template-columns: minmax(300px, 42%) minmax(0, 1fr);
  min-height: min(720px, 92vh); background: #0b1120; }
.sheet.vn::before { content: ''; position: absolute; inset: 0; background: var(--scene) center / cover no-repeat; filter: blur(3px) saturate(1.1); transform: scale(1.06); opacity: .55; pointer-events: none; }
.sheet.vn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #0b1120cc 0%, #0b112055 40%, #0b1120e6 62%, #0b1120f7 100%); pointer-events: none; }
.vn > * { position: relative; z-index: 1; }
.vn-x { position: absolute !important; top: 10px; right: 10px; z-index: 3 !important; }
.vn-stage { display: flex; flex-direction: column; justify-content: flex-end; padding: 22px 18px 18px; gap: 12px; }
.vn-portrait { position: relative; display: block; width: 100%; border-radius: 22px; overflow: hidden; padding: 0; border: 1px solid #ffffff2a; box-shadow: 0 24px 60px #000a, 0 0 0 1px #f6be6e22; cursor: zoom-in; animation: vn-in .35s ease-out; }
.vn-portrait .portrait.vn-img { aspect-ratio: 5 / 6; border-radius: 0; }
.vn-portrait .portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; image-rendering: auto; }
.vn-portrait.soft .portrait img { filter: contrast(1.04) saturate(1.04); }
.vn-portrait:hover { box-shadow: 0 28px 70px #000c, 0 0 0 2px #f6be6e66; }
.vn-zoom { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 99px; background: #0009; backdrop-filter: blur(6px); }
.vn-name { background: linear-gradient(135deg, #1a2342f2, #121a33f2); border: 1px solid #f6be6e44; border-radius: 16px; padding: 10px 14px; box-shadow: 0 10px 30px #0008; }
.vn-name b { font-size: 20px; letter-spacing: .2px; }
.vn-panel { padding: 56px 22px 22px 6px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; min-width: 0; }
.vn-panel .speech { background: linear-gradient(180deg, #ffffff10, #ffffff08); border: 1px solid #ffffff22; border-radius: 18px; font-size: 16px; line-height: 1.5; box-shadow: 0 10px 30px #0007; }
.vn-panel .speech .who { color: var(--gold); }
.vn-panel .speech.you { background: #ff7aa814; border-color: #ff7aa844; margin-left: 32px; }
.vn-panel .opt { background: #121a33e6; border: 1px solid #ffffff1f; border-radius: 14px; }
.vn-panel .opt:hover { border-color: #f6be6e88; background: #1b2546f0; }
@keyframes vn-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) {
  .sheet.vn { grid-template-columns: 1fr; min-height: auto; border-radius: 22px 22px 0 0; }
  .sheet.vn::after { background: linear-gradient(180deg, #0b112022 0%, #0b112066 35%, #0b1120f2 58%, #0b1120 100%); }
  .vn-stage { padding: 14px 14px 6px; flex-direction: row; align-items: flex-end; gap: 12px; }
  .vn-portrait { width: 58%; flex: none; border-radius: 18px; }
  .vn-portrait .portrait.vn-img { aspect-ratio: 4 / 5; }
  .vn-name { flex: 1; min-width: 0; padding: 8px 10px; } .vn-name b { font-size: 17px; }
  .vn-name .chip { font-size: 10px; padding: 2px 7px; }
  .vn-panel { padding: 8px 14px 18px; }
}
/* full-screen photo viewer */
.photo-view { position: fixed; inset: 0; z-index: 130; background: #05080fee; display: grid; place-items: center; padding: 16px; animation: up .2s ease-out; }
.photo-view figure { margin: 0; max-width: min(720px, 96vw); text-align: center; }
.photo-view img { max-width: 100%; max-height: 82vh; border-radius: 18px; box-shadow: 0 30px 80px #000; object-fit: contain; }
.photo-view figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; }
.photo-view .x { position: absolute; top: 14px; right: 14px; }
.composer { display: flex; gap: 8px; margin: 6px 0 4px; }
.composer input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 14px; background: #0b1226e6; border: 1px solid #f6be6e55; color: var(--text); font-size: 15px; }
.composer input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px #f6be6e33; }
.more-actions { margin-top: 4px; }
.more-actions > summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; padding: 6px 2px; list-style: none; }
.more-actions > summary::-webkit-details-marker { display: none; }
.more-actions > summary::before { content: '▸ '; } .more-actions[open] > summary::before { content: '▾ '; }
.vn-stage { justify-content: flex-start; padding-top: 28px; }
.sheet.vn::before { opacity: .75; filter: blur(2px) saturate(1.15) brightness(.9); }
.sheet.vn::after { background: linear-gradient(90deg, #0b112066 0%, #0b112033 30%, #0b1120d9 58%, #0b1120f5 100%); }
.vn-zoom .ic { width: 18px; height: 18px; color: #fff; }

/* =====================================================================
   MOBILE GAME MODE (phones & small tablets): full-screen HUD, bottom game dock,
   bottom sheets with a grab handle, big touch targets, no web-page feel.
   ===================================================================== */
html, body { height: 100dvh; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, .btn, .opt, .pick, .chip, .tabbar, .topbar, .action-tile, .look, .vn-portrait { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
@media (max-width: 959px) {
  #app { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
  .topbar { grid-row: 1; padding-top: max(8px, env(safe-area-inset-top)); background: linear-gradient(180deg, #0d1530f5, #0b1226e8); box-shadow: 0 6px 20px #0006; border-bottom: 1px solid #f6be6e22; }
  .main { grid-row: 2; }
  /* game dock */
  .tabbar { grid-row: 3; height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 4px;
    background: linear-gradient(180deg, #121b36f2, #0a1022fa); border-top: 1px solid #f6be6e33; box-shadow: 0 -8px 26px #0008; }
  .tabbar button { min-height: 56px; border-radius: 16px; gap: 3px; font-size: 10.5px; letter-spacing: .2px; transition: transform .12s ease, background .2s; }
  .tabbar button .i { width: 40px; height: 30px; border-radius: 12px; display: grid; place-items: center; transition: background .2s, transform .2s; }
  .tabbar button .i .ic { width: 23px; height: 23px; }
  .tabbar button.on { color: #ffe2b0; }
  .tabbar button.on .i { background: linear-gradient(135deg, #ff7aa8cc, #f6be6ecc); box-shadow: 0 6px 16px #f6be6e55; transform: translateY(-3px); }
  .tabbar button.on .i .ic { color: #1a1426; }
  .tabbar button:active { transform: scale(.92); }
  .badge { top: 2px; right: calc(50% - 26px); box-shadow: 0 0 0 2px #0b1226; }
  .page { padding: 12px 12px 20px; }
  /* bottom sheets feel native: full width, grab handle, nearly full height */
  .overlay { align-items: flex-end; }
  .sheet { width: 100%; max-height: calc(100dvh - 24px - env(safe-area-inset-top)); border-radius: 26px 26px 0 0; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); animation: sheet-up .28s cubic-bezier(.2,.8,.2,1); }
  .sheet::before { content: ''; position: sticky; top: -14px; display: block; width: 44px; height: 5px; border-radius: 99px; background: #ffffff38; margin: -10px auto 10px; z-index: 4; }
  .sheet.vn::before { position: absolute; }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
  /* thumb-friendly controls */
  .btn { min-height: 48px; border-radius: 14px; font-size: 15px; }
  .btn.sm { min-height: 40px; }
  .opt { min-height: 54px; padding: 12px 14px; border-radius: 16px; font-size: 15px; }
  .opt:active, .btn:active, .action-tile:active, .pick:active { transform: scale(.96); filter: brightness(1.12); }
  .opts.two { grid-template-columns: 1fr 1fr; }
  .action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; }
  .action-tile { min-height: 92px; border-radius: 18px; }
  .card { border-radius: 18px; }
  .tabs button { min-height: 40px; padding: 8px 14px; }
  input, select, textarea { font-size: 16px !important; } /* no iOS zoom-on-focus */
}
@media (max-width: 380px) { .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } .tabbar button { font-size: 9.5px; } }
/* landscape phones: keep the game playable */
@media (max-height: 480px) and (orientation: landscape) {
  .tabbar button { min-height: 44px; } .tabbar button .i { height: 24px; }
  .topbar .vitals { display: none; }
}
/* installed app (home-screen): true full screen */
@media (display-mode: standalone), (display-mode: fullscreen) { .install-hint { display: none !important; } }
.install-hint { display: none; }
@media (max-width: 959px) { .install-hint { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: #f6be6e14; border: 1px solid #f6be6e44; font-size: 12.5px; text-align: left; } }
@media (max-width: 959px) {
  .today-strip { padding: 10px 12px; }
  .today-strip .task-chips { flex-wrap: wrap; gap: 6px; }
  .today-strip .task-chips::-webkit-scrollbar { display: none; }
  .today-strip .task-chips .chip { flex: 0 1 auto; white-space: normal; text-align: left; line-height: 1.3; border-radius: 10px; }
  .today-strip > .row > .row { margin-top: 8px; width: 100%; }
  .today-strip > .row > .row .btn { flex: 1; min-height: 40px; }
}
/* Getting-started coach (ui/tutorial.js) */
.coach { margin-bottom: 12px; border-color: #f6be6e55; background: linear-gradient(135deg, #f6be6e14, #ff6fa814); }
.coach .chip { cursor: pointer; font: inherit; font-size: 12px; }
.coach-bar { margin-top: 10px; }

/* High-resolution scene photos (e.g. the rooftop bar): show them sharp. */
.scene.hd .photo { top: 0; bottom: 14%; left: -3%; right: -3%; filter: saturate(1.05) brightness(.82); }
.scene.hd .far { display: none; }

/* Title screen header bar (brand + main actions). */
.title-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; padding: 12px clamp(14px, 3vw, 32px); background: linear-gradient(180deg, #050812f2, #050812b8); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line2); }
.title-brand { font-size: 24px; font-weight: 900; letter-spacing: -.5px; line-height: 1; white-space: nowrap; }
.title-brand em { font-style: normal; background: linear-gradient(120deg, var(--peach), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.title-brand .heart { color: var(--pink); }
.title-brand small { margin-left: 8px; font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--gold); vertical-align: middle; }
.title-nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.title-nav .btn { padding: 9px 14px; font-size: 14px; white-space: nowrap; }
.btn.navy { background: #22305a; border-color: #3a4c86; }
.title-screen .title-hero { min-height: calc(100% - 64px); }
@media (max-width: 720px) {
  .title-top { padding: 10px 12px; }
  .title-nav { width: 100%; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .title-nav .btn { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; }
}

/* Map pins close to the edge: keep the label on screen. */
.pin.edge-l .lbl { transform: translateX(calc(50% - 14px)); }
.pin.edge-r .lbl { transform: translateX(calc(-50% + 14px)); }

/* Clean chat board: replies, text box, one row of actions. */
.chat-label { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 4px 0 6px; }
.vn-panel .opts.replies { display: grid; gap: 8px; }
.vn-panel .opts.replies .opt { padding: 12px 14px; font-size: 15px; font-weight: 600; line-height: 1.35; background: #17203d; border: 1px solid #ffffff1f; border-radius: 14px; text-align: left; }
.vn-panel .opts.replies .opt:hover, .vn-panel .opts.replies .opt:focus-visible { border-color: var(--gold); background: #1f2a50; }
.chat-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chat-actions .btn { min-height: 40px; }
.chat-actions .btn.primary { padding: 10px 18px; font-size: 15px; }
.vn-panel .composer { margin-top: 10px; }
.vn-panel .composer input { min-height: 44px; }
.more-list { margin-top: 8px; }

/* Sleep scene: you asleep in your room while the clock runs to morning */
.sleep-scene { position: fixed; inset: 0; z-index: 60; background: #0b1026; display: grid; place-items: center; overflow: hidden; animation: sleepIn .5s ease; }
.sleep-scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.62) saturate(.85); }
.sleep-night { position: absolute; inset: 0; background: radial-gradient(ellipse at 45% 20%, rgba(80,110,200,.10), rgba(8,12,40,.55) 70%); }
.sleep-zzz { position: absolute; left: 46%; top: 6%; font: 800 44px/1 var(--font, system-ui), sans-serif; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6); display: flex; gap: 6px; }
.sleep-zzz span { display: inline-block; animation: zzz 2.4s ease-in-out infinite; opacity: 0; }
.sleep-zzz span:nth-child(2) { animation-delay: .4s; font-size: .8em; } .sleep-zzz span:nth-child(3) { animation-delay: .8s; font-size: .64em; }
.sleep-card { position: absolute; bottom: max(28px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; min-width: 260px; padding: 14px 20px; border-radius: 18px; background: rgba(12,18,44,.78); color: #fff; backdrop-filter: blur(6px); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.sleep-moon { font-size: 30px; color: #ffd27a; }
.sleep-clock { font-size: 26px; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.sleep-sub { font-size: 13px; opacity: .8; }
.sleep-bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: rgba(255,255,255,.15); overflow: hidden; }
.sleep-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #7c8cff, #ffd27a); }
@keyframes zzz { 0% { opacity: 0; transform: translateY(10px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }
@keyframes sleepIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sleep-zzz span { animation: none; opacity: .9; } .sleep-scene { animation: none; } }

/* ===== Start page: sign in / create account, then Play ===== */
.auth-card { max-width: 460px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 20px auto 6px; padding: 4px; border-radius: 14px; background: #ffffff10; border: 1px solid var(--line2, #ffffff22); max-width: 360px; }
.auth-tabs button { border: 0; background: transparent; color: var(--muted, #b7c0dd); font-weight: 800; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.auth-tabs button.on { background: linear-gradient(120deg, #ff6fa8, #ffc04d); color: #1a1426; }
.auth-form { display: grid; gap: 10px; text-align: left; margin: 12px auto 10px; max-width: 360px; }
.auth-field { display: grid; gap: 5px; font-size: 13px; font-weight: 700; color: #e9e3f5; }
.auth-field input { width: 100%; border-radius: 12px; border: 1px solid #ffffff2e; background: #0b1226cc; color: #fff; padding: 11px 12px; font: inherit; font-weight: 500; }
.auth-field input:focus { outline: 2px solid #ffb86b; outline-offset: 1px; border-color: transparent; }
.auth-field .pw { position: relative; display: block; }
.auth-field .pw input { padding-right: 44px; }
.auth-field .peek { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #cfd6ee; cursor: pointer; }
.auth-field .peek:hover { background: #ffffff14; }
.auth-form .check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #e9e3f5; line-height: 1.4; }
.auth-form .check input { width: 18px; height: 18px; margin-top: 1px; accent-color: #ff6fa8; flex: none; }
.auth-form .check a, .title-welcome a, .auth-card .legal-links a { color: #ffd27a; }
.auth-form .btn.primary { padding: 12px; font-size: 15px; margin-top: 4px; }
.auth-error { margin: 0; padding: 8px 12px; border-radius: 10px; background: #ff5d7a22; border: 1px solid #ff5d7a66; color: #ffd0d8; font-size: 13px; }
.linkbtn { border: 0; background: none; padding: 0; color: #ffd27a; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.title-welcome { position: relative; z-index: 1; text-align: center; max-width: 620px; padding: 24px 18px; text-shadow: 0 2px 14px #000c; }
.title-welcome .welcome-line { font-size: 17px; color: #f1ecfa; margin: 16px auto 22px; line-height: 1.5; }
.title-welcome .play-big { display: inline-flex; align-items: center; gap: 8px; padding: 15px 46px; font-size: 19px; border-radius: 16px; box-shadow: 0 10px 30px #ff6fa866; text-shadow: none; }
.title-welcome .fine { margin-top: 10px; }
.title-nav .acct span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
.btn.danger { background: #c0392b; color: #fff; border-color: transparent; }
.title-nav a.btn, .title-welcome a.btn { text-decoration: none; color: var(--ink, #fff); }
.title-nav a.btn.primary, .title-welcome a.btn.primary { color: #1a1426; }
.title-welcome { background: radial-gradient(ellipse at center, #0a0f1eb0 0%, #0a0f1e66 45%, transparent 72%); border-radius: 40px; }
.auth-field > span .dim { font-weight: 500; }

/* Start page header: the logo is a link; buttons are icon + label (icons only on phones) */
a.title-brand { color: inherit; text-decoration: none; border-radius: 10px; }
a.title-brand:hover .heart { filter: drop-shadow(0 0 6px #ff6fa8aa); }
a.title-brand:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.title-nav .nb { display: inline-flex; align-items: center; gap: 7px; }
.title-nav .nb .ic { width: 18px; height: 18px; }
@media (max-width: 720px) {
  .title-top { flex-wrap: nowrap; }
  .title-brand { font-size: 21px; } .title-brand small { display: none; }
  .title-nav { width: auto; flex-wrap: nowrap; overflow: visible; gap: 6px; padding: 0; }
  .title-nav .nb { width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 12px; }
  .title-nav .nb .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .title-nav .nb .ic { width: 21px; height: 21px; }
}

/* Sign-in window: opens from the top bar, closes with ×, Esc or a tap outside */
.auth-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; overflow-y: auto; background: #05081299; backdrop-filter: blur(5px); animation: authfade .18s ease-out; }
.auth-modal .auth-card { position: relative; width: 100%; max-width: 440px; text-align: center; background: #0a0f1ef2; border: 1px solid #ffffff26; border-radius: 22px; padding: 26px 22px 18px; box-shadow: 0 24px 60px #000a; animation: authpop .2s ease-out; }
.auth-modal .auth-card .logo { font-size: clamp(40px, 9vw, 58px); }
.auth-x { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #ffffff22; border-radius: 12px; background: #ffffff10; color: #e7e2f3; cursor: pointer; }
.auth-x:hover { background: #ffffff22; color: #fff; } .auth-x .ic { width: 20px; height: 20px; }
@keyframes authfade { from { opacity: 0; } } @keyframes authpop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (max-width: 560px) { .auth-modal { align-items: start; padding: 12px; } .auth-modal .auth-card { padding: 22px 16px 14px; } }
.auth-modal .auth-card .presented { margin: 4px 46px 12px; }

.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.title-welcome .preview-btn { padding: 14px 22px; font-size: 16px; border-radius: 16px; background: #0a0f1e99; border: 1px solid #ffffff40; color: #fff; text-decoration: none; text-shadow: none; display: inline-flex; align-items: center; gap: 8px; }
.title-welcome .preview-btn:hover { background: #0a0f1ecc; border-color: #ffffff80; }
