﻿/* ============================================================
   ג'ונס בנתיב איילון - stylesheet
   Aesthetic: retro-90s Sierra adventure warmth × Israeli street
   poster. Sand/teal Tel Aviv palette, hard comic shadows,
   neon cyan-violet for everything AI.
   ============================================================ */

/* ---------- fonts (vendored, OFL) ---------- */
@font-face { font-family: "Karantina"; font-weight: 400; font-display: swap;
  src: url("fonts/karantina-400-hebrew.woff2") format("woff2"); unicode-range: U+0590-05FF, U+20AA; }
@font-face { font-family: "Karantina"; font-weight: 400; font-display: swap;
  src: url("fonts/karantina-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF; }
@font-face { font-family: "Karantina"; font-weight: 700; font-display: swap;
  src: url("fonts/karantina-700-hebrew.woff2") format("woff2"); unicode-range: U+0590-05FF, U+20AA; }
@font-face { font-family: "Karantina"; font-weight: 700; font-display: swap;
  src: url("fonts/karantina-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF; }
@font-face { font-family: "Rubik"; font-weight: 400; font-display: swap;
  src: url("fonts/rubik-400-hebrew.woff2") format("woff2"); unicode-range: U+0590-05FF, U+20AA; }
@font-face { font-family: "Rubik"; font-weight: 400; font-display: swap;
  src: url("fonts/rubik-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF; }
@font-face { font-family: "Rubik"; font-weight: 600; font-display: swap;
  src: url("fonts/rubik-600-hebrew.woff2") format("woff2"); unicode-range: U+0590-05FF, U+20AA; }
@font-face { font-family: "Rubik"; font-weight: 600; font-display: swap;
  src: url("fonts/rubik-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF; }
@font-face { font-family: "Rubik"; font-weight: 800; font-display: swap;
  src: url("fonts/rubik-800-hebrew.woff2") format("woff2"); unicode-range: U+0590-05FF, U+20AA; }
@font-face { font-family: "Rubik"; font-weight: 800; font-display: swap;
  src: url("fonts/rubik-800-latin.woff2") format("woff2"); unicode-range: U+0000-00FF; }

/* ---------- tokens ---------- */
:root {
  --sand: #f2e3c4;
  --sand-2: #e8d3a8;
  --paper: #faf1dc;
  --ink: #4a2f1d;
  --line: #6b4a2f;
  --teal: #5f9e94;
  --teal-deep: #3d7268;
  --gold: #e8a94e;
  --peach: #f0b98a;
  --coral: #e2603f;
  --night: #1d2733;
  --night-2: #141c26;
  --ai-cyan: #46e0e8;
  --ai-violet: #8b5cf6;
  --good: #4e9e5f;
  --shadow: 4px 4px 0 rgba(74, 47, 29, .55);
  --shadow-sm: 2px 2px 0 rgba(74, 47, 29, .5);
  --radius: 14px;
  --font-display: "Karantina", "Rubik", "Segoe UI", sans-serif;
  --font-body: "Rubik", "Segoe UI", "Arial Hebrew", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* themed scrolling */
* { scrollbar-width: thin; scrollbar-color: rgba(107,74,47,.55) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(107,74,47,.5); border-radius: 8px;
  border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(107,74,47,.8); background-clip: padding-box; }
.modal-body, #panel, #board, #screen-char { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--night);
  color: var(--ink);
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--ai-cyan); outline-offset: 2px; }
img { max-width: 100%; display: block; }
/* portraits: crop past each painting's own decorative frame so the game's
   CSS borders are the one coherent frame everywhere */
.port { object-fit: cover; }

.screen { position: fixed; inset: 0; display: none; }
.screen.on { display: flex; }

/* ============================================================
   TITLE SCREEN
   ============================================================ */
#screen-title {
  flex-direction: column; align-items: center; justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(20,28,38,0) 30%, rgba(20,28,38,.88) 78%),
    url("img/title_hero.jpg?v=5") center 20% / cover no-repeat,
    var(--night);
  padding: 4vh 20px 5vh;
  text-align: center;
}
.title-card { animation: rise .8s cubic-bezier(.2,.9,.3,1.2) both; }
.title-main {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(64px, 13vw, 150px);
  line-height: .85; color: var(--paper);
  text-shadow: 0 0 34px rgba(70,224,232,.45), 5px 5px 0 rgba(0,0,0,.55);
  letter-spacing: .01em;
}
.title-sub {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(26px, 4.6vw, 44px);
  color: var(--gold); margin-top: 6px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.6);
}
.title-tag {
  color: #cfe3df; font-size: clamp(14px, 2.2vw, 18px);
  margin: 14px auto 26px; max-width: 560px; line-height: 1.5;
  text-shadow: 1px 1px 0 rgba(0,0,0,.7);
}
.title-buttons { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; animation: rise 1s .25s cubic-bezier(.2,.9,.3,1.2) both; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-weight: 800; font-size: 17px;
  padding: 14px 28px; border-radius: var(--radius);
  background: var(--gold); color: var(--ink);
  border: 3px solid var(--line); box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 rgba(74,47,29,.55); filter: brightness(1.05); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 rgba(74,47,29,.55); }
.btn.secondary { background: var(--paper); }
.btn.ai {
  background: var(--night); color: var(--ai-cyan); border-color: var(--ai-cyan);
  box-shadow: 0 0 18px rgba(70,224,232,.35), var(--shadow);
}
.btn.small { padding: 8px 14px; font-size: 14px; border-width: 2px; box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ============================================================
   CHARACTER SELECT
   ============================================================ */
#screen-char {
  flex-direction: column; align-items: center;
  background:
    linear-gradient(180deg, rgba(29,39,51,.93), rgba(29,39,51,.97)),
    url("img/board_backdrop.jpg?v=5") center / cover no-repeat;
  overflow-y: auto; padding: 30px 16px 40px;
}
#screen-char h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 7vw, 64px); color: var(--paper);
  text-shadow: 3px 3px 0 rgba(0,0,0,.5); margin-bottom: 18px;
}
.char-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px; width: min(1150px, 100%);
}
.char-card {
  background: var(--paper); border: 3px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; text-align: right;
  transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
  animation: rise .5s both;
}
.char-card:nth-child(2) { animation-delay: .06s; } .char-card:nth-child(3) { animation-delay: .12s; }
.char-card:nth-child(4) { animation-delay: .18s; } .char-card:nth-child(5) { animation-delay: .24s; }
.char-card:nth-child(6) { animation-delay: .3s; }
.char-card:hover { transform: translateY(-5px) rotate(-.5deg); box-shadow: 7px 9px 0 rgba(0,0,0,.35); }
.char-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-bottom: 3px solid var(--line); }
.char-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.char-name { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1; }
.char-title { color: var(--teal-deep); font-weight: 600; font-size: 15px; margin-top: -4px; }
.char-desc { font-size: 14px; line-height: 1.45; }
.char-perk {
  font-size: 13px; line-height: 1.4; background: var(--sand);
  border: 2px dashed var(--line); border-radius: 9px; padding: 7px 9px;
}
.char-card .btn { margin-top: auto; }

/* ============================================================
   GAME SCREEN
   ============================================================ */
#screen-game { flex-direction: column; background: var(--night); }

/* ---------- HUD ---------- */
#hud {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--night-2);
  border-bottom: 3px solid var(--line);
  z-index: 5;
}
.hud-week {
  font-family: var(--font-display); font-weight: 700; font-size: 30px;
  color: var(--gold); line-height: 1; padding-inline-end: 6px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); border: 2px solid var(--line);
  border-radius: 999px; padding: 4px 12px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.chip b { font-weight: 800; }
