:root{
  --bg0:#0b1020;
  --bg1:#0d1634;
  --panel:#0e1733cc;
  --panel2:#0f1b3fe6;
  --text:#f7f8ff;
  --muted:#b9c2ffcc;
  --hot:#ff4d6d;
  --hot2:#ffcc57;
  --good:#4dffb5;
  --outline:#243262;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --radius: 18px;
  --radius2: 26px;
  --uiScale: 1;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:
    radial-gradient(1200px 700px at 20% 15%, #1c2c78 0%, rgba(28,44,120,0) 55%),
    radial-gradient(900px 600px at 90% 25%, #6a1a3a 0%, rgba(106,26,58,0) 50%),
    radial-gradient(900px 600px at 65% 120%, #0a5a4e 0%, rgba(10,90,78,0) 55%),
    linear-gradient(180deg,var(--bg0),var(--bg1));
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  overflow:hidden;
}

.app{
  height:100%;
  display:grid;
  grid-template-rows:auto 1fr auto;
}

.topbar{
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  user-select:none;
}
.logoMark{
  width:42px;height:42px;
  border-radius:14px;
  display:grid;place-items:center;
  font-weight:900;
  letter-spacing:.5px;
  background:
    radial-gradient(14px 14px at 30% 30%, #fff 0%, rgba(255,255,255,0) 60%),
    linear-gradient(135deg, var(--hot), #8a4dff);
  box-shadow: 0 10px 24px rgba(255,77,109,.25);
  border:1px solid rgba(255,255,255,.18);
}
.brandText .title{
  font-weight:900;
  font-size:18px;
  line-height:1.05;
}
.brandText .subtitle{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}

.topbarRight{display:flex;gap:10px;align-items:center}
.pill{
  appearance:none;
  border:1px solid rgba(255,255,255,.14);
  color:var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  border-radius:999px;
  padding:10px 12px;
  font-weight:800;
  letter-spacing:.2px;
  cursor:pointer;
  box-shadow: 0 10px 20px rgba(0,0,0,.2);
  transform: translateZ(0);
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.pill:hover{filter:brightness(1.1)}
.pill:active{transform: translateY(1px) scale(.98)}
.pill:focus-visible{outline:3px solid rgba(255,204,87,.55); outline-offset:2px}

.main{
  min-height:0;
  display:grid;
  place-items:center;
  padding: 10px 12px 14px;
}

.stageWrap{
  width:min(1100px, 100%);
  height:min(680px, 100%);
  position:relative;
  border-radius: var(--radius2);
  overflow:hidden;
  box-shadow: var(--shadow);
  border:1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(500px 420px at 30% 30%, rgba(255,77,109,.18), rgba(255,77,109,0) 62%),
    radial-gradient(700px 520px at 75% 35%, rgba(77,255,181,.14), rgba(77,255,181,0) 60%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}

.gameCanvas{
  width:100%;
  height:100%;
  display:block;
  image-rendering:auto;
  background: transparent;
}

.hud{
  position:absolute;
  inset: 10px 10px auto 10px;
  display:flex;
  justify-content:space-between;
  gap: 10px;
  pointer-events:none;
}
.hudLeft,.hudRight{display:flex;gap:10px;align-items:stretch}
.hudStat{
  background: var(--panel);
  border:1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding:10px 12px;
  min-width:120px;
  box-shadow: 0 14px 26px rgba(0,0,0,.18);
}
.hudLabel{
  font-size:11px;
  color:var(--muted);
  font-weight:900;
  letter-spacing:.5px;
  text-transform:uppercase;
}
.hudValue{
  font-size:22px;
  font-weight:1000;
  margin-top:2px;
}
.meter{
  background: var(--panel);
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:10px 12px;
  min-width:220px;
}
.meterTop{display:flex;justify-content:space-between;gap:10px;align-items:baseline}
.meterLabel{font-size:11px;color:var(--muted);font-weight:900;text-transform:uppercase;letter-spacing:.5px}
.meterValue{font-size:11px;color:var(--muted);font-weight:900}
.meterBar{
  height:10px;
  border-radius:999px;
  margin-top:8px;
  background: rgba(255,255,255,.08);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
}
.meterFill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--hot2), var(--hot));
  border-radius:999px;
  transition: width .12s ease;
}
.cooldowns{
  display:flex;
  gap:10px;
}
.cd{
  background: var(--panel);
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:10px 12px;
  width:150px;
}
.cdName{font-size:11px;color:var(--muted);font-weight:900;text-transform:uppercase;letter-spacing:.5px}
.cdBar{
  height:10px;border-radius:999px;margin-top:8px;
  background: rgba(255,255,255,.08);
  overflow:hidden;border:1px solid rgba(255,255,255,.10);
}
.cdFill{
  height:100%;
  width:100%;
  background: linear-gradient(90deg, rgba(77,255,181,.95), rgba(255,204,87,.95));
  border-radius:999px;
  transition: width .08s linear;
}

.overlay{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  padding: 18px;
  pointer-events:none;
}

.panel{
  width:min(560px, 100%);
  background: var(--panel2);
  border:1px solid rgba(255,255,255,.14);
  border-radius: var(--radius2);
  padding: 16px;
  box-shadow: var(--shadow);
  pointer-events:auto;
}
.panelHeader{
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  margin-bottom:10px;
}
.panelTitle{
  font-weight:1000;
  font-size:22px;
  letter-spacing:.2px;
}
.panelSubtitle{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
}
.xBtn{
  width:40px;height:40px;border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  color:var(--text);
  background: rgba(255,255,255,.06);
  font-weight:1000;
  cursor:pointer;
  transition: transform .12s ease, filter .12s ease;
}
.xBtn:hover{filter:brightness(1.1)}
.xBtn:active{transform: translateY(1px) scale(.98)}
.xBtn:focus-visible{outline:3px solid rgba(255,204,87,.55); outline-offset:2px}

.menuGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top: 12px;
}
.bigBtn{
  border:1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  padding: 14px 14px;
  background:
    radial-gradient(120px 80px at 20% 25%, rgba(255,255,255,.11), rgba(255,255,255,0) 60%),
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  cursor:pointer;
  color:var(--text);
  text-align:left;
  box-shadow: 0 14px 22px rgba(0,0,0,.20);
  transition: transform .12s ease, filter .12s ease, border-color .12s ease;
}
.bigBtn:hover{filter:brightness(1.1); border-color: rgba(255,204,87,.35)}
.bigBtn:active{transform: translateY(1px) scale(.99)}
.bigBtn:focus-visible{outline:3px solid rgba(255,204,87,.55); outline-offset:2px}
.bigBtn .btnTitle{font-weight:1000;font-size:16px}
.bigBtn .btnSub{margin-top:4px;color:var(--muted);font-size:12px;line-height:1.35}
.bigBtn.primary{
  background:
    radial-gradient(160px 110px at 25% 25%, rgba(255,255,255,.13), rgba(255,255,255,0) 65%),
    linear-gradient(135deg, rgba(255,77,109,.35), rgba(138,77,255,.22)),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border-color: rgba(255,77,109,.35);
}

.splitRow{display:grid;grid-template-columns: 1fr 1fr; gap:12px; margin-top:12px}
.card{
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  padding: 12px;
  background: rgba(255,255,255,.04);
}
.cardTitle{font-weight:1000;font-size:13px;letter-spacing:.35px;text-transform:uppercase;color:var(--muted)}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.chip{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color:var(--text);
  border-radius:999px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:900;
  font-size:12px;
  transition: transform .12s ease, filter .12s ease, border-color .12s ease;
}
.chip:hover{filter:brightness(1.1)}
.chip:active{transform: translateY(1px) scale(.99)}
.chip.selected{border-color: rgba(77,255,181,.45); box-shadow: 0 0 0 2px rgba(77,255,181,.15) inset}

.list{
  margin: 10px 0 0 0;
  padding-left: 18px;
  color: var(--text);
}
.list li{margin: 6px 0; color: var(--text)}
.muted{color:var(--muted)}

.footer{
  padding: 10px 14px 12px;
  color: var(--muted);
  font-weight:800;
  font-size: 12px;
  user-select:none;
}
.hintRow{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:center}
.kbd{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  border-radius:10px;
  padding: 3px 8px;
  color: var(--text);
  font-weight:1000;
}
.dot{opacity:.7; padding:0 2px}

.mobileControls{
  position:absolute;
  inset: auto 10px 10px 10px;
  display:none;
  justify-content:space-between;
  align-items:flex-end;
  gap: 12px;
  pointer-events:none;
}
.joyWrap{display:flex;flex-direction:column;gap:8px;align-items:flex-start}
.joyBase{
  width:120px;height:120px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  position:relative;
  pointer-events:auto;
  touch-action:none;
  -webkit-user-select:none;
  user-select:none;
}
.joyStick{
  width:58px;height:58px;border-radius:999px;
  background:
    radial-gradient(20px 20px at 35% 30%, rgba(255,255,255,.24), rgba(255,255,255,0) 60%),
    linear-gradient(135deg, rgba(255,77,109,.8), rgba(138,77,255,.75));
  position:absolute;
  left:50%; top:50%;
  transform: translate(-50%,-50%);
  border:1px solid rgba(255,255,255,.18);
  box-shadow: 0 14px 24px rgba(0,0,0,.20);
}
.joyHint{font-size:12px;color:var(--muted);font-weight:1000}
.actionWrap{display:flex;gap:10px;align-items:flex-end}
.actionBtn{
  width:108px;height:84px;
  border-radius: 24px;
  border:1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(120px 90px at 30% 30%, rgba(255,255,255,.13), rgba(255,255,255,0) 60%),
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  color:var(--text);
  cursor:pointer;
  pointer-events:auto;
  font-weight:1000;
  box-shadow: 0 14px 22px rgba(0,0,0,.20);
  transition: transform .12s ease, filter .12s ease;
  touch-action:manipulation;
}
.actionBtn:active{transform: translateY(1px) scale(.99)}
.actionBtn:focus-visible{outline:3px solid rgba(255,204,87,.55); outline-offset:2px}
.actionBark{border-color: rgba(255,204,87,.35)}
.actionDash{border-color: rgba(77,255,181,.35)}
.actionIcon{display:block;font-size:16px;letter-spacing:.4px}
.actionSmall{display:block;font-size:11px;color:var(--muted);margin-top:4px}

@media (max-width: 900px){
  .hudRight .cooldowns{display:none}
  .meter{min-width: 200px}
}

@media (hover: none) and (pointer: coarse){
  .mobileControls{display:flex}
  .footer{display:none}
}
