* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px var(--shadow);
  border: 1px solid var(--border-color);
}

/* Buttons */
.btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--accent-secondary);
}

.btn-success {
  background: var(--success);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Inputs */
.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  background: white;
  color: var(--text-primary);
  transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Game Board */
.game-board {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.starting-word {
  font-size: 32px;
  font-weight: bold;
  text-align: center;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 4px 12px var(--shadow);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.word-chain {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.word-chain-display {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.word-input-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 2px solid var(--border-color);
}

.word-input-item input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-primary);
  padding: 0;
}

.word-input-item input:focus {
  outline: none;
  border: none;
}

.word-input-item input::placeholder {
  color: var(--text-light);
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
}

.word-item {
  padding: 16px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 2px solid var(--border-color);
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.word-item.guessed {
  background: var(--success);
  color: white;
  border-color: var(--success);
  animation: pulse 0.5s ease;
}

.word-item.current-turn {
  border-color: var(--active);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3), 0 0 20px var(--active);
  animation: pulse-border 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3), 0 0 20px var(--active); }
  50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.4), 0 0 30px var(--active); }
}

/* Scoreboard */
.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.score-item {
  padding: 16px;
  background: var(--bg-card);
  border-radius: 8px;
  text-align: center;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.score-item.active {
  border-color: var(--active);
  background: var(--accent-primary);
  color: white;
  transform: scale(1.05);
}

.score-item .player-name {
  font-weight: 600;
  margin-bottom: 8px;
}

.score-item .score {
  font-size: 24px;
  font-weight: bold;
  color: var(--accent-primary);
}

.score-item.active .score {
  color: white;
}

/* QR Code */
.qr-container {
  text-align: center;
  padding: 20px;
  background: white;
  border-radius: 12px;
  margin: 20px 0;
}

.qr-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Player List */
.player-list {
  list-style: none;
  margin: 16px 0;
}

.player-list li {
  padding: 12px;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 4px solid var(--accent-primary);
}

/* Theme Selector */
.theme-selector {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.theme-option {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.theme-option:hover {
  transform: scale(1.1);
}

.theme-option.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5);
}

.theme-option[data-theme="sunset-warmth"] {
  background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%);
}

.theme-option[data-theme="tropical-paradise"] {
  background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 50%, #ffd89b 100%);
}

.theme-option[data-theme="berry-burst"] {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.theme-option[data-theme="golden-hour"] {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 50%, #ffecd2 100%);
}

.theme-option[data-theme="ocean-breeze"] {
  background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 50%, #ffecd2 100%);
}

/* Turn Indicator */
.turn-indicator {
  text-align: center;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 8px;
  margin: 20px 0;
  font-size: 18px;
  font-weight: 600;
}

.turn-indicator.active {
  background: var(--active);
  color: white;
  animation: pulse 2s infinite;
}

/* Timer */
.timer {
  font-size: 48px;
  font-weight: bold;
  text-align: center;
  padding: 20px;
  color: var(--accent-primary);
}

.timer.warning {
  color: #ff4444;
  animation: pulse 1s infinite;
}

/* Guess Input */
.guess-input-container {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}

.guess-input-container input {
  flex: 1;
  padding: 16px;
  font-size: 20px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
}

.guess-input-container button {
  padding: 16px 32px;
}

/* Matched Button */
.matched-btn {
  width: 100%;
  padding: 20px;
  font-size: 24px;
  margin: 20px 0;
  animation: pulse 2s infinite;
}

/* Viewer View - Large Screen Optimized */
@media (min-width: 1024px) {
  .viewer-container {
    font-size: 1.2em;
  }
  
  .starting-word {
    font-size: 48px;
    padding: 30px;
  }
  
  .word-item {
    font-size: 32px;
    padding: 24px;
  }
  
  .scoreboard {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Mobile Optimized */
/* Copyright Footer */
.copyright-footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  color: var(--text-light);
  font-size: 14px;
  border-top: 1px solid var(--border-color);
}

.copyright-footer p {
  margin: 0;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .container {
    padding: 12px;
  }
  
  .card {
    padding: 16px;
  }
  
  .starting-word {
    font-size: 20px;
    padding: 12px;
  }
  
  .word-item {
    font-size: 16px;
    padding: 8px;
    letter-spacing: 1px;
  }
  
  .guess-input-container {
    flex-direction: column;
  }
  
  .guess-input-container input {
    font-size: 18px;
  }
  
  /* Two player view on mobile */
  #two-player-view {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .player-board {
    padding: 12px;
  }
  
  .player-board.compact .starting-word {
    font-size: 16px;
    padding: 6px;
  }
  
  .player-board.compact .word-item {
    font-size: 12px;
    padding: 4px;
  }
  
  /* Circular view on mobile */
  .players-circle {
    max-width: 100%;
    height: 300px;
  }
  
  .player-circle-item {
    width: 90px;
    height: 90px;
  }
  
  .player-circle-item .player-avatar {
    width: 45px;
    height: 45px;
    font-size: 18px;
    margin-bottom: 4px;
  }
  
  .player-circle-item .player-name {
    font-size: 10px;
    max-width: 80px;
  }
  
  .player-circle-item .player-stats {
    font-size: 8px;
  }
  
  .modal-content {
    padding: 16px;
    max-width: 100%;
  }
}

/* Battle Target Selection */
.battle-targets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.battle-targets-list .btn {
  width: 100%;
  text-align: left;
  padding: 16px;
  font-size: 16px;
}

#current-battle-target {
  font-weight: 600;
  color: var(--accent-primary);
  text-align: center;
}

