/* ============================================
   SCREEN FLASH OVERLAY
   ============================================ */
.screen-flash {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.08s ease-out;
}

.screen-flash.win-flash {
  background: radial-gradient(ellipse at center, rgba(0,230,118,0.35) 0%, rgba(0,230,118,0.08) 50%, transparent 80%);
  opacity: 1;
}

.screen-flash.lose-flash {
  background: radial-gradient(ellipse at center, rgba(255,61,0,0.3) 0%, rgba(255,61,0,0.08) 50%, transparent 80%);
  opacity: 1;
}

.screen-flash.big-win-flash {
  background: radial-gradient(ellipse at center, rgba(255,193,7,0.4) 0%, rgba(255,193,7,0.1) 50%, transparent 80%);
  opacity: 1;
}

/* ============================================
   HEADER (.hdr)
   ============================================ */
.hdr {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  background: rgba(0,0,0,0.8);
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  flex-shrink: 0;
  gap: 12px;
  z-index: 10;
  border-bottom: 1px solid rgba(0,255,136,0.1);
  overflow: hidden;
}

.logo {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
  white-space: nowrap;
  font-style: normal;
}

.streak-badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.hdr-phase {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hdr-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.hstat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 1rem;
  white-space: nowrap;
}

.hstat-lbl {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hstat-val {
  font-weight: 700;
  font-family: var(--mono);
  font-size: 1rem;
}

.hstat-val.bal {
  color: var(--gold);
}

.hstat-val.bet {
  color: #b39ddb;
}

.hstat-val.pnl {
  color: var(--green);
}

.hstat-val.pnl.pos {
  color: var(--green);
}

.hstat-val.pnl.neg {
  color: var(--red);
}

/* bankroll animations */
@keyframes bankrollWin {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); color: var(--green); text-shadow: 0 0 8px rgba(0,230,118,0.6); }
  100% { transform: scale(1); }
}

@keyframes bankrollLose {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); color: var(--red); text-shadow: 0 0 8px rgba(255,61,0,0.6); }
  100% { transform: scale(1); }
}

.hstat-val.bankroll-win {
  animation: bankrollWin 0.4s ease;
}

.hstat-val.bankroll-lose {
  animation: bankrollLose 0.4s ease;
}

/* ============================================
   HISTORY STRIP (.hist-strip)
   ============================================ */
.hist-strip {
  display: flex;
  align-items: center;
  padding: 4px 16px;
  background: rgba(0,0,0,0.6);
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  flex-shrink: 0;
  gap: 8px;
  z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
}

.hist-lbl {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0.6;
  white-space: nowrap;
  flex-shrink: 0;
}

.hist-rolls {
  display: flex;
  flex-direction: row-reverse;
  gap: 3px;
  overflow: hidden;
  flex: 1;
  align-items: center;
  -webkit-mask-image: linear-gradient(to left, black 90%, transparent 100%);
  mask-image: linear-gradient(to left, black 90%, transparent 100%);
}

.h-roll {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0 3px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.1);
  animation: rollBadgeIn 0.15s ease-out;
}

.h-roll.seven {
  background: rgba(255,61,0,0.2);
  border-color: rgba(255,61,0,0.5);
  color: var(--red);
}

.h-roll.point {
  background: rgba(255,193,7,0.2);
  border-color: rgba(255,193,7,0.5);
  color: var(--gold);
}

.h-roll.craps {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
}

.h-roll.nat {
  background: rgba(0,230,118,0.2);
  border-color: rgba(0,230,118,0.5);
  color: var(--green);
}

.hist-freq {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  flex-shrink: 0;
}

.freq-bar {
  width: 8px;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: rgba(255,255,255,0.15);
  transition: height 0.3s ease;
}

.freq-bar.hot {
  background: var(--gold);
}

.freq-num {
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1;
}

/* ============================================
   GAME AREA
   ============================================ */
.game-area {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  z-index: 5;
  min-height: 0;
  overflow: hidden;
}

/* ============================================
   RESULT BANNER (above table)
   ============================================ */
.result-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 38px;
  padding: 4px 20px;
  border-radius: 8px;
  background: rgba(0,0,0,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  opacity: 0;
  overflow: hidden;
  z-index: 50;
  pointer-events: none;
}

.result-banner.show {
  opacity: 1;
}

.rb-dice {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(255,255,255,0.3);
}

.rb-text {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rb-pnl {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  min-width: 60px;
  text-align: center;
}

.rb-pnl.win {
  color: var(--green);
  text-shadow: 0 0 12px rgba(0,230,118,0.6), 0 0 24px rgba(0,230,118,0.2);
}

.rb-pnl.lose {
  color: var(--red);
  text-shadow: 0 0 12px rgba(255,61,0,0.6), 0 0 24px rgba(255,61,0,0.2);
}

.rb-pnl.push {
  color: rgba(255,255,255,0.4);
}

/* Result banner animations */
@keyframes rbPulseWin {
  0% { background: rgba(0,230,118,0.15); }
  50% { background: rgba(0,230,118,0.05); }
  100% { background: rgba(0,0,0,0.5); }
}

@keyframes rbPulseLose {
  0% { background: rgba(255,61,0,0.15); }
  50% { background: rgba(255,61,0,0.05); }
  100% { background: rgba(0,0,0,0.5); }
}

@keyframes rbPulseBigWin {
  0% { background: rgba(255,193,7,0.25); }
  25% { background: rgba(0,230,118,0.15); }
  50% { background: rgba(255,193,7,0.1); }
  100% { background: rgba(0,0,0,0.5); }
}

@keyframes rbCountUp {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.result-banner.rb-win {
  animation: rbPulseWin 0.6s ease;
  border-bottom: 1px solid rgba(0,230,118,0.3);
}

.result-banner.rb-lose {
  animation: rbPulseLose 0.6s ease;
  border-bottom: 1px solid rgba(255,61,0,0.3);
}

.result-banner.rb-bigwin {
  animation: rbPulseBigWin 0.8s ease;
  border-bottom: 1px solid rgba(255,193,7,0.4);
}

.rb-pnl.pop {
  animation: rbCountUp 0.25s ease forwards;
}
