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

html {
  height: 100%;
  overflow-y: auto;
}

body {
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
  color: #fff;
  min-height: 100vh;
  padding: 15px;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.game-container {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.balance-display {
  display: flex;
  align-items: center;
  gap: 15px;
}

.balance-label {
  font-size: 18px;
  color: #aaa;
}

.balance-amount {
  font-size: 28px;
  font-weight: 700;
  color: #00ff88;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.win-display {
  font-size: 28px;
  font-weight: 700;
  color: #ffd700;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s ease;
}

.win-display.show {
  opacity: 1;
  transform: scale(1);
  animation: pulse 0.5s ease;
}

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

/* Wheel Section */
.wheel-section {
  margin-bottom: 20px;
  flex-shrink: 0;
}

.roulette-wrapper {
  position: relative;
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: linear-gradient(180deg, #1a1f2e 0%, #0f1419 100%);
  border-radius: 15px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 20px;
}

.roulette-wrapper .selector {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #ffd700 0%, #ffaa00 100%);
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.roulette-wrapper .selector::before,
.roulette-wrapper .selector::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.roulette-wrapper .selector::before {
  top: -8px;
  border-bottom: 12px solid #ffd700;
}

.roulette-wrapper .selector::after {
  bottom: -8px;
  border-top: 12px solid #ffd700;
}

.roulette-wrapper .wheel {
  display: flex;
  height: 100%;
  will-change: transform;
  position: relative;
  z-index: 1;
}

.roulette-wrapper .wheel .row {
  display: flex;
  height: 100%;
}

.roulette-wrapper .wheel .card {
  width: 75px;
  height: 100%;
  margin: 0 3px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
}

.roulette-wrapper .wheel .card:hover {
  transform: scale(1.05);
}

.card.red {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.card.black {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.card.green {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 0 20px rgba(5, 150, 105, 0.5);
}

.winning-number-display {
  text-align: center;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
}

.winning-label {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.winning-number {
  font-size: 40px;
  font-weight: 700;
  padding: 12px 25px;
  border-radius: 10px;
  display: inline-block;
  min-width: 100px;
}

.winning-number.red {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.5);
}

.winning-number.black {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  box-shadow: 0 0 30px rgba(31, 41, 55, 0.5);
}

.winning-number.green {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 0 30px rgba(5, 150, 105, 0.5);
}

.winning-number {
  animation: fadeInScale 0.5s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Betting Section */
.betting-section {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  padding: 20px;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.bet-controls {
  margin-bottom: 20px;
}

.bet-input-group {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.bet-input-group label {
  font-size: 18px;
  font-weight: 500;
}

.bet-input-group input {
  flex: 1;
  max-width: 200px;
  padding: 12px 20px;
  font-size: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
  transition: all 0.3s ease;
}

.bet-input-group input:focus {
  border-color: #00ff88;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.quick-bet-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-bet {
  padding: 8px 20px;
  font-size: 16px;
  font-weight: 500;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quick-bet:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #00ff88;
  transform: translateY(-2px);
}

.betting-table {
  margin-bottom: 15px;
}

.bet-buttons-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.bet-button {
  flex: 1;
  min-width: 200px;
  padding: 20px 30px;
  border: none;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.bet-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.bet-button:active::before {
  width: 300px;
  height: 300px;
}

.bet-button:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.bet-button:active {
  transform: translateY(-2px);
}

.bet-label {
  position: relative;
  z-index: 1;
}

.bet-payout {
  font-size: 16px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.red-bet {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #fff;
}

.red-bet:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.6);
}

.green-bet {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
}

.green-bet:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 30px rgba(5, 150, 105, 0.6);
}

.black-bet {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.black-bet:hover {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
  box-shadow: 0 0 30px rgba(31, 41, 55, 0.6);
}

/* Game Status */
.game-status {
  text-align: center;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.status-text {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.status-text.success {
  color: #00ff88;
}

.status-text.error {
  color: #ff4444;
}

.status-text.info {
  color: #00d4ff;
}

.status-text.spinning {
  color: #ffd700;
  animation: pulse 1s ease infinite;
}

.countdown {
  font-size: 16px;
  color: #aaa;
}

/* Attribution Header */
.attribution-header {
  margin-bottom: 20px;
  padding: 15px 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.attribution-content {
  max-width: 800px;
  margin: 0 auto;
}

.attribution-title {
  font-size: 16px;
  font-weight: 600;
  color: #00ff88;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Page Footer */
.page-footer {
  margin-top: 30px;
  padding: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-content p {
  font-size: 14px;
  color: #aaa;
  margin: 0;
}

.footer-content strong {
  color: #00d4ff;
  font-weight: 700;
}

/* WebSocket Log Viewer */
.log-toggle-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Roboto', sans-serif;
}

.log-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #00ff88;
}

.log-toggle-btn.active {
  background: rgba(0, 255, 136, 0.2);
  border-color: #00ff88;
  color: #00ff88;
}

.log-viewer-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 600px;
  max-height: 400px;
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: opacity 0.3s ease, transform 0.3s ease;
  font-family: 'Courier New', monospace;
}

.log-viewer-panel.hidden {
  display: none;
}

.log-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px 8px 0 0;
}

.log-viewer-title {
  font-size: 14px;
  font-weight: 600;
  color: #00ff88;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.log-close-btn {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.log-close-btn:hover {
  color: #ff4444;
}

.log-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #00ff88;
  background: #0a0a0a;
  max-height: 350px;
}

.log-content::-webkit-scrollbar {
  width: 8px;
}

.log-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.log-entry {
  margin-bottom: 4px;
  word-wrap: break-word;
  font-family: 'Courier New', monospace;
}

.log-timestamp {
  color: #888;
  margin-right: 8px;
}

.log-message {
  color: #00ff88;
}

.log-entry.log-error .log-message {
  color: #ff4444;
}

.log-entry.log-success .log-message {
  color: #ffd700;
}

.log-entry.log-connection .log-message {
  color: #00d4ff;
}

.log-entry.log-info .log-message {
  color: #00ff88;
}

/* Responsive */
@media (max-width: 768px) {
  .bet-buttons-row {
    flex-direction: column;
  }

  .bet-button {
    width: 100%;
  }

  .game-header {
    flex-direction: column;
    gap: 15px;
  }

  .log-viewer-panel {
    width: calc(100% - 40px);
    max-width: 600px;
    bottom: 10px;
    right: 10px;
    max-height: 300px;
  }

  .log-content {
    max-height: 250px;
    font-size: 11px;
  }
}
