/* ========================================
   VARIABLES & RESET
======================================== */
:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --accent: #f093fb;
  --success: #51cf66;
  --danger: #ff6b6b;
  --warning: #ffd43b;
  --dark: #1a1a2e;
  --dark-light: #16213e;
  --light: #f8f9fa;
  --text: #2d3436;
  --text-light: #636e72;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Poppins",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ========================================
   HOME BUTTON
======================================== */
.home-button {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.home-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.home-button svg {
  flex-shrink: 0;
}

/* ========================================
   ANIMATED BACKGROUND
======================================== */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  bottom: -10%;
  right: -10%;
  animation-delay: 7s;
}

.blob-3 {
  width: 450px;
  height: 450px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 14s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 30px) scale(0.9);
  }
}

/* ========================================
   CONTAINER
======================================== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* ========================================
   HEADER
======================================== */
.header {
  padding: 40px 0 30px;
  text-align: center;
  animation: slideDown 0.8s ease-out;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.logo-icon {
  font-size: 64px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.header h1 {
  font-size: 56px;
  font-weight: 800;
  color: white;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  letter-spacing: -1px;
}

.subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  margin-top: 10px;
}

/* ========================================
   MONEY DISPLAY
======================================== */
.money-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  animation: fadeInUp 0.8s ease-out 0.1s both;
}

.money-card {
  flex: 1;
  background: white;
  border-radius: var(--radius);
  padding: 20px 30px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.money-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-light);
}

.money-amount {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.reset-button {
  padding: 15px 25px;
  background: white;
  color: var(--danger);
  border: 2px solid var(--danger);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.reset-button:hover {
  background: var(--danger);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

/* ========================================
   CONFIG CARD
======================================== */
.config-container {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.config-card {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.config-header {
  text-align: center;
  margin-bottom: 40px;
}

.config-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.config-header p {
  color: var(--text-light);
  font-size: 16px;
}

.config-section {
  margin-bottom: 35px;
}

/* ========================================
   RADIO CARDS
======================================== */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
}

.budget-grid {
  grid-template-columns: repeat(2, 1fr);
}

.radio-card {
  cursor: pointer;
}

.radio-card input[type="radio"] {
  display: none;
}

.radio-content {
  padding: 20px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--light);
  text-align: center;
  transition: var(--transition);
}

.radio-card input:checked + .radio-content {
  border-color: var(--primary);
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.radio-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.radio-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.radio-description {
  font-size: 12px;
  color: var(--text-light);
}

/* ========================================
   START BUTTON
======================================== */
.start-button {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.start-button:active {
  transform: translateY(0);
}

/* ========================================
   GAMES GRID
======================================== */
.games-container {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.game-card {
  background: var(--light);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  transition: var(--transition);
  border: 2px solid transparent;
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.game-icon {
  font-size: 64px;
  margin-bottom: 15px;
}

.game-card h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.game-card p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.6;
}

.game-info {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.info-badge {
  padding: 6px 12px;
  background: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.play-button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.play-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* ========================================
   STATS SECTION
======================================== */
.casino-stats-section {
  background: var(--light);
  padding: 25px;
  border-radius: 12px;
  margin-top: 30px;
}

.casino-stats-section h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  text-align: center;
}

.casino-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.casino-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: white;
  border-radius: 8px;
}

.casino-stat-icon {
  font-size: 28px;
}

.casino-stat-info {
  display: flex;
  flex-direction: column;
}

.casino-stat-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.casino-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

/* ========================================
   FOOTER
======================================== */
.footer {
  padding: 30px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

/* ========================================
   CUSTOM POPUP
======================================== */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.popup-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.popup-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.popup-overlay.show .popup-card {
  transform: scale(1);
  animation: popupBounce 0.5s ease;
}

@keyframes popupBounce {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.popup-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.popup-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 15px;
}

.popup-message {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 30px;
  line-height: 1.6;
}

.popup-button {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.popup-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.popup-button:active {
  transform: translateY(0);
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-aspect-ratio: 1/1) {
  .home-button {
    top: 10px;
    left: 10px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .home-button svg {
    width: 18px;
    height: 18px;
  }

  .header h1 {
    font-size: 40px;
  }

  .logo-icon {
    font-size: 48px;
  }

  .config-card {
    padding: 25px;
  }

  .config-header h2 {
    font-size: 24px;
  }

  .budget-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .money-display {
    flex-direction: column;
  }

  .money-card {
    width: 100%;
  }

  .reset-button {
    width: 100%;
  }
}