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

body {
  background: #0a0a1a;
  color: #e0e0e0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#app {
  width: 100%;
  max-width: 1200px;
  padding: 20px;
}

h1 {
  font-size: 3rem;
  text-align: center;
  color: #00f0f0;
  text-shadow: 0 0 20px rgba(0, 240, 240, 0.5);
  letter-spacing: 0.3em;
  margin-bottom: 5px;
}

.subtitle {
  text-align: center;
  color: #888;
  margin-bottom: 30px;
  font-size: 1.1rem;
}

#lobby-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.input-group {
  display: flex;
  gap: 10px;
}

.input-group input {
  padding: 12px 16px;
  border: 2px solid #333;
  border-radius: 8px;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 1rem;
  width: 250px;
  outline: none;
  transition: border-color 0.3s;
}

.input-group input:focus {
  border-color: #00f0f0;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #00f0f0, #0080ff);
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 240, 240, 0.3);
}

button:active {
  transform: translateY(0);
}

h2 {
  text-align: center;
  margin-bottom: 15px;
  color: #ccc;
  font-size: 1.2rem;
}

#lobby-list {
  max-width: 500px;
  margin: 0 auto;
}

.empty-msg {
  text-align: center;
  color: #666;
  padding: 20px;
}

.lobby-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #1a1a2e;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid #333;
}

.lobby-item .lobby-info {
  display: flex;
  flex-direction: column;
}

.lobby-item .lobby-name {
  font-weight: bold;
  color: #e0e0e0;
}

.lobby-item .lobby-players {
  font-size: 0.85rem;
  color: #888;
}

.lobby-item button {
  padding: 8px 18px;
  font-size: 0.9rem;
}

#waiting-screen {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #333;
  border-top: 4px solid #00f0f0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 30px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#game-screen {
  position: relative;
}

#game-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.player-side {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.board-wrap {
  border: 3px solid #333;
  border-radius: 4px;
  background: #111;
  line-height: 0;
}

canvas {
  display: block;
}

.info-panel {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  align-items: flex-start;
}

.info-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1a1a2e;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #333;
}

.info-label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.info-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #00f0f0;
}

.info-box canvas {
  background: #111;
  border-radius: 4px;
}

.vs-divider {
  font-size: 2rem;
  font-weight: bold;
  color: #f00;
  text-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
  align-self: center;
  padding: 0 10px;
}

#game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 8px;
}

#overlay-text {
  font-size: 2.5rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.4;
}

#controls-hint {
  text-align: center;
  color: #555;
  margin-top: 20px;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  #game-container { gap: 10px; }
  .board-wrap canvas { width: 150px; height: 300px; }
  .vs-divider { font-size: 1.2rem; }
}
