:root{
  --bg:#0b0e1a;
  --panel:#0c1020;
  --panel2: rgba(12,16,30,.92);
  --line: rgba(255,255,255,.10);
  --line2: rgba(255,255,255,.08);
  --text: rgba(233,238,252,.95);
  --muted: rgba(169,179,209,.9);
  --btn: rgba(255,255,255,.06);
  --btn2: rgba(255,255,255,.10);
  --danger: rgba(255,90,120,.16);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  overflow:hidden;
}

#gameStage{
  height:100vh;
  display:flex;
  background: var(--bg);
  position:relative;
  overflow:hidden;
}

/* -------------------------
   Panes (Windows-like)
-------------------------- */
.pane{
  display:flex;
  flex-direction:column;
  min-height:0;
  border-left: 1px solid var(--line2);
  background: var(--panel2);
}

.paneBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 8px 10px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--line2);
  user-select:none;
}

.paneTitle{
  font-weight: 800;
  letter-spacing:.2px;
  color: var(--text);
}

.paneBtns{
  display:flex;
  gap:8px;
}

.winBtn{
  width:34px;
  height:28px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--btn);
  color: var(--text);
  cursor:pointer;
  font-weight:800;
}
.winBtn:hover{background: var(--btn2)}

.paneBody{
  min-height:0;
  overflow:auto;
  padding: 10px;
}

/* Default sizes */
.pane-admin{
  flex: 0 0 520px;
  min-width: 340px;
  max-width: 780px;
  resize: horizontal;
  overflow:hidden;
}
.pane-game{
  flex: 1 1 auto;
  min-width: 360px;
  background: #070a13;
}
.pane-stats{
  flex: 0 0 340px;
  min-width: 240px;
  max-width: 560px;
  resize: horizontal;
  overflow:hidden;
}

/* Min/Hide */
.pane-hidden{display:none !important}

.pane-min{
  flex: 0 0 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  resize: none;
}
.pane-min .paneBody{display:none}
.pane-min .paneBar{height: 100%;}
.pane-min .paneTitle{
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.pane-min .paneBtns{
  flex-direction:column;
}

/* Focus mode */
#gameStage.has-focus .pane{flex: 1 1 auto}
#gameStage.has-focus .pane.pane-focus{flex: 2.4 1 auto}

/* Dock */
.dockBar{
  position:absolute;
  left: 10px;
  bottom: 10px;
  display:flex;
  gap:8px;
  z-index: 30;
}
.dockBtn{
  border: 1px solid var(--line2);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
  font-weight:800;
}
.dockBtn:hover{background: rgba(255,255,255,.10)}

/* -------------------------
   Game wrap + canvas
-------------------------- */
#gameWrap{
  position:relative;
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding: 8px;
}

#game{
  width: 100%;
  height: 80vh; /* <- pedido */
  display:block;
  border-radius: 16px;
  background: #0b1020;
  border: 1px solid rgba(255,255,255,.06);
}

/* inventory bar */
.inventoryBar{
  display:grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
}
.invSlot{
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  padding: 8px;
  text-align:center;
  min-height: 56px;
}
.invIcon{font-size: 18px}
.invName{
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.hidden{display:none !important}

/* -------------------------
   Overlays (menu/login/over)
-------------------------- */
.overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.35);
  z-index: 20;
}

.menuCard{
  width: min(620px, 92%);
  background: rgba(12,16,30,.95);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 45px rgba(0,0,0,.45);
}
.menuTitle{font-weight: 900; font-size: 18px; margin-bottom: 6px}
.menuSub{color: var(--muted); margin-bottom: 12px}

.menuBtns{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  margin-bottom: 14px;
}

.tabsRow{
  display:flex;
  gap:10px;
  margin-bottom: 10px;
}
.tab{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
  font-weight:800;
}
.tab.active{background: rgba(255,255,255,.12)}
.tabContent{display:none}
.tabContent.active{display:block}

