/* StratLab — same design language as SprayLab, cyan accent */
: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);
  --brand: var(--lab-accent, #3ac8ff);
  --accent: var(--pl-orange, #f5a623);
  --t-col: var(--pl-t, #e8a33d);
  --ct-col: var(--pl-ct, #4f8fe0);
}
* { box-sizing: border-box; margin: 0; padding: 0; }

* { 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); }
*::-webkit-scrollbar-thumb:hover { background: #3a4a68; }

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 */
.name-input {
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  color: var(--text); font-family: 'Rajdhani'; font-weight: 600; font-size: 17px;
  padding: 7px 10px; min-width: 180px; flex: 0 1 300px;
}
.name-input:hover { border-color: var(--line); }
.name-input:focus { border-color: var(--brand); outline: none; background: var(--panel); }

.hbtn {
  font-family: 'Rajdhani'; font-weight: 600; font-size: 15px; letter-spacing: 0.5px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 7px; cursor: pointer; transition: 0.15s;
  text-decoration: none; display: inline-block; white-space: nowrap; min-height: 42px;
}
.hbtn:hover { border-color: #3a4a68; background: #1a2336; }
.hbtn.primary { background: var(--brand); color: #032030; border-color: var(--brand); font-weight: 700; }
.hbtn.primary:hover { filter: brightness(1.1); }
.hbtn.ghost { background: transparent; }
.hbtn.big { width: 100%; margin-top: 10px; padding: 11px; text-align: center; }
.hbtn.mini { padding: 4px 10px; font-size: 12px; }
.hbtn:disabled { opacity: 0.45; cursor: not-allowed; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.danger-mini { border-color: #6b2430 !important; color: #ff7a8a !important; }

/* ---------- layout */
#layout { flex: 1; display: grid; grid-template-columns: 230px 1fr 265px; min-height: 0; }
#layout > * { 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; display: flex; flex-direction: column; overflow: hidden; }
#stage { display: block; flex: 1; width: 100%; min-height: 0; cursor: crosshair; }

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

/* ---------- segmented buttons */
.seggroup { display: flex; flex-wrap: wrap; gap: 5px; }
.seggroup.sub { margin-top: 6px; }
.seg {
  flex: 1 1 30%; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); font-family: 'Rajdhani'; font-weight: 600; font-size: 14px;
  padding: 10px 8px; border-radius: 7px; cursor: pointer; transition: 0.12s; min-height: 44px;
}
.seg:hover { border-color: #3a4a68; }
.seg.active { border-color: var(--brand); color: var(--brand); }
#nadePicker .seg.active { border-color: var(--nc); color: var(--nc); }
#movePicker .seg { flex: 1 1 22%; }
.toolrow { display: flex; gap: 5px; margin-top: 6px; }
.toolrow .seg { flex: 1; }

.sideselect {
  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;
}
.sideselect.slim { padding: 7px 8px; }

/* ---------- roster */
.wcat { font-size: 10px; letter-spacing: 1.5px; color: #5d6b80; margin: 12px 0 4px; text-transform: uppercase; }
.pl-btn {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 9px; margin-bottom: 4px; cursor: pointer; color: var(--text);
  text-align: left; transition: 0.12s;
}
.pl-btn:hover { border-color: #3a4a68; }
.pl-btn.active { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 9%, var(--panel)); }
.pl-dot { flex: 0 0 12px; height: 12px; border-radius: 50%; background: var(--tc); }
.pl-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pl-name { font-family: 'Rajdhani'; font-weight: 600; font-size: 14px; }
.pl-sub { font-size: 10px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- timebar */
#timebar {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #0e1420, #121a29);
}
.tbtn {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 7px; padding: 9px 14px; cursor: pointer; font-size: 16px; transition: 0.12s;
  min-height: 42px;
}
.tbtn:hover { border-color: #3a4a68; }
.tbtn.play { font-size: 15px; padding: 9px 18px; }
.tbtn.play.active { border-color: var(--brand); color: var(--brand); }
.clock {
  font-family: 'Rajdhani'; font-weight: 700; font-size: 22px; min-width: 64px;
  text-align: center; color: var(--text); letter-spacing: 1px;
}
.scrub-wrap { position: relative; flex: 1; display: flex; align-items: center; }
#scrub { width: 100%; accent-color: var(--brand); height: 4px; cursor: pointer; }
kbd {
  background: #232d40; border-radius: 4px; padding: 1px 5px; font-size: 11px;
  font-family: inherit; border: 1px solid #33405c;
}

/* ---------- selection info */
.sel-info {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.sel-extra { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--mut); }
.sel-extra input { width: 58px; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 5px; padding: 3px 5px; }
.sel-info .seg { flex: 0 0 auto; padding: 3px 10px; font-size: 11px; }
.sel-hint { flex: 1 0 100%; font-size: 10.5px; line-height: 1.4; color: var(--mut); }

/* ---------- loadout */
.lo-name { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.lo-team { font-family: 'Rajdhani'; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 5px; }
.lo-team.T { background: color-mix(in srgb, var(--t-col) 20%, transparent); color: var(--t-col); }
.lo-team.CT { background: color-mix(in srgb, var(--ct-col) 20%, transparent); color: var(--ct-col); }
.lo-name 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;
}
.lo-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.lo-row span { flex: 0 0 52px; color: var(--mut); }
.lo-row select { flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 5px; font-size: 12px; min-width: 0; }

/* ---------- ads (same pattern as SprayLab: reserved slots, AdSense drops in later) */
.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; flex: 0 0 auto; }
.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 p { color: var(--mut); line-height: 1.55; margin: 8px 0 12px; font-size: 13px; }
.card p b { color: var(--text); }
.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); }

.tac-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
.tac-row.current { background: color-mix(in srgb, var(--brand) 6%, transparent); border-radius: 8px; }
.tac-name { font-family: 'Rajdhani'; font-weight: 600; font-size: 15px; }
.tac-sub { font-size: 11px; color: var(--mut); flex: 1; }
.tac-actions { display: flex; gap: 5px; }

/* ---------- admin */
.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: 244px; z-index: 40; width: 290px;
  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: 1px; font-size: 13px; color: var(--accent); margin-bottom: 8px; }
.ad-note { font-size: 11px; line-height: 1.5; color: var(--mut); padding-bottom: 6px; }
.ad-row { display: flex; gap: 6px; margin-top: 8px; }
.ad-row .hbtn { flex: 1; padding: 8px 6px; font-size: 12px; }
.frow { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12px; }
.frow span { flex: 0 0 70px; color: var(--mut); }
.frow input { flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 8px; min-width: 0; }

.ad-toast {
  /* safe area: topo do board (dentro do #center), nunca sobre a timeline (issue 2) */
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%) translateY(-10px);
  background: var(--brand); color: #032030; font-family: 'Rajdhani'; font-weight: 700;
  padding: 9px 18px; border-radius: 8px; opacity: 0; transition: 0.25s; z-index: 60;
  pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.4); max-width: 80%; text-align: center;
}
.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 */
@media (max-width: 1100px) {
  #layout { grid-template-columns: 190px 1fr 240px; }
  .name-input { display: none; }
}
/* ===== F2: mobile = board inteiro + paineis em gaveta ===== */
@media (max-width: 920px) {
  #layout { grid-template-columns: 1fr; }
  #left, #right {
    position: fixed; top: 0; bottom: 0; width: min(84vw, 330px); z-index: 950;
    transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.55);
  }
  #left  { left: 0;  transform: translateX(-105%); border-right: 1px solid var(--line); }
  #right { right: 0; transform: translateX(105%);  border-left: 1px solid var(--line); }
  #left.open, #right.open { transform: translateX(0); }
  #drawerBack { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 900; display: none; }
  #drawerBack.show { display: block; }
  .drawer-btn {
    position: fixed; bottom: 118px; z-index: 800; height: 42px; padding: 0 12px; cursor: pointer;
    font: 700 11px Rajdhani, sans-serif; letter-spacing: 1.5px; color: var(--text);
    background: color-mix(in srgb, var(--bg2) 92%, transparent);
    border: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }
  .drawer-btn.l { left: 0; border-left: 0; border-radius: 0 9px 9px 0; }
  .drawer-btn.r { right: 0; border-right: 0; border-radius: 9px 0 0 9px; }
  .hbtn { min-height: 44px; }
  .sideselect.slim { min-height: 38px; }
  #timebar { gap: 6px; padding: 6px 8px; }
  aside .seg, aside .hbtn { min-height: 44px; }
}
/* sem gaveta no desktop */
@media (min-width: 921px) { .drawer-btn, #drawerBack { display: none !important; } }

/* F2: gestos proprios no canvas (pinch/pan em interact.js) */
#stage { touch-action: none; }
