/* ============================================
   Monster Capture Challenge - Style Sheet
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;900&display=swap');

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --accent-yellow: #eab308;
  --accent-purple: #a855f7;
  --accent-green: #22c55e;
  --accent-gold: #fbbf24;
  --glow-red: 0 0 20px rgba(239, 68, 68, 0.5);
  --glow-blue: 0 0 20px rgba(59, 130, 246, 0.5);
  --glow-yellow: 0 0 20px rgba(234, 179, 8, 0.5);
  --glow-purple: 0 0 20px rgba(168, 85, 247, 0.5);
  --glow-gold: 0 0 30px rgba(251, 191, 36, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Screen Management ---- */
.screen { min-height: 100vh; }
.screen.hidden { display: none; }

/* ---- Start Screen ---- */
.start-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}
.start-content {
  text-align: center;
  padding: 20px;
  max-width: 400px;
}
.start-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--accent-gold), #fff, var(--accent-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.start-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  margin-bottom: 30px;
}
.start-rules {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: left;
}
.rules-heading {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  text-align: center;
  text-transform: uppercase;
}
.rules-list {
  padding-left: 20px;
  margin: 0;
}
.rules-list li {
  margin-bottom: 2px;
}
.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin-bottom: 6px;
}
.rules-table th {
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: left;
}
.rules-table td {
  padding: 4px 6px;
  color: var(--text-primary);
}
.rules-note {
  font-size: 0.7rem;
  color: var(--accent-purple);
  text-align: center;
  margin-top: 4px;
}
.rules-rarity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 6px;
}
.rules-rarity {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.05em;
}
.rules-prizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: center;
  font-size: 0.75rem;
}
.start-credit-box {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: var(--accent-gold);
}
.start-credit-box strong {
  color: #fff;
}
.start-btn {
  width: 100%;
  padding: 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-green), #16a34a);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  letter-spacing: 0.1em;
  box-shadow: 0 4px 20px rgba(34,197,94,0.3);
  transition: all 0.3s;
}
.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(34,197,94,0.5);
}

/* ---- End Button ---- */
.end-btn {
  width: 100%;
  max-width: 300px;
  padding: 10px 24px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 8px;
}
.end-btn:hover:not(:disabled) {
  background: rgba(239,68,68,0.1);
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.end-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---- End Screen ---- */
.end-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}
.end-content {
  text-align: center;
  padding: 20px;
  max-width: 420px;
  width: 100%;
}
.end-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}
.end-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.end-stats {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.end-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
}
.end-stat-label { color: var(--text-secondary); }
.end-stat-value { font-weight: 700; color: var(--text-primary); }
.end-total {
  background: rgba(251,191,36,0.08);
  border: 2px solid rgba(251,191,36,0.25);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.end-total-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.end-total-value {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: var(--glow-gold);
}
.end-total-unit {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.end-prize {
  margin-bottom: 24px;
}
.end-prize-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}
.end-prize-value {
  font-size: 1.8rem;
  font-weight: 900;
  text-shadow: 0 0 20px currentColor;
}
.restart-btn {
  width: 100%;
  padding: 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  letter-spacing: 0.1em;
  box-shadow: 0 4px 15px rgba(59,130,246,0.3);
  transition: all 0.3s;
}
.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(59,130,246,0.5);
}

/* ---- Background ---- */
.game-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 50% 120%, #0f2b1a 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.08) 0%, transparent 50%),
    linear-gradient(180deg, #0a0e1a 0%, #0d1520 50%, #0a1a10 100%);
  z-index: -2;
}
.game-bg::after {
  content: '';
  position: fixed;
  bottom: 0; left: 0;
  width: 100%; height: 35%;
  background: linear-gradient(0deg, #1a3a1a 0%, #0f2b15 40%, transparent 100%);
  z-index: -1;
}

/* ---- Layout ---- */
.game-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
}

/* ---- Header ---- */
.game-header {
  text-align: center;
  padding: 12px 0 8px;
}
.game-title {
  font-size: 1.3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-gold), #fff, var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  letter-spacing: 0.08em;
}
.game-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  margin-top: 2px;
}

