/* ============================================
   SIDE PANELS — Analytics & Data Viz
   ============================================ */

/* Game center wrapper (wraps table + controls) */
.game-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  z-index: 5;
}

/* Side panels — pinned to page edges */
.panel {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  z-index: 5;
  mask-image: linear-gradient(to bottom, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 92%, transparent 100%);
}

.panel::-webkit-scrollbar {
  display: none;
}

/* ── SECTION CONTAINERS ─────────────────── */
.p-section {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(0,255,136,0.06);
  border-radius: 4px;
  padding: 10px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  contain: layout paint;
}

.p-section-grow {
  flex: 1;
  min-height: 80px;
}

/* Subtle top highlight (static — avoids infinite layout animation) */
.p-section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,255,136,0.1), transparent);
  top: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* Flash on data update */
@keyframes pFlash {
  0% { border-color: rgba(0,255,136,0.2); }
  100% { border-color: rgba(0,255,136,0.06); }
}

.p-section.flash {
  animation: pFlash 0.4s ease;
}

/* ── SECTION HEADERS ────────────────────── */
.p-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.p-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.5;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.p-val {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.p-val.pos { color: var(--green); }
.p-val.neg { color: var(--red); }

.p-val-sm {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.5;
}

/* ── SPARKLINE CANVAS ───────────────────── */
.sparkline {
  width: 100%;
  height: 60px;
  display: block;
  border-radius: 2px;
  background:
    linear-gradient(rgba(0,255,136,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.02) 1px, transparent 1px);
  background-size: 20% 25%;
}

.sparkline-sm {
  height: 36px;
}

.chart-range {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
}

.chart-hi, .chart-lo {
  font-family: var(--mono);
  font-size: 0.6rem;
  opacity: 0.4;
}

.chart-hi { color: var(--green); }
.chart-lo { color: var(--red); }

/* ── DISTRIBUTION BARS ──────────────────── */
.dist-row {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 18px;
}

.dist-num {
  width: 18px;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.dist-bar-wrap {
  flex: 1;
  height: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.dist-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
  min-width: 1px;
  opacity: 0.8;
}

.dist-expected {
  position: absolute;
  top: 0;
  height: 100%;
  width: 2px;
  background: rgba(255,255,255,0.25);
  transition: left 0.4s ease;
  border-radius: 1px;
}

.dist-cnt {
  width: 24px;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ── DICE HEATMAP ───────────────────────── */
.dice-matrix {
  display: grid;
  grid-template-columns: auto repeat(6, 1fr);
  gap: 2px;
}

.dm-header {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.dm-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
  min-height: 26px;
}

.dm-cell.hot {
  box-shadow: 0 0 6px rgba(0,255,136,0.3);
}

/* ── METRICS GRID ───────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-k {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--accent);
  opacity: 0.4;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.metric-v {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.metric-v.pos { color: var(--green); }
.metric-v.neg { color: var(--red); }
.metric-v.hot { color: var(--gold); }

/* ── BET PERFORMANCE TABLE ──────────────── */
.bet-perf-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.bet-perf-row:last-child {
  border-bottom: none;
}

.bp-name {
  width: 48px;
  color: var(--text-dim);
  text-transform: uppercase;
  flex-shrink: 0;
}

.bp-count {
  width: 22px;
  text-align: right;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.bp-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  overflow: hidden;
  min-width: 30px;
}

.bp-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.bp-pct {
  width: 30px;
  text-align: right;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  flex-shrink: 0;
}

.bp-pnl {
  width: 50px;
  text-align: right;
  font-weight: 700;
  flex-shrink: 0;
}

.bp-pnl.pos { color: var(--green); }
.bp-pnl.neg { color: var(--red); }

/* ── SHOOTER BAR ────────────────────────── */
.shooter-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  margin: 8px 0 4px;
  overflow: hidden;
}

.shooter-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
  max-width: 100%;
  box-shadow: 0 0 6px rgba(0,255,136,0.3);
}

/* ── LIVE FEED ──────────────────────────── */
.live-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.feed-entry {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 2px 0 2px 8px;
  border-left: 2px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: feedIn 0.15s ease-out;
}

.feed-entry.win {
  border-color: var(--green);
  color: rgba(0,230,118,0.85);
}

.feed-entry.lose {
  border-color: var(--red);
  color: rgba(255,61,0,0.85);
}

.feed-entry.info {
  border-color: rgba(0,255,136,0.15);
  color: rgba(255,255,255,0.35);
}

.feed-entry.point {
  border-color: var(--gold);
  color: rgba(255,193,7,0.85);
}

@keyframes feedIn {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── LUCK GAUGE ────────────────────────────── */
.luck-gauge {
  margin-top: 4px;
}

.luck-track {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.luck-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
  transition: left 0.6s ease, width 0.6s ease, background 0.6s ease;
  width: 4px;
  left: 50%;
}

.luck-marker {
  position: absolute;
  top: -2px;
  width: 4px;
  height: 12px;
  background: #fff;
  border-radius: 2px;
  left: 50%;
  transform: translateX(-50%);
  transition: left 0.6s ease;
  box-shadow: 0 0 6px rgba(255,255,255,0.4);
  z-index: 2;
}

.luck-center {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: rgba(255,255,255,0.15);
  transform: translateX(-50%);
}

.luck-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* ── SHOOTER LEADERBOARD ───────────────────── */
.shooter-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 100px;
  overflow: hidden;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.lb-row:first-child {
  color: var(--gold);
}

.lb-rank {
  width: 14px;
  text-align: right;
  color: var(--text-dim);
  flex-shrink: 0;
}

.lb-row:first-child .lb-rank {
  color: var(--gold);
}

.lb-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  min-width: 20px;
}

.lb-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

.lb-row:first-child .lb-bar-fill {
  background: var(--gold);
}

.lb-rolls {
  width: 20px;
  text-align: right;
  font-weight: 700;
  flex-shrink: 0;
}

.lb-pts {
  width: 28px;
  text-align: right;
  color: var(--text-dim);
  flex-shrink: 0;
}

.lb-pnl {
  width: 40px;
  text-align: right;
  font-weight: 700;
  flex-shrink: 0;
}

.lb-pnl.pos { color: var(--green); }
.lb-pnl.neg { color: var(--red); }

/* ── STREAK HEATSTRIP ──────────────────────── */
.streak-heatstrip {
  display: flex;
  gap: 1px;
  margin-top: 8px;
  height: 10px;
  border-radius: 2px;
  overflow: hidden;
}

.heat-block {
  flex: 1;
  min-width: 3px;
  max-width: 8px;
  border-radius: 1px;
  transition: background 0.2s;
}

.heat-block.win { background: var(--green); opacity: 0.7; }
.heat-block.lose { background: var(--red); opacity: 0.7; }
.heat-block.push { background: rgba(255,255,255,0.1); }
