/* ============ DESIGN TOKENS ============ */
:root {
  --bg: #0d0d12;
  --bg-surface: #13131a;
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --glass-hover: rgba(255,255,255,0.08);
  --blur: blur(20px);
  --primary: #a855f7;
  --secondary: #06b6d4;
  --accent: #f472b6;
  --gradient: linear-gradient(135deg, var(--secondary), var(--primary), var(--accent));
  --text: #f0f0f5;
  --text-muted: rgba(255,255,255,0.5);
  --text-dim: rgba(255,255,255,0.3);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Poppins', -apple-system, sans-serif;
}

/* ============ RESET ============ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;-webkit-text-size-adjust:100%}
body{font-family:var(--font);background:var(--bg);color:var(--text);min-height:100vh;overflow-x:hidden;line-height:1.5}
a{color:var(--secondary);text-decoration:none}
ul{list-style:none}
button{font-family:var(--font);cursor:pointer;border:none;background:none;color:var(--text)}
input{font-family:var(--font);color:var(--text);background:transparent;border:none;outline:none}

/* ============ SCREENS ============ */
.screen{display:none;min-height:100vh}
.screen.active{display:flex;flex-direction:column;align-items:center;justify-content:center}
.container{width:100%;max-width:640px;padding:24px 20px}

/* ============ LOBBY ============ */
.logo-area{text-align:center;margin-bottom:20px}
.logo{height:40px}
.title{text-align:center;font-size:1.8rem;font-weight:700;background:var(--gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;margin-bottom:8px}
.subtitle{text-align:center;color:var(--text-muted);font-size:0.95rem;margin-bottom:32px}
.scenario-list{display:flex;flex-direction:column;gap:12px}
.scenario-card{background:var(--glass);backdrop-filter:var(--blur);border:1px solid var(--glass-border);border-radius:var(--radius);padding:20px;cursor:pointer;transition:all .2s}
.scenario-card:hover{background:var(--glass-hover);border-color:var(--primary);transform:translateY(-2px)}
.scenario-card h3{font-size:1.05rem;font-weight:600;margin-bottom:6px}
.scenario-card p{font-size:0.85rem;color:var(--text-muted)}
.scenario-card .persona-tag{display:inline-block;background:rgba(168,85,247,0.15);color:var(--primary);padding:2px 10px;border-radius:20px;font-size:0.75rem;margin-top:8px}
.footer-tag{text-align:center;color:var(--text-dim);font-size:0.7rem;margin-top:32px}

/* ============ BRIEFING ============ */
.glass-card{background:var(--glass);backdrop-filter:var(--blur);border:1px solid var(--glass-border);border-radius:var(--radius);padding:24px}
.briefing-card{display:flex;flex-direction:column;gap:20px}
.briefing-badge{display:inline-block;background:rgba(6,182,212,0.15);color:var(--secondary);padding:4px 14px;border-radius:20px;font-size:0.8rem;font-weight:500;align-self:flex-start}
.briefing-card h2{font-size:1.3rem;font-weight:600}
.briefing-desc{color:var(--text-muted);font-size:0.9rem;line-height:1.6}
.persona-card{display:flex;align-items:center;gap:14px;background:rgba(255,255,255,0.03);border:1px solid var(--glass-border);border-radius:var(--radius-sm);padding:14px}
.persona-avatar{width:50px;height:50px;border-radius:50%;background:var(--gradient);display:flex;align-items:center;justify-content:center;font-size:1.5rem}
.persona-name{font-weight:600;font-size:1rem;display:block}
.persona-role{color:var(--text-muted);font-size:0.8rem}
.briefing-steps{display:flex;flex-wrap:wrap;gap:8px}
.step-chip{background:rgba(255,255,255,0.05);border:1px solid var(--glass-border);border-radius:20px;padding:4px 12px;font-size:0.75rem;color:var(--text-muted)}
.mode-toggle-area{display:flex;flex-direction:column;gap:8px}
.mode-label{font-size:0.85rem;color:var(--text-muted)}
.toggle-switch{display:flex;background:rgba(255,255,255,0.05);border-radius:var(--radius-sm);overflow:hidden;border:1px solid var(--glass-border)}
.toggle-btn{flex:1;padding:10px 16px;font-size:0.85rem;font-weight:500;transition:all .2s;text-align:center}
.toggle-btn.active{background:var(--primary);color:#fff}
.toggle-sm .toggle-btn{padding:6px 10px;font-size:0.75rem}
.btn-primary{background:var(--gradient);color:#fff;padding:14px 28px;border-radius:var(--radius-sm);font-size:1rem;font-weight:600;text-align:center;transition:all .2s;width:100%}
.btn-primary:hover{opacity:0.9;transform:translateY(-1px)}
.btn-secondary{background:var(--glass);border:1px solid var(--glass-border);color:var(--text);padding:14px 28px;border-radius:var(--radius-sm);font-size:1rem;font-weight:500;text-align:center}
.btn-lg{padding:16px 32px;font-size:1.05rem}
.btn-sm{padding:6px 14px;font-size:0.8rem;border-radius:8px}
.btn-danger{background:rgba(248,113,113,0.15);color:var(--danger);border:1px solid rgba(248,113,113,0.2)}

/* ============ SIMULATION ============ */
#screen-sim.active{justify-content:flex-start}
.sim-layout{width:100%;height:100vh;display:flex;flex-direction:column}
.sim-header{display:flex;justify-content:space-between;align-items:center;padding:12px 20px;background:var(--bg-surface);border-bottom:1px solid var(--glass-border)}
.sim-header-left,.sim-header-right{display:flex;align-items:center;gap:10px}
.persona-chip{background:rgba(168,85,247,0.15);color:var(--primary);padding:4px 12px;border-radius:20px;font-size:0.8rem;font-weight:500}
.status-dot{width:8px;height:8px;border-radius:50%;background:var(--text-dim);transition:background .3s}
.status-dot.listening{background:var(--success);box-shadow:0 0 8px var(--success)}
.status-dot.thinking{background:var(--warning);animation:pulse 1s infinite}
.status-dot.speaking{background:var(--primary);animation:pulse 0.6s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.4}}
.status-text{font-size:0.75rem;color:var(--text-muted)}

/* Orb area */
.orb-area{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;min-height:0}
.orb-container{position:relative;display:flex;flex-direction:column;align-items:center;gap:16px}
#orb-canvas{border-radius:50%}
.orb-label{font-size:0.85rem;color:var(--text-muted);font-weight:500}
.subtitles{position:absolute;bottom:40px;left:20px;right:20px;text-align:center;font-size:1rem;color:var(--text);opacity:0;transition:opacity .3s;line-height:1.5;text-shadow:0 2px 8px rgba(0,0,0,0.8)}
.subtitles.visible{opacity:1}

/* Chat area */
.chat-area{flex:1;overflow-y:auto;padding:16px 20px;display:none;flex-direction:column;gap:12px}
.chat-area.visible{display:flex}
.chat-messages{display:flex;flex-direction:column;gap:10px}
.msg{max-width:80%;padding:12px 16px;border-radius:var(--radius-sm);font-size:0.9rem;line-height:1.5;animation:msgIn .3s ease}
@keyframes msgIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.msg.participant{align-self:flex-end;background:var(--primary);color:#fff;border-bottom-right-radius:4px}
.msg.persona{align-self:flex-start;background:var(--glass);border:1px solid var(--glass-border);border-bottom-left-radius:4px}
.msg .msg-name{font-size:0.7rem;color:var(--text-muted);margin-bottom:4px;font-weight:500}

/* Input area */
.input-area{padding:16px 20px;background:var(--bg-surface);border-top:1px solid var(--glass-border)}
.voice-input{display:flex;flex-direction:column;align-items:center;gap:8px}
.vad-indicator{display:flex;align-items:center;gap:10px;padding:10px 20px;background:var(--glass);border:1px solid var(--glass-border);border-radius:24px}
.vad-dot{width:10px;height:10px;border-radius:50%;background:var(--success);box-shadow:0 0 8px var(--success);animation:vad-pulse 2s infinite}
.vad-dot.speaking{background:var(--primary);box-shadow:0 0 12px var(--primary);animation:vad-pulse .4s infinite}
.vad-dot.paused{background:var(--text-dim);box-shadow:none;animation:none}
@keyframes vad-pulse{0%,100%{opacity:1}50%{opacity:0.5}}
.vad-label{font-size:0.8rem;color:var(--text-muted)}
.text-input{display:flex;gap:10px;align-items:center}
.text-input input{flex:1;background:var(--glass);border:1px solid var(--glass-border);border-radius:var(--radius-sm);padding:14px 16px;font-size:0.95rem}
.text-input input:focus{border-color:var(--primary)}
.btn-send{width:48px;height:48px;border-radius:50%;background:var(--gradient);display:flex;align-items:center;justify-content:center;font-size:1.2rem}
.hidden{display:none!important}

/* ============ REPORT ============ */
#screen-report.active{justify-content:flex-start;overflow-y:auto}
.report-container{max-width:700px;padding-top:40px;padding-bottom:40px}
.report-header{text-align:center;margin-bottom:32px}
.report-header h1{font-size:1.5rem;font-weight:700;background:var(--gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;margin-bottom:12px}
.report-score-badge{font-size:1.2rem;margin-bottom:8px}
.report-score-number{font-size:3rem;font-weight:700}
.report-tabs{display:flex;gap:4px;background:var(--glass);border:1px solid var(--glass-border);border-radius:var(--radius-sm);padding:4px;margin-bottom:24px;overflow-x:auto}
.tab-btn{flex:1;padding:10px 8px;font-size:0.8rem;font-weight:500;border-radius:8px;transition:all .2s;white-space:nowrap;text-align:center}
.tab-btn.active{background:var(--primary);color:#fff}
.tab-content{display:none;flex-direction:column;gap:16px}
.tab-content.active{display:flex}
.tab-content h3{font-size:1rem;font-weight:600;margin-bottom:8px}
.tab-content ul li{padding:6px 0;font-size:0.9rem;color:var(--text-muted)}
.tab-content ul li::before{content:"→ ";color:var(--primary)}

/* Steps detail */
.step-detail{margin-bottom:16px}
.step-detail-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.step-detail-name{font-weight:600;font-size:0.95rem}
.step-status{padding:2px 10px;border-radius:20px;font-size:0.7rem;font-weight:600}
.step-status.done{background:rgba(52,211,153,0.15);color:var(--success)}
.step-status.partial{background:rgba(251,191,36,0.15);color:var(--warning)}
.step-status.missed{background:rgba(248,113,113,0.15);color:var(--danger)}
.step-detail-body{font-size:0.85rem;color:var(--text-muted);line-height:1.6}
.step-verbatim{font-style:italic;color:var(--secondary);margin-top:6px;padding-left:12px;border-left:2px solid var(--secondary)}
.step-example{color:var(--text-dim);margin-top:6px;font-size:0.8rem}
.step-example::before{content:"💡 Exemple : "}
.step-score-bar{height:4px;background:rgba(255,255,255,0.08);border-radius:2px;margin-top:8px;overflow:hidden}
.step-score-fill{height:100%;border-radius:2px;background:var(--gradient);transition:width .6s ease}

/* Mirror */
.mirror-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.mirror-stat{text-align:center;padding:20px 12px}
.mirror-value{font-size:2rem;font-weight:700;background:var(--gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.mirror-label{font-size:0.75rem;color:var(--text-muted);margin-top:4px}
.moment-item{display:flex;gap:10px;padding:8px 0;border-bottom:1px solid var(--glass-border)}
.moment-icon{font-size:1.1rem}
.moment-text{font-size:0.85rem;color:var(--text-muted)}

/* Transcript */
.transcript{display:flex;flex-direction:column;gap:8px}
.transcript .msg{max-width:100%}

/* Report actions */
.report-actions{display:flex;gap:12px;margin-top:24px}
.report-actions button{flex:1}

/* ============ RESPONSIVE ============ */
@media(max-width:600px){
  .mirror-grid{grid-template-columns:1fr}
  .report-tabs{flex-wrap:nowrap;-webkit-overflow-scrolling:touch}
  .tab-btn{min-width:auto;padding:8px 6px;font-size:0.72rem}
  .orb-container canvas{width:200px!important;height:200px!important}
}

/* ============ ANALYZING OVERLAY ============ */
.analyzing-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  background: var(--bg, #0d0d12);
  animation: analyzeFadeIn 0.5s ease;
}
.analyzing-overlay.hidden { display: none; }

@keyframes analyzeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.analyzing-content {
  text-align: center;
  color: rgba(255,255,255,0.9);
}
.analyzing-content h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--secondary, #06b6d4), var(--primary, #a855f7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.analyzing-content p {
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  margin: 0.3rem 0;
}
.analyzing-sub {
  font-size: 0.85rem !important;
  color: rgba(255,255,255,0.35) !important;
}

.analyzing-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.5rem;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary, #a855f7);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ FILLERS (tics de langage) ============ */
.fillers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.filler-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 100, 100, 0.12);
  border: 1px solid rgba(255, 100, 100, 0.3);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.9);
}
.filler-chip .filler-count {
  background: rgba(255, 100, 100, 0.35);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
}
.fillers-empty {
  padding: 14px 0;
  color: rgba(120, 220, 150, 0.9);
  font-size: 0.95rem;
}
.fillers-footer {
  margin-top: 14px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}



/* ============ HISTORY (tabular) ============ */
.history-section {
  margin-top: 48px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.history-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  background: linear-gradient(135deg, var(--secondary, #06b6d4), var(--primary, #a855f7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.history-subtitle {
  display: block;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
.history-stats {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  text-align: right;
  line-height: 1.5;
}
.history-stats strong { color: rgba(255,255,255,0.95); font-weight: 600; }

.history-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255,255,255,0.5);
}
.history-empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.6; }
.history-empty-title { font-size: 1rem; color: rgba(255,255,255,0.8); font-weight: 500; margin-bottom: 6px; }
.history-empty-text { font-size: 0.85rem; color: rgba(255,255,255,0.4); }
.history-loading { text-align: center; padding: 24px; color: rgba(255,255,255,0.4); font-size: 0.9rem; }

.history-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
}
.history-table thead {
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(6,182,212,0.15));
}
.history-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.history-table th.col-step,
.history-table th.col-total,
.history-table th.col-duration,
.history-table th.col-date { text-align: center; }

.history-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s ease;
}
.history-table tbody tr:last-child { border-bottom: none; }
.history-table tbody tr.clickable { cursor: pointer; }
.history-table tbody tr.clickable:hover { background: rgba(255,255,255,0.04); }
.history-table tbody tr.pending { opacity: 0.5; }

