@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 10px;
  color: #fff;
  touch-action: manipulation;
  overflow-x: hidden;
  /* FIXED: Remove any extra bottom padding */
  padding-bottom: 10px;
}

.game-container {
  max-width: 1200px;
  margin: 0 auto;
  /* FIXED: No extra padding at bottom */
  padding-bottom: 0;
}

/* Center game on large screens */
@media (min-height: 900px) and (min-width: 1200px) {
  body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Offset centering to account for header elements above the board */
    padding-bottom: 140px;
    box-sizing: border-box;
  }
  
  .game-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
  }
  
  .game-layout {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

body.dark-theme {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.nature-theme {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

body.sunset-theme {
  background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%);
}

body.ocean-theme {
  background: linear-gradient(135deg, #2e3192 0%, #1bffff 100%);
}

body.fire-theme {
  background: linear-gradient(135deg, #f12711 0%, #f5af19 100%);
}

body.midnight-theme {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

body.royal-theme {
  background: linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%);
}

body.cosmic-theme {
  background: linear-gradient(135deg, #0f0c29 0%, #1a1a4e 30%, #4b134f 70%, #c94b4b 100%);
}

body.lava-theme {
  background: linear-gradient(135deg, #C33764 0%, #1D2671 100%);
}

body.emerald-theme {
  background: linear-gradient(135deg, #348F50 0%, #56B4D3 100%);
}

body.meme-theme {
  background: linear-gradient(135deg, #FFD93D 0%, #FF6B6B 100%);
}

body.money-theme {
  background: linear-gradient(135deg, #2E7D32 0%, #FDD835 100%);
}

/* FIXED: Font icon pack styling */
body.icon-font .map-cell,
body.icon-font .current-card,
body.icon-font .floating-card {
  font-family: 'Orbitron', sans-serif !important;
  font-weight: 900 !important;
  letter-spacing: 2px !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body.icon-font .map-cell {
  font-size: clamp(1.2em, 3.5vw, 2em) !important;
}

body.icon-font .current-card {
  font-family: 'Orbitron', sans-serif !important;
  font-weight: 900 !important;
}

header {
  text-align: center;
  margin-bottom: 15px;
}

h1 {
  font-size: clamp(1.5em, 5vw, 2.5em);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 10px;
}

.header-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.header-controls button {
  padding: 8px 16px;
  font-size: 0.9em;
}

.rules {
  background: rgba(255,255,255,0.1);
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 15px;
  backdrop-filter: blur(10px);
  font-size: clamp(0.8em, 2vw, 1em);
  display: none;
}

.rules.show {
  display: block;
}

.rules h3 {
  margin-bottom: 8px;
}

.rules ul {
  list-style: none;
  padding-left: 15px;
}

.rules li {
  margin: 3px 0;
}

.rules li:before {
  content: "→ ";
  margin-right: 5px;
}

/* Desktop Layout */
@media (min-width: 768px) {
  .game-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .left-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .center-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .right-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .player-hand-area {
    background: rgba(255,255,255,0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 3px solid #4CAF50;
    text-align: center;
    transition: opacity 0.3s;
  }

  .game-container {
    max-width: 1200px;
    margin: 0 auto;
  }

  .game-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    align-items: start;
  }

  @media (min-width: 768px) {
    .game-layout {
      display: grid;
      grid-template-columns: 1fr 2fr 1fr;
      gap: 20px;
      align-items: start;
    }
  }

  .score-board {
    flex-direction: column !important;
  }

  .controls {
    flex-direction: column !important;
  }

  .controls button {
    width: 100%;
  }

  .powerups {
    flex-direction: column !important;
  }

  .powerup-btn {
    width: 100%;
  }
}

/* Mobile Layout */
@media (max-width: 767px) {
  .game-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .left-panel, .center-panel, .right-panel {
    width: 100%;
  }
}

.score-board {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.score-card {
  background: rgba(255,255,255,0.95);
  padding: 15px;
  border-radius: 15px;
  flex: 1;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  position: relative;
}

.score-card.player {
  border: 3px solid #4CAF50;
}

.score-card.ai {
  border: 3px solid #f44336;
}

.score-card h3 {
  margin-bottom: 5px;
  font-size: clamp(1em, 3vw, 1.3em);
}

.score-card.player h3 {
  color: #4CAF50;
}

.score-card.ai h3 {
  color: #f44336;
}

.score {
  font-size: clamp(1.5em, 5vw, 2.5em);
  font-weight: bold;
  color: #333;
}

.map-container {
  background: rgba(255,255,255,0.95);
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  position: relative;
}

.map-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

/* Allow larger map sizes for bigger grids on desktop */
@media (min-width: 1024px) {
  .map-wrapper {
    max-width: 600px;
  }
}

@media (min-width: 1400px) {
  .map-wrapper {
    max-width: 700px;
  }
}

.map-grid {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.map-grid.size-3 {
  grid-template-columns: repeat(3, 1fr);
}

.map-grid.size-4 {
  grid-template-columns: repeat(4, 1fr);
}

.map-grid.size-5 {
  grid-template-columns: repeat(5, 1fr);
}

.map-grid.size-6 {
  grid-template-columns: repeat(6, 1fr);
}

.map-grid.size-7 {
  grid-template-columns: repeat(7, 1fr);
}

.map-grid.size-8 {
  grid-template-columns: repeat(8, 1fr);
}

.map-grid.size-9 {
  grid-template-columns: repeat(9, 1fr);
}

.map-grid.size-10 {
  grid-template-columns: repeat(10, 1fr);
}

/* Reduce gap for larger grids */
.map-grid.size-7,
.map-grid.size-8,
.map-grid.size-9,
.map-grid.size-10 {
  gap: 5px;
}

/* Adjust cell sizes for larger grids */
.map-grid.size-9 .map-cell,
.map-grid.size-10 .map-cell {
  font-size: clamp(0.6em, 2vw, 1em);
}

.map-cell {
  aspect-ratio: 1;
  background: #f5f5f5;
  border: 3px dashed #bbb;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.9em, 3vw, 1.6em);
  font-weight: bold;
  color: #333;
  position: relative;
  transition: all 0.3s;
  cursor: pointer;
  touch-action: none;
  margin: 1px;
}

.map-cell.empty {
  color: #ccc;
  font-size: clamp(0.6em, 2vw, 0.8em);
}

.map-cell.empty:hover {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: #2196F3;
  border-style: solid;
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(33, 150, 243, 0.5);
}

.map-cell.empty:hover::before {
  content: '✨';
  position: absolute;
  font-size: 1.5em;
  animation: sparkle 0.6s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(180deg);
  }
}

.map-cell.drag-over {
  background: #e3f2fd;
  border-color: #2196F3;
  border-style: solid;
  transform: scale(1.05);
}

.map-cell.neutral {
  background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
  border-color: #616161;
  border-style: solid;
  color: white;
  box-shadow: 0 0 10px rgba(158, 158, 158, 0.4);
}

.map-cell.player-owned {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  border-color: #2e7d32;
  border-style: solid;
  color: white;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

.map-cell.ai-owned {
  background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
  border-color: #c62828;
  border-style: solid;
  color: white;
  box-shadow: 0 0 15px rgba(244, 67, 54, 0.4);
}

.map-cell.fog-hidden {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-color: #1a252f;
  border-style: solid;
  color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 10px rgba(44, 62, 80, 0.5);
}

.map-cell.nearby-highlight {
  border-color: #FFD700;
  border-style: solid;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.map-cell.bonus-pulse-player {
  animation: bonusPulsePlayer 0.8s ease-in-out;
}

.map-cell.bonus-pulse-ai {
  animation: bonusPulseAI 0.8s ease-in-out;
}

@keyframes bonusPulsePlayer {
  0% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
  }
  25% {
    transform: scale(1.25);
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.9);
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 0 40px rgba(76, 175, 80, 1);
  }
  75% {
    transform: scale(1.25);
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.9);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
  }
}

@keyframes bonusPulseAI {
  0% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.4);
  }
  25% {
    transform: scale(1.25);
    box-shadow: 0 0 30px rgba(244, 67, 54, 0.9);
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 0 40px rgba(244, 67, 54, 1);
  }
  75% {
    transform: scale(1.25);
    box-shadow: 0 0 30px rgba(244, 67, 54, 0.9);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.4);
  }
}

.connections-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.connections-svg line {
  stroke: #555;
  stroke-width: 12;
  opacity: 0.6;
  stroke-linecap: round;
  transition: all 0.3s;
}

.connections-svg line.highlighted {
  stroke: #FFD700;
  stroke-width: 14;
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

.player-hand-area {
  background: rgba(255,255,255,0.95);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border: 3px solid #4CAF50;
  text-align: center;
  transition: opacity 0.3s;
  /* Remove position relative if it exists */
}

.player-hand-area.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Testing Time timer */
.testing-time-timer {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1.5em;
  font-weight: bold;
  padding: 8px 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  text-align: center;
  transition: all 0.3s;
  animation: pulse-timer 1s infinite;
}

.testing-time-timer.danger {
  background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
  animation: pulse-danger 0.3s infinite;
}

@keyframes pulse-timer {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes pulse-danger {
  0%, 100% { transform: scale(1); background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%); }
  50% { transform: scale(1.05); background: linear-gradient(135deg, #ff0000 0%, #aa0000 100%); }
}

.player-hand-area h3 {
  color: #4CAF50;
  margin-bottom: 15px;
  font-size: clamp(1em, 3vw, 1.5em);
}

.current-card-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  /* Ensure no position relative here */
}

.current-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 20px;
  font-size: clamp(3em, 10vw, 5em);
  font-weight: bold;
  min-width: 150px;
  text-align: center;
  cursor: grab;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transition: all 0.2s;
  user-select: none;
  touch-action: none;
}

.current-card:active {
  cursor: grabbing;
  transform: scale(0.95);
}

.current-card.dragging {
  opacity: 0.5;
}

.next-card-preview {
  background: rgba(255,255,255,0.2);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 1.2em;
  font-weight: bold;
  color: #4CAF50;
  display: none;
}

.next-card-preview.show {
  display: block;
}

/* AI vs AI Control Button */
.ai-vs-ai-controls {
  text-align: center;
  margin-top: 10px;
}

.ai-control-btn {
  background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 1em;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(156, 39, 176, 0.4);
  width: 100%;
}

.ai-control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(156, 39, 176, 0.5);
}

.ai-control-btn:active {
  transform: translateY(0);
}

.ai-control-btn.playing {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.ai-control-btn.playing:hover {
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.5);
}

/* Power-ups Button */
.powerups-btn {
  width: 100%;
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 1.1em;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  margin-top: 15px;
}

.powerups-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.powerups-btn:active {
  transform: translateY(0);
}

/* Power-ups Grid in Modal */
.powerups-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 20px 0;
}

.powerup-menu-item {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 15px;
  font-size: 1em;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  touch-action: manipulation;
}

.powerup-menu-item:hover:not(:disabled) {
  transform: translateX(5px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.3);
}

.powerup-menu-item:active:not(:disabled) {
  transform: translateX(3px);
}

.powerup-menu-item:disabled {
  background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
  cursor: not-allowed;
  opacity: 0.6;
}

.powerup-menu-item .powerup-icon {
  font-size: 1.5em;
  min-width: 30px;
  text-align: center;
}

.powerup-menu-item .powerup-name {
  flex: 1;
  text-align: left;
}

.powerup-menu-item .powerup-badge {
  background: rgba(255,255,255,0.3);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.9em;
  min-width: 30px;
  text-align: center;
}

.powerup-btn {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: clamp(0.85em, 2.5vw, 1em);
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  touch-action: manipulation;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: center;
}

.powerup-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.powerup-btn:active:not(:disabled) {
  transform: translateY(0);
}

.powerup-btn:disabled {
  background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
  cursor: not-allowed;
  opacity: 0.6;
}

.powerup-badge {
  background: rgba(255,255,255,0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.85em;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

button {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: clamp(0.9em, 2.5vw, 1.1em);
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  touch-action: manipulation;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

button.info {
  background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
}

button.warning {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.message {
  text-align: center;
  padding: 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  font-size: clamp(0.9em, 2.5vw, 1.2em);
  font-weight: bold;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  color: #333;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-width: 90%;
  width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
  position: relative;
}

.modal-content.large {
  width: 800px;
  max-width: 95%;
}

/* Larger modals on desktop */
@media (min-width: 1024px) {
  .modal-content {
    width: 600px;
    padding: 40px;
  }
  
  .modal-content.large {
    width: 900px;
  }
}

@media (min-width: 1400px) {
  .modal-content {
    width: 700px;
    padding: 45px;
  }
  
  .modal-content.large {
    width: 1000px;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  font-size: clamp(1.5em, 4vw, 2em);
  margin-bottom: 20px;
  color: #667eea;
}

.modal-content h3 {
  font-size: clamp(1.2em, 3vw, 1.5em);
  margin: 20px 0 10px;
  color: #764ba2;
}

.setting-group {
  margin-bottom: 20px;
}

.setting-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: #555;
}

.setting-group select {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  border-radius: 8px;
  border: 2px solid #ddd;
  background: white;
  color: #333;
  cursor: pointer;
}

.setting-group select option:disabled {
  color: #999;
}

.theme-selector, .icon-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.icon-selector {
  grid-template-columns: repeat(2, 1fr);
}

/* 3 columns on desktop for icon packs */
@media (min-width: 768px) {
  .icon-selector {
    grid-template-columns: repeat(3, 1fr);
  }
}

.theme-section, .icon-section {
  margin-bottom: 20px;
}

.theme-section-title, .icon-section-title {
  font-size: 1em;
  font-weight: bold;
  color: #555;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid #ddd;
}

.theme-option, .icon-option {
  padding: 15px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  font-weight: bold;
  transition: all 0.2s;
  border: 3px solid transparent;
  position: relative;
}

.theme-option:hover, .icon-option:hover {
  transform: scale(1.05);
}

.theme-option.active, .icon-option.active {
  border-color: #667eea;
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.icon-option {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #333;
  font-size: 2em;
}

.icon-option .icon-name {
  font-size: 0.4em;
  margin-top: 5px;
}

.theme-option.default {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.theme-option.dark {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
}

.theme-option.nature {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  color: white;
}

.theme-option.sunset {
  background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%);
  color: white;
}

.theme-option.ocean {
  background: linear-gradient(135deg, #2e3192 0%, #1bffff 100%);
  color: white;
}

.theme-option.fire {
  background: linear-gradient(135deg, #f12711 0%, #f5af19 100%);
  color: white;
}

.theme-option.midnight {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  color: white;
}

.theme-option.royal {
  background: linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%);
  color: white;
}

.theme-option.cosmic {
  background: linear-gradient(135deg, #0f0c29 0%, #1a1a4e 30%, #4b134f 70%, #c94b4b 100%);
  color: white;
}

.theme-option.lava {
  background: linear-gradient(135deg, #C33764 0%, #1D2671 100%);
  color: white;
}

.theme-option.emerald {
  background: linear-gradient(135deg, #348F50 0%, #56B4D3 100%);
  color: white;
}

.theme-option.meme {
  background: linear-gradient(135deg, #FFD93D 0%, #FF6B6B 100%);
  color: white;
}

.theme-option.money {
  background: linear-gradient(135deg, #2E7D32 0%, #FDD835 100%);
  color: white;
}

.unlock-text {
  font-size: 0.75em;
  opacity: 0.9;
  margin-top: 3px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.stat-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  color: white;
}

.stat-label {
  font-size: 0.9em;
  opacity: 0.9;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 2.5em;
  font-weight: bold;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-buttons button {
  flex: 1;
}

.game-over {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  color: #333;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  text-align: center;
  z-index: 1000;
  max-width: 90%;
  width: 400px;
}

.game-over h2 {
  font-size: clamp(1.5em, 5vw, 2.5em);
  margin-bottom: 20px;
}

.game-over .final-score {
  font-size: clamp(1em, 3vw, 1.5em);
  margin: 20px 0;
}

.game-over.hidden {
  display: none;
}

.floating-card {
  position: fixed;
  font-size: 3em;
  font-weight: bold;
  color: white;
  padding: 20px;
  border-radius: 15px;
  pointer-events: none;
  z-index: 100;
  animation: floatToCell 0.8s ease-out forwards;
}

.floating-card.player {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  box-shadow: 0 5px 20px rgba(76, 175, 80, 0.6);
}

.floating-card.ai {
  background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
  box-shadow: 0 5px 20px rgba(244, 67, 54, 0.6);
}

@keyframes floatToCell {
  0% {
    transform: scale(1.2) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.8) rotate(360deg);
    opacity: 0;
  }
}

.points-popup {
  position: fixed;
  font-size: 2.5em;
  font-weight: bold;
  padding: 15px 30px;
  border-radius: 15px;
  pointer-events: none;
  z-index: 101;
  animation: pointsFloat 1.5s ease-out forwards;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.points-popup.player {
  color: #4CAF50;
  background: rgba(76, 175, 80, 0.2);
  border: 3px solid #4CAF50;
}

.points-popup.ai {
  color: #f44336;
  background: rgba(244, 67, 54, 0.2);
  border: 3px solid #f44336;
}

.points-popup.bonus {
  color: #FF9800;
  background: rgba(255, 152, 0, 0.2);
  border: 3px solid #FF9800;
}

@keyframes pointsFloat {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }
  20% {
    transform: translateY(-20px) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) scale(1);
    opacity: 0;
  }
}

.cell-points {
  position: absolute;
  top: -10px;
  right: -10px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: white;
  font-size: 0.8em;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.8);
  z-index: 10;
  animation: cellPointsPop 0.6s ease-out forwards;
}

@keyframes cellPointsPop {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.5) rotate(180deg);
    opacity: 1;
  }
  70% {
    transform: scale(1.2) rotate(360deg);
  }
  100% {
    transform: scale(0) rotate(540deg);
    opacity: 0;
  }
}

@keyframes scoreGain {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.score-animation {
  animation: scoreGain 0.5s ease-out;
}

.connection-highlight {
  animation: pulse 0.5s ease-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes cardPlace {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.map-cell.just-placed {
  animation: cardPlace 0.4s ease-out;
}

@keyframes ripple {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
  }
  100% {
    box-shadow: 0 0 0 20px rgba(255, 215, 0, 0);
  }
}

.map-cell.scoring {
  animation: ripple 0.6s ease-out;
}

/* Tutorial specific styles */
.tutorial-instruction {
  background: rgba(255, 215, 0, 0.95);
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 15px;
  color: #333;
  font-weight: bold;
  font-size: 1.1em;
  text-align: center;
  border: 3px solid #FFA500;
  box-shadow: 0 5px 15px rgba(255, 165, 0, 0.5);
}

.tutorial-highlight {
  animation: tutorialGlow 1.5s ease-in-out infinite;
}

@keyframes tutorialGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 1);
  }
}

.tutorial-next-btn {
  margin-left: 10px;
  display: inline-block;
}

.tutorial-next-btn:disabled {
  background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%) !important;
  cursor: not-allowed !important;
  opacity: 0.5;
}

.tutorial-next-btn:disabled:hover {
  transform: none !important;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2) !important;
}

/* Shop Styles */
.shop-section {
  margin-bottom: 30px;
}

.shop-section h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.shop-goto-settings-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.shop-goto-settings-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  filter: brightness(1.1);
}

.shop-category {
  background: rgba(255,255,255,0.05);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.shop-category h4 {
  color: #764ba2;
  margin-bottom: 10px;
  font-size: 1.2em;
}

.shop-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

/* Center items when only a few exist */
.shop-items.few-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.shop-items.few-items .shop-item {
  flex: 0 1 200px;
  max-width: 250px;
}

.shop-item {
  background: white;
  padding: 15px;
  border-radius: 10px;
  border: 2px solid #ddd;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.shop-item:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.shop-item.owned {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border-color: #2e7d32;
}

.shop-item.owned .shop-item-name {
  color: white;
}
.shop-item-desc {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 5px;
  font-style: italic;
}

.shop-item.owned .shop-item-desc {
  color: rgba(255,255,255,0.8);
}
.shop-item.owned .shop-item-price {
  color: rgba(255,255,255,0.9);
}

.shop-item-name {
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
  font-size: 1.1em;
}

.shop-item-price {
  color: #667eea;
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 10px;
}

.shop-item button {
  width: 100%;
  padding: 8px 16px;
  font-size: 0.9em;
}

.shop-item button:disabled {
  background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
  cursor: not-allowed;
}

.shop-points-display {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  margin-bottom: 20px;
  color: white;
  box-shadow: 0 5px 15px rgba(255, 165, 0, 0.5);
}

.shop-points-display .points-label {
  font-size: 1.1em;
  opacity: 0.9;
  margin-bottom: 5px;
}

.shop-points-display .points-value {
  font-size: 3em;
  font-weight: bold;
}

@media (max-width: 767px) {
  body {
    padding: 5px;
  }

  .map-grid {
    gap: 8px;
  }

  .player-hand-area {
    padding: 15px;
  }

  .current-card {
    padding: 20px;
    min-width: 120px;
  }

  .connections-svg line {
    stroke-width: 9;
  }

  .connections-svg line.highlighted {
    stroke-width: 11;
  }

  .floating-card {
    font-size: 2em;
    padding: 15px;
  }

  .points-popup {
    font-size: 1.8em;
    padding: 10px 20px;
  }

  .cell-points {
    font-size: 0.7em;
    padding: 3px 6px;
  }

  .powerup-btn {
    min-width: 120px;
    padding: 10px 15px;
  }
}
.double-points-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: white;
  font-size: 0.85em;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 3px 10px rgba(255, 165, 0, 0.5);
  animation: doublePointsPulse 2s ease-in-out infinite;
  cursor: help;
}

@keyframes doublePointsPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 3px 10px rgba(255, 165, 0, 0.5);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(255, 165, 0, 0.8);
  }
}
/* Font icon pack preview in settings */
.icon-font-preview {
  font-family: 'Orbitron', sans-serif !important;
  font-weight: 900 !important;
  letter-spacing: 3px !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
#shopPointsEarned {
  margin: 15px 0;
  font-weight: bold;
  color: #FFD700;
  font-size: 1em;
  line-height: 1.5;
  white-space: pre-line;
}
.shop-item-multiplier {
  color: #FF9800;
  font-size: 0.95em;
  margin-bottom: 5px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.shop-item.owned .shop-item-multiplier {
  color: rgba(255, 255, 255, 0.95);
}
.shop-info-section {
  background: rgba(102, 126, 234, 0.1);
  padding: 15px 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  border: 2px solid rgba(102, 126, 234, 0.3);
}

.shop-info-section.collapsible .shop-info-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #667eea;
  padding: 10px 0px;
  margin: 0;
  font-size: 1.3em;
  transition: color 0.2s;
}

.shop-info-section.collapsible .shop-info-header:hover {
  color: #5a6fd6;
}

.shop-info-section.collapsible .shop-info-header .dropdown-arrow {
  font-size: 0.8em;
  transition: transform 0.3s;
}

.shop-info-section.collapsible.open .shop-info-header .dropdown-arrow {
  transform: rotate(180deg);
}

.shop-info-content {
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.shop-info-section h3 {
  color: #667eea;
  margin-bottom: 10px;
  font-size: 1.3em;
}

.shop-info-section p {
  color: #555;
  margin-bottom: 10px;
  line-height: 1.6;
}

.multiplier-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 15px;
}

.multiplier-list li {
  color: #555;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  line-height: 1.6;
}

.multiplier-list li:last-child {
  border-bottom: none;
}

.multiplier-list strong {
  color: #667eea;
}

.multiplier-example {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: white;
  padding: 12px 15px;
  border-radius: 10px;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 3px 10px rgba(255, 165, 0, 0.3);
}
.current-multipliers {
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 15px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  border: 2px solid #FFD700;
  margin-top: 10px;
  position: relative;
}

.multipliers-header {
  cursor: pointer;
  user-select: none;
}

.multipliers-header:hover .multipliers-value {
  color: #388E3C;
}

.multipliers-title {
  font-size: 0.85em;
  color: #666;
  font-weight: bold;
  margin-bottom: 5px;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

.multipliers-value {
  font-size: 1.2em;
  font-weight: bold;
  color: #4CAF50;
  transition: all 0.3s;
}

.dropdown-arrow {
  font-size: 0.7em;
  margin-left: 5px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.multipliers-dropdown.show + .multipliers-header .dropdown-arrow,
.current-multipliers.dropdown-open .dropdown-arrow {
  transform: rotate(180deg);
}

.multipliers-dropdown {
  display: none;
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  text-align: left;
}

.multipliers-dropdown.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

.multiplier-breakdown {
  font-size: 0.85em;
  color: #555;
}

.multiplier-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dotted #eee;
}

.multiplier-item:last-child {
  border-bottom: none;
}

.multiplier-item-name {
  color: #666;
}

.multiplier-item-value {
  font-weight: bold;
  color: #4CAF50;
}

.multiplier-item-value.negative {
  color: #f44336;
}

.multiplier-item.total {
  margin-top: 5px;
  padding-top: 8px;
  border-top: 2px solid #ddd;
  border-bottom: none;
  font-weight: bold;
}

.multiplier-item.total .multiplier-item-name {
  color: #333;
}

.multiplier-item.total .multiplier-item-value {
  font-size: 1.1em;
}

.points-popup.subtraction {
  color: #f44336;
  background: rgba(244, 67, 54, 0.2);
  border: 3px solid #f44336;
}

/* ==================== DICE CLICKABLE ANIMATIONS ==================== */
.dice-clickable {
  position: relative;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.dice-clickable:hover {
  transform: scale(1.2) rotate(15deg);
}

.dice-clickable:active {
  transform: scale(0.9) rotate(-10deg);
}

.dice-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: conic-gradient(
    from 0deg,
    #ff6b6b,
    #feca57,
    #48dbfb,
    #ff9ff3,
    #54a0ff,
    #5f27cd,
    #ff6b6b
  );
  border-radius: 50%;
  animation: dice-spin 3s linear infinite;
  filter: blur(8px);
  opacity: 0.7;
  z-index: -1;
}

@keyframes dice-spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ==================== GAMBLING MODAL ==================== */
.gambling-game {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 20px;
  margin: 20px 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.gambling-game h3 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 1.4em;
}

.coin-container {
  perspective: 1000px;
  width: 120px;
  height: 120px;
  margin: 20px auto;
}

.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.1s ease;
}

.coin.flipping {
  animation: coinFlip 2s ease-out forwards;
}

.coin.flipping.result-tails {
  animation: coinFlipTails 2s ease-out forwards;
}

@keyframes coinFlip {
  0% {
    transform: rotateX(0deg);
  }
  100% {
    transform: rotateX(1800deg);
  }
}

@keyframes coinFlipTails {
  0% {
    transform: rotateX(0deg);
  }
  100% {
    transform: rotateX(1980deg);
  }
}

.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.coin-face img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.coin-heads {
  background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
}

.coin-tails {
  background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%);
  transform: rotateX(180deg);
}

.gambling-result {
  text-align: center;
  font-size: 1.3em;
  font-weight: bold;
  min-height: 40px;
  margin: 15px 0;
  padding: 10px;
  border-radius: 10px;
}

.gambling-result.win {
  color: #4CAF50;
  background: rgba(76, 175, 80, 0.2);
  animation: winPulse 0.5s ease;
}

.gambling-result.lose {
  color: #f44336;
  background: rgba(244, 67, 54, 0.2);
  animation: losePulse 0.5s ease;
}

@keyframes winPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes losePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.95); }
}

.bet-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.bet-section label {
  font-weight: bold;
  font-size: 1.1em;
}

.bet-section input {
  text-align: center;
  font-weight: bold;
}

.gambling-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.gambling-buttons button {
  padding: 12px 25px;
  font-size: 1.1em;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gambling-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Floating Points Badge */
.floating-points-badge {
  position: sticky;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #333;
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9em;
  box-shadow: 0 3px 10px rgba(255, 215, 0, 0.4);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  animation: floatBadge 2s ease-in-out infinite;
}

@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.floating-points-badge span {
  min-width: 40px;
  text-align: right;
}

/* ==================== CASINO GAME SELECTION ==================== */
.casino-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.casino-game-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  padding: 20px 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.casino-game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.casino-game-card:hover::before {
  left: 100%;
}

.casino-game-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-color: #ffd700;
}

.casino-game-card:active {
  transform: translateY(-2px) scale(0.98);
}

.casino-game-card.locked {
  background: linear-gradient(135deg, #555 0%, #333 100%);
  cursor: not-allowed;
  opacity: 0.7;
}

.casino-game-card.locked.can-afford {
  cursor: pointer;
  opacity: 0.9;
  border: 3px solid #4CAF50;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
  animation: canAffordPulse 2s infinite;
}

@keyframes canAffordPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
  }
}

.casino-game-card.locked.can-afford:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.6);
}

