/* ============================================================
   TTX CiberCrisis — Professional Light Theme
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary:        #2563eb;
  --primary-hover:  #1d4ed8;
  --primary-light:  #eff6ff;
  --primary-dark:   #1e3a8a;

  --danger:         #dc2626;
  --danger-hover:   #b91c1c;
  --danger-light:   #fef2f2;
  --danger-border:  #fecaca;

  --warning:        #d97706;
  --warning-light:  #fffbeb;
  --warning-border: #fde68a;

  --success:        #16a34a;
  --success-light:  #f0fdf4;
  --success-border: #bbf7d0;

  --info:           #0891b2;
  --info-light:     #ecfeff;
  --info-border:    #a5f3fc;

  --purple:         #7c3aed;
  --purple-light:   #f5f3ff;
  --purple-border:  #ddd6fe;

  --amber:          #b45309;
  --amber-light:    #fffbeb;

  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --bg:      #f1f5f9;
  --surface: #ffffff;
  --surface2:#f8fafc;
  --border:  #e2e8f0;
  --border2: #cbd5e1;

  --text:    #0f172a;
  --text-2:  #334155;
  --text-3:  #64748b;
  --text-4:  #94a3b8;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow:    0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 15px rgba(0,0,0,0.07), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);

  --radius:    6px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================ TYPOGRAPHY */
h1,h2,h3,h4,h5 { font-weight: 700; line-height: 1.3; }
p { color: var(--text-2); }

/* ============================================================ UTILITIES */
.text-muted   { color: var(--text-3) !important; font-size: 0.85em; }
.text-muted-sm{ color: var(--text-4) !important; font-size: 0.78em; }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-1   { margin-top: 0.5rem; }
.mt-2   { margin-top: 1rem; }
.mt-3   { margin-top: 1.5rem; }
.mb-1   { margin-bottom: 0.5rem; }
.mb-2   { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1  { gap: 0.5rem; }
.gap-2  { gap: 1rem; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

/* ============================================================ CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 1.25rem; }
.card-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 {
  font-size: 0.875rem; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 0.5rem;
}
.card-header h3 i { font-size: 0.85em; }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.55em 1.15em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s ease; text-decoration: none;
  font-family: var(--font); white-space: nowrap;
  line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn i { font-size: 0.9em; }

.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }

.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }

.btn-outline   { background: var(--surface); color: var(--text-2); border-color: var(--border2); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-outline-primary { background: var(--primary-light); color: var(--primary); border-color: #bfdbfe; }
.btn-outline-primary:hover { background: #dbeafe; }

.btn-ghost     { background: transparent; color: var(--text-3); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--text); }

.btn-warning   { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #b45309; }

.btn-sm  { padding: 0.35em 0.75em; font-size: 0.8rem; }
.btn-lg  { padding: 0.75em 1.5em; font-size: 1rem; }
.btn-xl  { padding: 0.9em 2em; font-size: 1.05rem; width: 100%; }
.btn-icon{ padding: 0.5em; border-radius: var(--radius); }

/* ============================================================ BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 0.3em;
  padding: 0.2em 0.65em;
  border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  border: 1px solid transparent; line-height: 1.4; white-space: nowrap;
}
.badge i { font-size: 0.8em; }
.badge-primary { background: var(--primary-light); color: var(--primary); border-color: #bfdbfe; }
.badge-danger  { background: var(--danger-light);  color: var(--danger);  border-color: var(--danger-border); }
.badge-warning { background: var(--warning-light); color: var(--warning); border-color: var(--warning-border); }
.badge-success { background: var(--success-light); color: var(--success); border-color: var(--success-border); }
.badge-info    { background: var(--info-light);    color: var(--info);    border-color: var(--info-border); }
.badge-purple  { background: var(--purple-light);  color: var(--purple);  border-color: var(--purple-border); }
.badge-gray    { background: var(--gray-100);      color: var(--text-3);  border-color: var(--border2); }

.badge-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-success { background: var(--success); }
.dot-warning { background: var(--warning); }
.dot-danger  { background: var(--danger); }
.dot-gray    { background: var(--gray-400); }
.dot-primary { background: var(--primary); }

/* ============================================================ STATUS INDICATORS */
.status-pill {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.25em 0.75em; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.status-activo    { background: var(--success-light); color: var(--success); }
.status-espera    { background: var(--warning-light); color: var(--warning); }
.status-pausa     { background: var(--danger-light);  color: var(--danger); }
.status-finalizado{ background: var(--gray-100);      color: var(--text-3); }

/* ============================================================ FORMS */
.form-group   { margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-2); margin-bottom: 0.35rem;
}
.form-control, .form-select {
  width: 100%; padding: 0.6em 0.875em;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border2); border-radius: var(--radius);
  font-family: var(--font); font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-control::placeholder { color: var(--text-4); }
.form-text { font-size: 0.78rem; color: var(--text-3); margin-top: 0.25rem; }
textarea.form-control { resize: vertical; min-height: 80px; }

.input-code {
  text-align: center; letter-spacing: 0.3em; font-size: 1.4rem !important;
  font-weight: 700; text-transform: uppercase;
}

/* ============================================================ ALERT */
.alert {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 1rem; border-radius: var(--radius);
  border: 1px solid; font-size: 0.875rem; margin-bottom: 1rem;
}
.alert i { font-size: 1.1em; flex-shrink: 0; margin-top: 1px; }
.alert-danger  { background: var(--danger-light);  border-color: var(--danger-border); color: #991b1b; }
.alert-warning { background: var(--warning-light); border-color: var(--warning-border);color: #92400e; }
.alert-info    { background: var(--info-light);    border-color: var(--info-border);   color: #164e63; }
.alert-success { background: var(--success-light); border-color: var(--success-border);color: #14532d; }

/* ============================================================ DIVIDER */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.divider-text {
  display: flex; align-items: center; gap: 0.75rem; color: var(--text-4);
  font-size: 0.8rem; margin: 1rem 0;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; border-top: 1px solid var(--border);
}

/* ============================================================ PULSE */
@keyframes pulse-ring {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22,163,74,0.5); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 6px rgba(22,163,74,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}
.pulse-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); animation: pulse-ring 1.5s infinite;
}

/* ============================================================ NAVBAR */
.navbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 1.5rem; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar-brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 800; font-size: 1.05rem; color: var(--text); text-decoration: none;
}
.navbar-brand .brand-icon {
  width: 32px; height: 32px; background: var(--primary); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.95rem;
}
.navbar-brand .brand-name { color: var(--text); }
.navbar-brand .brand-accent { color: var(--primary); }
.navbar-center { flex: 1; display: flex; justify-content: center; }
.navbar-right  { display: flex; align-items: center; gap: 0.75rem; }

/* Phase tracker in navbar */
.phase-tracker {
  display: flex; align-items: center; gap: 6px;
}
.phase-step {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--gray-100); border: 2px solid var(--border2);
  font-size: 0.7rem; font-weight: 700; color: var(--text-3);
  transition: all 0.2s;
}
.phase-step.done    { background: var(--success); border-color: var(--success); color: #fff; }
.phase-step.active  { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,0.2); }
.phase-connector    { width: 24px; height: 2px; background: var(--border2); }
.phase-connector.done { background: var(--success); }
.phase-label-bar { text-align: center; font-size: 0.72rem; color: var(--text-3); font-weight: 500; margin-top: 2px; }

/* Player chip */
.player-chip {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35em 0.75em; background: var(--gray-50);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.82rem;
}
.player-chip .role-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: #fff; font-weight: 700; flex-shrink: 0;
}
.player-chip .pc-name { font-weight: 600; color: var(--text); }
.player-chip .pc-role { color: var(--text-3); font-size: 0.78rem; }

.game-clock {
  display: flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700;
  color: var(--text-2); background: var(--gray-50);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.3em 0.65em;
}

/* Case badge in navbar */
.case-navbar-badge {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3em 0.75em; border-radius: var(--radius);
  font-size: 0.78rem; font-weight: 700;
}
.case-navbar-badge.type-ransomware  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.case-navbar-badge.type-databreach  { background: var(--purple-light); color: var(--purple); border: 1px solid var(--purple-border); }
.case-navbar-badge.type-ddos        { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning-border); }
.case-navbar-badge.type-bec         { background: var(--info-light); color: var(--info); border: 1px solid var(--info-border); }
.case-navbar-badge.type-insider     { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--border2); }