.history-table td {
  padding: 12px 14px;
  vertical-align: middle;
}
.history-table td.col-scenario {
  font-weight: 500;
  color: rgba(255,255,255,0.95);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-table td.col-date,
.history-table td.col-duration {
  text-align: center;
  color: rgba(255,255,255,0.55);
  font-size: 0.78rem;
  white-space: nowrap;
}
.history-table td.col-step,
.history-table td.col-total {
  text-align: center;
}

.score-pill {
  display: inline-block;
  min-width: 48px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.score-pill.excellent { background: rgba(74,222,128,0.15); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }
.score-pill.good      { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.score-pill.low       { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.score-pill.empty     { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.3); border: 1px solid rgba(255,255,255,0.06); }
.score-pill.total     { font-size: 0.82rem; min-width: 54px; font-weight: 700; }

/* ============ LOBBY LAYOUT ============ */
.screen.lobby-layout.active {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100vh;
  background: var(--bg, #0a0a0f);
}
.lobby-layout .container { display: none; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px 14px;
  transition: width 0.25s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  backdrop-filter: blur(16px);
}
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-user-info { display: none; }
.sidebar.collapsed .sidebar-item,
.sidebar.collapsed .sidebar-logout { justify-content: center; padding: 12px 8px; }
.sidebar.collapsed .sidebar-header { justify-content: center; }
.sidebar.collapsed .sidebar-user { justify-content: center; }
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 14px;
}
.sidebar-logo { width: 140px; height: auto; max-height: 48px; object-fit: contain; display: block; margin: 4px 0 2px 4px; }
.sidebar-brand {
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--secondary, #06b6d4), var(--primary, #a855f7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  flex: 1;
}
.sidebar-toggle {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.1); color: white; }

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  padding: 0 8px;
  margin-bottom: 8px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.95);
}
.sidebar-item.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.18), rgba(6,182,212,0.12));
  border-color: rgba(168,85,247,0.3);
  color: white;
  box-shadow: 0 4px 20px rgba(168,85,247,0.1);
}
.sidebar-icon {
  width: 22px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,0.55);
}
.sidebar-item.active .sidebar-icon { color: rgba(255,255,255,0.95); }
.sidebar-item:hover .sidebar-icon { color: rgba(255,255,255,0.85); }
.sidebar-logout .sidebar-icon { color: inherit; }
.sidebar-label {
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 14px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}
.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary, #a855f7), var(--secondary, #06b6d4));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.95);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.sidebar-logout:hover {
  background: rgba(248,113,113,0.08);
  color: #f87171;
}

