/* SpacetimeDB Games Styles */

/* General Styles */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f9fafb;
  }
  
  .spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  .connection-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
    background-color: #f9fafb;
  }
  
  .connection-error h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #ef4444;
  }
  
  .connection-error p {
    margin-bottom: 1.5rem;
    color: #4b5563;
  }
  
  /* TicTacToe Game Styles */
  .tictactoe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 300px;
    margin: 0 auto;
  }
  
  .tictactoe-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    background-color: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .tictactoe-cell:hover {
    background-color: #f3f4f6;
  }
  
  .tictactoe-cell-x {
    color: #3b82f6;
  }
  
  .tictactoe-cell-o {
    color: #ef4444;
  }
  
  .tictactoe-cell-disabled {
    cursor: not-allowed;
  }
  
  .tictactoe-status {
    margin-top: 1.5rem;
    text-align: center;
    font-weight: 500;
    padding: 0.75rem;
    border-radius: 0.375rem;
    background-color: #f3f4f6;
  }
  
  .tictactoe-status-win {
    background-color: #dcfce7;
    color: #166534;
  }
  
  .tictactoe-status-draw {
    background-color: #f3f4f6;
    color: #4b5563;
  }
  
  /* Drawing Game Styles */
  .drawing-canvas-container {
    width: 100%;
    height: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
    border-radius: 0.375rem;
    overflow: hidden;
  }
  
  .drawing-canvas {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    touch-action: none;
  }
  
  .drawing-tools {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #f3f4f6;
    border-radius: 0.375rem;
  }
  
  .color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .color-option {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .color-option-selected {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6;
  }
  
  .brush-size-picker {
    display: flex;
    gap: 0.5rem;
  }
  
  .brush-option {
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    border: 2px solid #e5e7eb;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .brush-option-selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
  }
  
  .word-option {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.375rem;
    text-align: center;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .word-option:hover {
    background-color: #eff6ff;
    border-color: #3b82f6;
  }
  
  /* Game Lobby Styles */
  .room-card {
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
  }
  
  .room-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #3b82f6;
  }
  
  .room-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
  }
  
  .room-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
  }
  
  .room-status-waiting {
    background-color: #dcfce7;
    color: #166534;
  }
  
  .room-status-playing {
    background-color: #dbeafe;
    color: #1e40af;
  }
  
  .room-status-finished {
    background-color: #f3f4f6;
    color: #4b5563;
  }
  
  /* Chat Box Styles */
  .chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 300px;
  }
  
  .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .chat-message {
    padding: 0.75rem;
    border-radius: 0.375rem;
    max-width: 85%;
    word-break: break-word;
  }
  
  .chat-message-system {
    align-self: center;
    background-color: #f3f4f6;
    color: #6b7280;
    font-style: italic;
    max-width: 100%;
    text-align: center;
  }
  
  .chat-message-user {
    align-self: flex-end;
    background-color: #dbeafe;
    color: #1e40af;
  }
  
  .chat-message-other {
    align-self: flex-start;
    background-color: #f3f4f6;
    color: #4b5563;
  }
  
  .chat-input-container {
    display: flex;
    padding: 0.75rem;
    border-top: 1px solid #e5e7eb;
  }
  
  .chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem 0 0 0.375rem;
    padding: 0.5rem 0.75rem;
    outline: none;
  }
  
  .chat-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
  }
  
  .chat-send-button {
    border-radius: 0 0.375rem 0.375rem 0;
  }
  
  /* Player list styles */
  .player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
  }
  
  .player-item {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background-color: #f3f4f6;
    font-weight: 500;
  }
  
  .player-item-active {
    background-color: #dbeafe;
    color: #1e40af;
  }
  
  .player-item-self {
    border: 1px solid #3b82f6;
  }
  
  /* Responsive styles */
  @media (max-width: 768px) {
    .drawing-tools {
      flex-direction: column;
      align-items: center;
    }
    
    .chat-message {
      max-width: 90%;
    }
  }
  
  /* Dark mode support */
  @media (prefers-color-scheme: dark) {
    body {
      background-color: #1f2937;
      color: #f9fafb;
    }
    
    .loading-screen,
    .connection-error {
      background-color: #111827;
    }
    
    .connection-error h2 {
      color: #f87171;
    }
    
    .connection-error p {
      color: #d1d5db;
    }
    
    .tictactoe-cell {
      background-color: #374151;
      border-color: #4b5563;
    }
    
    .tictactoe-cell:hover {
      background-color: #4b5563;
    }
    
    .tictactoe-status {
      background-color: #374151;
      color: #e5e7eb;
    }
    
    .tictactoe-status-win {
      background-color: #065f46;
      color: #d1fae5;
    }
    
    .tictactoe-status-draw {
      background-color: #374151;
      color: #e5e7eb;
    }
    
    .drawing-canvas-container {
      background-color: #111827;
    }
    
    .drawing-canvas {
      background-color: #ffffff;
    }
    
    .drawing-tools {
      background-color: #374151;
    }
    
    .brush-option {
      background-color: #4b5563;
      border-color: #6b7280;
    }
    
    .brush-option-selected {
      border-color: #60a5fa;
      background-color: #1e40af;
    }
    
    .word-option {
      border-color: #4b5563;
      background-color: #374151;
      color: #e5e7eb;
    }
    
    .word-option:hover {
      background-color: #1e40af;
      border-color: #60a5fa;
    }
    
    .room-card-footer {
      border-top-color: #4b5563;
    }
    
    .chat-message-system {
      background-color: #374151;
      color: #9ca3af;
    }
    
    .chat-message-user {
      background-color: #1e40af;
      color: #dbeafe;
    }
    
    .chat-message-other {
      background-color: #374151;
      color: #e5e7eb;
    }
    
    .chat-input-container {
      border-top-color: #4b5563;
    }
    
    .chat-input {
      background-color: #374151;
      border-color: #4b5563;
      color: #e5e7eb;
    }
    
    .player-item {
      background-color: #374151;
      color: #e5e7eb;
    }
    
    .player-item-active {
      background-color: #1e40af;
      color: #dbeafe;
    }
  }