.chip.alert { background: var(--coral); color: #fff; animation: pulse 1.2s infinite; }
.chip .bar { width: 52px; height: 9px; border-radius: 6px; background: var(--sand-2); border: 1px solid var(--line); overflow: hidden; }
.chip .bar i { display: block; height: 100%; background: var(--good); transition: width .4s; }
@keyframes pulse { 50% { transform: scale(1.06); } }
#hud .spacer { flex: 1; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 10px; font-size: 17px;
  background: var(--paper); border: 2px solid var(--line); box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- main layout ---------- */
#main { flex: 1; display: flex; gap: 12px; padding: 12px; min-height: 0; }

#board {
  flex: 1; position: relative; border-radius: 18px; border: 3px solid var(--line);
  /* quiet, flat ground plane: buildings are the stars (figure-ground, like the original Jones) */
  background: linear-gradient(180deg, #ddcda6 0%, #d3c197 45%, #d3c197 55%, #c9b689 100%);
  padding: 14px; overflow-y: auto;
  box-shadow: inset 0 0 46px rgba(74, 47, 29, .22);
}
.loc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}
.loc-card {
  position: relative; text-align: right;
  background: linear-gradient(180deg, var(--paper), var(--sand));
  border: 3px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 12px 10px;
  transition: transform .13s, box-shadow .13s;
  min-height: 96px; display: flex; flex-direction: column; gap: 3px;
}
.loc-card:hover { transform: translate(-2px,-3px) rotate(-.4deg); box-shadow: 6px 7px 0 rgba(0,0,0,.4); }
.loc-card:active { transform: translate(1px,1px); }
.loc-icon { font-size: 30px; line-height: 1; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.15)); }
.loc-name { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.05; }
.loc-sub { font-size: 12px; color: #6d5138; line-height: 1.3; }
.loc-here {
  position: absolute; top: -12px; inset-inline-start: 10px;
  background: var(--coral); color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px; border: 2px solid var(--line);
  transform: rotate(-3deg);
}
.loc-badge {
  position: absolute; top: -10px; inset-inline-end: 10px;
  background: var(--night); color: var(--ai-cyan); font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; border: 2px solid var(--ai-cyan);
  box-shadow: 0 0 10px rgba(70,224,232,.5);
}
.loc-cost { margin-top: auto; font-size: 12px; font-weight: 600; color: var(--teal-deep); }

/* ---------- side panel ---------- */
#panel {
  width: 308px; display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; flex-shrink: 0;
}
.panel-box {
  background: var(--paper); border: 3px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px;
}
.panel-box h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1;
  margin-bottom: 8px;
}
/* goals: full label + target on top, chunky bar below - readable at a glance */
.goals-hint { font-size: 11.5px; color: #7a5c3e; line-height: 1.4; margin: -3px 0 9px; }
.goal2 { margin-bottom: 10px; }
.goal2:last-of-type { margin-bottom: 0; }
.g2-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.g2-label { min-width: 0; }
.g2-val { flex-shrink: 0; font-size: 11px; color: #7a5c3e; font-weight: 700; white-space: nowrap; }
.g2-bar { height: 13px; background: var(--sand-2); border: 2px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 3px; }
.g2-bar i { display: block; height: 100%; background: var(--teal); transition: width .5s; }
.goal2.done .g2-bar i { background: var(--good); }
.goal2.done .g2-label, .goal2.done .g2-val { color: var(--good); }

/* personal character goal card */
.chargoal {
  background: var(--sand); border: 2px dashed var(--line); border-radius: 10px;
  padding: 7px 10px; margin-top: 4px; font-size: 12.5px; line-height: 1.45;
}
.chargoal.done { background: #d4e8d0; border-style: solid; }
.chargoal .cg-top { font-weight: 800; font-size: 13px; }
.chargoal .cg-done { color: var(--good); font-weight: 800; font-size: 11px; }
.chargoal .cg-sub { color: #6d5138; margin-top: 2px; }
.chargoal.done .cg-sub { color: #3f6d47; }
.char-goal {
  font-size: 12.5px; font-weight: 600; color: var(--teal-deep); line-height: 1.35;
}

/* Jones panel - AI aesthetics */
.panel-box.jones {
  background: var(--night); color: #d9e6ea; border-color: var(--ai-cyan);
  box-shadow: 0 0 22px rgba(70,224,232,.28), var(--shadow);
}
.panel-box.jones h3 { color: var(--ai-cyan); }
.jones-row { display: flex; gap: 10px; align-items: center; }
.jones-row img {
  width: 62px; height: 62px; border-radius: 12px; border: 2px solid var(--ai-cyan);
  box-shadow: 0 0 12px rgba(70,224,232,.55);
}
.jones-info { flex: 1; min-width: 0; }
.jbar { height: 16px; background: #0c1218; border: 2px solid var(--ai-cyan); border-radius: 9px; overflow: hidden; }
.jbar i {
  display: block; height: 100%; transition: width .8s;
  background: repeating-linear-gradient(45deg, var(--ai-violet) 0 8px, var(--ai-cyan) 8px 16px);
  animation: jshift 2.2s linear infinite; background-size: 200% 100%;
}
@keyframes jshift { to { background-position: 32px 0; } }
.jones-mood { font-size: 12px; color: #9fd8dc; line-height: 1.45; margin-top: 7px; min-height: 34px; }
.jones-pct { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--ai-cyan); }

.rumor-line { font-size: 12px; background: var(--sand); border: 2px dashed var(--line); border-radius: 8px; padding: 6px 8px; margin-top: 8px; line-height: 1.4; color: var(--ink); }

.job-line { font-size: 13px; line-height: 1.5; }
.job-line b { font-size: 15px; }

/* ---------- ticker ---------- */
#ticker {
  display: flex; align-items: center; background: var(--night-2);
  border-top: 3px solid var(--line); height: 40px; overflow: hidden; z-index: 5;
}
#ticker .label {
  flex-shrink: 0; background: var(--coral); color: #fff; font-weight: 800; font-size: 13px;
  padding: 4px 14px; margin-inline-start: 10px; border-radius: 7px; border: 2px solid var(--line);
  transform: rotate(-1deg);
}
.ticker-view { flex: 1; overflow: hidden; position: relative; height: 100%; }
.ticker-track {
  position: absolute; white-space: nowrap; display: flex; gap: 60px;
  align-items: center; height: 100%; padding-inline-end: 60px;
  color: var(--ai-cyan); font-size: 14px; font-weight: 600;
  animation: tick 40s linear infinite;
}
/* content is rendered twice; moving right by half the track = one copy → seamless loop */
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(50%); } }
#endweek-btn {
  flex-shrink: 0; margin-inline-end: 10px;
}

/* ---------- modal ---------- */
#modal-root { position: fixed; inset: 0; z-index: 40; display: none; }
#modal-root.on { display: block; }
.modal-back {
  position: absolute; inset: 0; background: rgba(12,17,23,.66);
  backdrop-filter: blur(3px); animation: fadein .2s both;
}
@keyframes fadein { from { opacity: 0; } }
.modal {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: min(560px, calc(100vw - 28px)); max-height: min(86vh, 720px);
  background: var(--paper); border: 3px solid var(--line); border-radius: 18px;
  box-shadow: 8px 10px 0 rgba(0,0,0,.45);
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop .28s cubic-bezier(.2,1.1,.3,1.15) both;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%,-46%) scale(.92); } }
.modal-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px;
  border-bottom: 3px solid var(--line); background: var(--sand);
}
.modal-head .micon { font-size: 30px; }
.modal-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1; flex: 1; }
.modal-head .x { font-size: 20px; font-weight: 800; width: 34px; height: 34px; border-radius: 9px;
  background: var(--paper); border: 2px solid var(--line); box-shadow: var(--shadow-sm); }
