/* ── Coin Flip — "The Flip" ── */

* { box-sizing: border-box; }

body {
  background: linear-gradient(135deg, #3d5a80 0%, #4d6a90 50%, #3d6090 100%);
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  min-height: 100vh;
  color: white;
}

button { cursor: pointer; }

/* ── Header (matching darts/site) ── */

.header {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 40px;
  border-bottom: 2px solid rgba(94, 190, 255, 0.3);
  position: sticky;
  top: 0;
  height: 90px;
  background: linear-gradient(135deg, rgba(20, 40, 80, 0.95), rgba(30, 50, 100, 0.95));
  backdrop-filter: blur(10px);
  z-index: 100;
  gap: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.header-btn.shop-btn:hover {
  background: linear-gradient(135deg, #70c8ff, #90ddff);
  box-shadow: 0 4px 20px rgba(94, 190, 255, 0.5);
}
.header-btn.inventory-btn:hover { background: rgba(255, 255, 255, 0.25); }

.games-header {
  color: white;
  font-family: "Orbitron", sans-serif;
  font-size: 28px;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
}
.games-header:hover { color: #5ebeff; }

.header-left { display: flex; align-items: center; gap: 20px; }

.version-badge {
  background: rgba(94, 190, 255, 0.2);
  border: 1px solid rgba(94, 190, 255, 0.4);
  color: #5ebeff;
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.header-nav { display: flex; gap: 15px; margin-left: auto; align-items: center; }

.header-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-family: Arial, sans-serif;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-weight: 600;
}
.header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(94, 190, 255, 0.3);
}

.header-btn.shop-btn {
  background: linear-gradient(135deg, #5ebeff, #7dd3ff);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white;
  font-weight: bold;
}

.header-btn.inventory-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.money-amount {
  color: white;
  font-family: Arial, sans-serif;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(94, 190, 255, 0.15);
  border: 2px solid rgba(94, 190, 255, 0.4);
  padding: 8px 15px;
  border-radius: 8px;
  font-weight: 600;
}

.header-auth { display: flex; align-items: center; gap: 8px; margin-left: 15px; }
.header-auth-link {
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-family: Arial, sans-serif;
  padding: 8px 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 600;
}
.header-auth-link:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.5); }
.header-auth-link.signup {
  color: white;
  background: linear-gradient(135deg, #5ebeff, #7dd3ff);
  border: 2px solid rgba(255, 255, 255, 0.4);
}
.header-auth-link.signup:hover {
  background: linear-gradient(135deg, #70c8ff, #90ddff);
  box-shadow: 0 4px 15px rgba(94, 190, 255, 0.4);
}

.user-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-family: 'Orbitron', sans-serif; font-size: 18px;
  font-weight: bold; cursor: pointer; transition: all 0.3s ease;
  text-decoration: none; border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  position: relative; overflow: hidden;
}
.user-avatar:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6), 0 0 35px rgba(240, 147, 251, 0.4);
}

model-viewer.riskcoin {
  display: inline-block; vertical-align: middle;
  --poster-color: transparent; background: transparent;
}
model-viewer.riskcoin::part(default-progress-bar) { display: none; }
model-viewer.riskcoin::part(default-ar-button) { display: none; }
model-viewer.riskcoin-header { width: 42px; height: 42px; }

/* ── Game Layout ── */

.flip-layout {
  display: flex;
  flex-direction: row;
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 20px;
  gap: 24px;
  align-items: flex-start;
}

/* ── Control Panel ── */

.control-panel {
  width: 300px;
  min-width: 280px;
  background: linear-gradient(135deg, rgba(61, 90, 128, 0.3), rgba(77, 106, 144, 0.3));
  border: 2px solid rgba(94, 190, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  flex-shrink: 0;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(94, 190, 255, 0.3);
}
.tab-btn {
  flex: 1;
  padding: 10px;
  background: rgba(61, 90, 128, 0.3);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s ease;
}
.tab-btn.active {
  background: rgba(94, 190, 255, 0.25);
  color: #5ebeff;
}
.tab-btn:hover:not(.active) {
  background: rgba(94, 190, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

/* Form groups */
.form-group { margin-bottom: 10px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0, 0, 48, 0.4);
  border: 2px solid rgba(94, 190, 255, 0.3);
  border-radius: 8px;
  color: white;
  font-size: 16px;
  font-family: "Orbitron", sans-serif;
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}
.form-input:focus { border-color: rgba(94, 190, 255, 0.6); }

.form-error {
  color: #f44336;
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

/* Bet Row — bet display + side selector inline */
.bet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px;
}
.bet-display {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.bet-display-prefix {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.bet-display-value {
  color: white;
  font-size: 17px;
  font-weight: 700;
  font-family: "Orbitron", sans-serif;
  white-space: nowrap;
}
.clear-bet-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.clear-bet-btn:hover {
  background: rgba(244, 67, 54, 0.2);
  border-color: rgba(244, 67, 54, 0.5);
  color: #f44336;
}

/* Game area controls (under streak bar) */
.game-area-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  width: 100%;
  max-width: 400px;
}
.mult-toggle-btn {
  background: rgba(61, 90, 128, 0.3);
  border: 1px solid rgba(94, 190, 255, 0.2);
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 20px;
  transition: all 0.15s;
  font-family: Arial, sans-serif;
}
.mult-toggle-btn:hover {
  background: rgba(94, 190, 255, 0.15);
  border-color: rgba(94, 190, 255, 0.4);
  color: #5ebeff;
}
.mult-toggle-btn.open {
  background: rgba(94, 190, 255, 0.15);
  border-color: rgba(94, 190, 255, 0.4);
  color: #5ebeff;
}

/* Quick-adjust buttons */
.quick-btns { display: flex; gap: 6px; margin-top: 8px; }
.quick-btn {
  flex: 1;
  padding: 6px;
  background: rgba(94, 190, 255, 0.1);
  border: 1px solid rgba(94, 190, 255, 0.25);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.quick-btn:hover {
  background: rgba(94, 190, 255, 0.2);
  color: white;
  border-color: rgba(94, 190, 255, 0.5);
}

/* Side Picker */
.side-selector {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(94, 190, 255, 0.3);
}
.side-btn {
  flex: 1;
  padding: 8px 12px;
  background: rgba(61, 90, 128, 0.3);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.side-btn + .side-btn {
  border-left: 1px solid rgba(94, 190, 255, 0.15);
}
.side-btn:hover:not(.active) {
  background: rgba(94, 190, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}
.side-btn.active[data-side="heads"] {
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.3), rgba(199, 110, 0, 0.3));
  color: #F7931A;
  box-shadow: inset 0 0 12px rgba(247, 147, 26, 0.15);
}
.side-btn.active[data-side="tails"] {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(29, 78, 216, 0.3));
  color: #3B82F6;
  box-shadow: inset 0 0 12px rgba(59, 130, 246, 0.15);
}

/* Flip Button */
.flip-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #00c853, #00e676);
  border: none;
  border-radius: 10px;
  color: white;
  font-family: "Orbitron", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  margin-bottom: 10px;
  min-height: 48px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.flip-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #00e676, #69f0ae);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 230, 118, 0.4);
}
.flip-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.flip-btn.hidden { display: none; }

/* Auto start button */
.auto-start-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #00c853, #00e676);
  border: none;
  border-radius: 10px;
  color: white;
  font-family: "Orbitron", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  margin-top: 16px;
  min-height: 56px;
}
.auto-start-btn.running {
  background: linear-gradient(135deg, #d32f2f, #f44336);
  color: white;
}
.auto-start-btn:hover { transform: translateY(-1px); }

/* Round Info */
.round-info {
  display: none;
  background: linear-gradient(135deg, rgba(61, 90, 128, 0.25), rgba(94, 190, 255, 0.08));
  border: 1px solid rgba(94, 190, 255, 0.25);
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
}
.round-info.active { display: block; }
.round-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.round-info-row:last-child { border-bottom: none; }
.round-info-row .value {
  color: #fff;
  font-weight: 600;
  font-family: "Orbitron", sans-serif;
  font-size: 13px;
}
.round-info-row .value.profit { color: #00e676; }
.round-info-row .value.loss { color: #f44336; }

/* Instant toggle */
.instant-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 20px;
  background: rgba(61, 90, 128, 0.3);
  border: 1px solid rgba(94, 190, 255, 0.2);
  transition: all 0.15s;
  font-family: Arial, sans-serif;
  user-select: none;
}
.instant-toggle:hover {
  background: rgba(94, 190, 255, 0.15);
  border-color: rgba(94, 190, 255, 0.4);
  color: #5ebeff;
}
.instant-toggle input[type="checkbox"] {
  accent-color: #5ebeff;
  margin: 0;
  width: 14px;
  height: 14px;
}

/* Multiplier Table */
.mult-table-wrapper {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid rgba(94, 190, 255, 0.15);
  border-radius: 8px;
  background: rgba(0, 0, 48, 0.2);
  margin-top: 6px;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}
.mult-table-wrapper.collapsed {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  border: none;
}
.mult-table-wrapper::-webkit-scrollbar { width: 4px; }
.mult-table-wrapper::-webkit-scrollbar-track { background: transparent; }
.mult-table-wrapper::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 2px; }

.mult-table { width: 100%; border-collapse: collapse; }
.mult-table td {
  padding: 5px 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.mult-table td:nth-child(2) {
  text-align: right;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
}
.mult-table tr.active-row td {
  background: rgba(94, 190, 255, 0.1);
  color: #5ebeff;
}
.mult-table tr.completed-row td {
  color: rgba(0, 230, 118, 0.6);
}

/* Radio group */
.radio-group {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.radio-group input[type="radio"] { accent-color: #5ebeff; }
.inline-input {
  width: 60px;
  padding: 4px 6px;
  background: rgba(0, 0, 48, 0.4);
  border: 1px solid rgba(94, 190, 255, 0.3);
  border-radius: 4px;
  color: white;
  font-size: 13px;
  outline: none;
}

/* Session Stats */
.session-stats {
  margin-top: 12px;
  padding: 10px;
  background: rgba(61, 90, 128, 0.2);
  border: 1px solid rgba(94, 190, 255, 0.15);
  border-radius: 8px;
}
.session-stat {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  padding: 3px 0;
}
.session-stat .val {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
}

/* ── Game Area ── */

.game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 20px 0;
}

/* Multiplier Display */
.multiplier-display {
  font-family: 'Orbitron', sans-serif;
  font-size: 52px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.15);
  text-align: center;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  letter-spacing: 2px;
}
.multiplier-display.win {
  color: #00e676;
  text-shadow: 0 0 25px rgba(0, 230, 118, 0.5), 0 0 50px rgba(0, 230, 118, 0.2);
  animation: multPop 0.3s ease-out;
}
.multiplier-display.big-win {
  font-size: 60px;
  color: #ffd740;
  text-shadow: 0 0 30px rgba(255, 215, 64, 0.6), 0 0 60px rgba(255, 215, 64, 0.25);
  animation: multPop 0.3s ease-out;
}
@keyframes multPop {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.payout-display {
  font-family: "Orbitron", sans-serif;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  margin-top: 2px;
  min-height: 20px;
  letter-spacing: 0.5px;
}

/* ── Coin ── */

.coin-container {
  perspective: 800px;
  width: 220px;
  height: 220px;
  margin: 24px 0;
  position: relative;
}

.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.1s;
}

.coin.idle {
  animation: coinIdle 4s ease-in-out infinite;
}

@keyframes coinIdle {
  0%, 100% { transform: rotateY(0deg) rotateX(0deg) translateY(0px); }
  25% { transform: rotateY(12deg) rotateX(2deg) translateY(-3px); }
  50% { transform: rotateY(0deg) rotateX(0deg) translateY(0px); }
  75% { transform: rotateY(-12deg) rotateX(-2deg) translateY(-3px); }
}

.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.coin-face::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.08) 55%,
    transparent 60%
  );
  pointer-events: none;
}

.coin-heads {
  background: radial-gradient(ellipse at 35% 35%, #ffd97d 0%, #F7931A 40%, #c76e00 100%);
}

.coin-tails {
  background: radial-gradient(ellipse at 35% 35%, #93c5fd 0%, #3B82F6 40%, #1d4ed8 100%);
  transform: rotateY(180deg);
}

/* Blue overlay for tails when universal skin is active */
.coin-tails-blue {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  background: rgba(30, 80, 220, 0.45);
  pointer-events: none;
  z-index: 1;
}
.coin-tails.coin-tails-overlay .coin-tails-blue {
  display: block;
}

/* Keep coin text above the tails blue overlay */
.coin-icon, .coin-label { position: relative; z-index: 2; }

.coin-icon {
  font-size: 48px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-family: 'Orbitron', sans-serif;
  z-index: 1;
}

.coin-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  margin-top: 4px;
  z-index: 1;
}

.coin-shadow {
  width: 160px;
  height: 16px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.1) 50%, transparent 75%);
  margin: 14px auto 0;
  transition: all 0.2s;
  filter: blur(2px);
}

