:root {
  color-scheme: dark;
  --bg: #07111d;
  --panel: rgba(8, 22, 35, .94);
  --panel-2: rgba(16, 35, 50, .9);
  --line: rgba(154, 209, 224, .16);
  --text: #ecfaff;
  --muted: #8ea7b7;
  --green: #23d7a5;
  --green-2: #6cf5cf;
  --yellow: #f9d65c;
  --red: #ff6885;
  --blue: #64b9ff;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
#game-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.glass { background: linear-gradient(145deg, rgba(12, 32, 48, .96), rgba(5, 17, 28, .97)); border: 1px solid rgba(133, 216, 224, .18); box-shadow: 0 28px 80px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.04); backdrop-filter: blur(22px); }
.topbar { position: fixed; top: 14px; left: 14px; right: 14px; min-height: 70px; display: flex; align-items: stretch; gap: 2px; background: rgba(5, 17, 28, .91); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.28); backdrop-filter: blur(16px); z-index: 20; overflow: hidden; }
.brand-button { display: flex; align-items: center; gap: 12px; min-width: 235px; border: 0; background: linear-gradient(90deg, rgba(35,215,165,.12), transparent); padding: 10px 18px; cursor: pointer; text-align: left; }
.brand-button strong, .brand-button small { display: block; }
.brand-button small { margin-top: 3px; color: var(--muted); }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #04231a; font-weight: 900; background: var(--green); box-shadow: 0 0 28px rgba(35,215,165,.25); }
.metric { min-width: 145px; flex: 1; padding: 13px 18px; border-left: 1px solid var(--line); }
.metric span, .metric strong { display: block; white-space: nowrap; }
.metric span { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }
.metric strong { margin-top: 5px; font-size: 1.08rem; }
.top-actions { display: flex; align-items: center; gap: 7px; padding: 0 12px; border-left: 1px solid var(--line); }
.icon-button { border: 1px solid var(--line); background: rgba(255,255,255,.035); width: 38px; height: 38px; border-radius: 11px; cursor: pointer; font-size: 1.12rem; }
.icon-button:hover { background: rgba(35,215,165,.12); border-color: rgba(35,215,165,.35); }
.toolbar { position: fixed; z-index: 21; left: 14px; top: 98px; width: 80px; display: flex; flex-direction: column; padding: 7px; gap: 5px; background: rgba(5,17,28,.91); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.28); backdrop-filter: blur(16px); }
.toolbar button { position: relative; border: 0; background: transparent; padding: 8px 3px; min-height: 58px; border-radius: 11px; cursor: pointer; color: var(--muted); }
.toolbar button span { display: block; color: var(--text); font-size: 1.35rem; line-height: 1; }
.toolbar button small { display: block; margin-top: 5px; font-size: .66rem; }
.toolbar button:hover, .toolbar button.active { color: var(--green-2); background: rgba(35,215,165,.1); }
.badge { position: absolute; top: 5px; right: 7px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; background: var(--red); color: white; font-size: .65rem; display: grid; place-items: center; }
.panel { position: fixed; z-index: 22; top: 98px; left: 104px; bottom: 78px; width: min(430px, calc(100vw - 130px)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 25px 70px rgba(0,0,0,.42); overflow: hidden; backdrop-filter: blur(20px); }
.panel > header { display: flex; justify-content: space-between; align-items: center; padding: 20px 21px 16px; border-bottom: 1px solid var(--line); }
.panel > header h2 { margin: 3px 0 0; font-size: 1.28rem; }
.panel > header small { color: var(--green-2); text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; }
.panel-content { overflow: auto; height: calc(100% - 77px); padding: 18px 20px 30px; }
.inspector { position: fixed; z-index: 22; top: 98px; right: 14px; width: 330px; max-height: calc(100vh - 176px); overflow: auto; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 25px 70px rgba(0,0,0,.42); backdrop-filter: blur(20px); }
.inspector > .icon-button { float: right; }
.inspector h2 { margin: 4px 0 10px; font-size: 1.55rem; }
.inspector > small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.owner-pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: rgba(142,167,183,.12); color: #c9dbe5; font-size: .78rem; margin-bottom: 15px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 17px; }
.stat { padding: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 12px; }
.stat span, .stat strong { display: block; }
.stat span { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.stat strong { margin-top: 5px; }
.stack { display: flex; flex-direction: column; gap: 9px; }
.timebar { position: fixed; z-index: 20; left: 104px; right: 14px; bottom: 14px; min-height: 55px; display: flex; align-items: center; gap: 7px; padding: 8px; background: rgba(5,17,28,.91); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.28); backdrop-filter: blur(16px); }
.timebar > button { width: 44px; height: 38px; border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 10px; cursor: pointer; font-size: .78rem; }
.timebar > button.active { color: #031b14; background: var(--green); border-color: var(--green); }
.project-summary { margin-left: 8px; min-width: 0; flex: 1; display: grid; grid-template-columns: auto minmax(120px, 1fr) minmax(120px, 260px); align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; }
.progress { height: 7px; background: rgba(255,255,255,.08); border-radius: 8px; overflow: hidden; }
.progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--green), var(--yellow)); transition: width .3s ease; }
.start-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 25% 20%, rgba(35,215,165,.18), transparent 30%), radial-gradient(circle at 80% 80%, rgba(100,185,255,.13), transparent 35%), rgba(3,10,17,.84); backdrop-filter: blur(10px); overflow: auto; }
.start-card { width: min(1020px, 100%); border-radius: 26px; padding: 32px; }
.logo-lockup { display: flex; gap: 22px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 25px; }
.logo-lockup p { color: var(--green-2); letter-spacing: .22em; font-size: .68rem; font-weight: 800; margin: 0 0 6px; }
.logo-lockup h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 5rem); line-height: .78; letter-spacing: -.06em; }
.logo-lockup h2 { margin: 13px 0 0; color: var(--muted); font-size: .96rem; font-weight: 500; }
.logo-mark { width: 105px; height: 105px; border-radius: 28px; background: linear-gradient(145deg, #36e4b3, #148e77); box-shadow: 0 24px 50px rgba(35,215,165,.25); display: flex; align-items: end; justify-content: center; gap: 8px; padding: 24px; transform: rotate(-4deg); }
.logo-mark span { width: 14px; border-radius: 10px 10px 2px 2px; background: #07251e; }
.logo-mark span:nth-child(1){height:35%}.logo-mark span:nth-child(2){height:65%}.logo-mark span:nth-child(3){height:100%}
.start-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 34px; padding: 26px 0 10px; }
h3 { margin: 0 0 15px; }
label { display: block; color: var(--muted); font-size: .78rem; margin: 11px 0; }
input, select { display: block; width: 100%; margin-top: 6px; padding: 12px 13px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.045); color: var(--text); }
select option { background: #102333; }
.primary, .secondary, .ghost, .danger { border-radius: 11px; padding: 11px 14px; cursor: pointer; font-weight: 700; border: 1px solid transparent; }
.primary { color: #03271d; background: linear-gradient(135deg, var(--green-2), var(--green)); }
.secondary { color: var(--text); background: rgba(100,185,255,.12); border-color: rgba(100,185,255,.25); }
.ghost { color: var(--text); background: rgba(255,255,255,.035); border-color: var(--line); }
.danger { color: #fff; background: rgba(255,104,133,.15); border-color: rgba(255,104,133,.3); }
.large { width: 100%; padding: 13px 16px; margin-top: 11px; }
button:disabled { opacity: .42; cursor: not-allowed; }
.save-card { min-height: 115px; padding: 15px; border: 1px dashed rgba(142,167,183,.28); border-radius: 13px; line-height: 1.6; }
.start-card footer { text-align: center; color: var(--muted); font-size: .72rem; padding-top: 12px; }
.text-link { display: block; text-align: center; margin: 16px 0 0; color: var(--green-2); font-size: .82rem; }
.modal-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(2,8,14,.76); backdrop-filter: blur(10px); }
.modal { position: relative; width: min(540px, 100%); max-height: min(780px, 92vh); overflow: auto; border-radius: 22px; padding: 26px; }
.modal-close { position: absolute; top: 15px; right: 15px; }
.modal h2 { margin: 0 48px 8px 0; }
.modal p { color: var(--muted); line-height: 1.6; }
.tooltip { position: fixed; z-index: 70; pointer-events: none; max-width: 220px; padding: 9px 11px; border-radius: 10px; background: rgba(4,14,24,.95); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0,0,0,.4); font-size: .75rem; }
.toast-stack { position: fixed; z-index: 100; right: 18px; bottom: 85px; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.toast { padding: 13px 15px; border-radius: 13px; background: #102536; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.35); animation: toast-in .25s ease; }
.toast.success { border-color: rgba(35,215,165,.35); }.toast.error { border-color: rgba(255,104,133,.42); }.toast strong { display: block; }.toast small { display: block; margin-top: 3px; color: var(--muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.build-banner { position: fixed; z-index: 31; top: 99px; left: 50%; transform: translateX(-50%); padding: 11px 18px; border-radius: 999px; color: #241d00; background: var(--yellow); font-weight: 800; font-size: .82rem; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.card { padding: 15px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.025); margin-bottom: 11px; }
.card h4 { margin: 0 0 8px; }.card p { margin: 5px 0; color: var(--muted); line-height: 1.5; }
.kpi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; }
.kpi { padding: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 13px; }
.kpi span, .kpi strong { display: block; }.kpi span { color: var(--muted); font-size: .72rem; }.kpi strong { margin-top: 6px; font-size: 1.16rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range-row { margin: 16px 0; }.range-row header { display: flex; justify-content: space-between; align-items: center; }.range-row input[type=range] { padding: 0; accent-color: var(--green); }
.table { width: 100%; border-collapse: collapse; font-size: .78rem; }.table th, .table td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; }.table th { color: var(--muted); font-weight: 500; }
.positive { color: var(--green-2) !important; }.negative { color: var(--red) !important; }.warning { color: var(--yellow) !important; }
.objective { margin: 13px 0; }.objective header { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; }.objective.complete header { color: var(--green-2); }
.inbox-item { padding: 13px; border-left: 3px solid var(--line); background: rgba(255,255,255,.025); border-radius: 0 10px 10px 0; margin-bottom: 9px; }.inbox-item.unread { border-left-color: var(--green); }.inbox-item h4 { margin: 0 0 5px; }.inbox-item p { margin: 0; color: var(--muted); font-size: .79rem; line-height: 1.5; }.inbox-item small { display: block; margin-top: 8px; color: #668296; }
@media (max-width: 900px) {
  .metric:nth-of-type(3), .metric:nth-of-type(4) { display: none; }
  .brand-button { min-width: 200px; }
  .inspector { width: 300px; }
  .project-summary { grid-template-columns: 1fr; gap: 3px; }
  .project-summary .progress { display: none; }
  .start-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .topbar { top: 7px; left: 7px; right: 7px; min-height: 58px; }
  .brand-button { min-width: 0; flex: 1; padding: 8px 10px; }.brand-mark { width: 36px; height: 36px; }.metric { min-width: 105px; padding: 10px; }.metric:nth-of-type(n+2) { display: none; }
  .toolbar { top: auto; left: 7px; right: 7px; bottom: 64px; width: auto; flex-direction: row; overflow-x: auto; justify-content: space-between; padding: 4px; }.toolbar button { min-width: 57px; min-height: 50px; }.toolbar button small { font-size: .58rem; }
  .timebar { left: 7px; right: 7px; bottom: 7px; min-height: 50px; }.project-summary { display: none; }
  .panel { top: 72px; left: 7px; right: 7px; bottom: 125px; width: auto; }
  .inspector { top: 72px; left: 7px; right: 7px; bottom: 125px; width: auto; max-height: none; }
  .start-screen { padding: 8px; }.start-card { padding: 20px; }.logo-mark { width: 78px; height: 78px; padding: 18px; }.logo-lockup h1 { font-size: 2.35rem; }.logo-lockup h2 { display: none; }
}