/* ---- Credit ---- */
.credit-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 10px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}
.credit-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.credit-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: var(--glow-gold);
}
.credit-max {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---- Bet Control ---- */
.bet-control {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 8px 0;
}
.bet-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}
.bet-adjuster {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bet-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Outfit', sans-serif;
}
.bet-btn:hover {
  background: rgba(251,191,36,0.15);
  border-color: var(--accent-gold);
}
.bet-value {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent-gold);
  min-width: 40px;
  text-align: center;
}
.bet-unit {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---- Ball Selection ---- */
.ball-select-area {
  margin: 14px 0;
}
.ball-select-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}
.ball-options {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.ball-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 2px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}
.ball-option:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
}
.ball-option.selected {
  border-color: var(--accent-gold);
  background: rgba(251,191,36,0.08);
  box-shadow: 0 0 15px rgba(251,191,36,0.15);
}
.ball-option.disabled {
  opacity: 0.35;
  pointer-events: none;
}
.ball-option .ball-cost {
  font-size: 0.6rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.ball-option .ball-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-primary);
}
.ball-option .ball-multiplier {
  font-size: 0.55rem;
  color: var(--accent-gold);
  font-weight: 600;
}

/* ---- CSS Ball Shapes ---- */
.ball-shape {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: inset -3px -3px 8px rgba(0,0,0,0.4), inset 2px 2px 6px rgba(255,255,255,0.15);
}
.ball-shape::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 3px;
  background: #333;
  transform: translateY(-50%);
  z-index: 2;
}
.ball-shape::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 3px solid #333;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}
.ball-shape.ball-normal {
  background: linear-gradient(180deg, #ef4444 0%, #ef4444 48%, #333 48%, #333 52%, #fff 52%, #fff 100%);
}
.ball-shape.ball-super {
  background: linear-gradient(180deg, #3b82f6 0%, #3b82f6 48%, #333 48%, #333 52%, #fff 52%, #fff 100%);
}
.ball-shape.ball-hyper {
  background: linear-gradient(180deg, #eab308 0%, #eab308 48%, #333 48%, #333 52%, #fff 52%, #fff 100%);
}
.ball-shape.ball-master {
  background: linear-gradient(180deg, #a855f7 0%, #7c3aed 30%, #a855f7 48%, #333 48%, #333 52%, #fff 52%, #fff 100%);
}
.ball-shape.ball-master::before {
  background: #555;
}
.ball-shape .ball-highlight {
  position: absolute;
  top: 6px;
  left: 10px;
  width: 12px;
  height: 8px;
  background: rgba(255,255,255,0.45);
  border-radius: 50%;
  z-index: 4;
  transform: rotate(-20deg);
}

/* ---- Stage Area ---- */
.stage-area {
  position: relative;
  height: 320px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
}

/* ---- Stage Ball (big, animated) ---- */
.stage-ball-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage-ball {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: inset -6px -6px 15px rgba(0,0,0,0.5), inset 4px 4px 12px rgba(255,255,255,0.2), 0 0 30px rgba(0,0,0,0.5);
  transition: transform 0.1s ease;
}
.stage-ball::before {
  content: '';
  position: absolute;
  top: 50%; left: 0;
  width: 100%;
  height: 5px;
  background: #333;
  transform: translateY(-50%);
  z-index: 2;
}
.stage-ball::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 22px;
  background: #fff;
  border: 4px solid #444;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}
.stage-ball .ball-highlight {
  position: absolute;
  top: 12px; left: 20px;
  width: 22px; height: 14px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  z-index: 4;
  transform: rotate(-20deg);
}
.stage-ball.ball-normal {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 48%, #333 48%, #333 52%, #f8f8f8 52%, #e0e0e0 100%);
}
.stage-ball.ball-super {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 48%, #333 48%, #333 52%, #f8f8f8 52%, #e0e0e0 100%);
}
.stage-ball.ball-hyper {
  background: linear-gradient(180deg, #eab308 0%, #ca8a04 48%, #333 48%, #333 52%, #f8f8f8 52%, #e0e0e0 100%);
}
.stage-ball.ball-master {
  background: linear-gradient(180deg, #a855f7 0%, #7c3aed 30%, #9333ea 48%, #444 48%, #444 52%, #f8f8f8 52%, #e0e0e0 100%);
}

/* ---- Shake Indicators ---- */
.shake-indicators {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}
.shake-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.15);
  transition: all 0.4s ease;
}
.shake-dot.success {
  background: var(--accent-green);
  border-color: var(--accent-green);
  box-shadow: 0 0 12px rgba(34,197,94,0.6);
}
.shake-dot.fail {
  background: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 0 12px rgba(239,68,68,0.6);
}

/* ---- Shake Animation ---- */
@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(15deg); }
  30% { transform: rotate(-15deg); }
  45% { transform: rotate(12deg); }
  60% { transform: rotate(-12deg); }
  75% { transform: rotate(6deg); }
  90% { transform: rotate(-6deg); }
}
.shaking {
  animation: shake 0.6s ease-in-out;
}

/* ---- Throw Animation ---- */
@keyframes throwBall {
  0% { transform: scale(1) translateY(0); opacity: 1; }
  30% { transform: scale(0.6) translateY(-80px); opacity: 0.8; }
  50% { transform: scale(0.4) translateY(-120px); opacity: 0.6; }
  70% { transform: scale(0.7) translateY(-40px); opacity: 0.9; }
  85% { transform: scale(0.9) translateY(-10px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.throwing {
  animation: throwBall 0.8s ease-out;
}

/* ---- Capture Success ---- */
@keyframes captureFlash {
  0% { box-shadow: 0 0 0 rgba(251,191,36,0); }
  50% { box-shadow: 0 0 60px rgba(251,191,36,0.8), 0 0 120px rgba(251,191,36,0.3); }
  100% { box-shadow: 0 0 20px rgba(251,191,36,0.2); }
}
.capture-success {
  animation: captureFlash 0.8s ease-out;
}

/* ---- Escape Animation ---- */
@keyframes escapeBurst {
  0% { transform: scale(1); opacity: 1; }
  30% { transform: scale(1.3); opacity: 0.8; }
  100% { transform: scale(0.3); opacity: 0; }
}
.escaping {
  animation: escapeBurst 0.5s ease-out forwards;
}

/* ---- Monster Display ---- */
.monster-display {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.monster-display.show {
  display: flex;
  animation: monsterAppear 0.6s ease-out;
}
@keyframes monsterAppear {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ---- CSS Monster Shapes ---- */
.monster-shape {
  width: 80px;
  height: 80px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Common - Green Blob */
.monster-shape.monster-1 {
  background: radial-gradient(circle, #66bb6a, #388e3c);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 0 20px rgba(102,187,106,0.4);
}
/* Common - Brown Bug */
.monster-shape.monster-2 {
  background: radial-gradient(circle, #a1887f, #6d4c41);
  border-radius: 40% 40% 50% 50%;
  width: 70px;
  box-shadow: 0 0 15px rgba(161,136,127,0.4);
}
/* Common - Blue Fish */
.monster-shape.monster-3 {
  background: radial-gradient(circle, #4fc3f7, #0288d1);
  border-radius: 50% 10% 50% 10%;
  transform: rotate(-20deg);
  box-shadow: 0 0 20px rgba(79,195,247,0.4);
}
/* Uncommon - Orange Star */
.monster-shape.monster-4 {
  background: radial-gradient(circle, #ff8a65, #e64a19);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  box-shadow: 0 0 25px rgba(255,138,101,0.5);
}
/* Uncommon - Yellow Bolt */
.monster-shape.monster-5 {
  background: radial-gradient(circle, #fff176, #f9a825);
  clip-path: polygon(30% 0%, 70% 0%, 55% 35%, 80% 35%, 25% 100%, 45% 50%, 15% 50%);
  box-shadow: 0 0 25px rgba(255,241,118,0.5);
}
/* Rare - Purple Dragon */
.monster-shape.monster-6 {
  background: radial-gradient(circle, #b39ddb, #512da8);
  clip-path: polygon(50% 0%, 100% 50%, 85% 100%, 15% 100%, 0% 50%);
  box-shadow: 0 0 30px rgba(179,157,219,0.5);
}
/* Rare - Gray Golem */
.monster-shape.monster-7 {
  background: radial-gradient(circle, #b0bec5, #546e7a);
  border-radius: 8px;
  box-shadow: 0 0 25px rgba(176,190,197,0.5);
}
/* Epic - Dark Cross */
.monster-shape.monster-8 {
  background: radial-gradient(circle, #ce93d8, #7b1fa2);
  clip-path: polygon(35% 0%, 65% 0%, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0% 65%, 0% 35%, 35% 35%);
  box-shadow: 0 0 35px rgba(206,147,216,0.6);
}
/* Legendary - Gold Hexagram */
.monster-shape.monster-9 {
  background: linear-gradient(135deg, #ffd54f, #ff8f00, #ffd54f);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  width: 90px; height: 90px;
  box-shadow: 0 0 40px rgba(255,213,79,0.7);
}
/* Legendary Shiny - Rainbow */
.monster-shape.monster-10 {
  background: linear-gradient(135deg, #ff0000, #ff8800, #ffff00, #00ff00, #0088ff, #8800ff, #ff0088);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  width: 90px; height: 90px;
  box-shadow: 0 0 50px rgba(255,255,255,0.5);
  animation: rainbowGlow 2s linear infinite;
}
@keyframes rainbowGlow {
  0% { filter: hue-rotate(0deg); box-shadow: 0 0 40px rgba(255,0,0,0.6); }
  33% { box-shadow: 0 0 50px rgba(0,255,0,0.6); }
  66% { box-shadow: 0 0 50px rgba(0,0,255,0.6); }
  100% { filter: hue-rotate(360deg); box-shadow: 0 0 40px rgba(255,0,0,0.6); }
}

/* Monster Eyes */
.monster-eyes {
  position: absolute;
  display: flex;
  gap: 12px;
  top: 30%;
}
.monster-eye {
  width: 10px; height: 12px;
  background: #fff;
  border-radius: 50%;
  position: relative;
}
.monster-eye::after {
  content: '';
  position: absolute;
  width: 5px; height: 5px;
  background: #222;
  border-radius: 50%;
  top: 4px; left: 3px;
}

.monster-name {
  font-size: 1.1rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
}
.monster-rarity {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.rarity-common { background: rgba(34,197,94,0.2); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.rarity-uncommon { background: rgba(59,130,246,0.2); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.rarity-rare { background: rgba(168,85,247,0.2); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.rarity-epic { background: rgba(236,72,153,0.2); color: #f472b6; border: 1px solid rgba(236,72,153,0.3); }
.rarity-legendary { background: rgba(251,191,36,0.2); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }

.payout-text {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: var(--glow-gold);
}

/* ---- Message Area ---- */
.message-area {
  text-align: center;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.message-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.3s;
}
.message-text.highlight {
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 1rem;
  text-shadow: var(--glow-gold);
}
.message-text.fail-msg {
  color: var(--accent-red);
  font-weight: 700;
}

/* ---- Action Button ---- */
.action-area {
  text-align: center;
  margin: 12px 0;
}
.throw-btn {
  width: 100%;
  max-width: 300px;
  padding: 14px 24px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-red), #dc2626);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.1em;
  box-shadow: 0 4px 15px rgba(239,68,68,0.3);
  position: relative;
  overflow: hidden;
}
.throw-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(239,68,68,0.5);
}
.throw-btn:active:not(:disabled) {
  transform: translateY(0);
}
.throw-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.throw-btn::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.5s;
}
.throw-btn:hover::after {
  left: 100%;
}

/* ---- History ---- */
.history-area {
  margin-top: 14px;
}
.history-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 0.1em;
}
.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  max-height: 100px;
  overflow-y: auto;
}
.history-item {
  font-size: 0.6rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.history-item.win {
  border-color: rgba(34,197,94,0.3);
  color: #4ade80;
}
.history-item.lose {
  color: var(--text-secondary);
}

/* ---- Particles ---- */
.particle-container {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  pointer-events: none;
}
@keyframes particleFly {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* ---- Shiny Overlay ---- */
.shiny-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}
.shiny-overlay.show {
  display: block;
  animation: shinyFlash 2s ease-out forwards;
}
@keyframes shinyFlash {
  0% { background: rgba(255,255,255,0.8); }
  20% { background: rgba(255,215,0,0.3); }
  100% { background: transparent; }
}

/* ---- Responsive ---- */
@media (max-width: 400px) {
  .game-container { padding: 10px; }
  .ball-options { gap: 6px; }
  .ball-option { padding: 8px 8px; }
  .ball-shape { width: 36px; height: 36px; }
  .stage-ball { width: 80px; height: 80px; }
}
