/* City Drive v2: dark glass over the city, the Jersey 10 pixel font, gold for criminals and blue for police. */
:root {
  --crimpic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 17' shape-rendering='crispEdges'%3E%3Cpath d='M3 0h5v1h1v5h1v6H9v4H6v-3H5v3H2v-4H1V6h1V1h1z' fill='%231a1418'/%3E%3Crect x='3' y='1' width='5' height='5' fill='%233a2a3a'/%3E%3Crect x='4' y='3' width='3' height='3' fill='%23d9a37a'/%3E%3Crect x='4' y='4' width='1' height='1' fill='%231a1418'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%231a1418'/%3E%3Crect x='2' y='6' width='7' height='5' fill='%23b8433a'/%3E%3Crect x='2' y='6' width='1' height='5' fill='%237a2a2a'/%3E%3Crect x='5' y='7' width='1' height='3' fill='%23e8e0d0'/%3E%3Crect x='3' y='11' width='5' height='2' fill='%232a3446'/%3E%3Crect x='3' y='13' width='2' height='2' fill='%232a3446'/%3E%3Crect x='6' y='13' width='2' height='2' fill='%232a3446'/%3E%3C/svg%3E");
  --coppic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 17' shape-rendering='crispEdges'%3E%3Cpath d='M2 0h7v3h1v3h1v6H9v4H6v-3H5v3H2v-4H0V6h1V3h1z' fill='%231a1418'/%3E%3Crect x='2' y='1' width='7' height='2' fill='%231e2a48'/%3E%3Crect x='5' y='1' width='1' height='1' fill='%23f2c25a'/%3E%3Crect x='1' y='3' width='9' height='1' fill='%23101418'/%3E%3Crect x='3' y='4' width='5' height='2' fill='%23d9a37a'/%3E%3Crect x='4' y='4' width='1' height='1' fill='%231a1418'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%231a1418'/%3E%3Crect x='1' y='6' width='9' height='5' fill='%23263a6a'/%3E%3Crect x='4' y='6' width='3' height='1' fill='%23dfe6f0'/%3E%3Crect x='7' y='7' width='1' height='1' fill='%23f2c25a'/%3E%3Crect x='2' y='10' width='7' height='1' fill='%23101418'/%3E%3Crect x='3' y='11' width='5' height='2' fill='%231a2236'/%3E%3Crect x='3' y='13' width='2' height='2' fill='%231a2236'/%3E%3Crect x='6' y='13' width='2' height='2' fill='%231a2236'/%3E%3C/svg%3E");
  --glass: rgba(16, 19, 28, .86); --glass2: rgba(10, 12, 18, .92); --line: rgba(255, 255, 255, .12); --text: #ece8de; --sub: #aaa59b;
  --gold: #f2c25a; --cop: #8fb6ff; --good: #7ee67e; --bad: #ff8a7a; --acc: var(--gold);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #111318; color: var(--text); font: 20px/1.25 'Jersey 10', monospace; -webkit-user-select: none; user-select: none; touch-action: none; -webkit-tap-highlight-color: transparent; }
input, textarea { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { font: inherit; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* ---- Cards ---- */
.card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 22px 22px 18px; text-align: center; z-index: 30; animation: pop .35s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes pop { from { transform: translate(-50%, -46%) scale(.94); opacity: 0; } }
h1 { margin: 0 0 6px; font: 400 62px/1 'Jersey 10', monospace; letter-spacing: 1px; text-shadow: 0 4px 0 rgba(0, 0, 0, .5); }
h1 b { font-weight: 400; color: var(--gold); }
h2 { margin: 0 0 8px; font: 400 38px/1 'Jersey 10', monospace; }
h3 { margin: 14px 0 4px; font: 400 22px/1 'Jersey 10', monospace; color: var(--gold); }
.sub { margin: 0 0 14px; color: var(--sub); font-size: 19px; }
.sub b { color: var(--gold); font-weight: 400; }
.msg { min-height: 22px; margin: 10px 0 0; color: var(--sub); font-size: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .08); font-size: 21px; transition: transform .08s, background .15s; }
.btn:hover { background: rgba(255, 255, 255, .14); }
.btn:active { transform: scale(.96); }
.btn kbd { padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .4); color: var(--sub); font-size: 15px; }
.btn.gold { background: linear-gradient(180deg, #ffd978, #e0a43a); color: #2a1a06; border-color: #ffe7a8; box-shadow: 0 3px 0 #8a5a1a; }
.btn.big { width: 100%; height: 58px; font-size: 30px; margin: 6px 0 10px; }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.join { display: flex; gap: 6px; }
.join input { width: 104px; height: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35); color: var(--text); text-transform: uppercase; letter-spacing: 3px; font-size: 22px; text-align: center; }
.link { background: none; border: 0; color: var(--sub); text-decoration: underline; margin-top: 10px; font-size: 18px; }
.home { display: inline-block; margin-top: 10px; color: var(--sub); font-size: 18px; text-decoration: none; }
.foot { justify-content: space-between; align-items: baseline; }
.pic { width: 33px; height: 51px; image-rendering: pixelated; background: center / contain no-repeat; }
.crimpic { background-image: var(--crimpic); }
.coppic { background-image: var(--coppic); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.side { padding: 10px 8px; border-radius: 8px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); display: grid; justify-items: center; gap: 4px; font-size: 16px; color: var(--sub); }
.side b { font-weight: 400; font-size: 24px; }
.crim b { color: var(--gold); }
.cop b { color: var(--cop); }

.sidecard { width: min(620px, calc(100vw - 24px)); }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pickside { display: grid; justify-items: center; gap: 6px; padding: 16px 12px 14px; border-radius: 10px; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); transition: transform .12s, border-color .15s, background .15s; }
.pickside .pic { width: 55px; height: 85px; }
.pickside b { font-weight: 400; font-size: 32px; }
.pickside ul { margin: 0; padding: 0; list-style: none; text-align: left; display: grid; gap: 4px; font-size: 17px; color: #d8d3c8; }
.pickside li { padding-left: 14px; position: relative; }
.pickside li::before { content: ''; position: absolute; left: 2px; top: .5em; width: 6px; height: 6px; border-radius: 1px; background: currentColor; opacity: .5; }
.pickside:hover, .pickside:focus-visible { transform: translateY(-3px); outline: none; }
.pickside.crim:hover, .pickside.crim:focus-visible { border-color: var(--gold); background: rgba(242, 194, 90, .1); }
.pickside.cop:hover, .pickside.cop:focus-visible { border-color: var(--cop); background: rgba(143, 182, 255, .1); }
.pickside:active { transform: scale(.97); }

.credits ul { list-style: none; margin: 0 0 6px; padding: 0; text-align: left; font-size: 17px; color: #d8d3c8; display: grid; gap: 3px; }
.credits a { color: var(--cop); -webkit-user-select: none; user-select: none; }
.credits .btn { margin-top: 12px; }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud.cop { --acc: var(--cop); }
#hud > * { transition: opacity .3s; }
#hud.cutting > * { opacity: 0; pointer-events: none !important; } /* the manhole cutscene plays without the HUD */
.stats { position: fixed; left: calc(env(safe-area-inset-left) + 10px); top: calc(env(safe-area-inset-top) + 10px); padding: 8px 12px 10px; display: grid; gap: 6px; min-width: 168px; }
.srow { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.chip { font-weight: 400; font-size: 15px; letter-spacing: 1px; text-transform: uppercase; padding: 2px 7px 1px; border-radius: 4px; background: var(--gold); color: #2a1a06; }
#hud.cop .chip { background: var(--cop); color: #0c1630; }
.cash { font: 400 30px/1 'Jersey 10', monospace; color: var(--good); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.bounty { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bounty small { color: var(--sub); font-size: 16px; }
.bounty b { font: 400 24px/1 'Jersey 10', monospace; color: var(--bad); }
.carry { display: flex; gap: 5px; }
.carry i { flex: 1; height: 20px; border-radius: 4px; border: 1px dashed rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .25); }
.carry i.full { border: 1px solid rgba(0, 0, 0, .5); background: linear-gradient(180deg, #d8a86a, #a8763e); position: relative; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.carry i.full::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; transform: translateX(-50%); background: var(--c, #6ec46a); }
.hp { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .45); overflow: hidden; border: 1px solid rgba(255, 255, 255, .1); }
.hp i { display: block; height: 100%; width: var(--hp, 100%); background: linear-gradient(90deg, #e05a4a, #7ee67e 60%); transition: width .3s; }
.clockbox { position: fixed; top: calc(env(safe-area-inset-top) + 10px); left: 50%; transform: translateX(-50%); padding: 3px 16px 4px; text-align: center; display: grid; }
.clockbox b { font: 400 32px/1 'Jersey 10', monospace; color: #ffe7a8; }
.clockbox b.night { color: #a8c0ff; }
.clockbox small { color: var(--sub); font-size: 14px; letter-spacing: 1px; }
#mini { position: fixed; right: calc(env(safe-area-inset-right) + 10px); top: calc(env(safe-area-inset-top) + 10px); width: 150px; height: 150px; image-rendering: pixelated; border: 2px solid rgba(255, 255, 255, .16); border-radius: 50%; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); background: #1a1d24; }

.acts { position: fixed; right: calc(env(safe-area-inset-right) + 12px); bottom: calc(env(safe-area-inset-bottom) + 14px); display: grid; grid-template-columns: auto auto; grid-template-areas: 'radio gun' 'shoot main'; gap: 10px; align-items: end; justify-items: end; }
.act { pointer-events: auto; position: relative; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .16); background: linear-gradient(160deg, rgba(40, 45, 60, .95), rgba(14, 16, 24, .95)); box-shadow: 0 6px 18px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .12); border-radius: 14px; transition: transform .08s; }
.act:active { transform: scale(.92); }
.act kbd { position: absolute; right: -6px; bottom: -6px; font-size: 13px; line-height: 1; padding: 2px 4px 1px; border-radius: 4px; background: #0c0f17; color: var(--sub); border: 1px solid rgba(255, 255, 255, .14); }
.act svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.act.radio { grid-area: radio; height: 46px; padding: 0 12px; grid-auto-flow: column; gap: 6px; font-size: 17px; color: var(--acc); }
.act.radio span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.act.gun { grid-area: gun; height: 46px; padding: 0 12px; grid-auto-flow: column; gap: 8px; font-size: 17px; }
.act.gun img { height: 22px; image-rendering: pixelated; }
.act.shoot { grid-area: shoot; width: 64px; height: 64px; border-radius: 50%; color: #ffb0a0; border-color: rgba(255, 120, 100, .4); }
.act.shoot svg { width: 34px; height: 34px; }
.act.main { grid-area: main; min-width: 92px; height: 92px; padding: 0 16px; border-radius: 50%; font-size: 24px; line-height: 1; text-align: center; color: #2a1a06; background: linear-gradient(180deg, #ffd978, #e0a43a); border-color: #ffe7a8; box-shadow: 0 4px 0 #8a5a1a, 0 0 22px rgba(242, 194, 90, .45); animation: breathe 1.6s ease-in-out infinite; }
#hud.cop .act.main { color: #0c1630; background: linear-gradient(180deg, #b8d0ff, #5a86e0); border-color: #d8e4ff; box-shadow: 0 4px 0 #1c3470, 0 0 22px rgba(120, 170, 255, .45); }
.act.main span { max-width: 100px; }
@keyframes breathe { 50% { transform: scale(1.05); } }
.downed { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); padding: 14px 26px; text-align: center; display: grid; gap: 2px; border-color: rgba(255, 138, 122, .5); }
.downed b { font: 400 40px/1 'Jersey 10', monospace; color: var(--bad); }
.downed span { color: var(--sub); }
.downed i { font-style: normal; color: var(--text); }

/* ---- Gun van ---- */
.shop { width: min(440px, calc(100vw - 24px)); border-color: rgba(200, 80, 70, .45); }
.vanpic { width: 44px; height: 44px; fill: none; stroke: #e07a6a; stroke-width: 1.6; stroke-linejoin: round; }
.shoplist { display: grid; gap: 6px; margin: 0 0 12px; }
.gunrow { display: grid; grid-template-columns: 96px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); transition: background .12s, transform .08s; }
.gunrow:hover { background: rgba(255, 255, 255, .08); }
.gunrow:active { transform: scale(.98); }
.gunrow img { grid-row: 1 / 3; width: 96px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.gunrow b { font-weight: 400; font-size: 24px; }
.gunrow small { grid-column: 2; color: var(--sub); font-size: 15px; }
.gunrow span { grid-column: 3; grid-row: 1 / 3; font-size: 22px; color: var(--good); padding: 4px 10px; border-radius: 6px; background: rgba(126, 230, 126, .1); }
.gunrow.poor span { color: var(--sub); background: rgba(255, 255, 255, .05); }
.gunrow.poor { opacity: .7; }
.gunrow.own span { color: var(--cop); background: rgba(143, 182, 255, .12); }

/* ---- Apartment, overlays ---- */
.apartment { position: fixed; inset: 0; z-index: 12; background: #0c0d12; }
.apartment canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; touch-action: none; }
.cheer { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%) scale(.6); font: 400 54px 'Jersey 10', monospace; color: var(--gold); text-shadow: 0 4px 0 #000, 0 0 20px rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1); z-index: 45; white-space: nowrap; }
.cheer.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.cheer.bad { color: var(--bad); }
.cheer.good { color: var(--good); }
.cheer.cop { color: var(--cop); }
.note { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 70px); transform: translate(-50%, -10px); max-width: min(520px, calc(100vw - 40px)); padding: 8px 14px; background: var(--glass2); border: 1px solid var(--line); border-radius: 8px; font-size: 19px; opacity: 0; transition: opacity .2s, transform .2s; z-index: 45; text-align: center; pointer-events: none; }
.note.on { opacity: 1; transform: translate(-50%, 0); }
.note.bad { border-color: rgba(255, 138, 122, .6); color: #ffd0c8; }
.note.good { border-color: rgba(126, 230, 126, .5); }
.knob { position: fixed; width: 0; height: 0; z-index: 11; pointer-events: none; }
.knob::before { content: ''; position: absolute; left: -46px; top: -46px; width: 92px; height: 92px; border-radius: 50%; border: 2px dotted rgba(255, 255, 255, .45); }
.knob i { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .7); transform: translate(var(--kx, 0), var(--ky, 0)); }

@media (pointer: coarse) { .act kbd, .btn kbd { display: none; } }
@media (max-width: 560px) {
  h1 { font-size: 50px; }
  .pick { grid-template-columns: 1fr; }
  .pickside { grid-template-columns: auto 1fr; grid-template-rows: auto auto; justify-items: start; text-align: left; column-gap: 12px; }
  .pickside .pic { grid-row: 1 / 3; width: 44px; height: 68px; }
  .stats { min-width: 140px; padding: 6px 10px 8px; }
  .cash { font-size: 26px; }
  #mini { width: 96px; height: 96px; }
  .clockbox { top: calc(env(safe-area-inset-top) + 112px); left: auto; right: calc(env(safe-area-inset-right) + 10px); transform: none; padding: 2px 10px; }
  .clockbox b { font-size: 24px; }
  .clockbox small { display: none; }
  .act.main { min-width: 80px; height: 80px; font-size: 21px; }
  .acts { bottom: calc(env(safe-area-inset-bottom) + 74px); }
}

/* Landscape phones: a compact HUD so the city shows (owner: "make everything landscape phone friendly"). */
@media (max-height: 500px) and (orientation: landscape) {
  .stats { min-width: 128px; padding: 5px 8px 6px; gap: 4px; left: calc(env(safe-area-inset-left) + 6px); top: calc(env(safe-area-inset-top) + 6px); }
  .chip { font-size: 12px; padding: 1px 5px 0; }
  .cash { font-size: 20px; }
  .bounty small { font-size: 12px; }
  .bounty b { font-size: 17px; }
  .carry i { height: 13px; }
  .hp { height: 6px; }
  #mini { width: 84px; height: 84px; right: calc(env(safe-area-inset-right) + 6px); top: calc(env(safe-area-inset-top) + 6px); }
  .clockbox { top: calc(env(safe-area-inset-top) + 6px); padding: 1px 10px 2px; }
  .clockbox b { font-size: 21px; }
  .clockbox small { font-size: 11px; }
  .acts { right: calc(env(safe-area-inset-right) + 8px); bottom: calc(env(safe-area-inset-bottom) + 8px); gap: 7px; }
  .act.main { min-width: 68px; height: 68px; font-size: 17px; padding: 0 10px; }
  .act.main span { max-width: 70px; }
  .act.shoot { width: 50px; height: 50px; }
  .act.shoot svg { width: 26px; height: 26px; }
  .act.radio, .act.gun { height: 36px; font-size: 14px; padding: 0 9px; }
  .act.gun img { height: 16px; }
  .note { top: calc(env(safe-area-inset-top) + 42px); font-size: 15px; padding: 5px 10px; }
  .cheer { font-size: 36px; }
  .downed b { font-size: 28px; }
  .card { padding: 12px 14px 10px; max-height: calc(100dvh - 12px); }
  h1 { font-size: 40px; }
  h2 { font-size: 26px; }
  .sub { font-size: 15px; margin-bottom: 8px; }
  .menu .sides { display: none; }
  .btn { height: 38px; font-size: 18px; }
  .btn.big { height: 46px; font-size: 24px; margin: 2px 0 8px; }
  .join input { height: 38px; font-size: 19px; }
  .sidecard { width: min(640px, calc(100vw - 16px)); }
  .pickside { grid-template-columns: auto 1fr; grid-template-rows: auto auto; justify-items: start; text-align: left; column-gap: 10px; padding: 10px; }
  .pickside .pic { grid-row: 1 / 3; width: 36px; height: 56px; }
  .pickside b { font-size: 24px; }
  .pickside ul { font-size: 14px; gap: 2px; }
  .credits ul { font-size: 14px; }
  .shop { width: min(560px, calc(100vw - 16px)); }
  .shoplist { grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 8px; }
  .vanpic { display: none; }
  .gunrow { grid-template-columns: 52px 1fr auto; padding: 5px 8px; column-gap: 8px; }
  .gunrow img { width: 52px; height: 24px; }
  .gunrow b { font-size: 18px; }
  .gunrow small { font-size: 12px; }
  .gunrow span { font-size: 16px; padding: 2px 6px; }
}