/* ============================================================ LOBBY PAGE */
.lobby-wrapper { min-height: 100vh; background: var(--bg); }

.lobby-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #2563eb 100%);
  color: #fff; padding: 3rem 1.5rem;
  position: relative; overflow: hidden;
}
.lobby-hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.lobby-hero-inner { max-width: 1100px; margin: 0 auto; position: relative; }
.hero-logo { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.hero-logo-icon {
  width: 56px; height: 56px; background: rgba(255,255,255,0.15);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #fff; border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
}
.hero-logo h1 { font-size: 1.9rem; font-weight: 900; letter-spacing: -0.02em; }
.hero-logo h1 span { opacity: 0.7; font-weight: 400; font-size: 0.85em; display: block; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px; padding: 0.25em 0.85em; font-size: 0.75rem; font-weight: 600;
  color: rgba(255,255,255,0.9); margin-bottom: 0.75rem; backdrop-filter: blur(10px);
}
.hero-desc { font-size: 1rem; opacity: 0.85; max-width: 520px; line-height: 1.6; }

.lobby-features { display: flex; gap: 1.5rem; margin-top: 2rem; flex-wrap: wrap; }
.lobby-feat {
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-lg); padding: 0.6em 1em;
  font-size: 0.83rem; color: rgba(255,255,255,0.9);
}
.lobby-feat i { font-size: 1em; opacity: 0.8; }
.lobby-feat strong { display: block; font-size: 0.95em; }
.lobby-feat span   { font-size: 0.85em; opacity: 0.7; }

.lobby-body { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; display: grid; grid-template-columns: 1fr 400px; gap: 2rem; align-items: start; }

