/* SOLTROPOLIS skin: daytime sky, pixel clouds, voxel islands. Navy and cream from the wordmark,
   orange roofs, green grass, blue tower. Loaded after theme.css and overrides it. */
:root:root {
  color-scheme: light;
  --navy: #1b2a4a;
  --navy-2: #26395f;
  --cream: #fff6e3;
  --cream-2: #fdebc6;
  --sky-1: #5fb4f0;
  --sky-2: #bfe6ff;
  --grass: #5bbf3a;
  --grass-d: #2f7d22;
  --roof: #f0782b;
  --roof-d: #a8481a;
  --tower: #3b7de0;
  --dirt: #8b5a34;
  --stone: #4c5a7a;
  --paper: var(--sky-2);
  --panel: #fff9ec;
  --panel-2: #fff2d9;
  --raise: #ffffff;
  --street: #fff2d9;
  --edge: var(--navy);
  --ink: var(--navy);
  --ink-2: #51607f;
  --line: #e4d2aa;
  --line-2: var(--navy);
  --gold: #ffc93c;
  --gold-d: #c98a00;
  --teal: #2fae7d;
  --ok: #2f9e44;
  --red: #e8503a;
  --sign: #e8503a;
  --launch: var(--roof);
  --ind: #e8a23a;
  --com: var(--tower);
  --res: var(--grass);
  --lux: #f2b21d;
  --art: #e0679f;
  --civ: #8a6ee0;
  --park: #2fae7d;
  --ops: #7d8aa6;
  --display: 'Silkscreen', 'Pixelify Sans', 'Rubik', sans-serif;
  --pixel: 'Silkscreen', 'Pixelify Sans', 'Rubik', sans-serif;
  --slab: 0 5px 0 var(--navy), 0 18px 30px -18px rgba(27, 42, 74, 0.45);
  --outline-2: -2px 0 var(--cream), 2px 0 var(--cream), 0 -2px var(--cream), 0 2px var(--cream), -2px -2px var(--cream), 2px 2px var(--cream), -2px 2px var(--cream), 2px -2px var(--cream), -4px 0 var(--navy), 4px 0 var(--navy), 0 -4px var(--navy), 0 4px var(--navy), -4px -4px var(--navy), 4px 4px var(--navy), -4px 4px var(--navy), 4px -4px var(--navy), 0 7px var(--navy);
  --outline-3: -3px 0 var(--cream), 3px 0 var(--cream), 0 -3px var(--cream), 0 3px var(--cream), -3px -3px var(--cream), 3px 3px var(--cream), -3px 3px var(--cream), 3px -3px var(--cream), -6px 0 var(--navy), 6px 0 var(--navy), 0 -6px var(--navy), 0 6px var(--navy), -6px -6px var(--navy), 6px 6px var(--navy), -6px 6px var(--navy), 6px -6px var(--navy), 0 10px var(--navy);
}
html,
body {
  background-color: var(--sky-2);
}
body {
  color: var(--ink);
  background-image: linear-gradient(180deg, var(--sky-1) 0%, #8fd0fa 45%, var(--sky-2) 100%);
  background-size: 100% 100%;
  background-attachment: fixed;
}
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky i { position: absolute; left: 0; display: block; background: url('/img/cloud-a.png') no-repeat center / contain; image-rendering: auto; transform: translateX(var(--from, 10vw)); }
.sky .c1 { top: 7%; width: 280px; height: 188px; --from: 6vw; }
.sky .c2 { top: 22%; width: 120px; height: 116px; background-image: url('/img/cloud-b.png'); --from: 70vw; }
.sky .c3 { top: 48%; width: 200px; height: 134px; --from: 84vw; opacity: 0.85; }
.sky .c4 { top: 66%; width: 96px; height: 92px; background-image: url('/img/cloud-b.png'); --from: 28vw; opacity: 0.8; }
.sky .c5 { top: 84%; width: 240px; height: 160px; --from: 50vw; opacity: 0.7; }
body::after {
  background: none;
  height: 0;
}
::selection { background: var(--roof); color: #fff; }
a { color: var(--tower); }
.dim { color: var(--ink-2); }
.note { color: var(--ink-2); }

/* Display type: the wordmark look */
.title-3d,
.title-3d .gold {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--navy);
  text-shadow: var(--outline-3);
}
.title-3d { font-size: clamp(34px, 6.4vw, 78px); gap: 0.16em; }
.title-3d .gold { color: var(--roof); }
.section-title,
.district-head h1,
.gate h1,
.modal-card h2,
.wz-head h2,
.wz-center h3,
.lp-title,
.landing-title,
.hero-stats dd,
.stat3d b,
.slots b,
.play-head h2,
.tour-tip h3 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--navy);
  text-shadow: var(--outline-2);
  letter-spacing: 0.02em;
}
.section-title { font-size: clamp(22px, 3.2vw, 36px); margin-bottom: 18px; }
.district-head h1 { font-size: clamp(24px, 3.2vw, 34px); }
.district-head h1 .zone-chip { border: 2px solid var(--navy); box-shadow: 0 3px 0 var(--navy); }
.district-head::after { height: 6px; border: 2px solid var(--navy); box-shadow: 0 3px 0 var(--navy); }
.lede, .hero-lede, .section-lede { color: var(--ink-2); }
.kicker, .modal-kicker, .permit-title, .guide-step, .tour-count {
  color: var(--roof-d);
}
.wz-success h3 { color: var(--roof); text-shadow: var(--outline-2); }

