/* ============================================
   TERRITORY (DOTS AND BOXES) STYLES
   ============================================ */

/* Game Canvas */
#game-canvas {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  background: #1a1a2e;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Board Container */
.board-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 10px;
  background: linear-gradient(145deg, #16213e, #0f0f23);
  border-radius: 12px;
  margin: 10px 0;
  box-sizing: border-box;
}

/* ============================================
   PLAYER CARD - Territory-specific styles only
   Base styles inherited from common.css
   ============================================ */
/* Color indicator for Territory */
.player-card .color-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

.player-card .color-indicator.player1-color {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border: 1px solid #c0392b;
}

.player-card .color-indicator.player2-color {
  background: linear-gradient(135deg, #3498db, #2980b9);
  border: 1px solid #2980b9;
}
/* Territory uses score instead of timer */
.player-card .score {
  font-family: monospace;
  font-size: 14px;
  font-weight: bold;
}

#player1-card .score {
  color: #e74c3c;
}

#player2-card .score {
  color: #3498db;
}

/* Chat Tabs (Omok style) */
.chat-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0;
}

.chat-tab {
  flex: 1;
  padding: 10px 15px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.chat-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chat-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  font-weight: 500;
}

.participant-count {
  background: var(--accent);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Tab Content (Omok style) */
.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#chat-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}
#chat-content .chat-messages {
  flex: 1;
}

/* Participants List (Omok style) */
.participants-list {
  padding: 10px;
  overflow-y: auto;
  height: 100%;
}
.participant-section {
  margin-bottom: 15px;
}
.participant-section-header {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
}
.participant-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.participant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 13px;
}
.participant-item.player {
  border-left: 3px solid var(--accent);
}
.participant-item.host {
  border-left: 3px solid #f1c40f;
}
.participant-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.participant-info {
  flex: 1;
}
.participant-name {
  font-weight: 500;
  color: var(--text-primary);
}
.participant-role {
  font-size: 11px;
  color: var(--text-secondary);
}
.participant-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.participant-badge.host {
  background: #f1c40f;
  color: #000;
}
.participant-badge.red {
  background: #e74c3c;
  color: #fff;
}
.participant-badge.blue {
  background: #3498db;
  color: #fff;
}
.empty-participants {
  text-align: center;
  color: var(--text-secondary);
  padding: 20px;
  font-size: 13px;
}

/* Final Score in Game Over Modal */
.final-score {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--text-primary);
}

/* AI Badge */
.ai-badge {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

/* Waiting Overlay */
.waiting-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  z-index: 10;
}

.waiting-overlay.active {
  display: flex;
}

.waiting-overlay h3 {
  margin-top: 20px;
  color: var(--text-primary);
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive - 820px 이하: 게임판 화면 너비 꽉 차게 */
@media (max-width: 820px) {
  .board-container {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .player-card {
    min-width: 140px;
    padding: 8px 10px;
  }

  .player-card .name {
    font-size: 13px;
  }

  .player-card .score {
    font-size: 16px;
  }

  .player-card .color-indicator {
    width: 16px;
    height: 16px;
  }

  .board-container {
    padding: 4px;
  }
}

/* Light Theme Adjustments */
.theme-light .board-container {
  background: linear-gradient(145deg, #e8e8e8, #f5f5f5);
}

.theme-light #game-canvas {
  background: #f0f0f0;
}

.theme-light .player-card {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-light .player-score {
  background: rgba(0, 0, 0, 0.05);
}

/* Responsive Ads */
@media (max-width: 768px) {
  .ad-pc-only { display: none !important; }
}
@media (min-width: 769px) {
  .ad-mobile-only { display: none !important; }
}