.section-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.casos-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 2rem; }
.caso-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.875rem 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: all 0.15s; cursor: default;
  box-shadow: var(--shadow-xs);
}
.caso-row:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.caso-row-icon {
  width: 40px; height: 40px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.caso-row-icon.t-ransomware  { background: #fef2f2; color: var(--danger); }
.caso-row-icon.t-databreach  { background: var(--purple-light); color: var(--purple); }
.caso-row-icon.t-ddos        { background: var(--warning-light); color: var(--warning); }
.caso-row-icon.t-bec         { background: var(--info-light); color: var(--info); }
.caso-row-icon.t-insider     { background: var(--gray-100); color: var(--gray-700); }
.caso-row-info { flex: 1; }
.caso-row-title { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.caso-row-sub   { font-size: 0.78rem; color: var(--text-3); }
.caso-row-meta  { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }

.roles-grid-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.role-preview-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55em 0.75em; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.82rem; box-shadow: var(--shadow-xs);
}
.role-preview-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; flex-shrink: 0;
}

/* Forms panel */
.lobby-forms { display: flex; flex-direction: column; gap: 0; }
.form-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.5rem;
  box-shadow: var(--shadow-md);
}
.form-panel-header { margin-bottom: 1.25rem; }
.form-panel-header h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.2rem; }
.form-panel-header p { font-size: 0.83rem; color: var(--text-3); }
.panel-divider { padding: 0.75rem 0; text-align: center; color: var(--text-3); font-size: 0.8rem; position: relative; }
.panel-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); z-index: 0; }
.panel-divider span { position: relative; z-index: 1; background: var(--surface); padding: 0 0.75rem; }

.lobby-footer-bar { background: var(--surface); border-top: 1px solid var(--border); padding: 1rem 1.5rem; text-align: center; font-size: 0.78rem; color: var(--text-3); }

/* ============================================================ SALA PAGE */
.sala-page { min-height: 100vh; background: var(--bg); }

.sala-body { display: flex; height: calc(100vh - 56px); overflow: hidden; }

.sala-sidebar {
  width: 280px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); overflow-y: auto;
  display: flex; flex-direction: column;
}
.sala-sidebar-section { padding: 1rem; border-bottom: 1px solid var(--border); }
.sala-sidebar-section h4 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.4rem; }

.player-list { display: flex; flex-direction: column; gap: 0.35rem; }
.player-list-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5em 0.65em; background: var(--gray-50);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.83rem; transition: all 0.15s;
}
.player-list-item.is-me { border-color: var(--primary); background: var(--primary-light); }
.player-list-item .pli-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; flex-shrink: 0; color: #fff;
}
.player-list-item .pli-info { flex: 1; }
.player-list-item .pli-name { font-weight: 600; display: block; color: var(--text); }
.player-list-item .pli-role { font-size: 0.75rem; color: var(--text-3); }

.steps-list { counter-reset: steps; display: flex; flex-direction: column; gap: 0.5rem; }
.step-item {
  display: flex; gap: 0.6rem; align-items: flex-start;
  font-size: 0.82rem; color: var(--text-2);
}
.step-item::before {
  counter-increment: steps; content: counter(steps);
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; margin-top: 1px;
}

.sala-main { flex: 1; overflow-y: auto; padding: 1.5rem; }

/* Case selector */
.casos-selector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.caso-select-card {
  display: block; cursor: pointer; position: relative;
  border: 2px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); transition: all 0.15s; overflow: hidden;
}
.caso-select-card input[type=radio] { position: absolute; opacity: 0; }
.caso-select-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.caso-select-card.is-selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.caso-card-inner { padding: 1rem; }
.caso-type-stripe { height: 4px; width: 100%; }
.t-ransomware-stripe { background: linear-gradient(90deg, var(--danger), #f87171); }
.t-databreach-stripe { background: linear-gradient(90deg, var(--purple), #a78bfa); }
.t-ddos-stripe       { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.t-bec-stripe        { background: linear-gradient(90deg, var(--info), #38bdf8); }
.t-insider-stripe    { background: linear-gradient(90deg, var(--gray-600), var(--gray-400)); }
.caso-card-type { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 0.4rem; }
.caso-card-title { font-size: 0.9rem; font-weight: 800; color: var(--text); margin-bottom: 0.25rem; }
.caso-card-sub   { font-size: 0.75rem; color: var(--text-3); line-height: 1.4; margin-bottom: 0.5rem; }
.caso-card-meta  { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.dif-pill { font-size: 0.65rem; font-weight: 700; padding: 0.15em 0.5em; border-radius: 999px; }
.dif-basico    { background: var(--success-light); color: var(--success); }
.dif-intermedio{ background: var(--warning-light); color: var(--warning); }
.dif-avanzado  { background: var(--danger-light);  color: var(--danger); }

.caso-briefing-card { background: var(--gray-50); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin: 0.75rem 0 1rem; }
.caso-briefing-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text); }
.caso-briefing-text { font-size: 0.85rem; color: var(--text-2); line-height: 1.7; margin-bottom: 0.75rem; }
.caso-briefing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.caso-briefing-grid label { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); margin-bottom: 0.25rem; }
.caso-briefing-grid p { font-size: 0.8rem; color: var(--text-2); line-height: 1.5; }

.start-section { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.start-notice { font-size: 0.82rem; color: var(--text-3); display: flex; align-items: center; gap: 0.4rem; }

/* Role cards grid */
.roles-selector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 0.75rem; }
.role-select-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem;
  transition: all 0.2s; position: relative;
  box-shadow: var(--shadow-xs);
}
.role-select-card:hover:not(.is-taken) { border-color: var(--gray-300); box-shadow: var(--shadow-sm); }
.role-select-card.is-selected { border-color: var(--rc-color, var(--primary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc-color, var(--primary)) 15%, transparent); }
.role-select-card.is-taken { opacity: 0.55; }
.role-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.6rem; }
.role-icon-big {
  width: 44px; height: 44px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; color: #fff;
  background: var(--rc-color, var(--primary));
}
.role-card-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.role-card-name { font-size: 0.92rem; font-weight: 700; color: var(--text); margin-bottom: 0.2rem; }
.role-card-desc { font-size: 0.78rem; color: var(--text-3); line-height: 1.5; margin-bottom: 0.6rem; }
.role-card-resp-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-4); margin-bottom: 0.2rem; }
.role-card-resp-text  { font-size: 0.75rem; color: var(--text-3); line-height: 1.5; margin-bottom: 0.75rem; }
.role-card-action { margin-top: auto; }

.espera-banner {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; background: var(--info-light);
  border: 1px solid var(--info-border); border-radius: var(--radius-lg); margin-bottom: 1.5rem;
}
.espera-banner-icon { font-size: 1.5rem; color: var(--info); flex-shrink: 0; }
.espera-banner h4 { font-size: 0.9rem; font-weight: 700; color: var(--info); margin-bottom: 0.15rem; }
.espera-banner p  { font-size: 0.82rem; color: #164e63; }

/* ============================================================ GAME PAGE */
.game-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }

.game-layout { display: grid; grid-template-columns: 230px 1fr 290px; flex: 1; overflow: hidden; height: calc(100vh - 56px); }

.game-sidebar { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; }
.game-sidebar-right { border-right: none; border-left: 1px solid var(--border); }

.gs-section { padding: 0.875rem; border-bottom: 1px solid var(--border); }
.gs-section-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.4rem; }