.historyList{
  max-height: 40vh;
  overflow:auto;
  padding-right: 6px;
}
.historyItem{
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  padding: 10px;
  margin-top: 10px;
}
.historyTop{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  font-size: 12px;
}
.historyMeta{
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.form .label{display:block;margin:10px 0 6px;color:var(--muted);font-weight:700}
.input{
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline:none;
}
.input:focus{border-color: rgba(124,92,255,.45)}

.error{
  margin-top: 10px;
  background: rgba(255,90,120,.12);
  border: 1px solid rgba(255,90,120,.22);
  color: rgba(255,200,210,.95);
  border-radius: 12px;
  padding: 10px;
}

.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.micro{font-size: 12px; color: var(--muted); line-height: 1.3}
code{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  padding: 2px 6px;
}

/* Buttons */
.btn{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor:pointer;
  font-weight:900;
}
.btn:hover{background: rgba(255,255,255,.10)}
.btn.small{padding: 8px 10px; border-radius: 12px; font-weight:800}
.btn.danger{
  background: var(--danger);
  border-color: rgba(255,90,120,.25);
}

/* -------------------------
   Stats HUD in Stats Pane
-------------------------- */
.hudRow{display:flex; gap:10px; flex-wrap:wrap}
.hudBox{
  flex: 1 1 140px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  border-radius: 14px;
  padding: 10px;
}
.hudLabel{color: var(--muted); font-size: 12px; font-weight:800}
.hudValue{font-size: 18px; font-weight: 900; margin-top: 4px}

.hpWrap{margin-top: 10px}
.hpBar{
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
  overflow:hidden;
}
.hpFill{
  height: 100%;
  width: 0%;
  background: rgba(46,229,157,.85);
}
.hpText{margin-top: 8px; color: var(--muted); font-weight:800; font-size: 12px}

#hudStats{
  margin-top: 10px;
  display:grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
}
.hudStatCard{
  background: rgba(12,16,30,.55);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.25;
}
.hudStatCard .t{color: var(--muted); font-size: 11px; margin-bottom: 5px}
.hudStatCard .v{font-weight: 900}
.hudStatCard .d{color: var(--muted); font-size: 11px; margin-top: 4px}

.statsPlaceholder{
  color: var(--muted);
  font-weight: 800;
  padding: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
}

/* -------------------------
   Admin UI
-------------------------- */
.adminLocked{
  padding: 14px;
}
.adminLockedBox{
  border: 1px dashed rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  border-radius: 16px;
  padding: 14px;
}
.adminLockedTitle{font-weight:900; margin-bottom:6px}
.adminLockedText{color: var(--muted); line-height:1.35}

.adminTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  flex-wrap:wrap;
  margin-bottom: 10px;
}
.pill{
  display:inline-block;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-weight: 800;
}

.adminTabs{
  display:flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap:wrap;
}
.adminTab{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
  font-weight:900;
}
.adminTab.active{background: rgba(255,255,255,.12)}
.adminTabContent{display:none}
.adminTabContent.active{display:block}

.adminSectionHead{
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
}

.select{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text);
}

/* Excel-ish tables */
.sheet{
  width:100%;
  border-collapse: collapse;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  overflow:hidden;
}
.sheet th, .sheet td{
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 8px;
  font-size: 12px;
  vertical-align: top;
}
.sheet th{
  background: rgba(255,255,255,.06);
  text-align:left;
  color: var(--muted);
}
.sheet input[type="text"], .sheet input[type="number"], .sheet select{
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--text);
  outline:none;
}
.sheet input[type="text"]:focus, .sheet input[type="number"]:focus, .sheet select:focus{
  border-color: rgba(124,92,255,.45);
}

.miniBtn{
  border-radius: 10px;
  padding: 7px 9px;
  cursor:pointer;
  font-weight:900;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text);
}
.miniBtn:hover{background: rgba(255,255,255,.10)}
.miniBtn.danger{
  background: rgba(255,90,120,.14);
  border-color: rgba(255,90,120,.25);
}

/* Logs */
.logBody{
  height: 52vh;
  overflow:auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);
  padding: 10px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.logLine{margin-bottom: 6px}
.logLine .tag{color: rgba(169,179,209,.85)}
.logLine.warn{color: rgba(255,220,140,.95)}
.logLine.error{color: rgba(255,140,160,.95)}
.logLine.info{color: rgba(233,238,252,.95)}
.logLine.debug{color: rgba(169,179,209,.95)}

/* -------------------------
   Levels / Curves
-------------------------- */
.levelCurvePreview{
  width: 140px;
  height: 70px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
}

.curveModal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 16px;
}
.curveCard{
  width: min(820px, 96%);
  background: rgba(12,16,30,.96);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 45px rgba(0,0,0,.55);
}
.curveHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
}
.curveTitle{font-weight: 900; font-size: 16px;}
.curveMeta{color: rgba(169,179,209,.9); font-size: 12px; margin-top: 4px;}
.curveHelp{margin-top: 10px;}
.curveGridWrap{
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
  padding: 10px;
}
.curveSvg{
  width: 100%;
  height: 360px;
  border-radius: 12px;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.06), transparent 55%);
}
