/* ============================================================
   NEON SYNDICATE — style.css
   ============================================================ */

/* ── Z-INDEX SCALE ───────────────────────────────────────────
   All z-index values derive from these named layers.
   Never use raw numbers outside this block.
   ──────────────────────────────────────────────────────────── */
:root {
  --z-bg:          0;
  --z-root:        1;
  --z-content:     10;
  --z-hud:         100;
  --z-fab:         200;
  --z-overlay:     500;
  --z-event:       600;
  --z-police:      700;
  --z-tip:         800;
  --z-scanline:    900;
  --z-glitch:      901;
  --z-toast:       950;
  --z-music:       960;
  --z-controls:    970;
  --z-modal-hi:    980;
  --z-splash:      999;
}

/* ── COLOUR PALETTE ──────────────────────────────────────────*/
:root {
  /* Core — deep midnight base */
  --blk:     #020208;
  --deep:    #06061a;
  --surface: #0b0b20;
  --card:    #0f0f28;
  --card2:   #131332;
  --border:  #181840;
  --border2: #222255;

  /* Neon accents */
  --mg:   #ff1f5e;  --mg2:  #ff5585;
  --cyan: #00e8ff;  --cyan2:#70f5ff;
  --grn:  #00f57a;  --grn2: #70ffb8;
  --yel:  #ffd900;
  --pur:  #8b1fff;  --pur2: #b85eff;
  --org:  #ff5c00;
  --red:  #ff1040;
  --blue: #2850ff;

  /* Text hierarchy */
  --dim:  #606090;  --dim2: #9898c8;
  --txt:  #dde6ff;  --txt2: #aabbdd;

  /* Fonts */
  --mono: 'VT323', monospace;
  --head: 'Press Start 2P', monospace;
  --body: 'VT323', monospace;
  --disp: 'Press Start 2P', monospace;
}

/* ── RESET ───────────────────────────────────────────────────*/
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--blk);
  overflow: hidden;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ──────────────────────────────────────────────────*/
#bg {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
}

#root {
  position: relative;
  z-index: var(--z-root);
  width: 100%;
  height: 100%;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Scanlines + grain */
#root::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,.05) 3px, rgba(0,0,0,.05) 4px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: var(--z-scanline);
}

/* Vignette */
#root::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 90% 95% at 50% 50%, transparent 50%, rgba(0,0,0,.75) 100%);
  pointer-events: none;
  z-index: var(--z-scanline);
}

/* ── SCREENS ─────────────────────────────────────────────────*/
.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
.screen.active { display: flex; }

/* ── SPLASH SCREEN ───────────────────────────────────────────*/
#scr-splash {
  position: fixed;
  inset: 0;
  z-index: var(--z-splash);
  background: #020208;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#scr-splash.fade-out {
  animation: splashOut .7s ease forwards;
  pointer-events: none;
}
@keyframes splashOut {
  0%   { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
.splash-logo {
  animation: splashIn 1.8s ease forwards;
  opacity: 0;
}
@keyframes splashIn {
  0%   { opacity: 0; transform: scale(.92); }
  60%  { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}
.splash-tap {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  letter-spacing: 3px;
  position: absolute;
  bottom: 52px;
  opacity: 0;
  animation: splashTap 1s ease 2.2s forwards, tapBlink 2s ease-in-out 3.2s infinite;
}
@keyframes splashTap {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes tapBlink {
  0%, 100% { opacity: .9; }
  50%       { opacity: .35; }
}
.splash-ver {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 2px;
  position: absolute;
  bottom: 28px;
  opacity: 0;
  animation: splashTap .8s ease 2.4s forwards;
}

/* ── TITLE SCREEN ────────────────────────────────────────────*/
#scr-title {
  align-items: center;
  justify-content: center;
  background: #020208;
  overflow: hidden;
}
.t-grid {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50%;
  background-image:
    linear-gradient(rgba(0,232,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,232,255,.045) 1px, transparent 1px);
  background-size: 36px 36px;
  transform: perspective(400px) rotateX(50deg);
  transform-origin: 50% 100%;
  animation: gridDrift 18s linear infinite;
  opacity: .6;
}
@keyframes gridDrift { from { background-position: 0 0 } to { background-position: 0 -72px } }

.t-underglow {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 45%;
  background: radial-gradient(ellipse 85% 55% at 50% 100%,
    rgba(139,31,255,.15) 0%, rgba(255,31,94,.08) 40%, transparent 70%);
  pointer-events: none;
  animation: underGlow 5s ease-in-out infinite;
}
@keyframes underGlow { 0%, 100% { opacity: .8 } 50% { opacity: 1; } }

.t-scanline {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,232,255,.25), rgba(0,232,255,.5), rgba(0,232,255,.25), transparent);
  top: -2px;
  animation: scanSweep 6s linear infinite;
  pointer-events: none;
}
@keyframes scanSweep {
  0%   { top: -2px; opacity: 0 }
  5%   { opacity: 1 }
  95%  { opacity: .5 }
  100% { top: 100%; opacity: 0 }
}

.t-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.t-particles span {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  animation: particleFly linear infinite;
  opacity: 0;
}
@keyframes particleFly {
  0%   { opacity: 0; transform: translateY(100vh) translateX(0) }
  10%  { opacity: .7 }
  90%  { opacity: .3 }
  100% { opacity: 0; transform: translateY(-10vh) translateX(var(--dx, 0px)) }
}

.t-logo {
  position: relative;
  z-index: var(--z-content);
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 20px;
  gap: 0;
}
.t-svg-wrap {
  width: 100%;
  max-width: 300px;
  margin-bottom: 18px;
  animation: logoIn .7s cubic-bezier(.2,1.1,.4,1) .3s both;
  filter: url(#sketch2);
}
@keyframes logoIn { from { opacity: 0; transform: scale(.9) translateY(12px) } to { opacity: 1; transform: none } }

.t-tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim2);
  letter-spacing: 3px;
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.8;
  animation: fi .6s ease 1.1s both;
}
@keyframes fi { from { opacity: 0 } to { opacity: 1 } }

.t-btn {
  position: relative;
  overflow: hidden;
  background: rgba(0,0,0,.7);
  border: 1px solid var(--mg);
  color: var(--mg);
  font-family: var(--head);
  font-size: 8px;
  letter-spacing: 3px;
  padding: 14px 38px;
  cursor: pointer;
  animation: fi .6s ease 1.4s both;
  transition: all .2s;
  box-shadow: 0 0 18px rgba(255,31,94,.14);
  margin-bottom: 20px;
  filter: url(#sketch);
}
.t-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,31,94,.2), rgba(139,31,255,.2));
  opacity: 0;
  transition: opacity .2s;
}
.t-btn::after {
  content: '';
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mg), transparent);
  opacity: .8;
}
.t-btn:active::before { opacity: 1; }
.t-btn:active { transform: scale(.96); }
.t-btn span { position: relative; z-index: 1; }