/* Timeline */
.tl-list { display: flex; flex-direction: column; position: relative; }
.tl-item { display: flex; gap: 0.65rem; padding: 0.4em 0; position: relative; align-items: flex-start; }
.tl-item:not(:last-child)::after { content: ''; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--border2); }
.tl-item.done::after  { background: var(--success); }
.tl-node {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; transition: all 0.2s;
}
.tl-node-pending { background: var(--gray-100); border: 2px solid var(--border2); color: var(--text-3); }
.tl-node-active  { background: var(--primary); border: 2px solid var(--primary); color: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,0.2); }
.tl-node-done    { background: var(--success); border: 2px solid var(--success); color: #fff; }
.tl-node i       { font-size: 0.7rem; }
.tl-info { flex: 1; }
.tl-time  { font-size: 0.68rem; color: var(--text-3); font-weight: 500; }
.tl-title { font-size: 0.78rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.tl-item:not(.active-phase):not(.done-phase) .tl-title { color: var(--text-3); font-weight: 500; }

/* Online players */
.online-list { display: flex; flex-direction: column; gap: 0.3rem; }
.online-item {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; padding: 0.3em 0;
}
.online-item .oi-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: #fff; flex-shrink: 0;
}
.online-item .oi-name { font-weight: 600; flex: 1; color: var(--text); }
.online-item.is-me .oi-name { color: var(--primary); }

.context-block { font-size: 0.78rem; color: var(--text-3); line-height: 1.6; padding: 0.5em 0.75em; background: var(--gray-50); border-radius: var(--radius); border: 1px solid var(--border); }

/* MAIN GAME AREA */
.game-main { overflow-y: auto; padding: 1.25rem; background: var(--bg); }

.phase-narrative {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1rem;
  box-shadow: var(--shadow-xs);
}
.narrative-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.narrative-time {
  display: flex; align-items: center; gap: 0.35rem;
  background: var(--warning-light); color: var(--warning);
  border: 1px solid var(--warning-border); border-radius: var(--radius);
  padding: 0.25em 0.65em; font-size: 0.75rem; font-weight: 700; white-space: nowrap;
}
.narrative-header h2 { font-size: 1rem; font-weight: 700; color: var(--text); }
.narrative-text { font-size: 0.875rem; color: var(--text-2); line-height: 1.7; }

/* Inject section */
.section-heading {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-3);
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem;
}
.injects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }

.inject-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-xs); animation: inject-in 0.35s ease;
}
@keyframes inject-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.inject-card-stripe { height: 3px; }
.inject-card-body { padding: 0.875rem; }
.inject-type-label {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.2em 0.6em; border-radius: 999px; border: 1px solid; margin-bottom: 0.5rem;
}
.inject-title { font-size: 0.88rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem; line-height: 1.3; }
.inject-body { font-size: 0.8rem; color: var(--text-2); line-height: 1.6; white-space: pre-wrap; }