/* Shell */
.side { background: var(--navy); border-right: 4px solid #101a30; color: var(--cream); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-shadow: none; padding: 2px 0; }
.brand-island { width: auto; height: 38px; image-rendering: auto; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35)); }
.brand-word { height: 20px; width: auto; }
.mobile-bar .brand-island { height: 30px; }
.mobile-bar .brand-word { height: 15px; }
.brand-mark { display: none; }
.nav-head { color: #8ea6d6; }
.nav-item { color: #dfe7f7; }
.nav-item:hover { background: var(--navy-2); color: #fff; }
.nav-item.on { background: var(--cream); color: var(--navy); box-shadow: 0 3px 0 #0c1426; }
.nav-item.on .nav-text small { color: var(--ink-2); }
.nav-text small { color: #9fb2d8; }
.nav-ico { border: 2px solid #0c1426; }
.nav-badge { background: var(--roof); box-shadow: 0 2px 0 var(--roof-d); }
.permit { background: var(--cream); color: var(--navy); border: 3px solid #0c1426; box-shadow: 0 5px 0 #0c1426; }
.permit-copy { color: var(--ink-2); }
.permit-link-x { background: var(--panel-2); color: var(--navy); border: 2px solid var(--navy); box-shadow: 0 3px 0 var(--navy); }
.permit .linkish, .side .linkish { color: var(--ink-2); }
.mobile-bar { background: var(--navy); border-bottom: 4px solid #101a30; }
.mobile-bal:not(:empty) { background: #101a30; color: var(--cream); box-shadow: none; }
.menu-btn, .chat-btn { background: var(--cream); box-shadow: 0 3px 0 #0c1426; border: 2px solid #0c1426; }
.menu-btn span { background: var(--navy); }
.chat-btn::before { color: var(--navy); }
.tabbar { background: var(--navy); border-top: 4px solid #101a30; }
.tabbar button { color: #dfe7f7; }
.tabbar button.on { background: var(--cream); color: var(--navy); box-shadow: 0 3px 0 #0c1426; }
.scrim { background: rgba(16, 26, 48, 0.55); }
.side-head { background: var(--navy); border-bottom: 3px solid #101a30; }
.side-close { background: var(--cream); box-shadow: 0 3px 0 #0c1426; }
.side-close::before, .side-close::after { background: var(--navy); }

/* Buttons */
.btn { border: 3px solid var(--navy); font-weight: 800; }
.btn-primary,
.btn-launch {
  color: #fff;
  background: var(--roof);
  text-shadow: 0 2px 0 var(--roof-d);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.12), 0 5px 0 var(--navy);
}
.btn-primary:not(:disabled):hover,
.btn-launch:not(:disabled):hover { background: #ff8a3d; box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.4), 0 6px 0 var(--navy); }
.btn-primary:not(:disabled):active,
.btn-launch:not(:disabled):active { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.3), 0 1px 0 var(--navy); }
.btn-ghost { color: var(--navy); background: var(--cream); box-shadow: inset 0 3px 0 #fff, 0 5px 0 var(--navy); }
.btn-ghost:not(:disabled):hover { color: var(--navy); background: #fff; box-shadow: inset 0 3px 0 #fff, 0 6px 0 var(--navy); }
.btn-ghost:not(:disabled):active { box-shadow: 0 1px 0 var(--navy); }
.btn-danger { background: var(--red); border-color: var(--navy); box-shadow: 0 5px 0 var(--navy); }
.btn-sm.btn-primary, .btn-sm.btn-ghost { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 3px 0 var(--navy); }
.linkish { color: var(--tower); }
.linkish:hover { color: var(--roof); }

/* Surfaces: cream voxel blocks */
.panel,
.hero-slim,
.gate,
.lp-wizard,
.cta3d,
.stat3d,
.card3d,
.launch-card,
.lp-faq details,
.tour-cta,
.permit,
.token-card,
.myjob,
:is(.item, .fit, .menu-item, .recipe, .contract, .job, .inv-row, .feature, .earn-card, .tut-step) {
  background: var(--panel);
  border: 3px solid var(--navy);
  color: var(--navy);
  box-shadow: var(--slab);
}
:is(.item, .fit, .menu-item, .recipe, .contract, .job, .inv-row, .tut-step, .myjob, .launch-card, .earn-card) { box-shadow: 0 4px 0 var(--navy); }
.panel { position: relative; }
.card3d::before, .feature::before { height: 8px; background: var(--grass); border-bottom: 3px solid var(--navy); }
.card3d { padding-top: 26px; }
.card3d strong { font-family: var(--display); font-weight: 700; color: var(--navy); text-shadow: none; }
.card3d span, .feature span { color: var(--ink-2); }
.banner, .notice, .tour-cta, .wz-status { background: #fff1c2; border: 3px solid var(--navy); color: var(--navy); box-shadow: 0 4px 0 var(--navy); }
.modal-warn { background: #fff1c2; border: 2px solid var(--navy); color: var(--navy); }
.modal-error { background: #ffe1da; border: 2px solid var(--red); color: #8a2312; }
.myjob-empty { background: var(--panel-2); border-style: dashed; box-shadow: none; }
.tabs { background: var(--cream-2); border: 3px solid var(--navy); }
.tabs button { color: var(--ink-2); }
.tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 3px 0 var(--navy); }
input,
select,
textarea { background: #fff; color: var(--navy); border: 2px solid var(--navy); box-shadow: inset 0 3px 0 #e9eef8; }
input:focus,
select:focus,
textarea:focus { border-color: var(--roof); box-shadow: inset 0 3px 0 #e9eef8, 0 0 0 3px rgba(240, 120, 43, 0.25); }
.field-label { color: var(--ink-2); }
.table th { color: var(--ink-2); }
.table td, .table th { border-color: var(--line); }
.table tr.clickable:hover td { background: #fff2d9; }
.tag { background: var(--cream-2); color: var(--navy); border: 2px solid var(--navy); }
.meter { background: #e9e1cc; box-shadow: inset 0 2px 0 rgba(27, 42, 74, 0.2); border: 2px solid var(--navy); }
.amt { color: var(--navy); }
.world, .scene, .capital { border: 4px solid var(--navy); box-shadow: 0 8px 0 var(--navy), 0 30px 50px -24px rgba(27, 42, 74, 0.6); }
.scene { background: linear-gradient(180deg, #8ad0fb, #d3efff); }
.hud-chip { background: var(--cream); color: var(--navy); border: 2px solid var(--navy); box-shadow: 0 2px 0 var(--navy); }
.toast { background: var(--cream); color: var(--navy); border: 3px solid var(--navy); border-left-width: 8px; box-shadow: 0 5px 0 var(--navy); }
.toast-ok { border-left-color: var(--grass); }
.toast-err { border-left-color: var(--red); }
.guide { background: var(--cream); border: 3px solid var(--navy); color: var(--navy); }
.guide-bar, .tour-progress { background: #e9e1cc; border: 2px solid var(--navy); }
.guide-bar i, .tour-progress i { background: var(--grass); }
.guide-how { color: var(--ink-2); }
.boot { background: linear-gradient(180deg, var(--sky-1), var(--sky-2)); }
.boot p { color: var(--navy); font-family: var(--display); font-weight: 700; }
.boot-island { width: 120px; height: auto; filter: drop-shadow(0 8px 0 rgba(27, 42, 74, 0.25)); }
.scroll-progress { background: var(--roof); box-shadow: 0 2px 0 var(--roof-d); }
.page-loading span { background: var(--roof); box-shadow: 0 3px 0 var(--navy); }
.chip { background: var(--cream-2); color: var(--navy); border: 2px solid var(--navy); }
.chip-gold { background: var(--gold); color: var(--navy); box-shadow: 0 3px 0 var(--navy); }
.chip-teal { background: var(--grass); color: #fff; box-shadow: 0 3px 0 var(--navy); }
.count { background: var(--roof); }
.count.soft { background: #d8cdb0; color: var(--navy); }
.badge { background: var(--roof); box-shadow: 0 2px 0 var(--navy); }
.platform-badge { border: 2px solid var(--navy); box-shadow: 0 2px 0 var(--navy); color: var(--navy); }
.callout-x .platform-badge { background: #fff; }

/* Modal + sign in */
.modal-scrim { background: rgba(16, 26, 48, 0.55); }
.modal-card { background: var(--cream); border: 4px solid var(--navy); box-shadow: 0 8px 0 var(--navy), 0 40px 80px -30px rgba(16, 26, 48, 0.7); color: var(--navy); }
.modal-lede { color: var(--ink-2); }
.modal-x { background: #fff; border: 2px solid var(--navy); box-shadow: 0 3px 0 var(--navy); }
.modal-x::before, .modal-x::after { background: var(--navy); }
.login-btn { background: #fff; color: var(--navy); border: 3px solid var(--navy); box-shadow: 0 4px 0 var(--navy); }
.login-btn:hover { background: var(--panel-2); }
.login-btn small { color: var(--ink-2); }
.login-x { background: #111; color: #fff; }
.login-x small { color: #c9cfdb; }
.login-x:hover { background: #222; }
.login-wallet { box-shadow: inset 0 0 0 3px var(--gold), 0 4px 0 var(--navy); }
.divider { color: var(--ink-2); }
.divider::before, .divider::after { background: var(--navy); opacity: 0.25; }

/* Landing */
.hero-banner { margin: 0; border: 4px solid var(--navy); border-radius: 22px; overflow: hidden; box-shadow: 0 8px 0 var(--navy), 0 40px 60px -30px rgba(27, 42, 74, 0.6); background: #8fd0fa; }
.hero-banner img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; }
.hero-note { color: var(--ink-2); }
.ticker { background: var(--navy); color: var(--cream); border: 3px solid #0c1426; box-shadow: 0 5px 0 #0c1426; }
.tick-dot { background: var(--roof); }
.stat3d span { color: var(--ink-2); }
.hero-stats dt { color: var(--ink-2); }
.timeline::before { background: #e9e1cc; border: 2px solid var(--navy); box-shadow: none; height: 10px; top: 32px; }
.timeline::after { background: var(--grass); box-shadow: none; height: 10px; top: 32px; }
.num3d { color: #fff; background: var(--grass); border: 3px solid var(--navy); font-family: var(--display); font-weight: 700; text-shadow: 0 3px 0 var(--grass-d); box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.35), 0 8px 0 var(--navy); }
.timeline p { color: var(--ink-2); }
.flow-node { background: var(--panel); border: 3px solid var(--navy); color: var(--navy); box-shadow: 0 5px 0 var(--navy); }
.flow-node span { color: var(--ink-2); }
.flow-gold { background: var(--gold); }
.flow-gold b, .flow-gold span { color: var(--navy); }
.flow-pipe { background: #e9e1cc; border: 2px solid var(--navy); box-shadow: none; height: 12px; }
.flow-pipe i { background: var(--gold); border: 1px solid var(--gold-d); top: 1px; }
.capital::after { background: linear-gradient(180deg, transparent 60%, rgba(27, 42, 74, 0.55)); }
.residents { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; text-align: left; }
.resident { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 12px 14px; border-radius: 18px; background: var(--panel); border: 3px solid var(--navy); box-shadow: 0 5px 0 var(--navy); text-align: center; position: relative; overflow: hidden; }
.resident::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 70px; background: linear-gradient(180deg, #a6dcfc, #d8f0ff); border-bottom: 3px solid var(--navy); }
.resident .npc-portrait { position: relative; height: 112px; width: auto; filter: drop-shadow(0 4px 0 rgba(27, 42, 74, 0.25)); }
.resident b { font-family: var(--display); font-size: 15px; }
.resident span { color: var(--roof-d); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.resident p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.4; }

/* Launchpad wizard and cards */
.stepper li { background: #fff; color: var(--ink-2); border: 2px solid var(--navy); box-shadow: 0 3px 0 var(--navy); }
.stepper li span { background: var(--cream-2); color: var(--navy); }
.stepper li.on { color: var(--navy); box-shadow: inset 0 0 0 2px var(--roof), 0 3px 0 var(--navy); }
.stepper li.on span { background: var(--roof); color: #fff; }
.stepper li.done span { background: var(--grass); color: #fff; }
.wz-wallet { background: #e5f6dd; border: 3px solid var(--grass-d); }
.token-logo { background: var(--gold); color: var(--navy); border: 3px solid var(--navy); box-shadow: 0 4px 0 var(--navy); }
.token-sym { color: var(--roof-d); }
.token-desc { color: var(--ink-2); }
.token-tags span { background: var(--cream-2); border: 2px solid var(--navy); }
.lp-faq details p { color: var(--ink-2); }
.wz-center p { color: var(--ink-2); }

/* Jobs, foremen, slots */
.job-with-boss { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.job-boss { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.job-boss .npc-portrait { height: 64px; width: auto; }
.job-boss span { font-size: 11px; font-weight: 800; color: var(--ink-2); text-align: center; line-height: 1.1; }
.contract { position: relative; padding-top: 14px; }
.contract-giver { float: right; margin: -4px -2px 0 8px; }
.contract-giver .npc-portrait { height: 48px; width: auto; }
.slots i { background: linear-gradient(90deg, var(--grass) var(--p), #e9e1cc var(--p)); border: 2px solid var(--navy); box-shadow: none; }
.slots span { color: var(--ink-2); }
.myjob-shift .platform-badge { background: var(--ind); }
@media (max-width: 640px) {
  .job-with-boss { grid-template-columns: 56px minmax(0, 1fr); }
  .job-with-boss .job-actions { grid-column: 1 / -1; }
  .job-boss .npc-portrait { height: 52px; }
}

/* Chat dock */
.chat-fab { color: #fff; background: var(--roof); border: 3px solid var(--navy); text-shadow: 0 2px 0 var(--roof-d); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), 0 5px 0 var(--navy), 0 16px 30px -10px rgba(16, 26, 48, 0.5); }
.chat-fab:active { box-shadow: 0 1px 0 var(--navy); }
.chat-dock { background: var(--cream); border: 4px solid var(--navy); box-shadow: 0 8px 0 var(--navy), 0 40px 70px -30px rgba(16, 26, 48, 0.6); color: var(--navy); }
.dock-head { background: var(--navy); border-bottom: 3px solid #0c1426; }
.dock-tabs button { color: #dfe7f7; }
.dock-tabs button.on { background: var(--cream); color: var(--navy); box-shadow: 0 3px 0 #0c1426; }
.dock-close, .dock-back { background: var(--cream); box-shadow: 0 3px 0 #0c1426; }
.dock-close::before, .dock-close::after { background: var(--navy); }
.dock-back::before { border-color: var(--navy); }
.dock-chips { border-bottom: 2px solid var(--line); }
.dock-chips button { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.dock-chips button.on { background: var(--gold); color: var(--navy); box-shadow: 0 2px 0 var(--navy); }
.dock-input { background: var(--panel-2); border-top: 2px solid var(--line); }
.dock-signin { border-top: 2px solid var(--line); }
.dock-name { color: var(--navy); }
.dmsg-mine .dock-name { color: var(--roof-d); }
.dmsg-shout { background: #fff1c2; border: 2px solid var(--navy); }
.dmsg-meta time, .bubble time, .dock-thread-side { color: #8190ad; }
.dmsg-system { color: var(--ink-2); }
.dock-thread { color: var(--navy); }
.dock-thread:hover { background: #fff; }
.dock-thread-main span { color: var(--ink-2); }
.dock-thread.unread .dock-thread-main span { color: var(--navy); }
.dock-thread-head { border-bottom: 2px solid var(--line); }
.bubble { background: #fff; border: 2px solid var(--navy); box-shadow: 0 2px 0 var(--navy); }
.bubble-mine { background: var(--gold); color: var(--navy); box-shadow: 0 2px 0 var(--navy); }
.bubble-mine time { color: #7a5a10; }

/* Tour */
.tour-block { background: rgba(16, 26, 48, 0.5); }
.tour-spot { box-shadow: 0 0 0 4px var(--roof), 0 0 0 7px var(--navy), 0 0 30px rgba(240, 120, 43, 0.55); }
.tour-tip { background: var(--cream); border: 4px solid var(--navy); color: var(--navy); box-shadow: 0 8px 0 var(--navy), 0 30px 60px -20px rgba(16, 26, 48, 0.7); }
.tour-tip::before { background: var(--cream); border-color: var(--navy); border-width: 4px; }
.tour-tip p { color: var(--ink-2); }
.tour-hint { color: var(--roof-d) !important; }
.tour-guide { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; }
.tour-guide .npc-portrait { height: 64px; width: auto; filter: drop-shadow(0 3px 0 rgba(27, 42, 74, 0.25)); }
.tour-guide .tour-count { margin: 0 !important; }
.tour-guide-name { margin: 0 !important; font-weight: 800; color: var(--navy) !important; }

/* Play screen */
.play { background: rgba(16, 26, 48, 0.6); }
.play-card { background: var(--cream); border: 4px solid var(--navy); box-shadow: 0 10px 0 var(--navy), 0 50px 90px -30px rgba(16, 26, 48, 0.7); color: var(--navy); }
.play-head { background: var(--navy); border-bottom: 4px solid #0c1426; color: var(--cream); }
.play-head h2 { color: var(--cream); text-shadow: 0 3px 0 #0c1426; }
.play-head .kicker { color: var(--gold); }
.play-stats b { color: var(--cream); font-family: var(--display); font-weight: 700; }
.play-stats span { color: #9fb2d8; }
.play-head .dock-close { background: var(--cream); }
.play-box { background: #fff; border: 3px solid var(--navy); box-shadow: 0 4px 0 var(--navy); }
.feed li { color: var(--ink-2); }
.feed li.cheer { color: var(--roof-d); font-weight: 700; }
.round-slot { background: #fff; color: var(--ink-2); border: 2px solid var(--navy); box-shadow: 0 3px 0 var(--navy); }
.rules { color: var(--ink-2); }
.rules b { color: var(--navy); }
.play-live { color: var(--ink-2); }
.game-stage { border: 4px solid var(--navy); box-shadow: 0 6px 0 var(--navy); }
.grade, .grade-big, .round-slot[class*='grade-'] { border: 3px solid var(--navy); color: var(--navy); font-family: var(--display); font-weight: 700; }
.grade-big { color: var(--navy); box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.5), 0 10px 0 var(--navy) !important; }
.grade-S { background: var(--gold); }
.grade-A { background: var(--grass); color: #fff; }
.grade-B { background: #7cc4f2; }
.grade-C { background: #f4b56a; }
.grade-D { background: #c9cfdb; }
.foreman { display: flex; align-items: flex-end; gap: 14px; max-width: 560px; text-align: left; }
.foreman .npc-portrait { height: 110px; width: auto; flex: none; filter: drop-shadow(0 4px 0 rgba(27, 42, 74, 0.25)); }
.foreman-say { position: relative; padding: 12px 16px; border-radius: 16px; background: #fff; border: 3px solid var(--navy); box-shadow: 0 4px 0 var(--navy); margin-bottom: 18px; }
.foreman-say::before { content: ''; position: absolute; left: -12px; bottom: 16px; border: 9px solid transparent; border-right-color: var(--navy); border-left-width: 0; }
.foreman-say b { font-family: var(--display); font-size: 14px; }
.foreman-say p { margin: 4px 0 0; color: var(--ink-2); }

/* NPC dialogue over the map */
.npc-layer { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 6; pointer-events: none; }
.npc-dialog { pointer-events: auto; display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; align-items: end; padding: 12px 16px 14px 8px; border-radius: 18px; background: var(--cream); border: 4px solid var(--navy); box-shadow: 0 6px 0 var(--navy), 0 20px 40px -20px rgba(16, 26, 48, 0.7); }
.npc-dialog-face { display: flex; justify-content: center; align-items: flex-end; margin-top: -54px; }
.npc-dialog-face .npc-portrait { height: 150px; width: auto; filter: drop-shadow(0 5px 0 rgba(27, 42, 74, 0.3)); }
.npc-dialog-name { margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--navy); }
.npc-dialog-name span { margin-left: 8px; padding: 2px 8px; border-radius: 8px; font-family: var(--font); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--roof); vertical-align: 3px; }
.npc-dialog-text { margin: 0 0 10px; min-height: 3em; font-size: 15.5px; line-height: 1.5; color: var(--navy); }
.npc-dialog-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 860px) {
  /* the map is small on phones: the dialogue becomes a bottom sheet above the tab bar */
  .npc-layer { position: fixed; left: 8px; right: 8px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 60; }
  .npc-dialog { grid-template-columns: 76px minmax(0, 1fr); padding: 10px 10px 12px 4px; }
  .npc-dialog-face { margin-top: -36px; }
  .npc-dialog-face .npc-portrait { height: 100px; }
  .npc-dialog-text { font-size: 14px; }
}

@media (prefers-reduced-motion: no-preference) {
  .sky i { animation: drift var(--t, 160s) linear infinite; animation-delay: var(--d, 0s); }
  .sky .c1 { --t: 190s; --d: -40s; }
  .sky .c2 { --t: 130s; --d: -95s; }
  .sky .c3 { --t: 220s; --d: -170s; }
  .sky .c4 { --t: 150s; --d: -20s; }
  .sky .c5 { --t: 240s; --d: -120s; }
  .boot-island { animation: floaty 2.4s ease-in-out infinite; }
  .brand-island { transition: transform 0.2s; }
  .brand:hover .brand-island { transform: translateY(-3px) rotate(-3deg); }
  .resident { transition: transform 0.2s; }
  .resident:hover { transform: translateY(-5px); }
  .resident:hover .npc-portrait { animation: hop 0.5s steps(2) 2; }
  .npc-dialog { animation: modal-in 0.3s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
  .foreman .npc-portrait { animation: floaty 3s ease-in-out infinite; }
}
@keyframes drift { from { transform: translateX(-320px); } to { transform: translateX(calc(100vw + 40px)); } }


/* Eastside: fires, farm, arcade -------------------------------------------------------------------- */
.hud-fire { background: var(--red); color: #fff; border-color: var(--navy); }
.btn-hose { touch-action: none; user-select: none; -webkit-user-select: none; }
.btn-hose:active { background: #ff6d4a; }
.fire-alert { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border-radius: 16px; background: #ffe1d6; border: 3px solid var(--navy); box-shadow: 0 5px 0 var(--navy); }
.fire-alert h3 { margin: 0; font-family: var(--display); font-size: 22px; }
.fire-alert p { margin: 4px 0 0; }
.farm-host { margin: 4px 0; }
.farm-plots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.plot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; border-radius: 16px; background: var(--panel); border: 3px solid var(--navy); box-shadow: 0 4px 0 var(--navy); text-align: center; }
.plot-soil { position: relative; width: 100%; height: 86px; border-radius: 10px; border: 3px solid var(--navy); background: repeating-linear-gradient(180deg, #7a5230 0 12px, #5e3d22 12px 18px); overflow: hidden; }
.plot-empty .plot-soil { background: repeating-linear-gradient(180deg, #8b6238 0 12px, #6e4a2a 12px 18px); }
.sprout { position: absolute; left: 50%; bottom: 8px; width: 10px; height: calc(10px + 46px * var(--g, 0)); margin-left: -5px; background: #4fa83a; border: 2px solid var(--navy); border-radius: 6px 6px 2px 2px; transform-origin: bottom; }
.sprout::before, .sprout::after { content: ''; position: absolute; top: 4px; width: 16px; height: 9px; background: #6cc24a; border: 2px solid var(--navy); border-radius: 10px 0; }
.sprout::before { right: 6px; }
.sprout::after { left: 6px; transform: scaleX(-1); }
.plot-ready.crop-carrot .plot-soil::after, .plot-ready.crop-tomato .plot-soil::after, .plot-ready.crop-pumpkin .plot-soil::after { content: ''; position: absolute; left: 50%; bottom: 10px; width: 26px; height: 22px; margin-left: -13px; border: 2px solid var(--navy); border-radius: 50%; }
.plot-ready.crop-carrot .plot-soil::after { background: var(--roof); border-radius: 4px 4px 50% 50%; width: 14px; margin-left: -7px; height: 26px; }
.plot-ready.crop-tomato .plot-soil::after { background: var(--red); }
.plot-ready.crop-pumpkin .plot-soil::after { background: #f2952e; width: 36px; margin-left: -18px; }
.plot-name { margin: 0; font-weight: 800; }
.plot-pick { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.arcade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cab { display: flex; flex-direction: column; border-radius: 16px 16px 10px 10px; border: 3px solid var(--navy); background: #2a2050; box-shadow: 0 5px 0 var(--navy); overflow: hidden; }
.cab-screen { margin: 10px 10px 0; padding: 14px 12px; min-height: 108px; border-radius: 10px; border: 3px solid #0c1426; background: linear-gradient(180deg, #121a33, #1b2a4a); color: #dfe7f7; display: flex; flex-direction: column; gap: 6px; }
.cab-screen b { font-family: var(--display); color: #3bf0ff; font-size: 16px; text-shadow: 0 0 10px rgba(59, 240, 255, 0.5); }
.cab-screen span { font-size: 12.5px; color: #b9c7e6; }
.cab-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; }
.cab-foot .dim { color: #b9c7e6; }
.arcade-live { display: flex; flex-direction: column; gap: 10px; }
.guide-reward { margin: 0; font-size: 12.5px; font-weight: 800; color: var(--grass-d); }
.calc { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; text-align: left; padding: 20px; border-radius: 20px; background: var(--panel); border: 3px solid var(--navy); box-shadow: var(--slab); }
.calc-in { display: flex; flex-direction: column; gap: 12px; }
.calc-in input[type='range'] { padding: 0; box-shadow: none; border: 0; accent-color: var(--roof); }
.calc-in output { font-family: var(--mono); font-weight: 700; }
.calc-out { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.calc-out > div { padding: 12px; border-radius: 14px; background: #fff; border: 3px solid var(--navy); box-shadow: 0 4px 0 var(--navy); display: flex; flex-direction: column; gap: 2px; }
.calc-out b { font-family: var(--display); font-size: 22px; color: var(--navy); }
.calc-out span { color: var(--ink-2); font-size: 13px; }
.calc-out .calc-big { grid-column: 1 / -1; background: var(--gold); }
.calc-out .calc-big b { font-size: 34px; }
.calc-out .note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; }
.toolkit { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; text-align: left; }
.levels { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.level-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; border-radius: 18px; background: var(--panel); border: 3px solid var(--navy); box-shadow: 0 5px 0 var(--navy); }
.level-card .num3d { width: 56px; height: 56px; font-size: 24px; }
.level-card span { color: var(--ink-2); font-size: 13.5px; }
.first-day { width: 100%; max-width: 760px; margin: 0; padding: 0; list-style: none; counter-reset: fd; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.first-day li { counter-increment: fd; position: relative; padding: 14px 16px 14px 62px; border-radius: 16px; background: var(--panel); border: 3px solid var(--navy); box-shadow: 0 4px 0 var(--navy); }
.first-day li::before { content: counter(fd); position: absolute; left: 14px; top: 12px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-family: var(--display); font-weight: 700; color: #fff; background: var(--grass); border: 2px solid var(--navy); }
@media (max-width: 760px) {
  .calc { grid-template-columns: 1fr; padding: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  .hud-fire { animation: pulse-red 0.9s ease-in-out infinite; }
  .plot-growing .sprout { animation: sway 2.6s ease-in-out infinite; }
  .plot-ready .plot-soil::after { animation: hop 0.8s steps(2) infinite; }
}
@keyframes sway { 50% { transform: rotate(4deg); } }

.tour-tip h3 { margin-top: 12px; }
