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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
  color: white;
}

.menu-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.game-title {
  font-size: 4em;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.game-subtitle {
  font-size: 1.2em;
  opacity: 0.8;
  margin-bottom: 40px;
}

.menu-buttons {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
}

.mode-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  padding: 20px 40px;
  font-size: 1.3em;
  font-weight: bold;
  color: white;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.mode-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.rules {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 15px;
  text-align: left;
  max-width: 500px;
}

.rules h3 {
  margin-bottom: 15px;
  font-size: 1.5em;
}

.rules p {
  margin: 8px 0;
  opacity: 0.9;
}

.game-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.header {
  width: 100%;
  max-width: 800px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.back-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 10px 20px;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.turn-indicator {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 15px 30px;
  border-radius: 15px;
  margin-bottom: 30px;
}

.player-icon {
  opacity: 0.3;
  transition: all 0.3s;
}

.player-icon.active {
  opacity: 1;
  transform: scale(1.2);
}

.icon-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  font-weight: bold;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.turn-text {
  font-size: 1.3em;
  font-weight: bold;
}

.pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}

.pyramid-row {
  display: flex;
  gap: 15px;
}

.circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8em;
  font-weight: bold;
  color: white;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.1);
}

.circle:not(.filled):not(.black-hole):hover {
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.2);
}

.circle.filled {
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.circle.black-hole {
  background: radial-gradient(circle, #000 0%, #1a1a2e 100%);
  border-color: #667eea;
  box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
  animation: pulse 2s infinite;
}

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

.results {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 30px 50px;
  border-radius: 20px;
  text-align: center;
}

.results h2 {
  font-size: 2.5em;
  margin-bottom: 20px;
}

.scores {
  font-size: 1.5em;
  margin-bottom: 25px;
}

.scores div {
  margin: 10px 0;
  font-weight: bold;
}

.restart-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  padding: 15px 40px;
  font-size: 1.2em;
  font-weight: bold;
  color: white;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
}

.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: white;
  color: #333;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  position: relative;
  min-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal h2 {
  margin-bottom: 30px;
  color: #667eea;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
}

.modal-btn {
  background: #667eea;
  border: none;
  padding: 12px 30px;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  transition: all 0.3s;
}

.modal-btn:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

.modal-btn.secondary {
  background: #999;
}

.modal-btn.secondary:hover {
  background: #777;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #999;
}

.close-modal:hover {
  color: #333;
}

.room-code {
  background: #f0f0f0;
  padding: 20px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 2em;
  color: #667eea;
  font-weight: bold;
  letter-spacing: 3px;
  margin: 20px 0;
}

.join-input-container {
  margin-top: 20px;
}

.join-input-container input {
  width: 100%;
  padding: 12px;
  font-size: 1.1em;
  border: 2px solid #667eea;
  border-radius: 10px;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: white;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 1.5em;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.3s;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toggle:hover {
  background: #444;
  transform: scale(1.1);
}

.chat-toggle.notify {
  animation: shake 0.5s;
}

.badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.chat-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 300px;
  height: 400px;
  background: #222;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.chat-header {
  background: #333;
  color: white;
  padding: 15px;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.chat-header button {
  background: none;
  border: none;
  color: white;
  font-size: 1.2em;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  padding: 8px 12px;
  border-radius: 10px;
  max-width: 80%;
  word-wrap: break-word;
}

.chat-msg.me {
  background: #3b82f6;
  align-self: flex-end;
  text-align: right;
}

.chat-msg.them {
  background: #444;
  align-self: flex-start;
}

.chat-input-row {
  display: flex;
  border-top: 1px solid #444;
}

.chat-input-row input {
  flex: 1;
  background: #111;
  border: none;
  color: white;
  padding: 12px;
  font-size: 0.9em;
}

.chat-input-row input:focus {
  outline: none;
}

.chat-input-row button {
  background: #667eea;
  border: none;
  color: white;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: bold;
}

.chat-input-row button:hover {
  background: #5568d3;
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-title {
    font-size: 2.5em;
  }

  .menu-buttons {
    flex-direction: column;
  }

  .mode-btn {
    width: 100%;
  }

  .modal {
    min-width: 90%;
    padding: 30px 20px;
  }

  .circle {
    width: 50px;
    height: 50px;
    font-size: 1.3em;
  }

  .pyramid-row {
    gap: 10px;
  }

  .pyramid {
    gap: 10px;
  }

  .turn-indicator {
    padding: 10px 20px;
  }

  .icon-circle {
    width: 40px;
    height: 40px;
    font-size: 1.2em;
  }

  .turn-text {
    font-size: 1.1em;
  }

  .chat-window {
    width: calc(100vw - 40px);
    right: 20px;
  }

  .chat-toggle {
    width: 50px;
    height: 50px;
    font-size: 1.3em;
  }

  .results {
    padding: 20px 30px;
  }

  .results h2 {
    font-size: 2em;
  }

  .scores {
    font-size: 1.2em;
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 2em;
  }

  .circle {
    width: 40px;
    height: 40px;
    font-size: 1.1em;
  }

  .pyramid-row {
    gap: 8px;
  }

  .pyramid {
    gap: 8px;
  }

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

  .room-code {
    font-size: 1.5em;
    padding: 15px;
  }
}