/* Inject type styles */
.it-alerta_critica .inject-card-stripe { background: var(--danger); }
.it-alerta_critica .inject-type-label  { background: var(--danger-light); color: var(--danger); border-color: var(--danger-border); }
.it-alerta_critica { border-color: #fecaca; }

.it-alerta .inject-card-stripe { background: var(--warning); }
.it-alerta .inject-type-label  { background: var(--warning-light); color: var(--warning); border-color: var(--warning-border); }
.it-alerta { border-color: var(--warning-border); }

.it-noticia .inject-card-stripe { background: var(--primary); }
.it-noticia .inject-type-label  { background: var(--primary-light); color: var(--primary); border-color: #bfdbfe; }

.it-correo .inject-card-stripe { background: var(--purple); }
.it-correo .inject-type-label  { background: var(--purple-light); color: var(--purple); border-color: var(--purple-border); }
.it-correo .inject-body { font-family: var(--font-mono); font-size: 0.75rem; background: var(--gray-50); padding: 0.6em; border-radius: var(--radius); border: 1px solid var(--border); }

.it-llamada .inject-card-stripe { background: var(--success); }
.it-llamada .inject-type-label  { background: var(--success-light); color: var(--success); border-color: var(--success-border); }

.it-tweet .inject-card-stripe { background: var(--info); }
.it-tweet .inject-type-label  { background: var(--info-light); color: var(--info); border-color: var(--info-border); }

.it-evidencia .inject-card-stripe { background: var(--amber); }
.it-evidencia .inject-type-label  { background: var(--amber-light); color: var(--amber); border-color: var(--warning-border); }

.it-sistema .inject-card-stripe { background: var(--gray-500); }
.it-sistema .inject-type-label  { background: var(--gray-100); color: var(--gray-600); border-color: var(--border2); }

/* Clues */
.clues-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.65rem; margin-bottom: 1rem; }
.clue-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0.875rem;
  box-shadow: var(--shadow-xs); animation: inject-in 0.3s ease;
}
.clue-card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.clue-type-icon {
  width: 28px; height: 28px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 0.78rem;
}
.ct-tecnica       { background: var(--primary-light); color: var(--primary); }
.ct-legal         { background: var(--danger-light);  color: var(--danger); }
.ct-financiera    { background: var(--success-light); color: var(--success); }
.ct-comunicacion  { background: var(--warning-light); color: var(--warning); }
.ct-forense       { background: var(--purple-light);  color: var(--purple); }
.ct-inteligencia  { background: var(--info-light);    color: var(--info); }
.clue-type-label  { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); }
.clue-title       { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 0.3rem; }
.clue-text        { font-size: 0.78rem; color: var(--text-2); line-height: 1.6; }

/* Decision */
.decision-panel {
  background: var(--surface); border: 2px solid var(--primary);
  border-radius: var(--radius-xl); padding: 1.25rem; margin-bottom: 1rem;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.08), var(--shadow-sm);
}
.decision-panel-header {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem;
  padding-bottom: 0.875rem; border-bottom: 1px solid var(--border);
}
.decision-panel-header .dp-icon {
  width: 36px; height: 36px; background: var(--primary-light);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1.1rem;
}
.decision-panel-header h3 { font-size: 0.95rem; font-weight: 800; color: var(--primary); }
.decision-panel-header p  { font-size: 0.78rem; color: var(--text-3); }

.rol-guide-box {
  border-radius: var(--radius-lg); border: 1px solid; overflow: hidden; margin-bottom: 0.875rem;
}
.rol-guide-header {
  padding: 0.5em 0.875em; font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; gap: 0.5rem;
}
.rol-guide-body { padding: 0.75em 0.875em; }
.rol-guide-q { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 0.3rem; }
.rol-guide-c { font-size: 0.8rem; color: var(--text-2); line-height: 1.6; }

.decision-context { font-size: 0.83rem; color: var(--text-2); line-height: 1.6; margin-bottom: 0.5rem; padding: 0.75em 1em; background: var(--gray-50); border-radius: var(--radius); border: 1px solid var(--border); }
.decision-question { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; line-height: 1.4; }

.options-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.option-label {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875em 1em; background: var(--surface);
  border: 2px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: all 0.15s;
}
.option-label:hover { border-color: var(--primary); background: var(--primary-light); }
.option-label:has(input:checked) { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.option-label input { margin-top: 3px; accent-color: var(--primary); flex-shrink: 0; width: 16px; height: 16px; }
.option-letter {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--gray-200); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; transition: all 0.15s;
}
.option-label:has(input:checked) .option-letter { background: var(--primary); color: #fff; }
.option-text { font-size: 0.85rem; color: var(--text); line-height: 1.5; flex: 1; }

.answered-box { margin-bottom: 0.75rem; }
.my-answer {
  border-radius: var(--radius-lg); padding: 0.875em 1em; border: 2px solid; margin-bottom: 0.5rem;
}
.my-answer.is-optimal   { border-color: var(--success-border); background: var(--success-light); }
.my-answer.is-suboptimal{ border-color: var(--warning-border); background: var(--warning-light); }
.answer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; font-size: 0.8rem; font-weight: 700; }
.answer-header .pts-pill { background: var(--success); color: #fff; padding: 0.15em 0.55em; border-radius: 999px; font-size: 0.78em; }
.answer-text { font-size: 0.85rem; color: var(--text-2); line-height: 1.5; }
.waiting-others { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-3); padding: 0.5em; }
.team-answers-reveal { margin-top: 0.75rem; }
.team-answers-reveal h4 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); margin-bottom: 0.5rem; }
.team-answer-item {
  display: flex; flex-direction: column; gap: 0.3rem; padding: 0.65em 0.875em;
  background: var(--gray-50); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 0.4rem;
}
.tai-header { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.tai-role { font-weight: 700; flex: 1; }
.tai-pts { font-size: 0.78em; background: var(--success-light); color: var(--success); padding: 0.1em 0.45em; border-radius: 999px; font-weight: 700; }
.tai-text { font-size: 0.8rem; color: var(--text-2); }
.tai-explain { font-size: 0.75rem; color: var(--success); padding-top: 0.3rem; border-top: 1px solid var(--border); line-height: 1.5; }
.team-answer-item.opt-yes { border-color: var(--success-border); }

.no-decision-msg {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); font-size: 0.85rem; color: var(--text-3); margin-bottom: 1rem;
}
.no-role-msg {
  padding: 0.875em; background: var(--warning-light); border: 1px solid var(--warning-border);
  border-radius: var(--radius-lg); font-size: 0.85rem; color: #92400e;
  display: flex; align-items: center; gap: 0.5rem;
}