.t-credits {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  animation: fi 1s ease 1.8s both;
  padding-bottom: 8px;
}
.t-cred-by {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 2px;
  margin-top: 6px;
}
.t-cred-name {
  font-family: var(--head);
  font-size: 7px;
  color: var(--mg);
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(255,31,94,.4);
  line-height: 2;
}
.t-cred-pub {
  font-family: var(--head);
  font-size: 7px;
  color: var(--cyan);
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0,232,255,.4);
  line-height: 2;
}
.t-zdlogo {
  margin-top: 8px;
  animation: zdPulse 4s ease-in-out infinite;
}
@keyframes zdPulse {
  0%, 100% { opacity: .75 }
  50% { opacity: 1; filter: drop-shadow(0 0 8px rgba(0,232,255,.35)); }
}
.t-ver { display: none; }

/* Title stats */
.title-stats-wrap {
  width: 100%;
  margin-top: 10px;
  animation: fi .6s ease 1.6s both;
}
.tstat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
}
.tstat {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border2);
  padding: 8px 4px;
  text-align: center;
  filter: url(#sketch);
}
.tstat-v {
  font-family: var(--head);
  font-size: 9px;
  color: var(--cyan);
  line-height: 1.6;
}
.tstat-l {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  margin-top: 1px;
}

/* Reset save button */
#reset-save-btn {
  margin-top: 8px;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.08);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  animation: fi .6s ease 1.8s both;
}

/* ── TITLE TABS ──────────────────────────────────────────────*/
.t-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  overflow: hidden;
  animation: fi .5s ease .2s both;
  filter: url(#sketch);
}
.t-tab-btn {
  flex: 1;
  padding: 10px 6px;
  font-family: var(--head);
  font-size: 7px;
  letter-spacing: 1px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--dim2);
  transition: all .15s;
  position: relative;
}
.t-tab-btn.active {
  color: var(--cyan);
  background: rgba(0,232,255,.06);
}
.t-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}
.t-tab-btn:active { opacity: .7; }
.t-panel { display: none; width: 100%; flex-direction: column; align-items: center; }
.t-panel.active { display: flex; }

/* ── HOW TO PLAY ─────────────────────────────────────────────*/
.htp-wrap {
  width: 100%;
  max-width: 400px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  animation: fi .3s ease both;
}
.htp-card {
  background: linear-gradient(160deg, rgba(15,15,40,.95), rgba(10,10,28,.98));
  border: 1px solid var(--border2);
  border-left: 3px solid var(--cyan);
  padding: 16px 16px 14px;
  margin-bottom: 12px;
  position: relative;
  filter: url(#sketch);
  box-shadow: 2px 2px 0 rgba(0,0,0,.5);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}
.htp-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--pur), transparent);
  opacity: .7;
}
.htp-section {
  font-family: var(--head);
  font-size: 7px;
  letter-spacing: 2px;
  color: var(--cyan);
  margin-bottom: 10px;
  line-height: 1.8;
  text-shadow: 0 0 8px rgba(0,232,255,.4);
}
.htp-body {
  font-family: var(--body);
  font-size: 15px;
  color: var(--txt2);
  line-height: 1.55;
  flex: 1;
}
.htp-body b  { color: var(--txt); font-weight: 700; }
.htp-body .hl  { color: var(--cyan); }
.htp-body .hlm { color: var(--mg); }
.htp-body .hly { color: var(--yel); }
.htp-body .hlg { color: var(--grn); }
.htp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.htp-nav-btn {
  width: 44px; height: 36px;
  background: var(--card);
  border: 1px solid var(--border2);
  color: var(--txt2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
  filter: url(#sketch);
  flex-shrink: 0;
}
.htp-nav-btn:active   { background: var(--border2); color: var(--cyan); }
.htp-nav-btn:disabled { opacity: .25; cursor: not-allowed; }
.htp-counter {
  font-family: var(--head);
  font-size: 7px;
  color: var(--dim2);
  letter-spacing: 1px;
  text-align: center;
  flex: 1;
}
.htp-counter span { color: var(--cyan); }

/* ── AUDIO / MUSIC BUTTONS ───────────────────────────────────*/
#abtn, #music-btn {
  position: fixed;
  top: 10px;
  z-index: var(--z-controls);
  width: 34px; height: 34px;
  background: rgba(6,6,26,.9);
  border: 1px solid var(--border2);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
#abtn      { right: 10px; color: var(--cyan); }
#music-btn {
  right: 52px;
  color: var(--mg);
  width: 38px; height: 38px;
  background: rgba(10,10,30,.85);
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
  filter: url(#sketch);
}
#abtn:active, #music-btn:active { background: var(--border2); }
#abtn.off { color: var(--dim); }
#music-btn.playing { color: var(--grn); animation: mp-pulse 1.5s ease-in-out infinite; }
@keyframes mp-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .6 } }