/* Player Board Sections */
.player-board-section {
  margin-bottom: 24px;
}

.player-board-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.player-board {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  border: 2px solid var(--border-color);
}

.player-board.compact {
  padding: 8px;
}

.player-board.compact .starting-word {
  font-size: 18px;
  padding: 8px;
  margin-bottom: 8px;
}

.player-board.compact .word-item {
  font-size: 14px;
  padding: 6px;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

/* Two Player View */
#two-player-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

#two-player-view .player-board {
  min-height: 200px;
}

/* Multiplayer Circular View */
#multiplayer-view {
  position: relative;
  min-height: 400px;
  width: 100%;
}

.players-circle {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-circle-item {
  position: absolute;
  width: 120px;
  height: 120px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: 50%;
  border: 3px solid var(--border-color);
  box-shadow: 0 4px 12px var(--shadow);
}

.player-circle-item:hover {
  transform: scale(1.1);
  border-color: var(--accent-primary);
  z-index: 10;
}

.player-circle-item.current-turn {
  border-color: var(--active);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3), 0 0 20px var(--active);
  animation: pulse-border 2s infinite;
}

.player-circle-item.eliminated {
  opacity: 0.5;
  filter: grayscale(100%);
}

.player-circle-item .player-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
}

.player-circle-item .player-name {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-circle-item .player-stats {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.player-board-detail {
  margin-top: 20px;
}

.player-board-detail .starting-word {
  margin-bottom: 16px;
}

.player-board-detail .word-item {
  margin-bottom: 8px;
}

/* Share Buttons */
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.share-btn svg {
  flex-shrink: 0;
}

.share-btn[data-platform="twitter"]:hover {
  background: #000000;
  border-color: #000000;
}

.share-btn[data-platform="facebook"]:hover {
  background: #1877F2;
  border-color: #1877F2;
}

.share-btn[data-platform="whatsapp"]:hover {
  background: #25D366;
  border-color: #25D366;
}

.share-btn[data-platform="sms"]:hover {
  background: #34C759;
  border-color: #34C759;
}

.share-btn[data-platform="email"]:hover {
  background: #EA4335;
  border-color: #EA4335;
}

.share-btn[data-platform="native"]:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.mt-12 {
  margin-top: 12px;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* Loading Spinner */
.spinner {
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--accent-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