/* remaining hours + cash, always visible inside a location */
.mstatus {
  flex-shrink: 0; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  background: var(--paper); border: 2px solid var(--line); border-radius: 999px;
  padding: 4px 11px; box-shadow: var(--shadow-sm);
}
.mstatus b { font-weight: 800; }
.modal-body { padding: 14px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.modal.ai-modal { background: var(--night); color: #d9e6ea; border-color: var(--ai-cyan); }
.modal.ai-modal .modal-head { background: var(--night-2); border-color: var(--ai-cyan); }
.modal.ai-modal .modal-head h2 { color: var(--ai-cyan); }

.action-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff8e8; border: 2px solid var(--line); border-radius: 12px;
  padding: 10px 12px; box-shadow: var(--shadow-sm);
  text-align: right; width: 100%;
  transition: transform .1s, background .1s;
}
.action-row:hover:not(:disabled) { background: var(--sand); transform: translateX(-2px); }
.action-row:disabled { opacity: .5; }
.action-row .aicon { font-size: 24px; flex-shrink: 0; }
.action-row .atext { flex: 1; min-width: 0; }
.action-row .atitle { font-weight: 800; font-size: 15px; }
.action-row .asub { font-size: 12.5px; color: #74573b; line-height: 1.35; }
.action-row .acost { flex-shrink: 0; text-align: left; font-size: 12px; font-weight: 700; color: var(--teal-deep); white-space: nowrap; }

.joblist { display: flex; flex-direction: column; gap: 10px; }
/* career track picker (step 1 in the job office) */
.action-row.track-row { padding: 13px 14px; }
.action-row.track-row .aicon { font-size: 32px; }
.action-row.track-row .atitle { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1; }
.action-row.back-row { background: var(--sand-2); padding: 7px 12px; }
.action-row.automated-row { opacity: .6; }
.action-row.automated-row .atitle { text-decoration: line-through; }
.action-row.automated-row .acost { color: var(--ai-violet); font-weight: 800; }
.action-row.back-row .atitle { font-size: 13.5px; }
.track-title {
  font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1;
  padding: 2px 2px 0;
}
.track-exp {
  font-size: 12.5px; color: #74573b; line-height: 1.4;
  background: var(--sand); border: 2px dashed var(--line); border-radius: 9px;
  padding: 6px 9px;
}
.joblist .action-row { flex-wrap: wrap; }
.risk-tag { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 8px; border: 2px solid var(--line); background: var(--sand-2); white-space: nowrap; display: inline-block; }
.risk-3 { background: var(--ai-violet); color: #fff; border-color: var(--ai-violet); animation: pulse 1.6s infinite; }
.risk-2 { background: var(--coral); color: #fff; }
.risk-0 { background: var(--good); color: #fff; }
.missing { font-size: 12px; color: var(--coral); font-weight: 700; }

.event-text { font-size: 16px; line-height: 1.65; }
.event-fx { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-chip { font-size: 13px; font-weight: 700; background: var(--sand); border: 2px solid var(--line); border-radius: 999px; padding: 3px 11px; }
.fx-chip.bad { background: #f7d5c9; }
.fx-chip.good { background: #d4e8d0; }

.report-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; padding: 7px 4px; border-bottom: 1px dashed var(--line); }
.report-line:last-child { border-bottom: none; }
.report-line .v { font-weight: 800; white-space: nowrap; }

.alarm {
  background: var(--night); color: var(--ai-cyan); border: 2px solid var(--ai-cyan);
  border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5;
  box-shadow: 0 0 16px rgba(70,224,232,.35);
  animation: alarmflash .9s ease-in-out 3;
}
@keyframes alarmflash { 50% { box-shadow: 0 0 30px rgba(139,92,246,.8); } }

/* jones overlay */
#jones-overlay {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(12,17,23,.9); align-items: center; justify-content: center;
  flex-direction: column; gap: 18px; text-align: center; padding: 20px;
}
#jones-overlay.on { display: flex; }
#jones-overlay img {
  width: 130px; height: 130px; border-radius: 20px; border: 3px solid var(--ai-cyan);
  box-shadow: 0 0 40px rgba(70,224,232,.6);
  animation: joneswork .5s ease-in-out infinite alternate;
}
@keyframes joneswork { from { transform: rotate(-3deg) scale(1); } to { transform: rotate(3deg) scale(1.05); } }
#jones-overlay .jline { color: var(--ai-cyan); font-size: 18px; font-weight: 600; max-width: 480px; line-height: 1.5; }
#jones-overlay .jnews {
  color: var(--gold); font-size: 20px; font-weight: 800; max-width: 540px; line-height: 1.5;
  text-shadow: 0 0 18px rgba(232,169,78,.4);
}
#jones-overlay .jkicker {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  color: #7fa6ab; border: 1px solid rgba(127,166,171,.5); border-radius: 999px;
  padding: 3px 12px; margin-bottom: -6px;
}
#jones-overlay .jkicker.news {
  color: var(--gold); border-color: rgba(232,169,78,.65);
  box-shadow: 0 0 14px rgba(232,169,78,.25);
}
.jones-last {
  font-size: 11.5px; color: #e8cf9a; line-height: 1.45; margin-top: 7px;
  border-top: 1px dashed rgba(70,224,232,.35); padding-top: 6px;
}
.jprogress { width: min(340px, 80vw); height: 10px; background: #0c1218; border: 2px solid var(--ai-cyan); border-radius: 6px; overflow: hidden; }
.jprogress i { display: block; height: 100%; width: 0; background: var(--ai-cyan); animation: jfill 3.3s linear forwards; }
@keyframes jfill { to { width: 100%; } }
#jones-overlay { cursor: pointer; }
#jones-overlay .jskip { color: #7fa6ab; font-size: 13px; opacity: .8; }

/* toast */
#toast-root { position: fixed; bottom: 56px; left: 50%; transform: translateX(-50%); z-index: 80;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--night); color: var(--paper); font-size: 14.5px; font-weight: 600;
  border: 2px solid var(--gold); border-radius: 12px; padding: 10px 18px;
  box-shadow: var(--shadow); max-width: min(480px, 90vw); text-align: center; line-height: 1.45;
  animation: toastin .25s cubic-bezier(.2,1.2,.3,1.1) both, toastout .3s ease-in 5.1s both;
}
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(.94); } }
@keyframes toastout { to { opacity: 0; transform: translateY(8px); } }