/* ---------- Main ---------- */
.lobby-main {
  flex: 1;
  padding: 38px 44px 60px 44px;
  min-width: 0;
  overflow-x: hidden;
}
.lobby-view { display: none; }
.lobby-view.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-header { margin-bottom: 26px; }
.view-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 6px 0;
  background: linear-gradient(135deg, var(--secondary, #06b6d4), var(--primary, #a855f7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.view-subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

/* ---------- Welcome header ---------- */
.lobby-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.lobby-welcome-title {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0;
  color: rgba(255,255,255,0.98);
}
.lobby-welcome-title span#welcome-name {
  background: linear-gradient(135deg, var(--secondary, #06b6d4), var(--primary, #a855f7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.wave { display: inline-block; animation: wave 2.4s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40%, 50% { transform: rotate(14deg); }
}
.lobby-welcome-subtitle {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  margin: 6px 0 0 0;
}

/* ---------- Next simulation CTA ---------- */
.next-sim-card {
  position: relative;
  border-radius: 20px;
  padding: 32px 34px;
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid rgba(168,85,247,0.25);
  background:
    radial-gradient(circle at 100% 0%, rgba(168,85,247,0.22), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(6,182,212,0.18), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  box-shadow: 0 8px 40px rgba(168,85,247,0.08);
}
.next-sim-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(168,85,247,0.15), transparent 40%);
  pointer-events: none;
}
.next-sim-content { position: relative; }
.next-sim-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(168,85,247,0.9);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.next-sim-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  line-height: 1.3;
}
.next-sim-desc {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 14px;
  max-width: 620px;
  line-height: 1.5;
}
.next-sim-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  flex-wrap: wrap;
}
.next-sim-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
}
.next-sim-cta {
  min-width: 220px;
}