/* ── HUD ─────────────────────────────────────────────────────*/
#hud {
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-hud);
  background: linear-gradient(180deg, rgba(2,2,8,.99), rgba(6,6,26,.97));
  border-bottom: 1px solid var(--border2);
  padding: 9px 14px 7px;
  box-shadow: 0 2px 20px rgba(0,0,0,.6), inset 0 -1px 0 rgba(0,232,255,.08);
}
#hud::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pur), var(--mg), var(--cyan), var(--mg), var(--pur));
  background-size: 300% 100%;
  animation: hudStripe 8s ease-in-out infinite;
  opacity: .6;
}
@keyframes hudStripe {
  0%, 100% { background-position: 0% 50% }
  50%       { background-position: 100% 50% }
}
.hr1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.hud-center { text-align: center; }
.hud-right  { text-align: right; }
.hlbl {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--dim2);
  margin-bottom: 1px;
}
.hcash {
  font-family: var(--disp);
  font-size: 15px;
  color: var(--grn);
  text-shadow: 0 0 10px rgba(0,245,122,.5);
  line-height: 1.3;
  filter: url(#inkbleed);
  animation: cashGlow 5s ease-in-out infinite;
}
@keyframes cashGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(0,245,122,.5) }
  50%       { text-shadow: 0 0 18px rgba(0,245,122,.85), 0 0 32px rgba(0,245,122,.25) }
}
.hdist {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--yel);
  text-shadow: 0 0 8px rgba(255,217,0,.4);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  line-height: 1.4;
  animation: distPulse 7s ease-in-out infinite;
}
@keyframes distPulse {
  0%, 100% { text-shadow: 0 0 6px rgba(255,217,0,.3) }
  50%       { text-shadow: 0 0 12px rgba(255,217,0,.7), 0 0 24px rgba(255,217,0,.2) }
}
.hday {
  font-family: var(--disp);
  font-size: 13px;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0,232,255,.5);
  line-height: 1.3;
  text-align: right;
}
.hday-hidden { visibility: hidden; }
.hr2  { display: flex; align-items: center; gap: 8px; }
.hbg  { display: flex; align-items: center; gap: 4px; flex: 1; }
.hbl  { font-family: var(--mono); font-size: 11px; color: var(--dim2); width: 30px; flex-shrink: 0; }
.hbv  { font-family: var(--head); font-size: 7px; flex-shrink: 0; min-width: 28px; text-align: right; line-height: 1; letter-spacing: 0; }
.hbt  { flex: 1; height: 4px; background: rgba(255,255,255,.05); border-radius: 2px; overflow: hidden; position: relative; }
.hbf  {
  height: 100%;
  border-radius: 2px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
  filter: url(#sketch);
  position: relative;
}
.hbf::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  animation: barShimmer 3.5s ease-in-out infinite;
  border-radius: 2px;
}
@keyframes barShimmer { 0% { left: -60% } 60%, 100% { left: 120% } }
.bh  { background: linear-gradient(90deg, var(--org), var(--red)); }
.br  { background: linear-gradient(90deg, var(--pur), var(--mg)); }
.bhp { background: linear-gradient(90deg, var(--grn2), var(--grn)); }
.hdebt {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--red);
  white-space: nowrap;
  animation: debtWarn 5s ease-in-out infinite;
}
@keyframes debtWarn {
  0%, 100% { opacity: .8 }
  50% { opacity: 1; text-shadow: 0 0 8px rgba(255,16,64,.4) }
}

/* ── TICKER ──────────────────────────────────────────────────*/
#tkr {
  flex-shrink: 0;
  background: rgba(0,0,0,.4);
  border-bottom: 1px solid var(--border);
  padding: 5px 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}
#tkr::before, #tkr::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 36px;
  z-index: 2;
  pointer-events: none;
}
#tkr::before { left: 0;  background: linear-gradient(90deg,  rgba(2,2,8,1), transparent); }
#tkr::after  { right: 0; background: linear-gradient(-90deg, rgba(2,2,8,1), transparent); }
.tkrs {
  white-space: nowrap;
  display: inline-block;
  padding-left: 100%;
  flex: 1;
  min-width: 0;
  animation: tks 22s linear infinite, tickerFade 8s ease-in-out infinite;
}
@keyframes tks { to { transform: translateX(-100%) } }
@keyframes tickerFade { 0%, 100% { opacity: .9 } 50% { opacity: 1 } }
.ti  { display: inline-block; margin-right: 28px; font-family: var(--mono); font-size: 13px; }
.tnm { color: var(--dim2); }
.tup { color: var(--grn); }
.tdn { color: var(--red); }
.tfl { color: var(--dim2); }
#day-badge {
  flex-shrink: 0;
  padding: 0 10px;
  font-family: var(--head);
  font-size: 10px;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0,240,255,.6);
  letter-spacing: 1px;
  white-space: nowrap;
  border-left: 1px solid var(--border2);
  background: rgba(0,0,0,.4);
}
.day-label { color: var(--dim2); font-size: 9px; }

/* ── GAME TABS ───────────────────────────────────────────────*/
#tabs {
  flex-shrink: 0;
  display: flex;
  background: rgba(6,6,26,.99);
  border-bottom: 1px solid var(--border2);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px 6px;
  cursor: pointer;
  font-family: var(--head);
  font-size: 5px;
  letter-spacing: 0;
  color: var(--dim2);
  border-bottom: 2px solid transparent;
  transition: all .15s;
  position: relative;
}
.tab .ti2 { font-size: 15px; line-height: 1; margin-bottom: 1px; }
.tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  animation: tabGlow 4s ease-in-out infinite;
}
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 15%; right: 15%;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  filter: url(#sketch);
}
@keyframes tabGlow {
  0%, 100% { color: var(--cyan) }
  50% { color: var(--cyan2); text-shadow: 0 0 8px rgba(0,232,255,.5) }
}
.tab:active { background: rgba(0,232,255,.03); animation: none !important; }

/* ── CONTENT AREA ────────────────────────────────────────────*/
#content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: repeating-linear-gradient(180deg, transparent, transparent 48px, rgba(255,255,255,.006) 48px, rgba(255,255,255,.006) 49px);
}
#content::-webkit-scrollbar { display: none; }
.panel { display: none; padding: 12px 12px 80px; }
.panel.active { display: block; animation: pin .18s ease; }
@keyframes pin { from { opacity: 0; transform: translateY(5px) } to { opacity: 1; transform: none } }

/* ── SECTION TITLE ───────────────────────────────────────────*/
.stl {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--dim2);
  text-transform: uppercase;
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stl::before { content: '//'; color: var(--mg); opacity: .6; animation: prefixBlink 3.5s ease-in-out infinite; }
.stl::after  { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border2), transparent); }
@keyframes prefixBlink { 0%, 100% { opacity: .5 } 45%, 55% { opacity: .9 } }

/* ── DISTRICT HEADER ─────────────────────────────────────────*/
.dh {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--card), var(--card2));
  border: 1px solid var(--border2);
  border-left: 3px solid var(--mg);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.dh::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 100%;
  background: linear-gradient(-90deg, rgba(255,31,94,.06), transparent);
}
.dhn  { font-family: var(--head); font-size: 10px; color: var(--mg); letter-spacing: 1px; margin-bottom: 3px; line-height: 1.6; }
.dhf  { font-family: var(--body); font-size: 15px; color: var(--txt2); }
.dhr  { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: flex; gap: 4px; }
.pdot { width: 6px; height: 6px; border-radius: 50%; }

/* ── INVENTORY BAR ───────────────────────────────────────────*/
.ivb {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 12px;
  margin-bottom: 10px;
}
.ivl { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--dim2); flex-shrink: 0; }
.ivt { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; position: relative; }
.ivf {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--pur));
  border-radius: 2px;
  transition: width .3s;
  filter: url(#sketch);
  position: relative;
}
.ivf::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  animation: barShimmer 4s ease-in-out infinite;
  border-radius: 2px;
}
.ivc { font-family: var(--head); font-size: 8px; color: var(--cyan); flex-shrink: 0; line-height: 1.6; }

