/* Mystery at Maple Manor - Styles */

:root {
  --color-primary: #2c3e50;
  --color-secondary: #34495e;
  --color-accent: #8b6f47;
  --color-success: #27ae60;
  --color-danger: #c0392b;
  --color-warning: #f39c12;
  --color-bg: #ecf0f1;
  --color-card: #ffffff;
  --color-text: #2c3e50;
  --color-text-light: #7f8c8d;
  --color-border: #bdc3c7;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

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

.container-narrow {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  background: var(--color-primary);
  color: white;
  padding: 20px 0;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  position: relative;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  text-align: center;
}

header p {
  text-align: center;
  opacity: 0.9;
  margin-top: 5px;
  font-size: 0.95rem;
}

.leave-game-btn {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.leave-game-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: white;
  transform: translateY(-50%) scale(1.1);
}

/* Cards */
.card {
  background: var(--color-card);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--color-primary);
}

.card h3 {
  font-size: 1.2rem;
  margin: 16px 0 12px 0;
  color: var(--color-secondary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  width: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

.btn-primary:hover {
  background: #a0865c;
}

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

.btn-success:hover {
  background: #2ecc71;
}

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

.btn-danger:hover {
  background: #e74c3c;
}

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

.btn-secondary:hover {
  background: #415b76;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
}

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

/* Forms */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--color-secondary);
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Grid */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Status badge */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-waiting {
  background: var(--color-warning);
  color: white;
}

.badge-running {
  background: var(--color-success);
  color: white;
}

.badge-ended {
  background: var(--color-text-light);
  color: white;
}

/* Code display */
.code-display {
  background: var(--color-primary);
  color: white;
  padding: 16px;
  border-radius: 6px;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 4px;
  font-family: 'Courier New', monospace;
  margin: 20px 0;
}

/* Player list */
.player-list {
  list-style: none;
}

.player-item {
  padding: 12px;
  margin-bottom: 8px;
  background: var(--color-bg);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-name {
  font-weight: 500;
}

.player-character {
  color: var(--color-text-light);
  font-size: 0.9rem;
}

/* Character sheet */
.character-sheet {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.character-sheet h2 {
  color: white;
  margin-bottom: 8px;
}

.character-sheet .occupation {
  opacity: 0.9;
  font-style: italic;
  margin-bottom: 16px;
}

.character-sheet .personality {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.personality-tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.character-detail {
  margin-bottom: 16px;
}

.character-detail strong {
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Clues */
.clue-list {
  list-style: none;
}

.clue-item {
  background: var(--color-card);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 6px;
  border-left: 4px solid var(--color-accent);
  box-shadow: var(--shadow);
}

.clue-number {
  font-weight: bold;
  color: var(--color-accent);
  margin-right: 8px;
}

/* Timer */
.timer {
  text-align: center;
  font-size: 3rem;
  font-weight: bold;
  color: var(--color-primary);
  padding: 20px;
  background: var(--color-card);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  font-family: 'Courier New', monospace;
}

/* Alerts */
.alert {
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--color-text-light);
}

.spinner {
  border: 4px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes modalPopIn {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.clue-item.new-clue {
  animation: fadeIn 0.5s ease-out;
  border-left-width: 6px;
  box-shadow: 0 4px 12px rgba(139, 111, 71, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }

  .card {
    padding: 16px;
  }

  .code-display {
    font-size: 1.5rem;
    letter-spacing: 2px;
  }

  .timer {
    font-size: 2rem;
  }

  .btn {
    padding: 10px 20px;
  }
}

/* Character selection */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.character-option {
  padding: 12px;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--color-card);
}

.character-option:hover {
  border-color: var(--color-accent);
  background: var(--color-bg);
}

.character-option.selected {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: white;
}

.character-option.selected .character-occupation {
  color: rgba(255, 255, 255, 0.9);
}

.character-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.character-occupation {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* Control buttons for GM */
.control-buttons {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.clue-button {
  padding: 16px;
  font-size: 1rem;
}

/* Game rules */
.rules {
  background: var(--color-bg);
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.rules ul {
  margin-left: 20px;
  margin-top: 8px;
}

.rules li {
  margin-bottom: 8px;
}