/* ending / intro art: capped height so buttons never fall below the fold */
.ending-art {
  width: 100%; max-height: 30vh; object-fit: cover; object-position: center 25%;
  border-radius: 12px; border: 3px solid var(--line);
}
.ending-text { font-size: 16px; line-height: 1.7; }
.ending-stats { display: flex; flex-wrap: wrap; gap: 6px; }

/* tutorial hint */
.hint {
  background: var(--gold); border: 2px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm); padding: 9px 13px; font-size: 13.5px; font-weight: 600;
  line-height: 1.45; margin-bottom: 10px; transform: rotate(-.6deg);
}

/* dev overlay */
#dev { position: fixed; top: 6px; left: 6px; z-index: 99; background: rgba(0,0,0,.85); color: #0f0;
  font: 11px monospace; padding: 8px; border-radius: 8px; display: none; max-width: 300px; direction: ltr; }

/* ============================================================
   CITY MAP - the Ayalon strip
   ============================================================ */
#map { position: absolute; inset: 0; }
#board { overflow: hidden; }

.road {
  position: absolute; left: 0; right: 0; top: 41%; height: 18%;
  background: linear-gradient(180deg, #343943, #3f444d 30%, #3f444d 70%, #343943);
  border-top: 4px solid #8a7b5c; border-bottom: 4px solid #8a7b5c;
  overflow: hidden;
}
/* sidewalks: light bands with subtle tile joints, connecting buildings to the road */
.walk {
  position: absolute; left: 0; right: 0; height: 5%;
  background:
    repeating-linear-gradient(90deg, rgba(107,74,47,.10) 0 2px, transparent 2px 46px),
    #e6d8b2;
  pointer-events: none;
}
.walk.top { top: 36%; box-shadow: inset 0 -3px 0 rgba(107,74,47,.18); }
.walk.bottom { top: 59%; box-shadow: inset 0 3px 0 rgba(107,74,47,.18); }
.lane-divider {
  position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px;
  background: repeating-linear-gradient(90deg, #e8d5ad 0 26px, transparent 26px 52px);
  opacity: .8;
}
/* wolt courier: scooter with the teal delivery cube on the back */
.car.wolt { display: inline-flex; align-items: center; }
.wolt-box {
  width: 11px; height: 11px; border-radius: 3px;
  background: #00c2e8; border: 1.5px solid #075985;
  margin-inline-end: -4px; margin-top: -10px;
  box-shadow: 1px 2px 2px rgba(0,0,0,.3);
}
/* emoji vehicles face LEFT in Windows fonts: flip the left-to-right lane */
.car { position: absolute; font-size: 22px; filter: drop-shadow(2px 3px 2px rgba(0,0,0,.4)); will-change: transform; }
.car.dir0 { animation: drive0 9s linear infinite; transform: scaleX(-1); }
.car.dir1 { animation: drive1 9s linear infinite; }
@keyframes drive0 { from { left: -6%; } to { left: 104%; } }
@keyframes drive1 { from { left: 104%; } to { left: -6%; } }
.road.jammed .car { animation-duration: 30s !important; }
.jam-row {
  position: absolute; bottom: 6%; left: 0; right: 0; text-align: center;
  font-size: 18px; letter-spacing: 4px; opacity: .95;
  animation: jamcreep 14s linear infinite;
}
@keyframes jamcreep { from { transform: translateX(0); } to { transform: translateX(-40px); } }

/* buildings - painted facades */
.bld {
  position: absolute; width: 17%; height: 33%;
  top: 3%;
  background: var(--sand);
  border: 3px solid var(--line); border-radius: 10px;
  /* grounded diorama shadow */
  box-shadow: 0 12px 16px -8px rgba(60, 40, 20, .5), var(--shadow);
  padding: 0; text-align: center;
  transition: transform .13s, box-shadow .13s;
  overflow: hidden;
}
.bld.bottom { top: auto; bottom: 3%; }
.bld:hover { transform: translateY(-3px) scale(1.02); box-shadow: 6px 7px 0 rgba(0,0,0,.4); z-index: 3; }
.bld:hover .bld-art { transform: scale(1.07); }
.bld-art {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .35s ease;
}
.bld-sign {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(250,241,220,.94); border-top: 2px solid var(--line);
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(14px, 1.5vw, 21px); line-height: 1.05;
  padding: 3px 5px 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
}
.bld-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* always-visible travel-time chip: how long it takes to get there */
.bld-time {
  flex-shrink: 0; font-family: var(--font-body); font-weight: 700;
  font-size: 10.5px; line-height: 1; color: var(--teal-deep);
  background: var(--sand-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 7px; white-space: nowrap;
}
.bld-time.here { background: var(--gold); }
.bld-time.jam { background: #f7d5c9; color: var(--coral); }
.bld-key {
  position: absolute; top: 4px; inset-inline-start: 4px;
  background: rgba(29,39,51,.72); color: var(--gold); font-weight: 800; font-size: 10px;
  width: 17px; height: 17px; border-radius: 50%; border: 1px solid rgba(232,169,78,.7);
  display: flex; align-items: center; justify-content: center; z-index: 2;
  transition: opacity .15s; opacity: .8;
}
.bld:hover .bld-key { opacity: 1; }
.bld-badge {
  position: absolute; top: 5px; inset-inline-end: 5px;
  background: var(--coral); color: #fff; font-size: 11px; font-weight: 800;
  padding: 2px 9px; border-radius: 999px; border: 2px solid var(--line);
  transform: rotate(2deg); z-index: 2;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
}
.bld-badge.ai {
  background: var(--night); color: var(--ai-cyan); border-color: var(--ai-cyan);
  box-shadow: 0 0 10px rgba(70,224,232,.5);
}
.bld.here { outline: 3px solid var(--gold); outline-offset: 2px; }
.bld.suggested { animation: suggest 1.6s ease-in-out infinite; }
.loc-card.suggested { animation: suggest 1.6s ease-in-out infinite; }
@keyframes suggest {
  0%, 100% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 0 0 4px var(--gold), 6px 7px 0 rgba(0,0,0,.4); }
}

/* tokens */
.token {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; border: 3px solid var(--gold);
  box-shadow: 3px 3px 0 rgba(0,0,0,.45), 0 0 0 3px rgba(0,0,0,.2);
  overflow: hidden; z-index: 6; pointer-events: none;
  background: var(--paper);
}
.token img { width: 100%; height: 100%; object-fit: cover; }
.token.walking { animation: walkbob .35s ease-in-out infinite; }
@keyframes walkbob { 0%,100% { margin-top: -22px; } 50% { margin-top: -27px; } }
.jones-tok {
  border-color: var(--ai-cyan);
  box-shadow: 0 0 16px rgba(70,224,232,.8), 3px 3px 0 rgba(0,0,0,.45);
  top: 47%; left: -8%; opacity: 0;
}
.jones-tok.lapping { animation: joneslap 1.2s cubic-bezier(.5,0,.8,1) forwards; }
@keyframes joneslap {
  0% { left: -8%; opacity: 0; transform: rotate(0); }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 108%; opacity: 0; transform: rotate(360deg); }
}

/* ---------- coach bar ---------- */
#coach {
  display: flex; align-items: center; gap: 10px;
  background: var(--gold); border-bottom: 3px solid var(--line);
  padding: 6px 14px; font-size: 14px; font-weight: 600; line-height: 1.35;
  z-index: 5; min-height: 34px;
}
.coach-label {
  flex-shrink: 0; background: var(--night); color: var(--gold);
  font-weight: 800; font-size: 12.5px; padding: 3px 11px; border-radius: 999px;
  border: 2px solid var(--line);
}

/* ---------- paper-doll character card ---------- */
.charcard { padding: 10px; }
.cc-row { display: flex; gap: 10px; align-items: center; }
.cc-img {
  width: 84px; height: 84px; border-radius: 14px; border: 3px solid var(--line);
  object-fit: cover; box-shadow: var(--shadow-sm);
  transition: transform .3s;
}
.cc-img:hover { transform: scale(1.06) rotate(-2deg); }
.cc-info { flex: 1; min-width: 0; }
.cc-name { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; }
.cc-line { font-size: 12.5px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.charcard .job-line { margin-top: 6px; border-top: 2px dashed var(--line); padding-top: 6px; font-size: 12px; }
.hud-avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--gold);
  object-fit: cover; box-shadow: var(--shadow-sm);
}