/* ── EVENT BANNER ────────────────────────────────────────────*/
.evb {
  background: rgba(255,217,0,.05);
  border: 1px solid rgba(255,217,0,.2);
  border-left: 3px solid var(--yel);
  padding: 8px 12px 6px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--yel);
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: evbp 2.5s ease-in-out infinite;
  cursor: pointer;
  position: relative;
}
.evb:active { opacity: .6; }
.evb-row    { display: flex; align-items: center; gap: 8px; }
.evb-dismiss { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: 1px; align-self: flex-end; }
@keyframes evbp { 0%, 100% { border-left-color: var(--yel) } 50% { border-left-color: var(--org) } }

/* ── GOOD CARDS ──────────────────────────────────────────────*/
.gc {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 11px 13px;
  margin-bottom: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .1s, background .12s;
  filter: url(#sketch);
  box-shadow: 2px 2px 0 rgba(0,0,0,.4);
  animation: cardAura 6s ease-in-out infinite;
}
.gc:nth-child(2) { animation-delay: -2s; }
.gc:nth-child(3) { animation-delay: -4s; }
.gc:nth-child(4) { animation-delay: -1s; }
.gc:nth-child(5) { animation-delay: -3s; }
.gc:nth-child(6) { animation-delay: -5s; }
@keyframes cardAura {
  0%, 85%, 100% { box-shadow: 2px 2px 0 rgba(0,0,0,.4) }
  90%, 95%       { box-shadow: 2px 2px 0 rgba(0,0,0,.4), 0 0 12px rgba(255,31,94,.08) }
}
.gc:active { transform: rotate(0deg) scale(.99) !important; filter: none; animation: none !important; }
.gc:nth-child(odd)  { transform: rotate(-0.18deg); }
.gc:nth-child(even) { transform: rotate(0.15deg); }
.gc.sp {
  border-color: rgba(0,232,255,.25);
  background: linear-gradient(90deg, var(--card), rgba(0,232,255,.03));
}
.gc.sp::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(0,232,255,.018) 8px, rgba(0,232,255,.018) 9px);
  pointer-events: none;
  z-index: 0;
}
.gs {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  animation: stripeGlow 4s ease-in-out infinite;
}
@keyframes stripeGlow { 0%, 100% { opacity: .7 } 50% { opacity: 1; box-shadow: 0 0 8px currentColor } }
.gi   { font-size: 22px; flex-shrink: 0; }
.ginf { flex: 1; min-width: 0; }
.gnm  { font-family: var(--body); font-size: 16px; font-weight: 700; color: var(--txt); margin-bottom: 2px; }
.gct  { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; opacity: .65; }
.gr   { text-align: right; flex-shrink: 0; }
.gp   { font-family: var(--head); font-size: 10px; font-weight: 700; line-height: 1.5; filter: url(#inkbleed); }
.gtr  { font-family: var(--mono); font-size: 13px; margin-top: 2px; }
.gown { font-family: var(--mono); font-size: 12px; color: var(--cyan); margin-top: 2px; }
.good-hint { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 1px; }
.good-here { color: var(--grn); }
.price-band { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; }
.php { color: var(--red); }
.phi { color: var(--org); }
.pnm { color: var(--txt); }
.plo { color: var(--grn); }
.tup2 { color: var(--grn); }
.tdn2 { color: var(--red); }
.tfl2 { color: var(--dim2); }

/* ── CATEGORY COLOURS ────────────────────────────────────────*/
.cat-party  { color: var(--mg); }
.cat-cyber  { color: var(--cyan); }
.cat-chem   { color: var(--grn); }
.cat-data   { color: var(--blue); }
.cat-exotic { color: var(--yel); }
.cat-tech   { color: var(--pur); }

/* ── DISTRICT CARDS ──────────────────────────────────────────*/
.dc {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all .14s;
  filter: url(#sketch);
  box-shadow: 2px 2px 0 rgba(0,0,0,.4);
}
.dc.cur { border-color: var(--cyan); cursor: default; background: linear-gradient(90deg, var(--card), rgba(0,232,255,.03)); }
.dc:nth-child(odd)  { transform: rotate(-0.2deg); }
.dc:nth-child(even) { transform: rotate(0.12deg); }
.dc:not(.cur):active { transform: rotate(0deg) scale(.99); filter: none; }
.dch  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dcn  { font-family: var(--head); font-size: 9px; letter-spacing: .5px; line-height: 1.7; }
.dctag { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; padding: 3px 8px; border: 1px solid; }
.dcd  { font-family: var(--body); font-size: 15px; color: var(--txt2); margin-bottom: 10px; line-height: 1.4; }
.dcs  { display: flex; gap: 14px; font-family: var(--mono); font-size: 12px; color: var(--dim2); }
.cbadge {
  position: absolute;
  top: 0; right: 0;
  background: var(--cyan);
  color: #040412;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  padding: 3px 10px;
  animation: badgePulse 2.5s ease-in-out infinite;
}
@keyframes badgePulse { 0%, 100% { opacity: 1 } 50% { opacity: .7 } }

/* ── CREW ────────────────────────────────────────────────────*/
.cc {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
  overflow: hidden;
  filter: url(#sketch);
  box-shadow: 2px 2px 0 rgba(0,0,0,.4);
}
.cav {
  font-size: 28px;
  width: 50px; height: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border2);
  animation: avGlow 5s ease-in-out infinite;
}
@keyframes avGlow {
  0%, 100% { border-color: var(--border2) }
  50% { border-color: rgba(0,232,255,.35); box-shadow: 0 0 8px rgba(0,232,255,.15) }
}
.crew-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.cnm  { font-family: var(--head); font-size: 9px; margin-bottom: 2px; line-height: 1.7; }
.crl  { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--dim2); margin-bottom: 5px; }
.cab  { font-family: var(--body); font-size: 14px; color: var(--cyan2); margin-bottom: 6px; line-height: 1.4; }
.cbdg { display: flex; gap: 6px; flex-wrap: wrap; }
.bdg  { font-family: var(--mono); font-size: 10px; padding: 2px 7px; border: 1px solid; }
.clvb { text-align: right; flex-shrink: 0; }
.clv  { font-family: var(--head); font-size: 18px; }
.cxw  { width: 48px; height: 3px; background: var(--border); margin-top: 5px; overflow: hidden; border-radius: 2px; }
.cxf  { height: 100%; border-radius: 2px; background: var(--yel); transition: width .3s; }
.hrc {
  background: rgba(0,232,255,.015);
  border: 1px dashed var(--border2);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: all .14s;
}
.hrc:active { background: rgba(0,232,255,.04); border-color: var(--cyan); }
.crew-empty, .hire-empty { padding: 16px; text-align: center; font-size: 12px; color: var(--dim2); }
.crew-cost  { font-family: var(--head); font-size: 15px; color: var(--grn); text-align: right; flex-shrink: 0; }
.crew-hint  { font-family: var(--mono); font-size: 8px; color: var(--dim2); margin-top: 3px; letter-spacing: 1px; }
.crew-hire  { font-family: var(--mono); font-size: 8px; color: var(--dim2); margin-top: 3px; letter-spacing: 1px; }

/* ── UPGRADES ────────────────────────────────────────────────*/
.upc {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all .14s;
  position: relative;
  overflow: hidden;
  filter: url(#sketch);
  box-shadow: 2px 2px 0 rgba(0,0,0,.4);
}
.upc.own {
  border-color: rgba(0,245,122,.25);
  background: linear-gradient(90deg, var(--card), rgba(0,245,122,.025));
}
.upc.own::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,245,122,.025) 10px, rgba(0,245,122,.025) 11px);
  pointer-events: none;
  z-index: 0;
}
.upc.lck { opacity: .28; cursor: not-allowed; }
.upc:not(.own):not(.lck):active { background: rgba(255,255,255,.03); }
.upc:nth-child(odd)  { transform: rotate(0.15deg); }
.upc:nth-child(even) { transform: rotate(-0.12deg); }
.upc:active { transform: rotate(0deg) scale(.99) !important; filter: none; }
.upi   { font-size: 24px; }
.upinf { flex: 1; }
.upn   { font-family: var(--body); font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.upd   { font-family: var(--body); font-size: 14px; color: var(--txt2); line-height: 1.4; }
.upc2  { font-family: var(--head); font-size: 9px; text-align: right; flex-shrink: 0; line-height: 1.6; }

/* ── SKILL POINTS BOX ────────────────────────────────────────*/
.spb {
  background: linear-gradient(135deg, var(--card), var(--card2));
  border: 1px solid var(--border2);
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.spv {
  font-family: var(--head);
  font-size: 26px;
  color: var(--yel);
  text-shadow: 0 0 14px rgba(255,217,0,.45);
  animation: spShimmer 4s ease-in-out infinite;
}
@keyframes spShimmer {
  0%, 100% { text-shadow: 0 0 14px rgba(255,217,0,.45) }
  50% { text-shadow: 0 0 22px rgba(255,217,0,.8), 0 0 40px rgba(255,217,0,.2) }
}
.spd    { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--dim2); margin-bottom: 4px; }
.spdesc { font-family: var(--body); font-size: 14px; color: var(--txt2); }
.sp-saved { font-family: var(--mono); font-size: 10px; color: var(--grn); letter-spacing: 1px; flex-shrink: 0; align-self: center; }
.sp-hint {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: rgba(0,232,255,.04);
  border: 1px solid rgba(0,232,255,.15);
  border-left: 3px solid var(--cyan);
  font-family: var(--body);
  font-size: 15px;
  color: var(--txt2);
  line-height: 1.5;
}
.up-req { color: var(--red); }

/* ── ACTIVITY LOG ────────────────────────────────────────────*/
.lr {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  line-height: 1.4;
}
.lr:nth-child(odd)  { transform: rotate(-0.08deg); }
.lr:nth-child(even) { transform: rotate(0.08deg); }
.lday { font-family: var(--mono); font-size: 13px; color: var(--dim2); flex-shrink: 0; padding-top: 1px; width: 28px; }
.ltxt { flex: 1; color: var(--txt); font-family: var(--body); font-size: 15px; line-height: 1.45; }
.lt   { border-left: 2px solid var(--grn); }
.le   { border-left: 2px solid var(--yel); }
.lp   { border-left: 2px solid var(--red); }
.ltr  { border-left: 2px solid var(--cyan); }
.lc   { border-left: 2px solid var(--mg); }
.log-empty { padding: 16px; text-align: center; font-size: 12px; color: var(--dim2); }

/* ── FAB (END DAY) ───────────────────────────────────────────*/
.fab {
  position: fixed;
  bottom: 18px; right: 14px;
  z-index: var(--z-fab);
  width: 68px;
  border: 1px solid rgba(255,31,94,.5);
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(20,6,40,.95), rgba(10,2,26,.98));
  color: white;
  padding: 8px 0 9px;
  box-shadow: 0 4px 18px rgba(255,31,94,.35), 0 0 30px rgba(139,31,255,.15), inset 0 1px 0 rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all .15s;
  animation: fabp 2.5s ease-in-out infinite;
}
.fab::before {
  content: '';
  position: absolute;
  top: 0; left: 12px; right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mg), transparent);
  opacity: .8;
  border-radius: 1px;
}
@keyframes fabp {
  0%, 100% { box-shadow: 0 4px 18px rgba(255,31,94,.35), 0 0 30px rgba(139,31,255,.15), inset 0 1px 0 rgba(255,255,255,.06) }
  50%       { box-shadow: 0 4px 24px rgba(255,31,94,.6), 0 0 44px rgba(139,31,255,.28), inset 0 1px 0 rgba(255,255,255,.08) }
}
.fab:active { transform: scale(.94); animation: none; opacity: .85; }
.fab-day   { font-family: var(--head); font-size: 11px; color: var(--cyan); line-height: 1; text-shadow: 0 0 8px rgba(0,232,255,.7); }
.fab-of    { font-family: var(--mono); font-size: 11px; color: var(--dim2); line-height: 1; }
.fab-hint  { font-family: var(--mono); font-size: 9px; color: var(--dim); min-height: 11px; line-height: 1; }
.fab-label { font-family: var(--head); font-size: 6px; color: var(--mg); letter-spacing: 1px; opacity: .85; margin-top: 1px; text-shadow: 0 0 6px rgba(255,31,94,.5); }

