:root {
  --bg: #080617;
  --panel: rgba(16, 12, 38, .88);
  --panel-2: rgba(29, 20, 60, .92);
  --line: rgba(255,255,255,.11);
  --text: #f8f7ff;
  --muted: #aaa5c5;
  --cyan: #42e8ff;
  --pink: #ff3fb4;
  --purple: #9567ff;
  --gold: #ffd35a;
  --green: #63f5a6;
  --danger: #ff617c;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
body { overscroll-behavior: none; touch-action: none; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.glass { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 14px 45px rgba(0,0,0,.38); backdrop-filter: blur(18px); }

.topbar { position: fixed; inset: max(10px, env(safe-area-inset-top)) 12px auto; height: 66px; border-radius: 18px; display: flex; align-items: center; padding: 8px 12px; z-index: 20; }
.brand { display:flex; align-items:center; gap:10px; background:none; text-align:left; padding:0 9px 0 0; }
.brand-mark { display:grid; place-items:center; width:42px; height:42px; border-radius:13px; font:800 27px/1 'Arial Narrow','Segoe UI',sans-serif; background:linear-gradient(145deg,var(--pink),var(--purple)); box-shadow:0 0 24px rgba(255,63,180,.5); transform:skew(-7deg); }
.brand strong { display:block; font:800 20px/18px 'Arial Narrow','Segoe UI',sans-serif; letter-spacing:1.6px; }
.brand small { display:block; color:var(--muted); font:600 8px/12px Inter; letter-spacing:1.8px; }
.stats { display:flex; align-items:center; justify-content:center; gap:clamp(9px,3vw,34px); flex:1; }
.stat { display:grid; grid-template-columns:22px auto; align-items:center; column-gap:5px; min-width:66px; }
.stat>span { grid-row:1/3; color:var(--pink); font-size:20px; text-shadow:0 0 12px currentColor; }
.stat.cash>span { color:var(--gold); }
.stat strong { font:700 18px/20px 'Arial Narrow','Segoe UI',sans-serif; }
.stat small { color:var(--muted); font:600 8px/10px Inter; letter-spacing:1px; }
.level-pill { width:110px; height:46px; border-radius:13px; background:rgba(255,255,255,.06); padding:5px 9px; display:grid; grid-template-columns:auto 1fr; align-items:center; gap:0 7px; }
.level-pill span { font:700 8px Inter; color:var(--muted); }
.level-pill strong { font:800 22px 'Arial Narrow','Segoe UI',sans-serif; color:var(--cyan); }
.level-pill i { grid-column:1/3; height:4px; border-radius:9px; background:#2b2544; overflow:hidden; }
.level-pill b { display:block; width:0; height:100%; background:linear-gradient(90deg,var(--cyan),var(--purple)); transition:width .3s; }

#gameShell { position:absolute; inset:0; background:radial-gradient(circle at 50% 35%,#261858 0,#0b0820 47%,#05040e 100%); }
#gameCanvas { position:absolute; inset:0; width:100%; height:100%; touch-action:none; }
.objectives { position:fixed; right:14px; top:90px; width:250px; z-index:12; border-radius:15px; padding:12px; transition:all .2s; }
.objectives.collapsed #objectiveList { display:none; }
.panel-heading { display:flex; align-items:center; justify-content:space-between; color:var(--muted); font:700 9px Inter; letter-spacing:1.5px; }
.panel-heading button { background:none; font-size:18px; color:var(--muted); }
.objective { margin-top:11px; }
.objective-top { display:flex; justify-content:space-between; font-size:11px; gap:8px; }
.objective-top strong { font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.objective-top span { color:var(--gold); font-weight:700; }
.progress { height:5px; background:#2c2545; border-radius:10px; margin-top:6px; overflow:hidden; }
.progress b { display:block; height:100%; border-radius:10px; background:linear-gradient(90deg,var(--pink),var(--purple)); transition:width .35s; }
.objective.done { opacity:.55; }
.objective.done strong::before { content:'✓ '; color:var(--green); }
.venue-badge { position:fixed; left:14px; top:91px; z-index:12; border-radius:14px; padding:9px 10px; display:flex; align-items:center; gap:9px; }
.venue-badge small { display:block; color:var(--green); font:700 7px Inter; letter-spacing:1.4px; }
.venue-badge strong { display:block; font:700 14px 'Arial Narrow','Segoe UI',sans-serif; letter-spacing:.5px; }
.venue-badge button { background:none; color:var(--muted); font-size:14px; }
.open-dot { width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 12px var(--green); }
.zoom-tools { position:fixed; right:14px; bottom:102px; z-index:12; border-radius:13px; padding:5px; display:grid; }
.zoom-tools button { width:36px;height:34px;background:none;color:var(--muted);font-size:20px;border-bottom:1px solid var(--line); }
.zoom-tools button:last-child { border-bottom:0; font-size:17px; }

.dock { position:fixed; left:50%; bottom:max(12px, env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:30; height:72px; padding:6px; border-radius:20px; display:flex; gap:3px; }
.dock-tab { width:76px; border-radius:14px; background:none; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; color:var(--muted); font:700 8px Inter; letter-spacing:.6px; }
.dock-tab span { font-size:20px; line-height:20px; }
.dock-tab.active { color:#fff; background:linear-gradient(160deg,rgba(255,63,180,.28),rgba(149,103,255,.22)); box-shadow:inset 0 0 0 1px rgba(255,255,255,.08); }
.dock-tab.active span { color:var(--pink); text-shadow:0 0 14px var(--pink); }

.drawer { position:fixed; z-index:25; left:50%; bottom:95px; transform:translate(-50%, calc(100% + 130px)); width:min(760px,calc(100vw - 24px)); max-height:min(45vh,410px); border-radius:20px; padding:15px; transition:transform .25s ease; overflow:auto; }
.drawer.open { transform:translate(-50%,0); }
.drawer-handle { display:none; width:36px;height:4px;background:#635c7e;border-radius:8px;margin:-6px auto 10px; }
.drawer-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.drawer-header small { color:var(--pink); font:700 8px Inter; letter-spacing:1.7px; }
.drawer-header h2 { margin:1px 0 0; font:700 22px 'Arial Narrow','Segoe UI',sans-serif; }
.drawer-header button { background:none; color:var(--muted); font-size:25px; }
.catalog { display:grid; grid-template-columns:repeat(auto-fit,minmax(115px,1fr)); gap:9px; }
.item-card { position:relative; min-height:100px; border-radius:14px; padding:11px; text-align:left; background:linear-gradient(145deg,rgba(255,255,255,.07),rgba(255,255,255,.025)); border:1px solid rgba(255,255,255,.07); overflow:hidden; }
.item-card:hover,.item-card.selected { border-color:var(--pink); background:rgba(255,63,180,.13); }
.item-card.locked { opacity:.45; filter:saturate(.5); }
.item-icon { font-size:29px; display:block; height:38px; filter:drop-shadow(0 0 8px currentColor); }
.item-card strong { display:block; font:700 15px 'Arial Narrow','Segoe UI',sans-serif; }
.item-card small { color:var(--muted); font-size:9px; }
.item-card .price { position:absolute;right:9px;top:9px;color:var(--gold);font:700 10px Inter; }
.tool-row { display:flex;gap:8px;margin-bottom:10px; }
.tool-button { padding:8px 12px;border-radius:10px;background:rgba(255,255,255,.07);color:var(--muted);font-size:11px;font-weight:700; }
.tool-button.active { background:var(--pink);color:white; }
.staff-grid,.upgrade-grid,.menu-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px; }
.staff-card,.upgrade-card,.menu-card,.music-card { background:rgba(255,255,255,.05);border:1px solid var(--line);border-radius:14px;padding:13px;display:flex;align-items:center;gap:11px; }
.staff-avatar { width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:#34245f;font-size:23px; }
.card-copy { flex:1; }
.card-copy strong { display:block;font:700 17px 'Arial Narrow','Segoe UI',sans-serif; }
.card-copy small { display:block;color:var(--muted);font-size:9px;line-height:13px; }
.action-button { background:linear-gradient(135deg,var(--pink),#963fff);padding:8px 10px;border-radius:9px;font-size:9px;font-weight:800;white-space:nowrap; }
.action-button:disabled { opacity:.35;cursor:not-allowed; }
.music-list { display:grid;gap:9px; }
.music-card { width:100%;text-align:left; }
.music-card.active { border-color:var(--cyan);box-shadow:inset 0 0 22px rgba(66,232,255,.08); }
.music-wave { width:55px;height:35px;display:flex;align-items:center;justify-content:center;gap:3px; }
.music-wave i { width:3px;height:var(--h);background:linear-gradient(var(--cyan),var(--purple));border-radius:4px; }
.music-card.active .music-wave i { animation:wave .7s ease-in-out infinite alternate;animation-delay:var(--d); }
@keyframes wave { to { transform:scaleY(.35); } }

.toast { position:fixed;left:50%;top:90px;transform:translate(-50%,-20px);background:#161128;border:1px solid var(--line);border-radius:12px;padding:9px 14px;font-size:11px;font-weight:600;opacity:0;pointer-events:none;transition:.2s;z-index:50; }
.toast.show { opacity:1;transform:translate(-50%,0); }
.floating-text { position:fixed;color:var(--gold);font:800 16px 'Arial Narrow','Segoe UI',sans-serif;text-shadow:0 2px 7px #000;pointer-events:none;animation:floatUp 1.3s ease-out forwards;z-index:15; }
@keyframes floatUp { to { transform:translateY(-45px);opacity:0; } }
.modal-backdrop { position:fixed;inset:0;background:rgba(3,2,10,.7);z-index:100;display:grid;place-items:center;padding:16px;backdrop-filter:blur(8px); }
.modal-backdrop[hidden] { display:none; }
.modal { width:min(480px,100%);max-height:90vh;overflow:auto;border-radius:22px;padding:22px; }
.modal.welcome { width:min(760px,100%);padding:0;overflow:hidden; }
.welcome-art { width:100%;height:250px;object-fit:cover;display:block;mask-image:linear-gradient(to bottom,#000 68%,transparent 100%); }
.welcome-copy { padding:0 24px 22px;margin-top:-30px;position:relative; }
.modal h1,.modal h2 { font-family:'Arial Narrow','Segoe UI',sans-serif;margin:0 0 7px; }
.modal p { color:var(--muted);font-size:12px;line-height:19px; }
.modal-actions { display:flex;gap:9px;justify-content:flex-end;margin-top:18px;flex-wrap:wrap; }
.secondary-button,.primary-button,.danger-button { padding:10px 15px;border-radius:11px;font-weight:700;font-size:11px; }
.secondary-button { background:rgba(255,255,255,.08); }
.primary-button { background:linear-gradient(135deg,var(--pink),var(--purple)); }
.danger-button { background:rgba(255,97,124,.15);color:var(--danger); }
.field { width:100%;background:#0e0a20;border:1px solid var(--line);border-radius:11px;color:#fff;padding:11px;margin-top:8px;outline:0; }
.field:focus { border-color:var(--pink); }

@media (max-width: 700px) {
  .topbar { height:58px;inset:max(6px,env(safe-area-inset-top)) 7px auto;padding:6px; }
  .brand-mark { width:35px;height:35px;font-size:23px; }
  .brand strong { font-size:16px;line-height:15px; }
  .brand small { display:none; }
  .stats { gap:5px; }
  .stat { min-width:48px;grid-template-columns:15px auto;column-gap:2px; }
  .stat>span { font-size:14px; }
  .stat strong { font-size:14px;line-height:14px; }
  .stat small { font-size:6px; }
  .level-pill { width:57px;height:40px;padding:4px 7px;grid-template-columns:auto 1fr;gap:3px; }
  .level-pill strong { font-size:17px; }
  .objectives { top:70px;right:7px;width:190px;padding:9px; }
  .objective-top { font-size:9px; }
  .venue-badge { top:70px;left:7px; }
  .venue-badge div,.venue-badge button { display:none; }
  .dock { bottom:max(7px,env(safe-area-inset-bottom));width:calc(100% - 14px);height:64px;border-radius:17px;justify-content:space-around; }
  .dock-tab { width:auto;flex:1;font-size:7px; }
  .dock-tab span { font-size:18px; }
  .drawer { bottom:79px;width:calc(100% - 14px);max-height:48vh;padding:13px;border-radius:18px; }
  .drawer-handle { display:block; }
  .drawer-header h2 { font-size:19px; }
  .catalog { display:flex;overflow-x:auto;grid-template-columns:none;padding-bottom:4px;scroll-snap-type:x mandatory; }
  .item-card { flex:0 0 108px;min-height:91px;scroll-snap-align:start; }
  .zoom-tools { right:7px;bottom:84px; }
  .welcome-art { height:190px; }
  .welcome-copy { padding:0 17px 17px; }
}

@media (max-width: 420px) {
  .brand span:last-child { display:none; }
  .objectives { width:170px; }
  .staff-grid,.upgrade-grid,.menu-grid { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration:.01ms!important;transition-duration:.01ms!important; } }