/* CHAT */
.chat-panel { display: flex; flex-direction: column; height: 50%; border-bottom: 1px solid var(--border); }
.chat-header-bar {
  padding: 0.65em 0.875em; font-size: 0.78rem; font-weight: 700;
  color: var(--text-2); border-bottom: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; gap: 0.4rem; background: var(--gray-50);
}
.chat-msgs { flex: 1; overflow-y: auto; padding: 0.5rem 0.75rem; display: flex; flex-direction: column; gap: 0.4rem; }
.chat-msg { }
.chat-msg.from-me { display: flex; flex-direction: column; align-items: flex-end; }
.msg-sender { font-size: 0.7rem; font-weight: 600; color: var(--text-3); margin-bottom: 0.1rem; }
.msg-bubble {
  background: var(--gray-100); color: var(--text);
  padding: 0.4em 0.7em; border-radius: 10px; font-size: 0.82rem;
  max-width: 85%; line-height: 1.4;
}
.chat-msg.from-me .msg-bubble { background: var(--primary); color: #fff; border-radius: 10px 10px 2px 10px; }
.msg-system { text-align: center; font-size: 0.73rem; color: var(--text-3); padding: 0.25em 0.5em; background: var(--gray-50); border-radius: 999px; border: 1px solid var(--border); margin: 0.15rem auto; max-width: 90%; }
.chat-input-area { display: flex; gap: 0.35rem; padding: 0.5rem 0.65rem; border-top: 1px solid var(--border); flex-shrink: 0; }
.chat-input-area input { flex: 1; background: var(--gray-50); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 0.45em 0.875em; font-size: 0.82rem; font-family: var(--font); }
.chat-input-area input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.btn-send { background: var(--primary); color: #fff; border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; transition: all 0.15s; }
.btn-send:hover { background: var(--primary-hover); }

/* Role card mini */
.role-mini-card {
  padding: 0.875rem; border-bottom: 1px solid var(--border);
}
.rmc-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.rmc-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; color: #fff; flex-shrink: 0;
}
.rmc-name { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.rmc-tag  { font-size: 0.7rem; color: var(--text-3); }
.rmc-resp { font-size: 0.75rem; color: var(--text-3); line-height: 1.5; }

/* Clues request list */
.clues-request { padding: 0.875rem; }
.clues-request h4 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 0.5rem; }
.clue-req-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45em 0; border-bottom: 1px solid var(--border); font-size: 0.8rem;
}
.clue-req-item.revealed { opacity: 0.55; }
.clue-req-icon { font-size: 0.9em; flex-shrink: 0; }
.clue-req-title { flex: 1; font-weight: 500; color: var(--text); }
.clue-req-type { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-4); }

/* Phase notification */
.phase-notif {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff;
  padding: 0.75em 1.5em; border-radius: var(--radius-xl);
  font-size: 0.9rem; font-weight: 700;
  box-shadow: var(--shadow-lg); z-index: 999;
  animation: notif-in 0.3s ease;
  display: flex; align-items: center; gap: 0.5rem;
}
@keyframes notif-in { from { opacity:0; transform: translateX(-50%) translateY(16px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

/* ============================================================ FACILITATOR PAGE */
.fac-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }

.fac-topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 1.25rem; height: 56px; display: flex; align-items: center; gap: 1rem; flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.fac-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 0.95rem; }
.fac-brand .fac-brand-icon { width: 30px; height: 30px; background: var(--purple); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.85rem; }
.fac-info { flex: 1; display: flex; align-items: center; gap: 1.25rem; }
.fac-info-item { font-size: 0.82rem; }
.fac-info-label { color: var(--text-3); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; display: block; }
.fac-info-val   { font-weight: 700; color: var(--text); }
.fac-info-val.code { font-family: var(--font-mono); color: var(--primary); letter-spacing: 0.1em; font-size: 1.05em; }
.fac-controls { display: flex; align-items: center; gap: 0.5rem; }

.fac-body { display: grid; grid-template-columns: 1fr 1fr 300px; flex: 1; overflow: hidden; }
.fac-col { overflow-y: auto; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 0; }
.fac-col:last-child { border-right: none; }
.fac-panel { background: var(--surface); border-bottom: 1px solid var(--border); }
.fac-panel-header { padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: var(--gray-50); }
.fac-panel-header h3 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); display: flex; align-items: center; gap: 0.4rem; }
.fac-panel-body { padding: 0.875rem 1rem; }

.fac-players-list { display: flex; flex-direction: column; gap: 0.4rem; }
.fac-player-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.5em 0.65em; background: var(--gray-50); border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.83rem; }
.fac-player-row .fpr-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.73rem; color: #fff; flex-shrink: 0; }
.fac-player-row .fpr-info { flex: 1; }
.fac-player-row .fpr-name { font-weight: 700; color: var(--text); }
.fac-player-row .fpr-role { font-size: 0.75rem; color: var(--text-3); }
.pts-chip { background: var(--purple-light); color: var(--purple); border: 1px solid var(--purple-border); padding: 0.15em 0.55em; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }

