/* style.css - AI-Mafia dark theme */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --text-primary: #e0e0e0;
  --text-secondary: #888;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --mafia: #dc2626;
  --cop: #3b82f6;
  --villager: #6b7280;
  --border: #2a2a35;
  --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px var(--shadow);
}

.panel h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.hidden {
  display: none !important;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 0.5rem;
  accent-color: var(--accent);
}

/* Buttons */
button {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  opacity: 0.9;
}

/* Status Panel */
.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.game-id {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.status-item {
  text-align: center;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.status-item .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.status-item .value {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Players Grid */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.player-card {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.player-card.dead {
  opacity: 0.5;
  text-decoration: line-through;
}

.player-card.mafia {
  border-left: 3px solid var(--mafia);
}

.player-card.cop {
  border-left: 3px solid var(--cop);
}

.player-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.player-model {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.player-status {
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.player-status.alive {
  color: var(--success);
}

.player-status.dead {
  color: var(--danger);
}

/* Game Log */
.log-container {
  max-height: 500px;
  overflow-y: auto;
  font-size: 0.85rem;
}

.log-entry {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry .phase {
  color: var(--accent);
  font-weight: 600;
}

.log-entry .actor {
  color: var(--text-primary);
  font-weight: 600;
}

.log-entry .content {
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.log-entry.system {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.log-entry.phase-change {
  background: linear-gradient(90deg, var(--bg-tertiary), transparent);
  padding-left: 1rem;
}

.log-entry.death {
  border-left: 3px solid var(--danger);
}

.log-entry.vote {
  border-left: 3px solid var(--warning);
}

/* Game Over */
#winner-announcement {
  text-align: center;
  padding: 2rem;
  font-size: 1.5rem;
}

#winner-announcement.mafia-win {
  color: var(--mafia);
}

#winner-announcement.town-win {
  color: var(--success);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  header h1 {
    font-size: 1.75rem;
  }
  
  .status-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .players-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}
