.live-stats-panel {
  position: fixed;
  z-index: 8000;
  width: 320px;
  max-width: calc(100vw - 16px);
  background: linear-gradient(165deg, #0f212e 0%, #0b1628 100%);
  border: 1px solid #213c55;
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 117, 255, 0.06);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  user-select: none;
}

.live-stats-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.live-stats-panel.is-dragging {
  transition: none;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(0, 117, 255, 0.12);
}

.ls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: grab;
  touch-action: none;
}

.ls-header:active {
  cursor: grabbing;
}

.ls-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #f4f8ff;
  letter-spacing: 0.3px;
}

.ls-title i {
  color: #0075ff;
  font-size: 0.75rem;
}

.ls-title-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00e701;
  box-shadow: 0 0 6px rgba(0, 231, 1, 0.5);
  animation: lsDotPulse 2s ease-in-out infinite;
}

@keyframes lsDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.ls-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ls-header-btn {
  background: none;
  border: none;
  color: rgba(244, 248, 255, 0.3);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 5px;
  line-height: 1;
  transition: color 0.15s;
  border-radius: 4px;
}

.ls-header-btn:hover {
  color: #f4f8ff;
  background: rgba(255, 255, 255, 0.06);
}

.ls-body {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ls-summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.ls-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.ls-stat-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(244, 248, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.ls-stat-value {
  font-size: 0.85rem;
  font-weight: 800;
  color: #f4f8ff;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-stat-value.is-positive {
  color: #34d399;
}

.ls-stat-value.is-negative {
  color: #f87171;
}

.ls-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ls-section-toggle:first-of-type {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ls-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(244, 248, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.ls-section-chevron {
  color: rgba(244, 248, 255, 0.25);
  font-size: 0.6rem;
  transition: transform 0.2s ease;
}

.ls-section-toggle.is-collapsed .ls-section-chevron {
  transform: rotate(-90deg);
}

.ls-collapsible {
  overflow: hidden;
  max-height: 200px;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 1;
}

.ls-collapsible.is-collapsed {
  max-height: 0;
  opacity: 0;
}

.ls-chart-area {
  width: 100%;
  height: 80px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  margin-bottom: 2px;
}

.ls-chart-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.ls-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: rgba(244, 248, 255, 0.18);
  font-weight: 500;
}

.ls-bets-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 2px;
}

.ls-bet-row {
  display: grid;
  grid-template-columns: 22px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 0.72rem;
}

.ls-bet-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
}

.ls-bet-icon.win {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}

.ls-bet-icon.loss {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.ls-bet-game {
  color: rgba(244, 248, 255, 0.65);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-bet-amount {
  color: rgba(244, 248, 255, 0.4);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.ls-bet-pnl {
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  min-width: 54px;
}

.ls-bet-pnl.win {
  color: #34d399;
}

.ls-bet-pnl.loss {
  color: #f87171;
}

.ls-footer {
  padding: 8px 14px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ls-reset-btn {
  background: none;
  border: none;
  color: rgba(244, 248, 255, 0.25);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.3px;
}

.ls-reset-btn:hover {
  color: rgba(244, 248, 255, 0.55);
  background: rgba(255, 255, 255, 0.05);
}

.ls-session-time {
  font-size: 0.65rem;
  color: rgba(244, 248, 255, 0.2);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 400px) {
  .live-stats-panel {
    width: calc(100vw - 12px);
    border-radius: 10px;
  }

  .ls-summary-row {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
  }

  .ls-stat-card {
    padding: 6px 8px;
  }

  .ls-stat-value {
    font-size: 0.78rem;
  }

  .ls-bet-row {
    grid-template-columns: 20px 1fr auto auto;
    gap: 6px;
    font-size: 0.68rem;
  }
}