/* Decision overview in facilitator */
.decision-question-prev { font-size: 0.85rem; font-weight: 700; color: var(--primary); margin-bottom: 0.875rem; line-height: 1.4; padding: 0.75em; background: var(--primary-light); border-radius: var(--radius); border: 1px solid #bfdbfe; }
.options-overview { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.875rem; }
.opt-overview-row {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6em 0.75em;
  background: var(--surface);
}
.opt-overview-row.is-optimal { border-color: var(--success-border); background: var(--success-light); }
.opt-overview-info { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; font-size: 0.8rem; }
.opt-check { color: var(--success); }
.opt-text-sm { flex: 1; color: var(--text-2); }
.opt-pts  { font-size: 0.75rem; background: var(--success-light); color: var(--success); padding: 0.1em 0.45em; border-radius: 999px; font-weight: 700; }
.opt-bar-row { display: flex; align-items: center; gap: 0.5rem; }
.opt-bar-wrap { flex: 1; height: 6px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.opt-bar-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.4s ease; min-width: 3px; }
.opt-bar-fill.is-optimal { background: var(--success); }
.opt-count { font-size: 0.7rem; color: var(--text-3); white-space: nowrap; min-width: 40px; text-align: right; }

.individual-answers { margin-top: 0.75rem; }
.ia-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 0.4rem; }
.ia-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.35em 0; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.ia-row .ia-role { display: flex; align-items: center; gap: 0.35rem; min-width: 140px; }
.ia-row .ia-role-icon { font-size: 0.85rem; }
.ia-row .ia-text { flex: 1; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ia-row .ia-pts { background: var(--success-light); color: var(--success); padding: 0.1em 0.4em; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.ia-row.ia-optimal { color: var(--success); }

/* Fases progress */
.phases-progress { display: flex; flex-direction: column; gap: 0.4rem; }
.phase-prog-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55em 0.65em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 0.82rem; }
.phase-prog-row.is-current { border-color: var(--primary); background: var(--primary-light); }
.phase-prog-row.is-done    { border-color: var(--success-border); opacity: 0.7; }
.phase-num { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800; flex-shrink: 0; background: var(--gray-100); color: var(--text-3); border: 2px solid var(--border2); }
.phase-prog-row.is-current .phase-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.phase-prog-row.is-done    .phase-num { background: var(--success); border-color: var(--success); color: #fff; }
.phase-prog-row .pp-info { flex: 1; }
.phase-prog-row .pp-title { font-weight: 600; color: var(--text); }
.phase-prog-row .pp-time  { font-size: 0.72rem; color: var(--text-3); }

/* Clues management */
.clue-manage-list { display: flex; flex-direction: column; gap: 0.4rem; }
.clue-manage-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5em 0.65em; background: var(--gray-50);
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.82rem;
}
.clue-manage-row.is-revealed { opacity: 0.55; }
.clue-manage-icon { width: 26px; height: 26px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; flex-shrink: 0; }
.clue-manage-info { flex: 1; }
.clue-manage-title { font-weight: 600; color: var(--text); display: block; }
.clue-manage-type  { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-4); }

/* Custom inject form */
.inject-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.inject-form-grid .span-2 { grid-column: 1 / -1; }

/* Fac chat */
.fac-chat-panel { display: flex; flex-direction: column; height: 100%; }
.fac-chat-msgs { flex: 1; overflow-y: auto; padding: 0.5rem 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; }

/* ============================================================ RESULTADO PAGE */
.resultado-page { background: var(--bg); min-height: 100vh; }
.resultado-body { max-width: 920px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.resultado-hero { text-align: center; padding: 2.5rem 1rem 2rem; margin-bottom: 2rem; }
.resultado-type-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4em 1em; border-radius: 999px; font-size: 0.75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.875rem;
}
.resultado-hero h1 { font-size: 2.1rem; font-weight: 900; letter-spacing: -0.02em; color: var(--text); margin-bottom: 0.35rem; }
.resultado-hero .hero-sub { font-size: 1rem; color: var(--text-3); margin-bottom: 1rem; }
.resultado-meta { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.resultado-meta .meta-item { display: flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: var(--text-3); }

.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 2rem; }

.score-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.score-card-inner { display: flex; align-items: center; gap: 1.5rem; }
.score-donut { position: relative; width: 90px; height: 90px; flex-shrink: 0; }
.score-donut svg { width: 90px; height: 90px; transform: rotate(-90deg); }
.score-donut circle { fill: none; stroke-width: 8; }
.score-donut .track { stroke: var(--gray-100); }
.score-donut .progress { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.score-donut.clasif-experto .progress { stroke: var(--success); }
.score-donut.clasif-bueno   .progress { stroke: var(--primary); }
.score-donut.clasif-medio   .progress { stroke: var(--warning); }
.score-donut.clasif-bajo    .progress { stroke: var(--danger); }
.score-donut-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-donut-pct { font-size: 1.3rem; font-weight: 900; color: var(--text); line-height: 1; }
.score-donut-sub { font-size: 0.6rem; color: var(--text-3); margin-top: 2px; }
.score-info h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.2rem; }
.clasif-experto { color: var(--success); }
.clasif-bueno   { color: var(--primary); }
.clasif-medio   { color: var(--warning); }
.clasif-bajo    { color: var(--danger); }
.score-desc { font-size: 0.82rem; color: var(--text-3); margin-bottom: 0.75rem; line-height: 1.5; }
.pts-display { display: flex; align-items: baseline; gap: 0.35rem; }
.pts-big { font-size: 1.6rem; font-weight: 900; color: var(--text); line-height: 1; }
.pts-of  { font-size: 0.85rem; color: var(--text-3); }
.pts-role { font-size: 0.78rem; color: var(--text-3); margin-left: 0.25rem; }

