* { margin:0; padding:0; box-sizing:border-box; font-family:'Segoe UI', Arial, sans-serif; }
html,body { width:100%; height:100%; background:#060708; overflow:hidden; color:#e8f2ec; }
#app { position:relative; width:100vw; height:100vh; }
#game-canvas { position:absolute; inset:0; width:100%; height:100%; display:block; background:#0a0c0d; }

.panel {
  position:absolute; background:rgba(16,19,20,0.78); border:1px solid rgba(120,255,180,0.18);
  border-radius:10px; backdrop-filter:blur(6px); padding:12px 14px; box-shadow:0 8px 24px rgba(0,0,0,0.4);
}
.panel-title { font-size:11px; letter-spacing:2px; color:#6fffb0; opacity:0.85; margin-bottom:8px; font-weight:600; }

#hud-top {
  position:absolute; top:0; left:0; right:0; height:52px; display:flex; align-items:center;
  justify-content:space-between; padding:0 18px; background:linear-gradient(180deg, rgba(8,9,10,0.9), rgba(8,9,10,0));
  z-index:5; pointer-events:none;
}
.logo { font-size:20px; font-weight:800; letter-spacing:1px; color:#eafff2; }
.logo.big { font-size:40px; text-align:center; }
.logo-dot { color:#5bff9e; }
#round-status { font-size:13px; color:#aab8b2; }
#score { font-size:18px; font-weight:700; display:flex; gap:6px; }
.score-player { color:#5bff9e; }
.score-enemy { color:#ff6b5b; }
.score-sep { color:#555; }
#phase-timer { font-size:20px; font-weight:800; color:#eafff2; min-width:30px; text-align:right; }

#hud-left { top:64px; left:14px; width:220px; z-index:5; }
#hud-right { top:64px; right:14px; width:220px; z-index:5; }
#hud-bottom {
  position:absolute; bottom:0; left:0; right:0; height:38px; display:flex; align-items:center;
  justify-content:center; background:linear-gradient(0deg, rgba(8,9,10,0.9), rgba(8,9,10,0)); z-index:5;
}
#hint { font-size:11px; color:#8a988f; pointer-events:none; }

.unit-card {
  display:flex; align-items:center; gap:8px; padding:7px 8px; border-radius:7px; margin-bottom:6px;
  background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.05); cursor:pointer; transition:0.15s;
}
.unit-card:hover { background:rgba(91,255,158,0.08); }
.unit-card.selected { border-color:#5bff9e; background:rgba(91,255,158,0.1); }
.unit-card.dead { opacity:0.35; cursor:default; }
.unit-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.unit-meta { flex:1; }
.unit-name { font-size:12px; font-weight:600; }
.unit-hpbar { height:4px; background:rgba(255,255,255,0.08); border-radius:3px; margin-top:4px; overflow:hidden; }
.unit-hpfill { height:100%; background:#5bff9e; transition:width 0.2s; }

#money { font-size:22px; font-weight:800; color:#eafff2; margin-bottom:10px; }
#money-val { color:#5bff9e; }
#selected-info { font-size:12px; color:#aab8b2; line-height:1.5; }

.overlay {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(5,6,7,0.86); z-index:20; backdrop-filter:blur(4px);
}
.hidden { display:none !important; }

.menu-panel { text-align:center; padding:30px; }
.menu-sub { font-size:13px; color:#8a988f; margin:10px 0 28px; letter-spacing:0.5px; }
#menu-buttons { display:flex; flex-direction:column; gap:10px; width:280px; margin:0 auto; }

.btn-primary, .btn-secondary {
  padding:13px 20px; border-radius:8px; border:none; font-size:14px; font-weight:700; letter-spacing:1px;
  cursor:pointer; transition:0.15s;
}
.btn-primary { background:#5bff9e; color:#06130a; }
.btn-primary:hover { background:#7dffb4; }
.btn-secondary { background:rgba(255,255,255,0.06); color:#e8f2ec; border:1px solid rgba(255,255,255,0.12); }
.btn-secondary:hover { background:rgba(255,255,255,0.1); }

.spinner { width:30px; height:30px; border:3px solid rgba(91,255,158,0.2); border-top-color:#5bff9e;
  border-radius:50%; margin:0 auto 14px; animation:spin 0.9s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
#search-text { font-size:13px; color:#aab8b2; margin-bottom:20px; }

.buy-panel { width:420px; background:rgba(16,19,20,0.95); border:1px solid rgba(120,255,180,0.2);
  border-radius:12px; padding:20px; }
#buy-units { display:flex; flex-direction:column; gap:10px; margin:14px 0 18px; max-height:360px; overflow-y:auto; }
.buy-unit-row { background:rgba(255,255,255,0.03); border-radius:8px; padding:10px; }
.buy-unit-head { display:flex; justify-content:space-between; font-size:13px; font-weight:700; margin-bottom:8px; }
.buy-items { display:flex; gap:6px; flex-wrap:wrap; }
.buy-item {
  font-size:11px; padding:6px 9px; border-radius:6px; background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.08); cursor:pointer; transition:0.15s;
}
.buy-item:hover { background:rgba(91,255,158,0.12); border-color:rgba(91,255,158,0.3); }
.buy-item.owned { background:rgba(91,255,158,0.18); border-color:#5bff9e; color:#5bff9e; cursor:default; }
.buy-item.disabled { opacity:0.35; cursor:not-allowed; }

.result-title { font-size:36px; font-weight:800; margin-bottom:10px; }
.result-title.win { color:#5bff9e; }
.result-title.lose { color:#ff6b5b; }
#result-sub { font-size:14px; color:#aab8b2; margin-bottom:26px; }

@media (max-width: 720px) {
  #hud-left { width:150px; font-size:11px; }
  #hud-right { width:150px; }
  .logo { font-size:15px; }
  #round-status { display:none; }
  .buy-panel { width:92vw; }
  #menu-buttons { width:88vw; }
}