/* ── MODALS (TRADE) ──────────────────────────────────────────*/
.ov {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.ov.open { display: flex; }
.modal {
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, rgba(19,19,50,.98), rgba(15,15,40,.99));
  border: 1px solid var(--border2);
  border-bottom: none;
  border-top: 2px solid var(--mg);
  padding: 18px 16px 26px;
  animation: slu .2s cubic-bezier(.4,0,.2,1);
  color: var(--txt);
  box-shadow: 0 -6px 36px rgba(0,0,0,.5);
  position: relative;
}
.modal::before {
  content: '';
  position: absolute;
  top: -2px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--mg), var(--pur), var(--cyan), var(--pur), var(--mg));
  background-size: 300% 100%;
  animation: hudStripe 6s ease-in-out infinite;
}
@keyframes slu { from { transform: translateY(100%) } to { transform: translateY(0) } }
.mttl  { font-family: var(--head); font-size: 8px; color: var(--mg); letter-spacing: 2px; margin-bottom: 14px; line-height: 1.7; }
.mgr   { display: flex; gap: 14px; align-items: center; padding-bottom: 13px; border-bottom: 1px solid var(--border); margin-bottom: 13px; }
.mico  { font-size: 32px; }
.mgnm  { font-family: var(--body); font-size: 18px; font-weight: 700; color: var(--txt); margin-bottom: 3px; }
.mgpr  { font-family: var(--head); font-size: 12px; color: var(--grn); text-shadow: 0 0 8px rgba(0,245,122,.35); line-height: 1.7; }
.mgow  { font-family: var(--mono); font-size: 13px; color: var(--dim2); margin-top: 2px; }
.qr    { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qb {
  width: 52px; height: 52px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--txt);
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .1s;
  flex-shrink: 0;
  filter: url(#sketch);
}
.qb:active { background: var(--border2); }
.qn  { flex: 1; text-align: center; font-family: var(--head); font-size: 26px; color: var(--cyan); line-height: 1; }
.qmx {
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--dim2);
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .1s;
  filter: url(#sketch);
}
.qmx:active { background: var(--border); color: var(--txt); }
.qtot { text-align: center; font-family: var(--mono); font-size: 14px; color: var(--dim2); margin-bottom: 12px; }
.qtot span { font-family: var(--head); font-size: 12px; color: var(--grn); }
.mbs { display: flex; gap: 8px; }
.mb {
  flex: 1;
  padding: 13px;
  border: none;
  cursor: pointer;
  font-family: var(--head);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all .12s;
  line-height: 1.6;
  filter: url(#sketch);
}
.mb:active { transform: scale(.95); opacity: .8; }
.mb.mb-active { outline: 2px solid rgba(255,255,255,.2); outline-offset: -2px; }
.mbb  { background: linear-gradient(135deg, #001e16, #003828); color: var(--grn); border: 1px solid rgba(0,245,122,.2); }
.mbb.mb-active { background: linear-gradient(135deg, #003828, #005540); border-color: rgba(0,245,122,.45); }
.mbs2 { background: linear-gradient(135deg, #200010, #3c0020); color: var(--mg); border: 1px solid rgba(255,31,94,.2); }
.mbs2.mb-active { background: linear-gradient(135deg, #3c0020, #5e0030); border-color: rgba(255,31,94,.45); }
.mbx  { background: rgba(255,255,255,.03); color: var(--dim2); border: 1px solid var(--border); }
.mbx:active { background: rgba(255,255,255,.06); }
.modal-mode-row { display: flex; gap: 6px; margin-bottom: 14px; }

/* ── EVENT MODAL ─────────────────────────────────────────────*/
.eov {
  position: fixed;
  inset: 0;
  z-index: var(--z-event);
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.eov.open { display: flex; }
.ebox {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(160deg, rgba(19,19,50,.98), rgba(15,15,40,.99));
  border: 1px solid var(--border2);
  padding: 22px 20px;
  text-align: center;
  animation: epop .24s cubic-bezier(.2,1.2,.4,1);
  position: relative;
  overflow: hidden;
  color: var(--txt);
  box-shadow: 0 12px 50px rgba(0,0,0,.6);
  filter: url(#sketch2);
}
@keyframes epop { from { transform: scale(.86); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.eico  {
  font-size: 44px;
  margin-bottom: 8px;
  display: inline-block;
  animation: iconFloat 3s ease-in-out infinite;
}
@keyframes iconFloat { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-4px) } }
.etyp  { font-family: var(--mono); font-size: 13px; letter-spacing: 3px; margin-bottom: 5px; }
.ettl  { font-family: var(--head); font-size: 9px; font-weight: 700; margin-bottom: 10px; letter-spacing: 1px; line-height: 1.8; }
.edesc { font-family: var(--body); font-size: 16px; color: var(--txt2); line-height: 1.4; margin-bottom: 16px; }
.eopts { display: flex; flex-direction: column; gap: 6px; }
.ebtn {
  padding: 12px 14px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border2);
  color: var(--txt2);
  font-family: var(--body);
  font-size: 16px;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  transition: all .12s;
}
.ebtn:active { background: rgba(0,232,255,.05); border-color: rgba(0,232,255,.2); color: var(--cyan); }
.ecst { float: right; font-family: var(--head); font-size: 8px; color: var(--yel); line-height: 2; }

/* ── POLICE MODAL ────────────────────────────────────────────*/
.pov {
  position: fixed;
  inset: 0;
  z-index: var(--z-police);
  background: rgba(0,0,0,.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pov.open { display: flex; }
.pbox {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(160deg, rgba(19,19,50,.98), rgba(15,15,40,.99));
  border: 2px solid var(--red);
  padding: 22px 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
  color: var(--txt);
  box-shadow: 0 0 30px rgba(255,16,64,.15), 0 12px 50px rgba(0,0,0,.6);
  filter: url(#sketch);
  animation: policeAlert 1.8s ease-in-out infinite;
}
@keyframes policeAlert {
  0%, 100% { box-shadow: 0 0 20px rgba(255,16,64,.12), 0 12px 50px rgba(0,0,0,.6) }
  50%       { box-shadow: 0 0 30px rgba(255,16,64,.28), 0 12px 50px rgba(0,0,0,.6) }
}
.pbox::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,217,0,.05), transparent);
  animation: sc 1.8s linear infinite;
  filter: url(#sketch);
}
@keyframes sc { to { left: 150% } }
.pico  { font-size: 42px; margin-bottom: 8px; }
.pttl  { font-family: var(--head); font-size: 9px; color: var(--red); letter-spacing: 2px; text-shadow: 0 0 14px rgba(255,16,64,.65); margin-bottom: 5px; line-height: 1.8; }
.psub  { font-family: var(--mono); font-size: 13px; color: var(--dim2); letter-spacing: 2px; margin-bottom: 14px; }
.pdesc { font-family: var(--body); font-size: 16px; color: var(--txt2); margin-bottom: 16px; line-height: 1.4; }
.popts { display: flex; flex-direction: column; gap: 6px; }
.popt {
  padding: 12px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border2);
  color: var(--txt2);
  font-family: var(--body);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all .12s;
  text-align: left;
}
.popt:active { background: rgba(255,16,64,.05); border-color: rgba(255,16,64,.25); }
.prsk { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; padding: 3px 8px; border: 1px solid; flex-shrink: 0; margin-left: 8px; }
.police-warn { font-size: 11px; color: var(--red); font-family: var(--mono); }

/* ── GAME OVER SCREEN ────────────────────────────────────────*/
#scr-over {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 100% 80% at 50% 100%, #0a0520 0%, var(--blk) 70%);
  position: relative;
  overflow: hidden;
}
.obg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 60%, rgba(255,16,64,.08), transparent 70%);
  animation: op 4s ease-in-out infinite;
}
@keyframes op { 0%, 100% { opacity: .5 } 50% { opacity: 1 } }
.oc {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
  width: 100%;
}
.over-scene-wrap { margin-bottom: 12px; }
.ot {
  font-family: var(--disp);
  font-size: 26px;
  line-height: 1.2;
  color: transparent;
  background: linear-gradient(135deg, var(--red), var(--mg));
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 22px rgba(255,16,64,.65));
  margin-bottom: 6px;
}
.os  { font-family: var(--mono); font-size: 14px; color: var(--dim2); letter-spacing: 2px; margin-bottom: 22px; }
.ori {
  font-size: 46px;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 16px var(--yel));
  animation: rankFloat 3.5s ease-in-out infinite;
}
@keyframes rankFloat {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 16px var(--yel)) }
  50% { transform: translateY(-6px); filter: drop-shadow(0 0 24px var(--yel)) }
}
.orn  { font-family: var(--head); font-size: 9px; letter-spacing: 2px; color: var(--yel); text-shadow: 0 0 10px rgba(255,217,0,.45); margin-bottom: 18px; line-height: 1.8; }
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.sbox {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 14px;
  text-align: center;
  filter: url(#sketch);
  box-shadow: 2px 2px 0 rgba(0,0,0,.4);
}
.sv { font-family: var(--disp); font-size: 14px; font-weight: 700; margin-bottom: 4px; line-height: 1.55; }
.sl { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--dim2); }
.over-sp {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--yel);
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-align: center;
  min-height: 18px;
}

/* ── MUSIC PLAYER PANEL ──────────────────────────────────────*/
#music-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-music);
  max-width: 430px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(10,10,28,.97), rgba(5,5,15,.99));
  border-top: 2px solid var(--mg);
  border-left: 1px solid var(--border2);
  border-right: 1px solid var(--border2);
  filter: url(#sketch2);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
}
#music-panel.open { transform: translateY(0); }
#music-inner { display: flex; flex-direction: column; overflow: hidden; padding: 14px 16px 20px; }
#mp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
#mp-title-lbl { font-family: var(--mono); font-size: 9px; letter-spacing: 4px; color: var(--mg); text-shadow: 0 0 8px rgba(255,32,96,.5); }
#mp-close {
  background: none;
  border: 1px solid var(--border2);
  color: var(--dim2);
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  filter: url(#sketch);
}
#mp-close:active { background: var(--border2); color: var(--txt); }
#mp-now-playing { margin-bottom: 10px; }
#mp-track-name {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0,240,255,.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  filter: url(#inkbleed);
}
#mp-track-time { font-family: var(--mono); font-size: 10px; color: var(--dim2); letter-spacing: 1px; }
#mp-progress-wrap { cursor: pointer; padding: 6px 0; margin-bottom: 12px; }
#mp-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: visible;
  position: relative;
  filter: url(#sketch);
}
#mp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mg), var(--pur));
  border-radius: 2px;
  width: 0%;
  transition: width .5s linear;
  box-shadow: 0 0 6px rgba(255,32,96,.5);
}
#mp-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.mp-btn {
  background: var(--card);
  border: 1px solid var(--border2);
  color: var(--txt);
  font-size: 16px;
  width: 40px; height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
  flex-shrink: 0;
  filter: url(#sketch);
}
.mp-btn:active { background: var(--border2); transform: scale(.92); }
#mp-play-btn {
  background: linear-gradient(135deg, rgba(255,32,96,.2), rgba(155,48,255,.2));
  border-color: var(--mg);
  color: var(--mg);
  font-size: 18px;
  width: 44px; height: 44px;
}
#mp-play-btn.playing { color: var(--grn); border-color: var(--grn); }
#mp-loop-btn.active  { color: var(--cyan); border-color: var(--cyan); }
#mp-vol {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  outline: none;
}
#mp-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--mg);
  box-shadow: 0 0 6px rgba(255,32,96,.6);
  cursor: pointer;
}
#mp-playlist {
  overflow-y: auto;
  flex: 1;
  max-height: 180px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
