/* === UNDERCOVER MULTI - Styles harmonisés JLS Sandbox === */

:root {
  --uc-bg: #f5f5f5;
  --uc-panel: #ffffff;
  --uc-panel-alt: #fafafa;
  --uc-text: #1e293b;
  --uc-muted: #666666;
  --uc-border: #e5e5e5;
  --uc-border-light: #f0f0f0;
  --uc-accent: #10b981;
  --uc-accent-dark: #059669;
  --uc-ok: #22c55e;
  --uc-ko: #ef4444;
  --uc-warn: #f59e0b;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 20px rgba(24, 53, 90, 0.1);
  --shadow-lg: 0 8px 40px rgba(24, 53, 90, 0.15);
  --transition: 0.3s ease;
}

/* === BASE === */
* {
  box-sizing: border-box;
}

.game-body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--uc-text);
  background: var(--uc-bg);
  min-height: 100vh;
  line-height: 1.6;
}

/* === HERO HEADER === */
.game-hero {
  background: linear-gradient(135deg, var(--uc-text) 0%, #334155 100%);
  color: white;
  padding: 100px 20px 40px;
  text-align: center;
  margin-top: 70px;
}

.game-hero h1 {
  margin: 0 0 10px 0;
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 700;
}

.game-hero p {
  opacity: 0.85;
  margin: 0 0 20px 0;
  font-size: 1.1rem;
}

/* === GAME CONTAINER === */
.game-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* === GAME GRID === */
.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* === GAME CARDS === */
.game-card {
  background: var(--uc-panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}

.game-card:hover {
  box-shadow: var(--shadow-lg);
}

/* === HEADER ROW === */
.game-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.game-row-center {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* === BUTTONS === */
.game-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid var(--uc-border);
  background: var(--uc-panel);
  color: var(--uc-text);
  text-decoration: none;
  transition: all var(--transition);
  min-height: 44px;
}

.game-btn:hover {
  background: var(--uc-bg);
  border-color: var(--uc-accent);
}

.game-btn:active {
  transform: scale(0.98);
}

.game-btn-primary {
  background: linear-gradient(135deg, var(--uc-accent) 0%, var(--uc-accent-dark) 100%);
  border-color: var(--uc-accent);
  color: white;
}

.game-btn-primary:hover {
  background: linear-gradient(135deg, var(--uc-accent-dark) 0%, var(--uc-accent) 100%);
  border-color: var(--uc-accent-dark);
}

.game-btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--uc-ko);
}

.game-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.game-btn-secondary {
  background: transparent;
  border-color: var(--uc-border);
  color: var(--uc-muted);
}

.game-btn-secondary:hover {
  border-color: var(--uc-text);
  color: var(--uc-text);
}

.game-btn-full {
  width: 100%;
}

/* === FORMS === */
.game-label {
  display: block;
  font-size: 0.85rem;
  color: var(--uc-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.game-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--uc-border);
  background: var(--uc-panel);
  color: var(--uc-text);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.game-input:focus {
  outline: none;
  border-color: var(--uc-accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.game-input::placeholder {
  color: #999;
}

/* === FORMS GRID === */
.game-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.game-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.game-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 500px) {
  .game-form-grid-2,
  .game-form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* === HINT TEXT === */
.game-hint {
  font-size: 0.85rem;
  color: var(--uc-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* === DIVIDER === */
.game-divider {
  height: 1px;
  background: var(--uc-border);
  margin: 16px 0;
}

/* === BADGES / PILLS === */
.game-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--uc-bg);
  border: 1px solid var(--uc-border);
  color: var(--uc-muted);
}

.game-badge-ok {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--uc-ok);
}

.game-badge-ko {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--uc-ko);
}

.game-badge-warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--uc-warn);
}

.game-badge-primary {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--uc-accent);
}

.game-badge-lg {
  padding: 8px 18px;
  font-size: 0.95rem;
}

.game-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  background: var(--uc-bg);
  border: 1px solid var(--uc-border);
  color: var(--uc-muted);
}

/* === TITLE === */
.game-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--uc-text);
  margin: 0;
}