/* Coin Glow Effects */
.coin.win-glow .coin-face {
  box-shadow:
    0 0 30px rgba(0, 230, 118, 0.6),
    0 0 60px rgba(0, 230, 118, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
  border-color: rgba(0, 230, 118, 0.6);
}

.coin.loss-glow .coin-face {
  box-shadow:
    0 0 30px rgba(244, 67, 54, 0.6),
    0 0 60px rgba(244, 67, 54, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
  border-color: rgba(244, 67, 54, 0.6);
}

/* Glint Sweep */
.coin.glint .coin-face::after {
  animation: glintSweep 0.5s ease-out;
}
@keyframes glintSweep {
  0% { transform: translateX(-120%) rotate(35deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateX(120%) rotate(35deg); opacity: 0; }
}

/* Impact Ring — expands outward from coin on landing */
.coin-impact-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  border: 2px solid rgba(0, 230, 118, 0.6);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.3);
  pointer-events: none;
  animation: impactExpand 0.5s ease-out forwards;
}
.coin-impact-ring.loss {
  border-color: rgba(244, 67, 54, 0.6);
  box-shadow: 0 0 12px rgba(244, 67, 54, 0.3);
}
@keyframes impactExpand {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

/* Bust tilt */
.coin.bust {
  animation: bustTilt 0.4s ease-out forwards;
}
@keyframes bustTilt {
  0% { transform: rotateZ(0deg); }
  100% { transform: rotateZ(15deg) translateY(10px); }
}
.coin.bust-tails {
  animation: bustTiltTails 0.4s ease-out forwards;
}
@keyframes bustTiltTails {
  0% { transform: rotateY(180deg) rotateZ(0deg); }
  100% { transform: rotateY(180deg) rotateZ(15deg) translateY(10px); }
}

/* ── Decision Buttons ── */

.decision-buttons {
  display: none;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
  max-width: 400px;
}
.decision-buttons.active { display: flex; }

.cashout-btn {
  flex: 1;
  padding: 16px 20px;
  background: linear-gradient(135deg, #00c853, #00e676);
  border: 2px solid rgba(0, 230, 118, 0.3);
  border-radius: 10px;
  color: white;
  font-family: "Orbitron", sans-serif;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  animation: cashoutPulse 2s ease-in-out infinite;
  letter-spacing: 0.5px;
}
@keyframes cashoutPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(0, 200, 83, 0); }
}
.cashout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 200, 83, 0.4);
}

