/* SprayLab — dark, clean, CS2-flavored */
:root {
  /* F1 (2026-07-22): aliases dos tokens canonicos do ProLab (../shared/tokens.css) */
  --bg: var(--pl-bg, #0b0f16);
  --bg2: var(--pl-bg2, #121826);
  --panel: var(--pl-panel, #151c2b);
  --line: var(--pl-line, #232d40);
  --text: var(--pl-text, #e9f0fa);
  --mut: var(--pl-mut, #8fa3bd);
  --green: var(--lab-accent, #3aff3a);
  --accent: var(--pl-orange, #f5a623);
}
* { box-sizing: border-box; margin: 0; padding: 0; }

/* themed scrollbars (weapon list, panels, modals) */
* { scrollbar-width: thin; scrollbar-color: #2b3854 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #232d40; border-radius: 8px; border: 2px solid var(--bg2, #121826);
}
*::-webkit-scrollbar-thumb:hover { background: #3a4a68; }
*::-webkit-scrollbar-corner { background: transparent; }
html, body, #app { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  overflow: hidden;
}
#app { display: flex; flex-direction: column; }

/* ---------- header */
.rating-chip {
  --tier: #b0c3d9;
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 14px; border: 1px solid var(--tier); border-radius: 8px;
  background: color-mix(in srgb, var(--tier) 12%, transparent);
  min-width: 92px;
}
.rc-num { font-family: 'Rajdhani'; font-weight: 700; font-size: 20px; color: var(--tier); line-height: 1; }
.rc-tier { font-size: 9px; letter-spacing: 1.5px; color: var(--mut); }

.hbtn {
  font-family: 'Rajdhani'; font-weight: 600; font-size: 14px; letter-spacing: 0.5px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 7px; cursor: pointer; transition: 0.15s;
}
.hbtn:hover { border-color: #3a4a68; background: #1a2336; }
.hbtn.primary { background: var(--green); color: #06210a; border-color: var(--green); font-weight: 700; }
.hbtn.primary:hover { filter: brightness(1.1); }
.hbtn.danger { border-color: #6b2430; color: #ff7a8a; margin-top: 14px; }
.hbtn.ghost { background: transparent; }
.hbtn.big { width: 100%; margin-top: 8px; padding: 11px; }
.hbtn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- layout */
#layout { flex: 1; display: grid; grid-template-columns: 210px 1fr 250px; min-height: 0; }
aside { padding: 12px; overflow-y: auto; background: var(--bg2); }
#left  { border-right: 1px solid var(--line); }
#right { border-left: 1px solid var(--line); }
#center { position: relative; min-width: 0; }
#stage { display: block; width: 100%; height: 100%; cursor: pointer; } /* uma mira so: a verde do jogo (cursor crosshair do SO duplicava) */
.locked #stage { cursor: none; }

.panel-title {
  font-family: 'Rajdhani'; font-weight: 600; font-size: 12px; letter-spacing: 2px;
  color: var(--mut); text-transform: uppercase; margin: 14px 0 8px;
}
aside .panel-title:first-child { margin-top: 2px; }

/* ---------- weapons */
.wcat { font-size: 10px; letter-spacing: 1.5px; color: #5d6b80; margin: 10px 0 4px; text-transform: uppercase; }
.wbtn {
  position: relative; display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 8px; margin-bottom: 4px; cursor: pointer; color: var(--text);
  text-align: left; transition: 0.12s;
}
.wbtn:hover { border-color: #3a4a68; }
.wbtn.active { border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--panel)); }
.wspark { flex: 0 0 34px; opacity: 0.85; }
.wmeta { display: flex; flex-direction: column; }
.wname { font-family: 'Rajdhani'; font-weight: 600; font-size: 14px; }
.wsub { font-size: 10px; color: var(--mut); }
.wbadge {
  position: absolute; top: 4px; right: 7px; font-size: 11px; color: var(--accent);
}

/* ---------- segmented buttons */
.seggroup { display: flex; flex-wrap: wrap; gap: 5px; }
.seg {
  flex: 1 1 45%; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); font-family: 'Rajdhani'; font-weight: 600; font-size: 13px;
  padding: 8px 6px; border-radius: 7px; cursor: pointer; transition: 0.12s;
}
.seg:hover { border-color: #3a4a68; }
.seg.active { border-color: var(--green); color: var(--green); }

.sideselect {
  width: 100%; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); border-radius: 7px; padding: 8px;
  font-family: 'Rajdhani'; font-weight: 600; font-size: 13px;
}
.seg:disabled { opacity: 0.32; cursor: not-allowed; }
.seg:disabled:hover { border-color: var(--line); }

/* ---------- live stats & tips */
#liveStats { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.ls-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; }
.ls-row b { font-family: 'Rajdhani'; font-size: 15px; }
.muted { color: var(--mut); }
.small { font-size: 12px; margin: 4px 0 10px; }
.tips {
  margin-top: 14px; font-size: 12px; line-height: 1.55; color: var(--mut);
  border-top: 1px solid var(--line); padding-top: 12px;
}
.tips b { display: block; color: var(--text); font-family: 'Rajdhani'; letter-spacing: 1px; margin-bottom: 4px; }
kbd {
  background: #232d40; border-radius: 4px; padding: 1px 5px; font-size: 11px;
  font-family: inherit; border: 1px solid #33405c;
}

/* ---------- ads */
.ad-slot { overflow: hidden; }
.ad-slot.placeholder {
  border: 1px dashed #2b3854; border-radius: 8px; position: relative; min-height: 0;
}
.ad-slot.placeholder::after {
  content: 'AD'; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #2f3d5c; font-size: 11px; letter-spacing: 3px;
}
.ad-side { height: 250px; margin-top: 14px; }
.ad-summary { height: 90px; margin-top: 14px; }

/* ---------- modals */
.modal {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(5, 8, 13, 0.72); z-index: 50; backdrop-filter: blur(3px);
}
.modal.open { display: flex; }
.card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 26px; width: min(680px, 92vw); max-height: 88vh; overflow-y: auto;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.card.narrow { width: min(400px, 92vw); }
.card p { color: var(--mut); line-height: 1.55; margin: 8px 0 14px; }
.card-h { font-family: 'Rajdhani'; font-weight: 700; font-size: 22px; margin-bottom: 12px; }
.card-f { margin-top: 14px; font-size: 12px; text-align: center; }
.x {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  color: var(--mut); font-size: 22px; cursor: pointer;
}
.x:hover { color: var(--text); }

/* summary */
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.sum-score-label { font-size: 11px; letter-spacing: 2px; color: var(--mut); }
.sum-score { font-family: 'Rajdhani'; font-weight: 700; font-size: 64px; line-height: 1; }
.sum-rating { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 14px; }
.sum-delta { font-family: 'Rajdhani'; font-weight: 700; font-size: 22px; }
.sum-delta.up { color: var(--green); }
.sum-delta.down { color: #ff5252; }
.sum-rval { font-family: 'Rajdhani'; font-weight: 700; font-size: 26px; }
.sum-stats div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.sum-stats span { color: var(--mut); }
.plot-label { font-size: 11px; color: var(--mut); margin-bottom: 6px; }
#sprayPlot { width: 100%; height: 220px; background: #0d121c; border-radius: 10px; }

/* stats */
#ratingChart { width: 100%; height: 160px; background: #0d121c; border-radius: 10px; margin-bottom: 14px; }
.stats-table { width: 100%; border-collapse: collapse; }
.stats-table th, .stats-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.stats-table th { color: var(--mut); font-family: 'Rajdhani'; letter-spacing: 1px; font-size: 12px; }
.lb-you td { background: color-mix(in srgb, var(--green) 9%, transparent); }

/* settings */
.frow { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.frow span { flex: 0 0 170px; color: var(--mut); }
.frow input[type="range"] { flex: 1; accent-color: var(--green); }
.frow input[type="number"] {
  width: 84px; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); border-radius: 6px; padding: 6px 8px;
}
.frow select {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 6px 8px;
}
.frow input[type="color"] { width: 42px; height: 28px; border: none; background: none; cursor: pointer; }
.frow input[type="checkbox"] { accent-color: var(--green); width: 16px; height: 16px; }

/* ---------- admin editor */
.admin-btn { border-color: var(--accent); color: var(--accent); }
.admin-btn.primary { background: var(--accent); border-color: var(--accent); color: #211500; }
.admin-panel {
  position: fixed; top: 70px; left: 224px; z-index: 40; width: 300px;
  background: var(--bg2); border: 1px solid var(--accent); border-radius: 12px;
  padding: 14px; box-shadow: 0 16px 50px rgba(0,0,0,0.55);
  max-height: calc(100vh - 140px); overflow-y: auto;
}
.ad-head {
  font-family: 'Rajdhani'; font-weight: 700; letter-spacing: 2px; font-size: 13px;
  color: var(--accent); margin-bottom: 10px; display: flex; justify-content: space-between;
}
.ad-head .x { position: static; }
.admin-panel .sideselect { margin-bottom: 8px; }
.ad-rename { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ad-rename span { color: var(--mut); font-size: 11px; }
.ad-rename input {
  flex: 1; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); border-radius: 6px; padding: 6px 8px;
  font-family: 'Rajdhani'; font-weight: 600; font-size: 13px;
}
.ad-rename input:focus { border-color: var(--accent); outline: none; }
.ad-row { display: flex; gap: 6px; margin-top: 10px; }
.ad-row .hbtn { flex: 1; padding: 8px 6px; font-size: 12px; }
.ad-tabs { display: flex; gap: 5px; margin: 10px 0 8px; }
.ad-tabs .seg { flex: 1; }
.ad-dist {
  display: flex; align-items: center; gap: 8px; padding: 5px 0;
  border-bottom: 1px solid var(--line); font-size: 12px;
}
.ad-dist label { display: flex; gap: 5px; align-items: center; min-width: 56px; }
.ad-dist input[type="checkbox"] { accent-color: var(--accent); }
.ad-dist .seg { flex: 0 0 auto; padding: 3px 10px; font-size: 11px; }
.ad-dist select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 5px; padding: 3px 5px;
}
.ad-xy { color: var(--mut); margin-left: auto; font-size: 10px; white-space: nowrap; }
.ad-cur { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 5px; padding-left: 5px; }
.ad-note { font-size: 11px; line-height: 1.5; padding: 8px 0; }
.ad-toast {
  position: fixed; bottom: 46px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: #211500; font-family: 'Rajdhani'; font-weight: 700;
  padding: 9px 18px; border-radius: 8px; opacity: 0; transition: 0.25s; z-index: 60;
  pointer-events: none;
}
.ad-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- footer */
#foot {
  border-top: 1px solid var(--line); padding: 7px 18px; font-size: 11px; color: #5d6b80;
  background: #0d121c;
}

/* ---------- responsive (F2: nada de esconder paineis; empilha) */
@media (max-width: 1100px) {
  #layout { grid-template-columns: 170px 1fr 230px; }
}
@media (max-width: 920px) {
  #layout { display: flex; flex-direction: column; }
  #center { order: 0; min-height: 52vh; }
  #right  { order: 1; border-left: 0; border-top: 1px solid var(--line); }
  #left   { order: 2; border-right: 0; border-top: 1px solid var(--line); max-height: 44vh; }
  .hbtn { min-height: 40px; }
  .seg { min-height: 42px; }
  .wbtn, .pl-btn { min-height: 44px; }
}

/* F2: barra do modo touch (so aparece em dispositivo de toque, via js) */
#touchbar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 12.5px; color: var(--mut);
  background: color-mix(in srgb, var(--green) 7%, var(--bg2)); border-bottom: 1px solid var(--line); }
#touchbar b { color: var(--text); }
#touchbar button { margin-left: auto; min-height: 40px; padding: 0 14px; border-radius: 8px; flex: none;
  border: 1px solid var(--green); background: var(--green); color: #06210a; font: 700 12px Rajdhani, sans-serif; letter-spacing: 1px; }
#touchbar button:disabled { opacity: .75; }
#stage { touch-action: none; }