/* ---------- fridge ---------- */
.fridge {
  background: linear-gradient(180deg, #eef3f4, #d8e2e4);
  border: 3px solid var(--line); border-radius: 12px; padding: 8px 12px;
  box-shadow: var(--shadow-sm);
}
.fridge-title { font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.fridge-items { font-size: 24px; letter-spacing: 6px; min-height: 32px; }
.fridge-items span { display: inline-block; animation: rise .4s both; }

/* ---------- modal scene strip + art banner ---------- */
.mtitle { flex: 1; min-width: 0; }
.scene-strip { font-size: 15px; letter-spacing: 5px; opacity: .85; margin-top: 2px; }
.modal-art {
  width: 100%; height: clamp(140px, 26vh, 220px);
  object-fit: cover; object-position: center 35%;
  border-bottom: 3px solid var(--line); flex-shrink: 0;
}
.apt-thumb {
  width: 78px; height: 58px; object-fit: cover; border-radius: 8px;
  border: 2px solid var(--line); flex-shrink: 0; box-shadow: var(--shadow-sm);
}

/* ---------- floaters ---------- */
.floater {
  position: fixed; z-index: 90; transform: translateX(-50%);
  font-weight: 800; font-size: 15px; pointer-events: none;
  text-shadow: 1px 1px 0 rgba(0,0,0,.3);
  animation: floatup 1.3s ease-out forwards;
}
.floater.good { color: #7ee08a; }
.floater.bad { color: #ff9878; }
@keyframes floatup {
  0% { opacity: 0; margin-top: 0; }
  15% { opacity: 1; }
  100% { opacity: 0; margin-top: -34px; }
}

/* ---------- work shift animation ---------- */
.work-ov {
  position: fixed; inset: 0; z-index: 70; display: flex;
  align-items: center; justify-content: center;
  background: rgba(12,17,23,.45); backdrop-filter: blur(2px);
}
.work-card {
  background: var(--paper); border: 3px solid var(--line); border-radius: 16px;
  box-shadow: 8px 10px 0 rgba(0,0,0,.45); padding: 18px 26px; text-align: center;
  display: flex; flex-direction: column; gap: 10px; min-width: 260px;
  animation: pop .25s both;
}
.work-scene { font-size: 34px; letter-spacing: 10px; animation: workjig .4s ease-in-out infinite alternate; }
@keyframes workjig { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
.work-line { font-weight: 700; font-size: 15px; min-height: 22px; }
.work-bar { height: 12px; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--sand-2); }
.work-bar i { display: block; height: 100%; background: var(--teal); width: 0; animation: workfill 1.95s linear forwards; }
@keyframes workfill { to { width: 100%; } }

/* ---------- responsive ---------- */
@media (min-width: 861px) {
  .loc-grid { display: none; }
}
@media (max-width: 860px) {
  #map { display: none; }
  #main { flex-direction: column; overflow-y: auto; }
  #board { overflow-y: visible; flex: none; }
  #panel { width: 100%; flex-direction: row; flex-wrap: wrap; }
  #panel .panel-box { flex: 1 1 260px; }
  .loc-grid { grid-template-columns: repeat(2, 1fr); }
  .loc-name { font-size: 20px; }
  #hud { padding: 6px 8px; gap: 5px; }
  .chip { font-size: 12px; padding: 3px 9px; }
  .hud-week { font-size: 24px; }
  .ticker-track { animation-duration: 26s; }
}
@media (max-width: 400px) {
  .loc-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .btn { padding: 12px 18px; font-size: 15px; }
}