.flipagain-btn {
  flex: 1;
  padding: 16px 20px;
  background: linear-gradient(135deg, #F7931A, #c76e00);
  border: 2px solid rgba(247, 147, 26, 0.3);
  border-radius: 10px;
  color: white;
  font-family: "Orbitron", sans-serif;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.flipagain-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(247, 147, 26, 0.4);
}
.flipagain-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Inline side picker */
.inline-side-picker {
  display: none;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.inline-side-picker.active { display: flex; }

.inline-side-btn {
  padding: 10px 24px;
  background: rgba(61, 90, 128, 0.3);
  border: 2px solid rgba(94, 190, 255, 0.2);
  border-radius: 24px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.inline-side-btn.active[data-side="heads"] {
  background: rgba(247, 147, 26, 0.2);
  border-color: #F7931A;
  color: #F7931A;
}
.inline-side-btn.active[data-side="tails"] {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3B82F6;
  color: #3B82F6;
}

/* ── Streak Progress Bar ── */

.streak-bar {
  display: flex;
  gap: 3px;
  width: 100%;
  max-width: 400px;
  margin-top: 20px;
}
.streak-segment {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  transition: all 0.3s;
}
.streak-segment.filled {
  background: linear-gradient(90deg, #00c853, #69f0ae);
  box-shadow: 0 0 6px rgba(0, 200, 83, 0.4);
}
.streak-segment.filled.intense {
  background: linear-gradient(90deg, #ffd740, #ffab00);
  box-shadow: 0 0 8px rgba(255, 215, 64, 0.5);
}
.streak-segment.filled.epic {
  background: linear-gradient(90deg, #f44336, #ff6d00);
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

/* ── BUST Overlay ── */

.bust-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  pointer-events: none;
}
.bust-overlay.active {
  display: flex;
  animation: bustFade 1.5s ease-out forwards;
}
@keyframes bustFade {
  0% { opacity: 0; }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}
.bust-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 80px;
  font-weight: 900;
  color: #f44336;
  text-shadow: 0 0 40px rgba(244, 67, 54, 0.8), 0 0 80px rgba(244, 67, 54, 0.4);
  animation: bustScale 0.3s ease-out;
}
@keyframes bustScale {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.bust-amount {
  font-family: "Orbitron", sans-serif;
  font-size: 18px;
  color: #f44336;
  margin-top: 10px;
  text-align: center;
}

/* ── Results Strip ── */

.results-strip-wrapper {
  width: 100%;
  max-width: 500px;
  margin-top: 20px;
}
.results-strip {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: flex-end;
  min-height: 50px;
  overflow: hidden;
}

.result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 42px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(61, 90, 128, 0.2);
  border: 1px solid rgba(94, 190, 255, 0.15);
  animation: slideInRight 0.3s ease-out;
  cursor: pointer;
  position: relative;
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.result-item:first-child {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.15);
}
.result-item.win { border-color: rgba(0, 230, 118, 0.3); }
.result-item.loss { border-color: rgba(244, 67, 54, 0.2); }
.result-item.big-win {
  border-color: rgba(255, 215, 64, 0.4);
  box-shadow: 0 0 10px rgba(255, 215, 64, 0.15);
}

.result-coin {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Orbitron', sans-serif;
}
.result-coin.heads { background: radial-gradient(circle, #ffd97d, #F7931A); }
.result-coin.tails { background: radial-gradient(circle, #93c5fd, #3B82F6); }

.result-mult {
  font-size: 10px;
  font-weight: 600;
  font-family: "Orbitron", sans-serif;
}
.result-item.win .result-mult { color: #00e676; }
.result-item.loss .result-mult { color: #f44336; }
.result-item.big-win .result-mult { color: #ffd740; }

/* Streak dots */
.streak-dots {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 8px;
}
.streak-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.streak-dot.win { background: #00e676; }
.streak-dot.loss { background: #f44336; }

/* Tooltip */
.result-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 48, 0.95);
  border: 2px solid rgba(94, 190, 255, 0.4);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
}
.result-item:hover .result-tooltip { display: block; }

/* ── Confetti ── */

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -10px;
  animation: confettiFall 2s ease-in forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Escalation Effects ── */

.game-area.escalation-slow {
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.3) 100%);
  border-radius: 12px;
}
.game-area.escalation-intense {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.4) 100%);
  border-radius: 12px;
}
.game-area.escalation-dramatic {
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.5) 100%);
  border-radius: 12px;
}
.game-area.escalation-epic {
  background: radial-gradient(ellipse at center, rgba(247, 147, 26, 0.03) 0%, rgba(0, 0, 0, 0.6) 100%);
  border-radius: 12px;
  animation: epicPulse 1.5s ease-in-out infinite;
}
@keyframes epicPulse {
  0%, 100% { box-shadow: inset 0 0 60px rgba(247, 147, 26, 0.05); }
  50% { box-shadow: inset 0 0 100px rgba(247, 147, 26, 0.1); }
}

/* ── Max Win Celebration ── */

.max-win-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  z-index: 400;
  flex-direction: column;
}
.max-win-overlay.active {
  display: flex;
  animation: maxWinIn 0.5s ease-out;
}
@keyframes maxWinIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.max-win-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 64px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd740, #ffab00, #ffd740);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(255, 215, 64, 0.6));
  animation: maxWinPulse 1s ease-in-out infinite alternate;
}
@keyframes maxWinPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}
.max-win-amount {
  font-family: 'Orbitron', sans-serif;
  font-size: 32px;
  color: #00e676;
  margin-top: 10px;
  text-shadow: 0 0 20px rgba(0, 230, 118, 0.5);
}

/* ── Mobile Responsive ── */

@media (max-width: 900px) {
  .header { padding: 0 16px; height: 60px; gap: 10px; }
  .games-header { font-size: 18px; }
  .header-btn { padding: 6px 10px; font-size: 12px; }
  .money-amount { padding: 6px 10px; font-size: 12px; }

  .flip-layout {
    flex-direction: column;
    align-items: center;
    padding: 0 12px;
    gap: 16px;
  }

  .control-panel {
    width: 100%;
    min-width: unset;
    order: 2;
  }

  .game-area {
    order: 1;
    width: 100%;
  }

  .coin-container {
    width: 150px;
    height: 150px;
    margin: 15px 0;
  }

  .multiplier-display { font-size: 36px; }

  .decision-buttons {
    position: sticky;
    bottom: 10px;
    z-index: 90;
    background: linear-gradient(0deg, rgba(15, 16, 25, 0.98) 80%, transparent);
    padding: 12px;
    border-radius: 12px;
  }
  .cashout-btn, .flipagain-btn { min-height: 48px; font-size: 13px; }

  .bust-text { font-size: 48px; }
  .streak-bar { max-width: 100%; }
  .results-strip-wrapper { max-width: 100%; }
  .mult-table-wrapper { max-height: 150px; }
}

@media (max-width: 480px) {
  .coin-container { width: 130px; height: 130px; }
  .multiplier-display { font-size: 28px; }
  .coin-icon { font-size: 36px; }
}