.game-title-lg {
  font-size: 2rem;
  font-weight: 700;
  color: var(--uc-text);
  margin: 0;
}

.game-subtitle {
  font-size: 0.9rem;
  color: var(--uc-muted);
  margin: 4px 0 0 0;
}

/* === CENTER CONTENT === */
.game-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.game-center .game-title {
  margin-bottom: 0;
}

/* === PLAYER LIST === */
.game-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.game-player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--uc-bg);
  border-radius: var(--radius);
  transition: background var(--transition);
}

.game-player-item:hover {
  background: var(--uc-border-light);
}

.game-player-info {
  min-width: 0;
  flex: 1;
}

.game-player-name {
  font-weight: 600;
  color: var(--uc-text);
}

.game-player-name small {
  font-weight: 400;
  color: var(--uc-muted);
  margin-left: 6px;
  font-size: 0.85rem;
}

.game-player-meta {
  font-size: 0.85rem;
  color: var(--uc-muted);
}

/* === WORD BOX === */
.game-word-box {
  width: 100%;
  max-width: 400px;
  padding: 32px 24px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.04) 100%);
  border: 2px solid var(--uc-accent);
  border-radius: var(--radius-lg);
  text-align: center;
}

.game-word {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--uc-text);
  word-break: break-word;
  margin: 0;
}

.game-word-label {
  font-size: 0.9rem;
  color: var(--uc-muted);
  margin: 0 0 8px 0;
}

/* === VOTE BUTTONS === */
.game-vote-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--uc-panel);
  border: 1px solid var(--uc-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.game-vote-btn:hover:not(:disabled) {
  border-color: var(--uc-accent);
  background: rgba(16, 185, 129, 0.05);
}

.game-vote-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.game-vote-btn .game-vote-name {
  font-weight: 600;
  color: var(--uc-text);
}

.game-vote-btn .game-vote-meta {
  font-size: 0.85rem;
  color: var(--uc-muted);
}

/* === REVEAL SCREEN === */
.game-reveal-civil {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
}

.game-reveal-civil * {
  color: #ffffff !important;
}

.game-reveal-undercover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
}

.game-reveal-undercover * {
  color: #ffffff !important;
}

.game-reveal-white {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
  color: #ffffff !important;
}

.game-reveal-white * {
  color: #ffffff !important;
}

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

@keyframes revealShake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

@keyframes revealFlash {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 1; }
}

/* === GAME OVER === */
.game-over-badge {
  font-size: 1.2rem;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 999px;
}

.game-over-civil {
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid var(--uc-ok);
  color: var(--uc-ok);
}

.game-over-undercover {
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid var(--uc-ko);
  color: var(--uc-ko);
}

.game-over-white {
  background: rgba(245, 158, 11, 0.15);
  border: 2px solid var(--uc-warn);
  color: var(--uc-warn);
}

/* === CREATION CARDS === */
.game-create-card {
  background: var(--uc-panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}

.game-create-card h3 {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  color: var(--uc-text);
}

.game-create-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--uc-muted);
}

.game-create-card .game-hint {
  margin-top: 12px;
}

/* === EMPTY STATE === */
.game-empty {
  text-align: center;
  padding: 20px;
  color: var(--uc-muted);
}

/* === HEADER IN CARD === */
.game-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--uc-border);
}

.game-card-header-noborder {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 12px;
}

/* === STATUS STRIP === */
.game-status-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--uc-bg);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

/* === SCREEN SPECIFICS === */
.screen-connect { }
.screen-lobby { }
.screen-word { }
.screen-round { }
.screen-vote { }
.screen-reveal { }
.screen-gameover { }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .game-hero {
    padding: 90px 16px 30px;
  }
  
  .game-container {
    padding: 24px 16px;
  }
  
  .game-card {
    padding: 18px;
  }
  
  .game-word-box {
    padding: 24px 16px;
  }
  
  .game-word {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .game-hero h1 {
    font-size: 1.75rem;
  }
  
  .game-form-grid-2,
  .game-form-grid-3 {
    grid-template-columns: 1fr;
  }
  
  .game-title-lg {
    font-size: 1.5rem;
  }
}