.ranking-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.ranking-card h3 { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.875rem; display: flex; align-items: center; gap: 0.4rem; }
.ranking-list { display: flex; flex-direction: column; gap: 0.45rem; }
.ranking-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.45em 0.65em; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.83rem; background: var(--gray-50);
}
.ranking-row.is-me { background: var(--primary-light); border-color: #bfdbfe; }
.rank-pos { width: 28px; text-align: center; font-size: 1em; flex-shrink: 0; }
.rank-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; color: #fff; flex-shrink: 0; }
.rank-info { flex: 1; }
.rank-name { font-weight: 700; color: var(--text); display: block; }
.rank-role { font-size: 0.75rem; color: var(--text-3); }
.rank-bar-wrap { width: 70px; height: 6px; background: var(--gray-200); border-radius: 999px; overflow: hidden; }
.rank-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--purple)); }
.rank-pts { font-weight: 800; color: var(--text); min-width: 48px; text-align: right; }

/* Decision analysis */
.analisis-section h2 { font-size: 1.15rem; font-weight: 800; color: var(--text); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.analisis-intro { font-size: 0.85rem; color: var(--text-3); margin-bottom: 1.5rem; line-height: 1.7; padding: 0.75em 1em; background: var(--gray-50); border-radius: var(--radius); border: 1px solid var(--border); }

.dec-analysis-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); margin-bottom: 1rem; overflow: hidden; box-shadow: var(--shadow-xs); }
.dac-header { padding: 1rem 1.25rem; background: var(--gray-50); border-bottom: 1px solid var(--border); }
.dac-phase-tag { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.35rem; }
.dac-header h3 { font-size: 0.95rem; font-weight: 800; color: var(--text); }
.dac-body { padding: 1.25rem; }
.dac-question { background: var(--gray-50); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75em 1em; margin-bottom: 0.875rem; }
.dac-question label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); display: block; margin-bottom: 0.25rem; }
.dac-question p { font-size: 0.85rem; color: var(--text); line-height: 1.5; }

.dac-my-answer { border-radius: var(--radius-lg); padding: 0.875em 1em; border: 2px solid; margin-bottom: 0.65rem; }
.dac-my-answer.was-optimal     { border-color: var(--success-border); background: var(--success-light); }
.dac-my-answer.was-suboptimal  { border-color: var(--warning-border); background: var(--warning-light); }
.dac-answer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; font-size: 0.78rem; font-weight: 700; }
.dac-pts-chip { background: var(--surface); border: 1px solid var(--border); padding: 0.15em 0.55em; border-radius: 999px; font-weight: 700; }
.dac-answer-text { font-size: 0.85rem; color: var(--text-2); line-height: 1.5; margin-bottom: 0.4rem; }
.dac-explanation { font-size: 0.8rem; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 0.4rem; line-height: 1.6; }
.dac-optimal-answer { border-radius: var(--radius-lg); padding: 0.875em 1em; border: 2px solid var(--success-border); background: var(--success-light); margin-bottom: 0.65rem; }

.dac-team summary { cursor: pointer; font-size: 0.8rem; color: var(--primary); font-weight: 600; padding: 0.3em 0; user-select: none; display: flex; align-items: center; gap: 0.4rem; }
.dac-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.5rem; margin-top: 0.5rem; }
.dac-team-card { background: var(--gray-50); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.65em 0.75em; }
.dac-team-card.was-optimal { border-color: var(--success-border); background: var(--success-light); }
.dtc-who { font-size: 0.78rem; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.25rem; }
.dtc-text { font-size: 0.78rem; color: var(--text-3); line-height: 1.4; }
.dtc-pts { display: inline-block; font-size: 0.72rem; background: var(--success-light); color: var(--success); padding: 0.1em 0.4em; border-radius: 999px; margin-top: 0.25rem; font-weight: 700; }

/* Lessons */
.lecciones-section h2 { font-size: 1.15rem; font-weight: 800; color: var(--text); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.lecciones-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }
.leccion-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 1.1rem; box-shadow: var(--shadow-xs); }
.leccion-icon-box { width: 40px; height: 40px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 1rem; margin-bottom: 0.6rem; }
.leccion-card h4 { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 0.35rem; }
.leccion-card p { font-size: 0.8rem; color: var(--text-3); line-height: 1.6; }

.resultado-footer { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 0 0; border-top: 1px solid var(--border); margin-top: 2.5rem; }
.resultado-footer p { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.resultado-footer .text-muted { font-size: 0.78rem; }

/* ============================================================ SCROLLBARS */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--gray-50); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================================================ RESPONSIVE */
@media (max-width: 1024px) {
  .lobby-body { grid-template-columns: 1fr; }
  .game-layout { grid-template-columns: 1fr; height: auto; }
  .fac-body { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr; }
}
