/* Base styles */
:root {
  --red-primary: #ff4444;
  --red-secondary: #cc2222;
  --red-background: #ffeeee;
  --blue-primary: #4477ff;
  --blue-secondary: #2244cc;
  --blue-background: #eeeeff;
  --portal-color: #ff44ff;
  --text-color: #333333;
  --border-color: #dddddd;
  --bg-color: #ffffff;
}

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

body {
  font-family: 'Press Start 2P', cursive;
  line-height: 1.6;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
  height: 100vh;
}

.theme-red {
  --primary-color: var(--red-primary);
  --secondary-color: var(--red-secondary);
  --game-background: var(--red-background);
}

.theme-blue {
  --primary-color: var(--blue-primary);
  --secondary-color: var(--blue-secondary);
  --game-background: var(--blue-background);
}

.hidden {
  display: none !important;
}

/* Splash screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  color: white;
  text-align: center;
}

.splash-content {
  max-width: 600px;
  padding: 2rem;
}

.splash-content h1 {
  font-size: 3rem;
  margin-bottom: 2rem;
  text-shadow: 3px 3px 0 var(--secondary-color);
}

.splash-instructions {
  margin-bottom: 2rem;
  font-size: 0.8rem;
  line-height: 2;
}

.splash-portal {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.portal-animation {
  width: 50px;
  height: 50px;
  background-color: var(--portal-color);
  border-radius: 5px;
  animation: portal-pulse 2s infinite alternate;
  box-shadow: 0 0 15px var(--portal-color);
}

.portal-animation.large {
  width: 80px;
  height: 80px;
}

@keyframes portal-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 15px var(--portal-color);
  }
  100% {
    transform: scale(1.2);
    box-shadow: 0 0 30px var(--portal-color);
  }
}

/* Login form */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: var(--game-background);
}

.login-form {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.login-form h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.login-button {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.login-button:hover {
  background-color: var(--secondary-color);
}

.login-note {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.6rem;
  color: #666;
}

/* Game container */
.game-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: var(--game-background);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: var(--primary-color);
  color: white;
}

.game-info h1 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

#player-info {
  font-size: 0.7rem;
}

.logout-button {
  background-color: white;
  color: var(--primary-color);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.7rem;
}

.logout-button:hover {
  background-color: #f0f0f0;
}

.game-board-container {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
  background-color: var(--border-color);
  padding: 4px;
  border-radius: 8px;
}

.game-cell {
  background-color: white;
  border-radius: 4px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-cell.portal {
  background-color: var(--portal-color);
  animation: portal-pulse 2s infinite alternate;
}

.player {
  width: 70%;
  height: 70%;
  border-radius: 50%;
  position: absolute;
  z-index: 10;
}

.player::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30%;
  height: 30%;
  background-color: white;
  border-radius: 50%;
}

.other-player {
  width: 60%;
  height: 60%;
  border-radius: 50%;
  position: absolute;
  z-index: 5;
  animation: player-pulse 1.5s infinite alternate;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

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

.other-player-indicator {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ffcc00;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.game-controls {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  background-color: white;
  border-top: 2px solid var(--border-color);
}

.control-section {
  flex: 1;
}

.control-section h3 {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.control-section p {
  font-size: 0.7rem;
  margin-bottom: 0.25rem;
}

/* Transition screen */
.transition-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  color: white;
  text-align: center;
}

.transition-content {
  max-width: 600px;
  padding: 2rem;
}

.transition-content h2 {
  margin-bottom: 2rem;
}

.loading-bar {
  width: 100%;
  height: 20px;
  background-color: #333;
  border-radius: 10px;
  margin-top: 2rem;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  background-color: var(--portal-color);
  width: 0%;
  transition: width 3s linear;
}

/* Message modal */
.message-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.message-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 80%;
  text-align: center;
}

.message-content h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.message-content p {
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
}

#message-button {
  padding: 0.5rem 2rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

/* Connection status indicator */
.connection-status {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  font-size: 0.6rem;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 5px 8px;
  border-radius: 12px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-indicator.connected {
  background-color: #28a745;
}

.status-indicator.connecting {
  background-color: #ffc107;
  animation: blink 1s infinite;
}

.status-indicator.disconnected {
  background-color: #dc3545;
}

/* Player count */
.player-count {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.7rem;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 5px 8px;
  border-radius: 12px;
  color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
  .game-controls {
    flex-direction: column;
  }
  
  .control-section {
    margin-bottom: 1rem;
  }
  
  .splash-content h1 {
    font-size: 2rem;
  }
  
  .login-form {
    max-width: 90%;
  }
} 