#mp-playlist::-webkit-scrollbar { width: 3px; }
#mp-playlist::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.mp-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
  font-family: var(--body);
  font-size: 13px;
  color: var(--txt2);
}
.mp-track:active, .mp-track:hover { background: rgba(255,32,96,.06); }
.mp-track.active { color: var(--mg); background: rgba(255,32,96,.06); }
.mp-track-num  { font-family: var(--mono); font-size: 9px; color: var(--dim2); width: 18px; flex-shrink: 0; text-align: right; }
.mp-track-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-empty { padding: 20px; text-align: center; font-family: var(--mono); font-size: 10px; color: var(--dim2); letter-spacing: 2px; }

/* ── SCENE ART ───────────────────────────────────────────────*/
.scene-art {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: 0 auto 10px;
  opacity: 0.9;
  filter: url(#sketch);
  animation: sceneIn .35s cubic-bezier(.2,1.2,.4,1) both;
}
@keyframes sceneIn {
  from { opacity: 0; transform: scale(.88) translateY(8px); }
  to   { opacity: .9; transform: scale(1) translateY(0); }
}
.scene-wrap {
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  border-left: 3px solid var(--mg);
  padding: 10px 8px 6px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.scene-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(255,255,255,.012) 8px, rgba(255,255,255,.012) 9px);
  pointer-events: none;
}