/* ---------- Stats tiles ---------- */
.stats-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat-tile {
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}
.stat-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.12);
}
.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: white;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--secondary, #06b6d4), var(--primary, #a855f7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

/* ---------- Perf card ---------- */
.perf-card {
  padding: 24px 28px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 28px;
}
.perf-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.perf-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  margin: 0;
}
.perf-subtitle {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
}
.perf-bars { display: flex; flex-direction: column; gap: 12px; }
.perf-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 50px;
  gap: 14px;
  align-items: center;
}
.perf-bar-name {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.perf-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
}
.perf-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}
.perf-bar-fill.excellent { background: linear-gradient(90deg, #4ade80, #22c55e); }
.perf-bar-fill.good      { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.perf-bar-fill.low       { background: linear-gradient(90deg, #f87171, #ef4444); }
.perf-bar-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.perf-empty {
  text-align: center;
  padding: 30px 20px;
  color: rgba(255,255,255,0.4);
  font-size: 0.88rem;
}

/* ---------- Recent card ---------- */
.recent-card {
  padding: 24px 28px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 28px;
}
.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.recent-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: rgba(255,255,255,0.95);
}
.link-btn {
  background: transparent;
  border: none;
  color: var(--secondary, #06b6d4);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}
.link-btn:hover { background: rgba(6,182,212,0.1); }
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.recent-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
  transform: translateX(2px);
}
.recent-item.pending { opacity: 0.55; cursor: default; }
.recent-item.pending:hover { transform: none; background: rgba(255,255,255,0.025); }
.recent-score {
  min-width: 54px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.recent-score.excellent { background: rgba(74,222,128,0.15); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }
.recent-score.good      { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.recent-score.low       { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.recent-score.empty     { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.3); border: 1px solid rgba(255,255,255,0.06); }
.recent-body { flex: 1; min-width: 0; }
.recent-scenario {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.95);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-meta {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
.recent-empty {
  text-align: center;
  padding: 24px;
  color: rgba(255,255,255,0.4);
  font-size: 0.88rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stats-tiles { grid-template-columns: repeat(2, 1fr); }
  .lobby-main { padding: 24px 18px 40px 18px; }
  .sidebar { width: 68px; }
  .sidebar .sidebar-label,
  .sidebar .sidebar-brand,
  .sidebar .sidebar-section-label,
  .sidebar .sidebar-user-info { display: none; }
  .sidebar .sidebar-item,
  .sidebar .sidebar-logout { justify-content: center; padding: 12px 8px; }
  .sidebar-toggle { display: none; }
  .perf-bar-row { grid-template-columns: 110px 1fr 46px; }
}
