@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/BarlowCondensed-Regular.ttf'); font-weight: 400; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/BarlowCondensed-SemiBold.ttf'); font-weight: 600; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/BarlowCondensed-SemiBold.ttf'); font-weight: 700; }
@font-face { font-family: 'Plex Mono'; src: url('../fonts/IBMPlexMono-Medium.ttf'); font-weight: 500; }
:root { --bg: rgba(10,15,21,.86); --bg2: rgba(20,28,37,.92); --line: rgba(255,255,255,.09); --ink: #e9ecef; --dim: #8d99a6; --amber: #e8a33a; --amber2: #ffbf5c; --good: #57c78a; --bad: #e65b47; --blue: #5a9bd4; --r: 10px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #070b0f; color: var(--ink); font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 16px; user-select: none; -webkit-user-select: none; }
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font-family: inherit; color: inherit; cursor: pointer; }
.mono { font-family: 'Plex Mono', monospace; }
.hidden { display: none !important; }
/* boot */
#boot { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 60%, #15202b 0%, #070b0f 70%); transition: opacity .6s; }
#boot.out { opacity: 0; pointer-events: none; }
.boot-in { width: min(420px, 80vw); text-align: center; }
.sc-mark { display: inline-flex; align-items: center; gap: 12px; letter-spacing: .18em; font-weight: 700; font-size: 22px; line-height: .95; text-align: left; }
.sc-mark .bar { width: 6px; height: 46px; background: var(--amber); display: inline-block; }
.sc-mark b { display: block; }
.boot-title { margin: 26px 0 18px; font-size: 38px; font-weight: 700; letter-spacing: .06em; }
.boot-bar { height: 4px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--amber2)); transition: width .25s; }
#bootTxt { margin-top: 10px; color: var(--dim); letter-spacing: .12em; font-size: 14px; text-transform: uppercase; }
/* generic panels */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui > * { pointer-events: auto; }
.glass { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.btn { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 8px 14px; font-size: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; transition: background .15s, transform .08s; }
.btn:hover { background: rgba(255,255,255,.12); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #f0ae45, #d98f22); color: #1a1206; border-color: #ffc56a; }
.btn.primary:hover { background: linear-gradient(180deg, #ffbe58, #e79a2a); }
.btn.danger { background: rgba(230,91,71,.18); border-color: rgba(230,91,71,.5); color: #ffb3a6; }
.btn.small { padding: 5px 10px; font-size: 14px; }
.btn:disabled { opacity: .4; pointer-events: none; }
.kicker { font-size: 12px; letter-spacing: .2em; color: var(--amber); text-transform: uppercase; font-weight: 600; }
h2 { margin: 2px 0 10px; font-size: 28px; letter-spacing: .03em; font-weight: 700; }
h3 { margin: 14px 0 6px; font-size: 18px; letter-spacing: .05em; font-weight: 600; color: #cfd6dc; text-transform: uppercase; }
.dim { color: var(--dim); }
.good { color: var(--good); } .bad { color: var(--bad); } .amber { color: var(--amber2); }
/* top HUD */
#top { position: absolute; left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); top: calc(8px + var(--safe-t)); display: flex; gap: 8px; align-items: stretch; pointer-events: none; }
#top > * { pointer-events: auto; }
.stat { padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.stat .l { font-size: 11px; letter-spacing: .18em; color: var(--dim); text-transform: uppercase; white-space: nowrap; }
.stat .bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); margin-top: 4px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--amber); }
.stat.money .v { color: #f6f1e4; }
.spacer { flex: 1; }
.speed { display: flex; gap: 4px; padding: 5px; align-items: center; }
.speed button { width: 40px; height: 36px; border-radius: 7px; border: 1px solid transparent; background: transparent; font-size: 15px; font-weight: 700; }
.speed button.on { background: var(--amber); color: #1a1206; }
.clock .v { font-family: 'Plex Mono', monospace; font-size: 18px; }
/* feed */
#feed { position: absolute; left: calc(10px + var(--safe-l)); top: calc(78px + var(--safe-t)); width: min(340px, 42vw); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.note { pointer-events: auto; padding: 8px 12px 8px 14px; font-size: 15px; line-height: 1.25; border-left: 3px solid var(--blue); animation: noteIn .35s ease-out; cursor: pointer; }
.note.warn { border-left-color: var(--bad); } .note.good { border-left-color: var(--good); } .note.level, .note.event { border-left-color: var(--amber); } .note.ship { border-left-color: #7fc6e8; }
.note.out { opacity: 0; transform: translateX(-20px); transition: all .5s; }
@keyframes noteIn { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
/* vessels widget */
#vessels { position: absolute; right: calc(10px + var(--safe-r)); top: calc(78px + var(--safe-t)); width: min(270px, 34vw); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.vsl { font-size: 14px; cursor: pointer; }
.vsl .n { font-weight: 700; letter-spacing: .04em; } .vsl .s { color: var(--dim); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.vsl .pb { height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); margin-top: 3px; overflow: hidden; display: flex; }
.vsl .pb i { display: block; height: 100%; } .vsl .pb i.a { background: #7fc6e8; } .vsl .pb i.b { background: var(--amber); }
/* toolbar */
#bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); display: flex; gap: 6px; padding: 6px; }
#bar button { width: 84px; height: 62px; border-radius: 9px; border: 1px solid transparent; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 13px; font-weight: 600; letter-spacing: .12em; }
#bar button svg { width: 26px; height: 26px; }
#bar button:hover { background: rgba(255,255,255,.07); }
#bar button.on { background: rgba(232,163,58,.18); border-color: rgba(232,163,58,.5); color: var(--amber2); }
#bar .badge { position: absolute; margin: -34px 0 0 40px; background: var(--bad); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 5px; }
/* build drawer */
#drawer { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); width: min(980px, 96vw); padding: 10px 12px 12px; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; overflow-x: auto; }
.tabs button { background: transparent; border: none; padding: 6px 12px; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--dim); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--amber); }
.cards { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.card { flex: 0 0 132px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px 8px; cursor: pointer; position: relative; transition: border-color .15s, transform .1s; }
.card:hover { border-color: rgba(232,163,58,.6); transform: translateY(-2px); }
.card img { width: 100%; height: 88px; object-fit: contain; display: block; filter: drop-shadow(0 6px 8px rgba(0,0,0,.45)); }
.card .t { font-size: 15px; font-weight: 600; line-height: 1.05; margin-top: 2px; }
.card .c { font-size: 14px; color: var(--amber2); font-family: 'Plex Mono', monospace; }
.card.locked { opacity: .45; }
.card .lock { position: absolute; right: 6px; top: 6px; font-size: 11px; background: rgba(0,0,0,.6); padding: 1px 6px; border-radius: 6px; letter-spacing: .1em; }
/* placement bar */
#place { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); padding: 8px 10px; display: flex; gap: 10px; align-items: center; }
#place .info { min-width: 220px; } #place .info b { font-size: 18px; } #place .err { color: var(--bad); font-size: 14px; } #place .hint { color: var(--dim); font-size: 13px; }
/* side panel (selection) */
#side { position: absolute; right: calc(10px + var(--safe-r)); bottom: calc(86px + var(--safe-b)); width: min(320px, 40vw); padding: 12px 14px; max-height: 60vh; overflow-y: auto; }
.kv { display: flex; justify-content: space-between; font-size: 15px; padding: 3px 0; border-bottom: 1px dashed rgba(255,255,255,.06); }
.kv span:first-child { color: var(--dim); }
.row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
/* modal */
#modal { position: absolute; inset: 0; background: rgba(4,7,10,.55); display: grid; place-items: center; z-index: 20; }
.sheet { width: min(980px, 94vw); max-height: 86vh; display: flex; flex-direction: column; padding: 16px 18px; }
.sheet .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sheet .body { overflow-y: auto; margin-top: 6px; padding-right: 4px; }
.x { background: transparent; border: none; font-size: 28px; line-height: 1; color: var(--dim); padding: 0 4px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.tile { background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.tile .tt { font-size: 18px; font-weight: 700; } .tile .ts { font-size: 13px; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }
.tag { display: inline-block; font-size: 11px; letter-spacing: .14em; padding: 1px 7px; border-radius: 5px; background: rgba(232,163,58,.18); color: var(--amber2); margin-left: 6px; vertical-align: middle; }
.tag.blue { background: rgba(90,155,212,.18); color: #9cc8ee; } .tag.red { background: rgba(230,91,71,.18); color: #ffb3a6; } .tag.green { background: rgba(87,199,138,.18); color: #9fe3bd; }
.testbanner { background: repeating-linear-gradient(45deg, rgba(232,163,58,.16) 0 12px, rgba(232,163,58,.08) 12px 24px); border: 1px solid rgba(232,163,58,.4); border-radius: 8px; padding: 8px 12px; font-size: 14px; margin: 6px 0 10px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.chart i { flex: 1; background: var(--good); border-radius: 2px 2px 0 0; min-height: 2px; position: relative; } .chart i.neg { background: var(--bad); }
.swatch { width: 26px; height: 26px; border-radius: 6px; display: inline-block; vertical-align: middle; border: 1px solid rgba(255,255,255,.25); margin-right: 8px; }
/* tutorial */
#tut { position: absolute; left: 50%; top: calc(80px + var(--safe-t)); transform: translateX(-50%); width: min(560px, 90vw); padding: 14px 16px; border-color: rgba(232,163,58,.5); z-index: 15; }
#tut p { margin: 4px 0 10px; font-size: 17px; line-height: 1.3; }
/* title */
#title { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: calc(28px + var(--safe-t)) calc(36px + var(--safe-r)) calc(28px + var(--safe-b)) calc(36px + var(--safe-l)); background: linear-gradient(90deg, rgba(5,8,11,.82) 0%, rgba(5,8,11,.35) 45%, rgba(5,8,11,0) 70%); }
#title .logo h1 { font-size: clamp(48px, 8vw, 96px); margin: 0; letter-spacing: .03em; line-height: .9; font-weight: 700; text-shadow: 0 4px 30px rgba(0,0,0,.5); }
#title .logo .sub { letter-spacing: .32em; color: var(--amber2); font-size: 16px; margin-top: 8px; }
#title .menu { display: flex; flex-direction: column; gap: 8px; width: 280px; }
#title .menu .btn { text-align: left; padding: 12px 16px; font-size: 19px; }
#title .foot { color: var(--dim); font-size: 13px; letter-spacing: .1em; }
/* confirm */
#confirm { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.5); z-index: 40; }
#confirm .box { width: min(440px, 90vw); padding: 18px; }
/* floating money popups */
.pop { position: absolute; font-weight: 700; font-size: 16px; color: var(--good); text-shadow: 0 2px 6px rgba(0,0,0,.8); pointer-events: none; animation: popUp 1.6s ease-out forwards; z-index: 5; }
@keyframes popUp { from { opacity: 0; transform: translate(-50%, 0); } 15% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -46px); } }
.icon3d { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: rgba(230,91,71,.92); display: grid; place-items: center; font-weight: 700; font-size: 16px; box-shadow: 0 0 12px rgba(230,91,71,.7); pointer-events: none; z-index: 4; }
@media (max-width: 760px), (max-height: 520px) {
  .stat .v { font-size: 18px; } .stat .l { font-size: 10px; } .stat { padding: 4px 8px; }
  #bar button { width: 64px; height: 52px; font-size: 11px; } #bar button svg { width: 22px; height: 22px; }
  #feed { top: calc(64px + var(--safe-t)); } #vessels { top: calc(64px + var(--safe-t)); }
  .card { flex-basis: 112px; } .card img { height: 70px; }
  #drawer, #place { bottom: calc(70px + var(--safe-b)); } #side { bottom: calc(70px + var(--safe-b)); }
  .hide-s { display: none !important; }
}
.ccard { background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.ccard .btn { align-self: flex-start; }
