/* RSL Tracker v3 — scoped inside #techRSLRoot */

#techRSLRoot.tech-rsl-app *, #techRSLRoot.tech-rsl-app *::before, #techRSLRoot.tech-rsl-app *::after{ box-sizing: border-box; }

#techRSLRoot.tech-rsl-app{
  font-family: var(--font), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #111;
  color: #f0f0f0;
  min-height: 0;
}

#techRSLRoot .rsl-page{ max-width: 1200px; margin: 0 auto; padding: 20px 16px; }

#techRSLRoot .top-bar{
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}

#techRSLRoot .top-bar h1{ font-size: 16px; font-weight: 500; color: #ccc; }

#techRSLRoot .api-row{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

#techRSLRoot .api-row label{ font-size: 11px; color: #666; }

#techRSLRoot #el-key{
  font-size: 12px; padding: 5px 10px; border: 1px solid #333;
  border-radius: 6px; background: #1a1a1a; width: 200px; color: #ccc; font-family: monospace;
}

#techRSLRoot #el-key:focus{ outline: none; border-color: #555; }

#techRSLRoot .badge{ font-size: 10px; padding: 3px 8px; border-radius: 8px; background: #222; color: #666; }

#techRSLRoot .badge.live{ background: #14532d; color: #4ade80; }

#techRSLRoot #layout{ display: grid; grid-template-columns: 1fr 260px; gap: 14px; align-items: start; }

#techRSLRoot #vwrap{ position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; }

#techRSLRoot #video{ width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }

#techRSLRoot #canvas{ position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

#techRSLRoot #fps-lbl{ position: absolute; top: 10px; left: 14px; color: rgba(255,255,255,0.25); font-size: 11px; pointer-events: none; }

#techRSLRoot .hand-panel{
  position: absolute; bottom: 0;
  padding: 36px 16px 14px;
  pointer-events: none;
  width: 48%;
}

#techRSLRoot .hand-panel.left-panel{ left: 0;  background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, transparent 100%); border-bottom-left-radius: 12px; }

#techRSLRoot .hand-panel.right-panel{ right: 0; background: linear-gradient(to left,  rgba(0,0,0,0.7) 0%, transparent 100%); border-bottom-right-radius: 12px; text-align: right; }

#techRSLRoot .hp-label{
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; opacity: 0.7; margin-bottom: 4px;
}

#techRSLRoot .hp-word{
  font-size: 24px; font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  min-height: 34px; line-height: 1.2;
  transition: opacity 0.2s;
}

#techRSLRoot .hp-desc{ font-size: 11px; opacity: 0.55; margin-top: 2px; min-height: 16px; }

#techRSLRoot .hp-conf{ font-size: 10px; opacity: 0.4; margin-top: 1px; }

#techRSLRoot .hand-panel.left-panel .hp-label,
#techRSLRoot .hand-panel.left-panel .hp-word{ color: #4ade80; }

#techRSLRoot .hand-panel.right-panel .hp-label,
#techRSLRoot .hand-panel.right-panel .hp-word{ color: #60a5fa; }

#techRSLRoot .hand-panel.empty .hp-word{ opacity: 0.2; }

#techRSLRoot #hand-dots{
  position: absolute; top: 10px; right: 12px;
  display: flex; gap: 5px; align-items: center;
}

#techRSLRoot .hdot{
  width: 8px; height: 8px; border-radius: 50%;
  background: #333; transition: background 0.2s;
}

#techRSLRoot .hdot.on-green{ background: #4ade80; box-shadow: 0 0 6px #4ade8088; }

#techRSLRoot .hdot.on-blue{ background: #60a5fa; box-shadow: 0 0 6px #60a5fa88; }

#techRSLRoot #speak-indicator{
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 3px; align-items: flex-end;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}

#techRSLRoot #speak-indicator.active{ opacity: 1; }

#techRSLRoot .sw-b{ width: 3px; background: #fff; border-radius: 2px; animation: swv 0.6s ease-in-out infinite; }

#techRSLRoot .sw-b:nth-child(2){animation-delay:.1s}

#techRSLRoot .sw-b:nth-child(3){animation-delay:.2s}

#techRSLRoot .sw-b:nth-child(4){animation-delay:.3s}

@keyframes swv { 0%,100%{height:4px} 50%{height:16px} }

#techRSLRoot #load-scr{
  position: absolute; inset: 0; background: #000; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; z-index: 20;
}

#techRSLRoot #load-scr p{ color: rgba(255,255,255,0.4); font-size: 12px; }

#techRSLRoot .spinner{ width: 24px; height: 24px; border: 2px solid rgba(255,255,255,0.08); border-top-color: rgba(255,255,255,0.5); border-radius: 50%; animation: spin 0.7s linear infinite; }

@keyframes spin { to{transform:rotate(360deg)} }

#techRSLRoot #err-scr{
  display:none; position:absolute; inset:0; background:#000;
  align-items:center; justify-content:center; border-radius:12px;
  color:rgba(255,255,255,0.45); font-size:13px; text-align:center; padding:20px;
  white-space: pre-line;
}

#techRSLRoot #sidebar{ display: flex; flex-direction: column; gap: 10px; }

#techRSLRoot .card{ background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 10px; padding: 12px 14px; }

