﻿:root{
  --bg:#070a0f;
  --panel:#0f172a;
  --panel2:#111827;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:rgba(255,255,255,.12);
  --line2:rgba(255,255,255,.18);
  --accent:#22c55e;
  --accent2:#60a5fa;
  --warn:#fbbf24;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: radial-gradient(1200px 600px at 30% 20%, rgba(96,165,250,.10), transparent 60%),
              radial-gradient(900px 500px at 70% 80%, rgba(34,197,94,.08), transparent 60%),
              var(--bg);
  color:var(--text);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,"Noto Sans TC","Microsoft JhengHei",sans-serif;
  overflow:hidden; /* key: no scrollbars */
}

/* stage scaling wrapper */
#stageWrap{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

/* Base stage size (designed), JS scales it to fit viewport */
#stage{
  width:1280px;
  height:720px;
  position:relative;
  border-radius:18px;
  background: rgba(15,23,42,.72);
  border:1px solid var(--line2);
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  overflow:hidden;
}

/* Top bar */
.topbar{
  height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border-bottom:1px solid var(--line);
}

.brand{ display:flex; align-items:center; gap:12px; }
.logo{
  width:48px; height:48px;
  border-radius:12px;
  background: rgba(34,197,94,.14);
  border:1px solid rgba(34,197,94,.30);
  display:flex; align-items:center; justify-content:center;
  font-weight:800; letter-spacing:.8px;
}
.title .t1{ font-weight:800; letter-spacing:.6px; }
.title .t2{ font-size:12px; color:var(--muted); margin-top:2px; }

.sys{ display:flex; align-items:center; gap:10px; }
.pill{
  padding:7px 10px;
  border-radius:12px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  font-size:13px;
  color:var(--muted);
}
.btn{
  cursor:pointer;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:var(--text);
  font-size:13px;
}
.btn:hover{ background: rgba(255,255,255,.10); }

/* Main layout */
.main{
  height: calc(100% - 76px);
  display:grid;
  grid-template-columns: 1fr 360px; /* right dock in-frame */
}

.left{
  padding:14px 14px 10px 14px;
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  gap:10px;
}

.right{
  padding:14px;
  display:flex;
}

.panelTitle{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:.5px;
}
.dot{
  width:10px; height:10px; border-radius:3px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(34,197,94,.35);
}
.sub{ font-weight:600; color:var(--muted); font-size:12px; margin-left:6px; }

.grid{
  flex:1;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
  padding:8px 2px 0 2px;
}

/* Cartridge */
.cart{
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(17,24,39,.62);
  overflow:hidden;
  cursor:pointer;
  position:relative;
  min-height:128px;
  display:flex;
  flex-direction:column;
}
.cart:hover{ border-color: rgba(255,255,255,.25); }
.cart.sel{
  outline: 2px solid rgba(96,165,250,.70);
  box-shadow: 0 0 0 3px rgba(96,165,250,.22);
  border-color: rgba(96,165,250,.35);
}
.cartTop{
  height:18px;
  background: linear-gradient(90deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
}
.cartBody{
  padding:10px 10px 12px 10px;
  display:flex;
  gap:10px;
  flex:1;
}
.icon{
  width:54px; height:54px;
  border-radius:12px;
  background: rgba(96,165,250,.12);
  border:1px solid rgba(96,165,250,.25);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
}
.cartMeta{ flex:1; display:flex; flex-direction:column; gap:4px; }
.cartName{ font-weight:900; letter-spacing:.3px; }
.cartDesc{ font-size:12px; color:var(--muted); line-height:1.25; }
.badges{ display:flex; gap:6px; flex-wrap:wrap; margin-top:4px; }
.tag{
  font-size:11px;
  padding:3px 7px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  color:var(--muted);
}
.tag.hot{ border-color: rgba(251,191,36,.35); color: rgba(251,191,36,.95); background: rgba(251,191,36,.08); }

/* footer hints */
.footerHint{
  border-top:1px solid var(--line);
  padding-top:10px;
}
.hintLine{ font-size:12px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.k{
  font-weight:900;
  padding:2px 7px;
  border-radius:8px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
}
.muted{ color:var(--muted); }

/* Dock panel */
.dock{
  width:100%;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(17,24,39,.62);
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.dockTitle{
  display:flex; align-items:center; gap:10px;
  font-weight:900; letter-spacing:.4px;
}
.dockBox{
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
}
.dockRow{
  display:grid;
  grid-template-columns: 34px 1fr;
  gap:10px;
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  align-items:center;
}
.dockRow:last-child{ border-bottom:none; }
.dockKey{
  width:28px; height:28px;
  border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-weight:900;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
}
.dockMain{ font-weight:900; }
.dockSub{ font-size:12px; color:var(--muted); margin-top:2px; }

.nowPlaying{
  border:1px dashed rgba(255,255,255,.18);
  border-radius:14px;
  padding:10px;
  background: rgba(0,0,0,.12);
}
.npTitle{ font-size:11px; color:var(--muted); letter-spacing:.6px; }
.npGame{ font-weight:900; margin-top:2px; }
.npMeta{ font-size:12px; color:var(--muted); margin-top:4px; line-height:1.25; }

.dockActions{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
.btn2{
  cursor:pointer;
  padding:10px 10px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:var(--text);
  font-weight:800;
}
.btn2:hover{ background: rgba(255,255,255,.10); }
.btn2.ghost{ color:var(--muted); background: rgba(255,255,255,.03); }
.btn2.ghost:hover{ background: rgba(255,255,255,.06); }

.tiny{ font-size:12px; }

/* Modal */
.modal{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.modal.show{ display:flex; }
.modalCard{
  width:min(520px, 95%);
  border-radius:18px;
  border:1px solid var(--line2);
  background: rgba(15,23,42,.92);
  box-shadow: 0 22px 70px rgba(0,0,0,.55);
  padding:14px;
}
.modalTitle{ font-weight:900; font-size:16px; letter-spacing:.3px; }
.modalBody{ margin-top:8px; color:var(--muted); line-height:1.4; }
.modalBtns{ display:flex; gap:10px; margin-top:12px; }
.btn3{
  cursor:pointer;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:var(--text);
  font-weight:800;
}
.btn3:hover{ background: rgba(255,255,255,.10); }
.btn3.ghost{ color:var(--muted); background: rgba(255,255,255,.03); }
.btn3.ghost:hover{ background: rgba(255,255,255,.06); }