.casino-game-card.locked:not(.can-afford):hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

.casino-game-card.locked::before {
  display: none;
}

.casino-game-card.locked::after {
  content: '🔒';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2em;
}

.casino-game-card.locked.can-afford::after {
  content: '💰';
}

.casino-game-icon {
  font-size: 3em;
  margin-bottom: 10px;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.casino-game-name {
  font-size: 1.2em;
  font-weight: bold;
  color: #fff;
  margin-bottom: 5px;
}

.casino-game-desc {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.8);
}

.casino-game-price {
  margin-top: 10px;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: bold;
  color: #ffd700;
}

.casino-game-card.locked .casino-game-price {
  color: #999;
}

.casino-game-view {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.casino-back-btn {
  background: linear-gradient(135deg, #666 0%, #444 100%);
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  margin-bottom: 15px;
  transition: all 0.2s ease;
}

.casino-back-btn:hover {
  background: linear-gradient(135deg, #777 0%, #555 100%);
  transform: translateX(-3px);
}

/* ==================== HIGHER/LOWER GAME ==================== */
.higherlower-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 25px 0;
}

.hl-card {
  width: 100px;
  height: 140px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border: 4px solid #fff;
  position: relative;
  transition: all 0.3s ease;
}

.hl-card.hidden-card {
  background: linear-gradient(135deg, #333 0%, #555 100%);
}

.hl-card.hidden-card.revealed {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  animation: cardReveal 0.5s ease;
}

@keyframes cardReveal {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

.hl-card.shown-card {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.hl-question {
  font-size: 3em;
  color: #fff;
  font-weight: bold;
}

.hl-number {
  font-size: 2.5em;
  color: #fff;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hl-vs {
  font-size: 1.5em;
  font-weight: bold;
  color: #333;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* ==================== SLOT MACHINE STYLES ==================== */
.slots-machine {
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 20px;
  padding: 30px 20px;
  margin: 20px auto;
  max-width: 320px;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  border: 3px solid #ffd700;
}

.slots-reels {
  display: flex;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, #0f0f23 0%, #1a1a2e 50%, #0f0f23 100%);
  padding: 15px;
  border-radius: 12px;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5);
}

.slot-reel {
  width: 70px;
  height: 80px;
  background: linear-gradient(180deg, #fff 0%, #f0f0f0 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 4px 8px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
}

.slot-symbol {
  font-size: 2.5em;
  transition: transform 0.1s ease;
}

.slot-reel.spinning .slot-symbol {
  animation: slotSpin 0.1s linear infinite;
}

@keyframes slotSpin {
  0% { transform: translateY(-100%); opacity: 0; }
  50% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}

.slot-reel.winning {
  animation: reelWin 0.5s ease-in-out infinite;
  box-shadow: 0 0 20px #ffd700, 0 0 40px #ffd700;
}

@keyframes reelWin {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.slots-info {
  display: flex;
  justify-content: space-around;
  margin: 15px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.slots-info > div {
  text-align: center;
  font-size: 0.9em;
  color: #ccc;
}

.slots-info strong {
  color: #ffd700;
}

.slots-buttons {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.slots-buttons button {
  background: linear-gradient(145deg, #ff6b6b 0%, #ee5a5a 100%);
  border: none;
  box-shadow: 0 6px 20px rgba(238, 90, 90, 0.4);
  transition: all 0.2s ease;
}

.slots-buttons button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(238, 90, 90, 0.5);
}

.slots-buttons button:active:not(:disabled) {
  transform: translateY(0);
}

.slots-buttons button:disabled {
  background: #666;
  box-shadow: none;
  cursor: not-allowed;
}

.slots-upgrade-section {
  margin-top: 20px;
  padding: 15px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.slots-upgrade-section h4 {
  margin: 0 0 10px 0;
  color: #ffd700;
}

.slots-upgrade-info {
  display: flex;
  justify-content: space-around;
  margin-bottom: 10px;
  font-size: 0.9em;
  color: #aaa;
}

.slots-upgrade-info strong {
  color: #ffd700;
}

#upgradeBtn:disabled {
  background: #555 !important;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ==================== BLACKJACK STYLES ==================== */
.blackjack-table {
  background: linear-gradient(145deg, #0d5c0d 0%, #0a4a0a 100%);
  border-radius: 20px;
  padding: 20px;
  margin: 15px auto;
  max-width: 350px;
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  border: 3px solid #1a7a1a;
}

.bj-dealer-area,
.bj-player-area {
  padding: 10px 0;
}

.bj-label {
  color: #ffd700;
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 10px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.bj-label span {
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 10px;
  border-radius: 10px;
  margin-left: 10px;
  font-size: 0.9em;
}

.bj-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 70px;
}

.bj-card {
  width: 45px;
  height: 65px;
  background: linear-gradient(145deg, #fff 0%, #f0f0f0 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  font-weight: bold;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  animation: cardDeal 0.3s ease-out;
}

.bj-card.red {
  color: #d32f2f;
}

.bj-card.black {
  color: #212121;
}

.bj-card.hidden {
  background: linear-gradient(145deg, #1a237e 0%, #0d47a1 100%);
  color: transparent;
}

.bj-card.hidden::after {
  content: '🂠';
  font-size: 1.8em;
}

@keyframes cardDeal {
  0% { transform: translateY(-50px) rotateY(90deg); opacity: 0; }
  100% { transform: translateY(0) rotateY(0); opacity: 1; }
}

.bj-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.5), transparent);
  margin: 10px 0;
}

.bj-ace-choice {
  margin-top: 15px;
  padding: 15px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.bj-ace-choice p {
  margin-bottom: 10px;
  color: #ffd700;
  font-weight: bold;
}

.bj-ace-choice button {
  margin: 0 5px;
  padding: 10px 25px;
}

/* Dice Duel Game */
.dice-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.dice-player,
.dice-dealer {
  background: linear-gradient(145deg, #2c3e50 0%, #1a252f 100%);
  border-radius: 15px;
  padding: 20px;
  min-width: 150px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.dice-player {
  border: 2px solid #4CAF50;
}

.dice-dealer {
  border: 2px solid #f44336;
}

.dice-label {
  color: #fff;
  font-weight: bold;
  font-size: 1em;
  margin-bottom: 15px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.dice-display {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
}

.dice {
  font-size: 3em;
  background: linear-gradient(145deg, #fff 0%, #e0e0e0 100%);
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
}

.dice.dice-rolling {
  animation: diceShake 0.1s ease infinite;
}

@keyframes diceShake {
  0%, 100% { transform: rotate(-5deg) scale(1.05); }
  50% { transform: rotate(5deg) scale(1.05); }
}

.dice-total {
  font-size: 1.5em;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  margin-top: 10px;
}

.dice-vs {
  font-size: 2em;
  font-weight: bold;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Roulette Game Styles */
.roulette-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
  gap: 15px;
}

.roulette-wheel {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(
    #4caf50 0deg 36deg,
    #e53935 36deg 72deg,
    #212121 72deg 108deg,
    #e53935 108deg 144deg,
    #212121 144deg 180deg,
    #e53935 180deg 216deg,
    #212121 216deg 252deg,
    #e53935 252deg 288deg,
    #212121 288deg 324deg,
    #e53935 324deg 360deg
  );
  border: 6px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(0, 0, 0, 0.3);
  position: relative;
  transition: none;
}

.roulette-wheel.spinning {
  animation: rouletteSpin 0.15s linear infinite;
}

.roulette-wheel.stopping {
  animation: none;
  transition: transform 2s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

@keyframes rouletteSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.roulette-ball {
  position: absolute;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 30% 30%, #fff, #ccc);
  border-radius: 50%;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 -2px 4px rgba(0,0,0,0.2);
  z-index: 2;
}

.roulette-wheel.spinning .roulette-ball {
  animation: ballBounce 0.15s ease-in-out infinite;
}

@keyframes ballBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

.roulette-numbers {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.roulette-number {
  position: absolute;
  font-size: 0.7em;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roulette-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, #4a4a4a 0%, #2a2a2a 100%);
  border-radius: 50%;
  border: 3px solid #ffd700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  z-index: 1;
}

.roulette-pointer {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 20px solid #ffd700;
  z-index: 3;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}

.roulette-result {
  font-size: 3em;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  min-width: 60px;
  text-align: center;
}

.roulette-bet-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 15px;
}

.bet-type-section,
.bet-choice-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bet-type-label {
  font-weight: bold;
  color: #666;
  font-size: 0.9em;
}

.bet-type-buttons {
  display: flex;
  gap: 10px;
}

.bet-type-btn {
  padding: 8px 16px;
  border: 2px solid #555;
  background: #4a5568;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9em;
  color: #fff;
}

.bet-type-btn:hover {
  background: #5a6c7d;
}

.bet-type-btn.active {
  background: linear-gradient(135deg, #4a5c9e 0%, #5c3d7a 100%);
  color: #fff;
  border-color: #4a5c9e;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.color-bet-buttons {
  display: flex;
  gap: 10px;
}

.color-btn {
  padding: 12px 20px;
  border: 3px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  transition: all 0.2s;
}

.color-btn.red {
  background: linear-gradient(135deg, #e53935, #c62828);
  color: white;
}

.color-btn.black {
  background: linear-gradient(135deg, #424242, #212121);
  color: white;
}

.color-btn.green {
  background: linear-gradient(135deg, #4caf50, #388e3c);
  color: white;
}

.color-btn:hover {
  transform: scale(1.05);
}

.color-btn.active {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

.number-bet-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 300px;
}

.number-btn {
  padding: 12px 16px;
  border: 3px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2em;
  font-weight: bold;
  color: white;
  transition: all 0.2s;
}

.number-btn.red {
  background: linear-gradient(135deg, #e53935, #c62828);
}

.number-btn.black {
  background: linear-gradient(135deg, #424242, #212121);
}

.number-btn.green {
  background: linear-gradient(135deg, #4caf50, #388e3c);
}

.number-btn:hover {
  transform: scale(1.1);
}

.number-btn.active {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

/* ==================== CREATOR CENTER ==================== */
.creator-center {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.creator-center.hidden {
  display: none;
}

.creator-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 50%, #e8f4f8 100%);
}

.creator-content {
  position: relative;
  background: white;
  border-radius: 20px;
  padding: 30px 40px;
  max-width: 95%;
  width: 1100px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 80px rgba(255, 255, 255, 0.5);
  text-align: center;
  border: 3px solid rgba(255, 215, 0, 0.3);
}

.creator-points-display {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
}

.creator-points-item {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 15px;
  border-radius: 15px;
  font-weight: bold;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.creator-lock-panel, .creator-features {
  margin-top: 40px;
}

.creator-lock-panel h2, .creator-features h2 {
  color: #667eea;
  margin-bottom: 20px;
  font-size: 1.8em;
}

.creator-lock-message {
  color: #555;
  font-size: 1.1em;
  margin-bottom: 15px;
  line-height: 1.6;
}

.creator-lock-hint {
  color: #888;
  font-size: 0.9em;
  margin-bottom: 15px;
  font-style: italic;
}

.creator-access-hint {
  color: #667eea;
  font-size: 0.85em;
  margin-bottom: 25px;
  padding: 10px 15px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  border-left: 3px solid #667eea;
}

.creator-access-hint em {
  color: #764ba2;
  font-weight: bold;
}

.creator-unlock-btn {
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #333;
  border: none;
  padding: 15px 40px;
  border-radius: 25px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.creator-unlock-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.creator-unlock-btn:disabled {
  background: linear-gradient(135deg, #aaa 0%, #888 100%);
  color: #666;
  cursor: not-allowed;
  box-shadow: none;
}

.creator-coming-soon {
  padding: 40px 20px;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  border-radius: 15px;
  margin: 20px 0;
}

.creator-emoji {
  font-size: 4em;
  display: block;
  margin-bottom: 15px;
}

.creator-coming-soon p {
  color: #666;
  font-size: 1.2em;
  margin-bottom: 10px;
}

.creator-small-text {
  font-size: 0.9em !important;
  color: #888 !important;
}

.creator-back-btn {
  margin-top: 25px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 20px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s;
}

.creator-back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ==================== QUESTS ==================== */
.quests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.creator-points-small {
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #333;
  padding: 8px 15px;
  border-radius: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 5px;
}

.refresh-quests-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: bold;
}

.refresh-quests-btn:hover {
  transform: translateY(-2px);
}

.quests-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.quest-item {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #ddd;
  border-radius: 15px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.2s;
}

.quest-item.completed {
  border-color: #4caf50;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.quest-info {
  flex: 1;
}

.quest-title {
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.quest-progress-text {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 8px;
}

.quest-progress-bar {
  height: 8px;
  background: #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
  transition: width 0.3s;
}

.quest-item.completed .quest-progress-fill {
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

.quest-claim-btn {
  background: linear-gradient(135deg, #aaa 0%, #888 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: not-allowed;
  font-weight: bold;
  transition: all 0.2s;
  min-width: 80px;
}

.quest-claim-btn.ready {
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #333;
  cursor: pointer;
  animation: claimPulse 1s ease-in-out infinite;
}

.quest-claim-btn.ready:hover {
  transform: scale(1.05);
}

@keyframes claimPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
  50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

.no-quests-message {
  text-align: center;
  color: #888;
  padding: 30px;
  font-style: italic;
}

/* Game End Flash Overlay */
.game-end-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
  animation: flashFade 2s ease-out forwards;
}

@keyframes flashFade {
  0% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* ==================== IMPORT/EXPORT BUTTONS ==================== */
.import-export-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.import-export-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Import label styled as button */
label.import-export-btn {
  display: inline-flex;
  color: white;
}

/* ==================== LEVEL EDITOR ==================== */
.level-editor-container {
  display: flex;
  gap: 25px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.level-editor-left {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 540px;
  overflow-y: auto;
}

.level-editor-right {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 540px;
  overflow-y: auto;
}

.level-editor-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.editor-section {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.editor-section h4 {
  margin: 0 0 12px 0;
  color: #667eea;
  font-size: 0.95em;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.editor-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.editor-input-group label {
  flex: 0 0 50px;
  font-size: 0.9em;
  color: #555;
}

.editor-input-group input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9em;
  width: 100%;
  box-sizing: border-box;
}

.editor-tool-buttons {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.editor-tool-btn {
  flex: 1;
  padding: 8px 5px;
  border: 2px solid #555;
  background: #4a5568;
  border-radius: 8px;
  font-size: 0.8em;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.editor-tool-btn:hover {
  background: #5a6c7d;
  border-color: #667eea;
}

.editor-tool-btn.active {
  background: linear-gradient(135deg, #4a5c9e 0%, #5c3d7a 100%);
  color: #fff;
  border-color: #4a5c9e;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.editor-action-btn {
  width: 100%;
  padding: 8px 12px;
  margin-top: 8px;
  background: linear-gradient(135deg, #5a6c7d 0%, #4a5568 100%);
  border: 1px solid #4a5568;
  border-radius: 8px;
  font-size: 0.85em;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.editor-action-btn:hover {
  background: linear-gradient(135deg, #4a5568 0%, #3d4852 100%);
  transform: translateY(-1px);
}

/* Import label styled as button */
label.editor-action-btn {
  display: block;
  text-align: center;
  box-sizing: border-box;
}

/* Cost badge for editor buttons */
.cost-badge {
  font-size: 0.75em;
  opacity: 0.85;
  margin-left: 4px;
}

/* Editor Test Game Section */
.editor-test-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white;
}

.editor-test-section h4 {
  color: white !important;
}

.editor-test-card-container {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.editor-test-card {
  width: 60px;
  height: 80px;
  background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  font-weight: bold;
  color: #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: grab;
}

.editor-test-card:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.editor-test-score {
  display: flex;
  justify-content: space-around;
  margin: 10px 0;
  font-weight: bold;
}

.editor-test-message {
  text-align: center;
  font-size: 0.9em;
  opacity: 0.9;
}

/* Disabled editor state during test */
.level-editor-left.testing {
  pointer-events: none;
  opacity: 0.5;
}

.level-editor-center.testing {
  /* Keep pointer events for playing the test game */
  pointer-events: auto;
}

.level-editor-center.testing .editor-hint {
  display: none;
}

.level-editor-left.testing .editor-section:last-child {
  pointer-events: auto;
  opacity: 1;
}

/* Editor test cell styles */
.editor-cell.editor-test-cell {
  cursor: pointer;
  transition: all 0.2s;
}

.editor-cell.editor-test-cell.empty:hover {
  background: rgba(102, 126, 234, 0.3) !important;
  transform: scale(1.05);
}

.editor-cell.editor-test-cell.neutral-cell {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
  color: white;
  font-weight: bold;
}

.editor-cell.editor-test-cell.player-owned {
  background: linear-gradient(135deg, #4CAF50, #45a049) !important;
  color: white;
  font-weight: bold;
}

.editor-cell.editor-test-cell.ai-owned {
  background: linear-gradient(135deg, #f44336, #e53935) !important;
  color: white;
  font-weight: bold;
}

.editor-cell.editor-test-cell.neutral {
  background: linear-gradient(135deg, #9e9e9e, #757575) !important;
  color: white;
  font-weight: bold;
}

/* Shorter paths in test mode - only connecting the sides */
.testing .editor-cell.path-right::after {
  width: calc(50% + var(--editor-gap, 8px));
  left: 75%;
}

.testing .editor-cell.path-down::before {
  height: calc(50% + var(--editor-gap, 8px));
  top: 75%;
}

/* Bonus flash animation for end of test game */
.editor-cell.editor-test-cell.bonus-flash {
  animation: editorBonusFlash 0.4s ease-out;
}

@keyframes editorBonusFlash {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.8);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 20px 10px rgba(255, 215, 0, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
  }
}

.editor-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9em;
  background: white;
  cursor: pointer;
}

.editor-restrictions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8em;
  color: #555;
  cursor: pointer;
}

.editor-checkbox input {
  cursor: pointer;
}

.editor-board-container {
  background: linear-gradient(135deg, #2d3436 0%, #1a1a2e 100%);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 500px;
  max-width: 500px;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.editor-board {
  display: grid;
  gap: 6px;
  position: relative;
  user-select: none;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.editor-cell {
  background: linear-gradient(135deg, #3d4f5f 0%, #2d3e4f 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
  transition: background 0.2s;
  position: relative;
  color: rgba(255, 255, 255, 0.3);
  user-select: none;
  min-width: 0;
  min-height: 0;
  touch-action: none;
}

.editor-cell:hover {
  background: linear-gradient(135deg, #4d5f6f 0%, #3d4e5f 100%);
}

.editor-cell.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.editor-cell.dragging {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

/* Path connections in editor - visible lines connecting cell centers */
.editor-cell.path-right::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateY(-50%);
  width: calc(50% + var(--editor-gap, 8px) + 50%);
  height: 8px;
  background: linear-gradient(90deg, #4caf50 0%, #66bb6a 50%, #4caf50 100%);
  border-radius: 4px;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.4);
  pointer-events: none;
}

.editor-cell.path-down::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: calc(50% + var(--editor-gap, 8px) + 50%);
  background: linear-gradient(180deg, #4caf50 0%, #66bb6a 50%, #4caf50 100%);
  border-radius: 4px;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.4);
  pointer-events: none;
}

.editor-hint {
  color: #888;
  font-size: 0.85em;
  margin-top: 12px;
  font-style: italic;
}

.editor-primary-btn {
  width: 100%;
  padding: 12px 15px;
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.editor-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.editor-info {
  font-size: 0.85em;
  color: #555;
  line-height: 1.8;
}

.editor-info span {
  font-weight: bold;
  color: #667eea;
}

/* Responsive level editor */
@media (max-width: 900px) {
  .level-editor-container {
    flex-direction: column;
  }
  
  .level-editor-left,
  .level-editor-right {
    flex: none;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .level-editor-left .editor-section,
  .level-editor-right .editor-section {
    flex: 1;
    min-width: 150px;
  }
}

@media (max-width: 600px) {
  .editor-board-container {
    width: 300px;
    height: 300px;
    padding: 12px;
  }
  
  .level-editor-left {
    max-height: none;
    overflow-y: visible;
  }
  
  .editor-cell.path-right::after {
    width: calc(50% + var(--editor-gap, 6px) + 50%);
    height: 5px;
  }
  
  .editor-cell.path-down::before {
    width: 5px;
    height: calc(50% + var(--editor-gap, 6px) + 50%);
  }
}