#techRSLRoot .card-title{ font-size: 10px; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: 0.9px; margin-bottom: 10px; }

#techRSLRoot #vocab-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }

#techRSLRoot .vocab-item{
  border: 1px solid #2a2a2a; border-radius: 7px;
  padding: 7px 8px; cursor: pointer; transition: all 0.12s; user-select: none;
}

#techRSLRoot .vocab-item:hover{ border-color: #444; background: #222; }

#techRSLRoot .vocab-item.matched-green{ border-color: #4ade80; background: rgba(74,222,128,0.12); }

#techRSLRoot .vocab-item.matched-blue{ border-color: #60a5fa; background: rgba(96,165,250,0.12); }

#techRSLRoot .vi-emoji{ font-size: 16px; margin-bottom: 3px; }

#techRSLRoot .vi-word{ font-size: 12px; font-weight: 600; color: #ddd; }

#techRSLRoot .vi-desc{ font-size: 9px; color: #555; margin-top: 1px; }

#techRSLRoot #phrase-box{ background: #111; border-radius: 7px; padding: 10px; min-height: 48px; margin-bottom: 8px; }

#techRSLRoot #phrase-text{ font-size: 13px; color: #444; line-height: 1.5; }

#techRSLRoot #phrase-text.has-content{ color: #ccc; }

#techRSLRoot .phrase-actions{ display: flex; gap: 6px; }

#techRSLRoot .btn-p{
  flex: 1; padding: 8px; background: #2a2a2a; color: #ccc;
  border: 1px solid #333; border-radius: 7px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}

#techRSLRoot .btn-p:hover{ background: #333; }

#techRSLRoot .btn-p:disabled{ opacity: 0.3; cursor: default; }

#techRSLRoot .btn-p.primary{ background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

#techRSLRoot .btn-p.primary:hover{ background: #2563eb; }

#techRSLRoot #history{ display: flex; flex-direction: column; gap: 3px; max-height: 90px; overflow-y: auto; }

#techRSLRoot .hist-item{ font-size: 11px; color: #555; padding: 3px 0; border-bottom: 1px solid #222; display: flex; align-items: center; justify-content: space-between; }

#techRSLRoot .hist-item:last-child{ border: none; }

#techRSLRoot .hist-play{ background: none; border: none; cursor: pointer; color: #444; font-size: 11px; padding: 0 3px; }

#techRSLRoot .hist-play:hover{ color: #888; }

#techRSLRoot .emo-row{ display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }

#techRSLRoot .emo-row:last-child{ margin: 0; }

#techRSLRoot .emo-name{ font-size: 11px; color: #555; width: 74px; flex-shrink: 0; transition: color 0.2s; }

#techRSLRoot .emo-row.top .emo-name{ color: #ccc; font-weight: 500; }

#techRSLRoot .emo-track{ flex: 1; height: 2px; background: #222; border-radius: 2px; overflow: hidden; }

#techRSLRoot .emo-fill{ height: 100%; border-radius: 2px; width: 0%; transition: width 0.1s; }

#techRSLRoot .emo-pct{ font-size: 10px; color: #444; width: 26px; text-align: right; font-variant-numeric: tabular-nums; }

#techRSLRoot #hands-panel{ display: flex; gap: 8px; }

#techRSLRoot .hand-box{ flex: 1; }

#techRSLRoot .hand-box-label{ font-size: 9px; font-weight: 600; text-align: center; margin-bottom: 5px; letter-spacing: 0.5px; }

#techRSLRoot .hbl-green{ color: #4ade80; }

#techRSLRoot .hbl-blue{ color: #60a5fa; }

#techRSLRoot .frow{ display: flex; gap: 3px; }

#techRSLRoot .fc{ display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; }

#techRSLRoot .fp{ width: 100%; height: 20px; background: #222; border-radius: 3px; transition: background 0.08s; }

#techRSLRoot .fp.up-green{ background: #4ade80; }

#techRSLRoot .fp.up-blue{ background: #60a5fa; }

#techRSLRoot .fl{ font-size: 8px; color: #444; }

#techRSLRoot .tog-row{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

#techRSLRoot .tog-row:last-child{ margin: 0; }

#techRSLRoot .tog-lbl{ font-size: 12px; color: #888; }

#techRSLRoot .tog{ width: 32px; height: 17px; border-radius: 9px; background: #2a2a2a; position: relative; cursor: pointer; transition: background 0.2s; }

#techRSLRoot .tog.on{ background: #1d4ed8; }

#techRSLRoot .tog::after{ content:''; position:absolute; width:11px; height:11px; border-radius:50%; background:#888; top:3px; left:3px; transition:left 0.18s; }

#techRSLRoot .tog.on::after{ left:18px; background:#fff; }

#techRSLRoot .stats-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

#techRSLRoot .sl{ font-size: 9px; color: #444; margin-bottom: 2px; }

#techRSLRoot .sv{ font-size: 13px; font-weight: 500; color: #aaa; }

@keyframes flash-green{ 0%{opacity:1} 100%{opacity:0} }

#techRSLRoot .word-flash{ animation: flash-green 1.5s ease-out forwards; }

@media(max-width:700px){#techRSLRoot #layout{grid-template-columns:1fr;}}