/* ── HIRE MODAL ──────────────────────────────────────────────*/
#hire-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-hi);
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#hire-modal.open { display: flex; }
#hire-box {
  width: 100%;
  max-width: 320px;
  background: linear-gradient(160deg, rgba(19,19,50,.98), rgba(10,10,28,.99));
  border: 1px solid var(--border2);
  padding: 22px 20px 20px;
  text-align: center;
  animation: epop .22s cubic-bezier(.2,1.2,.4,1);
  filter: url(#sketch2);
  box-shadow: 0 12px 50px rgba(0,0,0,.6);
  position: relative;
}
#hire-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pur), var(--cyan), var(--pur));
  opacity: .8;
}
.hire-avatar   { font-size: 40px; margin-bottom: 8px; }
.hire-name     { font-family: var(--head); font-size: 10px; letter-spacing: 1px; line-height: 1.8; margin-bottom: 2px; }
.hire-role     { font-family: var(--mono); font-size: 13px; letter-spacing: 2px; color: var(--dim2); margin-bottom: 8px; }
.hire-ab       { font-family: var(--body); font-size: 15px; color: var(--txt2); line-height: 1.45; margin-bottom: 14px; padding: 8px 10px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.hire-cost     { font-family: var(--head); font-size: 12px; color: var(--grn); text-shadow: 0 0 8px rgba(0,245,122,.4); margin-bottom: 16px; }
.hire-question { font-family: var(--head); font-size: 7px; color: var(--dim2); letter-spacing: 1px; line-height: 1.8; margin-bottom: 14px; }
.hire-btns { display: flex; gap: 10px; }
.hire-yes {
  flex: 1; padding: 14px; border: none; cursor: pointer;
  font-family: var(--head); font-size: 8px; letter-spacing: 1px;
  background: linear-gradient(135deg, #002a1e, #004030);
  color: var(--grn); border: 1px solid rgba(0,245,122,.25);
  transition: all .12s; filter: url(#sketch);
}
.hire-yes:active { background: linear-gradient(135deg, #004030, #006050); border-color: var(--grn); }
.hire-no {
  flex: 1; padding: 14px; border: none; cursor: pointer;
  font-family: var(--head); font-size: 8px; letter-spacing: 1px;
  background: rgba(255,255,255,.04);
  color: var(--dim2); border: 1px solid var(--border2);
  transition: all .12s; filter: url(#sketch);
}
.hire-no:active { background: rgba(255,255,255,.08); color: var(--txt); }

/* ── QUIT BUTTON ─────────────────────────────────────────────*/
#quit-btn {
  position: fixed;
  bottom: 18px; left: 14px;
  z-index: var(--z-fab);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  cursor: pointer;
  background: rgba(6,6,26,.88);
  color: var(--dim2);
  font-family: var(--head);
  font-size: 6px;
  letter-spacing: 1px;
  padding: 8px 10px;
  transition: all .18s;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
  line-height: 1.6;
  text-align: center;
}
#quit-btn:active { background: rgba(255,16,64,.12); border-color: rgba(255,16,64,.3); color: var(--red); }

/* ── QUIT MODAL ──────────────────────────────────────────────*/
#quit-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-hi);
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#quit-modal.open { display: flex; }
#quit-box {
  width: 100%;
  max-width: 320px;
  background: linear-gradient(160deg, rgba(19,19,50,.98), rgba(10,10,28,.99));
  border: 1px solid var(--border2);
  border-top: 2px solid var(--red);
  padding: 24px 20px 22px;
  text-align: center;
  animation: epop .22s cubic-bezier(.2,1.2,.4,1);
  filter: url(#sketch2);
  box-shadow: 0 0 30px rgba(255,16,64,.1), 0 12px 50px rgba(0,0,0,.6);
}
.quit-icon  { font-size: 36px; margin-bottom: 10px; }
.quit-title { font-family: var(--head); font-size: 9px; color: var(--txt); letter-spacing: 1px; line-height: 1.8; margin-bottom: 6px; }
.quit-sub   { font-family: var(--body); font-size: 15px; color: var(--dim2); margin-bottom: 20px; line-height: 1.4; }
.quit-btns  { display: flex; gap: 10px; }
.quit-yes {
  flex: 1; padding: 14px; border: none; cursor: pointer;
  font-family: var(--head); font-size: 8px; letter-spacing: 1px;
  background: linear-gradient(135deg, #3a0010, #5a0020);
  color: var(--red); border: 1px solid rgba(255,16,64,.3);
  transition: all .12s; filter: url(#sketch);
}
.quit-yes:active { background: linear-gradient(135deg, #5a0020, #8a0030); border-color: var(--red); }
.quit-no {
  flex: 1; padding: 14px; border: none; cursor: pointer;
  font-family: var(--head); font-size: 8px; letter-spacing: 1px;
  background: rgba(255,255,255,.04);
  color: var(--dim2); border: 1px solid var(--border2);
  transition: all .12s; filter: url(#sketch);
}
.quit-no:active { background: rgba(255,255,255,.08); color: var(--txt); }

/* ── GLITCH & TOAST ──────────────────────────────────────────*/
#glitch {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-glitch);
  opacity: 0;
  transition: opacity .05s;
  background: linear-gradient(135deg, rgba(255,32,96,.15), rgba(0,240,255,.1));
  mix-blend-mode: screen;
}
#gline {
  position: fixed;
  z-index: var(--z-glitch);
  pointer-events: none;
  left: 0; right: 0;
  height: 2px;
  background: rgba(0,240,255,.5);
  opacity: 0;
}
#toast {
  position: fixed;
  top: 78px;
  left: 50%;
  z-index: var(--z-toast);
  transform: translateX(-50%) translateY(-14px) rotate(-0.4deg);
  background: var(--card2);
  border: 1px solid var(--border2);
  border-top: 2px solid var(--cyan);
  padding: 10px 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt);
  opacity: 0;
  transition: all .2s;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90%;
  text-align: center;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  filter: url(#sketch);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) rotate(-0.4deg);
}

/* ── TIP BANNER ──────────────────────────────────────────────*/
#tip-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-tip);
  max-width: 430px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(0,42,30,.97), rgba(0,60,40,.97));
  border-bottom: 2px solid var(--grn);
  padding: 12px 16px 8px;
  flex-direction: column;
  gap: 6px;
  animation: pin .3s ease both;
  cursor: pointer;
  display: none;
}
.tip-row       { display: flex; align-items: flex-start; gap: 12px; }
.tip-icon      { font-size: 22px; flex-shrink: 0; }
.tip-body      { flex: 1; }
.tip-title     { font-family: var(--head); font-size: 7px; color: var(--grn); letter-spacing: 1px; margin-bottom: 4px; line-height: 1.8; }
.tip-text      { font-family: var(--body); font-size: 15px; color: var(--txt2); line-height: 1.5; }
.tip-dismiss   { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: 1px; text-align: right; }
