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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: #fff;
}

.game-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  margin-bottom: 20px;
}

.game-title h1 {
  font-size: 1.8rem;
  background: linear-gradient(to bottom, #ffd700, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.balance-display {
  font-size: 1.2rem;
}

.balance-label {
  color: #aaa;
  margin-right: 10px;
}

.balance-amount {
  color: #4ade80;
  font-weight: bold;
  font-size: 1.4rem;
}

/* Main Game Area */
.game-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.grid-container {
  position: relative;
  width: 100%;
  max-width: 720px;
}

/* Game Grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 6px;
  padding: 15px;
  background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(30,30,60,0.5) 100%);
  border-radius: 15px;
  border: 3px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.1), inset 0 0 50px rgba(0,0,0,0.5);
}

.grid-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 2.5rem;
  font-weight: bold;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.grid-cell.winning {
  animation: pulse 0.5s ease infinite;
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.grid-cell.tumble-out {
  animation: fadeOut 0.3s ease forwards;
}

.grid-cell.tumble-in {
  animation: dropIn 0.3s ease forwards;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: scale(0.5); }
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-50px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Symbol Colors */
.symbol-SC { background: linear-gradient(135deg, #9333ea, #6b21a8); color: #fff; }
.symbol-H1 { background: linear-gradient(135deg, #fcd34d, #f59e0b); color: #78350f; }
.symbol-H2 { background: linear-gradient(135deg, #a78bfa, #7c3aed); color: #fff; }
.symbol-H3 { background: linear-gradient(135deg, #60a5fa, #3b82f6); color: #fff; }
.symbol-H4 { background: linear-gradient(135deg, #f472b6, #ec4899); color: #fff; }
.symbol-L1 { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.symbol-L2 { background: linear-gradient(135deg, #a855f7, #9333ea); color: #fff; }
.symbol-L3 { background: linear-gradient(135deg, #facc15, #eab308); color: #713f12; }
.symbol-L4 { background: linear-gradient(135deg, #4ade80, #22c55e); color: #fff; }
.symbol-L5 { background: linear-gradient(135deg, #38bdf8, #0ea5e9); color: #fff; }
.symbol-MP { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; border: 2px solid #fbbf24; }

/* Symbol Labels */
.symbol-label {
  font-size: 1.8rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  z-index: 10;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  text-align: center;
  padding: 30px;
}

#overlay-message {
  font-size: 2rem;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  animation: glowText 1.5s ease infinite;
}

@keyframes glowText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Win Display */
.win-display {
  margin-top: 15px;
  min-height: 60px;
}

.win-panel {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  padding: 10px 30px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  animation: winPop 0.5s ease;
}

.win-panel.hidden {
  display: none;
}

.win-label {
  font-size: 1.2rem;
  color: #78350f;
  font-weight: bold;
}

.win-amount {
  font-size: 1.8rem;
  color: #78350f;
  font-weight: bold;
}

@keyframes winPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Free Spins Panel */
.freespin-panel {
  margin-top: 15px;
  background: linear-gradient(135deg, #9333ea, #6b21a8);
  padding: 15px 30px;
  border-radius: 15px;
  display: flex;
  gap: 30px;
  font-size: 1.2rem;
}

.freespin-panel.hidden {
  display: none;
}

.fs-counter, .fs-multiplier {
  display: flex;
  gap: 10px;
}

#fs-multiplier {
  color: #ffd700;
  font-weight: bold;
}

/* Controls */
.game-controls {
  margin-top: 20px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-group label {
  color: #aaa;
}

.bet-select {
  padding: 10px 15px;
  font-size: 1rem;
  background: #1a1a2e;
  color: #fff;
  border: 2px solid #4ade80;
  border-radius: 8px;
  cursor: pointer;
}

/* Ante Toggle */
.ante-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.ante-toggle input {
  display: none;
}

.toggle-slider {
  width: 50px;
  height: 26px;
  background: #333;
  border-radius: 13px;
  position: relative;
  transition: background 0.3s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
}

.ante-toggle input:checked + .toggle-slider {
  background: #4ade80;
}

.ante-toggle input:checked + .toggle-slider::after {
  transform: translateX(24px);
}

.toggle-label {
  color: #aaa;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-spin {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #fff;
  min-width: 150px;
  font-size: 1.4rem;
}

.btn-spin:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.btn-bonus {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.3;
}

.btn-bonus:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.5);
}

#bonus-cost {
  font-size: 0.8rem;
  opacity: 0.8;
}

.btn-demo {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}

.btn-demo:hover:not(:disabled) {
  transform: scale(1.05);
}

/* Demo Row */
.demo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.session-status {
  color: #888;
  font-size: 0.9rem;
}

.session-status.connected {
  color: #4ade80;
}

/* Responsive */
@media (max-width: 768px) {
  .game-title h1 {
    font-size: 1.2rem;
  }
  
  .grid-cell {
    font-size: 1.2rem;
  }
  
  .control-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .btn {
    width: 100%;
    max-width: 200px;
  }
}
