:root {
  --bg: #0f172a;
  --card: #0b1022;
  --accent: #f97316;
  --accent-2: #22d3ee;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #1e293b;
  --success: #34d399;
  --warn: #fbbf24;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 10% 20%, rgba(34, 211, 238, 0.08), transparent 25%),
    radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.08), transparent 25%),
    var(--bg);
  color: var(--text);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 56px;
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 28px;
}

h1 {
  margin: 8px 0 12px;
  font-size: 42px;
}

h2 {
  margin: 0 0 6px;
}

p {
  margin: 0;
}

.eyebrow {
  color: var(--accent-2);
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
}

.lede {
  color: var(--muted);
  max-width: 680px;
  line-height: 1.5;
}

.btn {
  border: 1px solid var(--bs-btn-border-color, var(--border));
  background-color: var(--bs-btn-bg, transparent);
  color: var(--bs-btn-color, var(--text));
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.1s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--bs-btn-hover-border-color, var(--accent));
  background-color: var(--bs-btn-hover-bg, var(--bs-btn-bg, transparent));
  color: var(--bs-btn-hover-color, var(--bs-btn-color, var(--text)));
}

.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.hero-card {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(34, 211, 238, 0.06));
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 16px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.label {
  color: var(--muted);
  font-size: 13px;
}

.stat {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
}

.meter {
  margin-top: 12px;
}

.meter-bar {
  margin-top: 6px;
  background: #111728;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.fill {
  display: block;
  height: 10px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 6px;
  transition: width 0.25s ease;
}

.layout {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr;
  grid-template-areas:
    'play board'
    'play log';
  gap: 22px;
}

.playbook {
  grid-area: play;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.moves {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.score-card {
  margin-top: 18px;
  background: #0f172a;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.score-row:last-child {
  border-bottom: none;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.board {
  grid-area: board;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.pill.open {
  background: rgba(34, 211, 238, 0.12);
  color: #67e8f9;
}

.pill.probe {
  background: rgba(244, 114, 182, 0.12);
  color: #fb7185;
}

.pill.advise {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
}

.pill.close {
  background: rgba(249, 115, 22, 0.12);
  color: #fdba74;
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  background: #ffffff;
  border: 1px solid #e1e7ef;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  color: #0f1a24;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.02));
  pointer-events: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.badge {
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 12px;
  border: 1px solid #e1e7ef;
  color: inherit;
}

.badge.bg-primary,
.badge.bg-success,
.badge.bg-danger,
.badge.bg-secondary,
.badge.bg-dark,
.badge.badge-accent,
.badge.bg-info {
  color: #fff;
}

.badge.bg-warning,
.badge.bg-light {
  color: #212529;
}

.stage {
  font-weight: 700;
  color: #0f1a24;
}

.card p {
  color: #42566a;
  font-size: 14px;
  line-height: 1.5;
}

.progress {
  height: 8px;
  background: #0b1224;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  width: 40%;
  transition: width 0.2s ease;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-btn {
  flex: 1;
  min-width: 100px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.1s ease;
}

.action-btn:hover {
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.log {
  grid-area: log;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.event-log {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.event-log li {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  color: var(--muted);
  font-size: 14px;
}

.event-log li strong {
  color: var(--text);
}

.badge.win {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.35);
}

.badge.fail {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.35);
}

.case-loader {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.1), rgba(249, 115, 22, 0.05));
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.case-spinner {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: case-spin 0.9s linear infinite;
}

@keyframes case-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.case-highlight {
  background: linear-gradient(135deg, #fff7f1, #ffeede);
  border: 1px solid #ffd4b2;
  border-radius: 12px;
  padding: 12px 14px;
  color: #4a3424;
  margin-bottom: 14px;
}
.case-description {
  font-size: 1rem;
  line-height: 1.45;
}

.case-question {
  color: #e63946;
  font-weight: 800;
}

.avatar-preview .avatar-frame,
.avatar-frame {
  width: 50px;
  height: 50px;
  max-width: 50px;
  max-height: 50px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(0,0,0,0.08);
  overflow: hidden;
  background: #f4f6f9;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.65), 0 6px 18px rgba(0,0,0,0.12);
}

.avatar-preview.small .avatar-frame {
  width: 30px;
  height: 30px;
  max-width: 30px;
  max-height: 30px;
  border-width: 2px;
}

.avatar-preview.small {
  min-width: 30px;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
}

.avatar-frame span {
  font-weight: 700;
  color: #0f172a;
}

.avatar-pill {
  border-radius: 999px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-width: 1px;
  border-color: rgba(0,0,0,0.08);
  color: #0f172a;
  background: #f8fbff;
  min-width: 44px;
  justify-content: center;
}

.avatar-option {
  position: relative;
}

.resume-box {
  background: #f8fbff;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 12px;
}

.resume-box .form-text {
  color: #4b5563;
}

.btn-check:checked + .avatar-pill,
.avatar-pill.active {
  background: #c1121f;
  color: #fff;
  border-color: #c1121f;
  box-shadow: 0 6px 16px rgba(193, 18, 31, 0.25);
}

.avatar-pill:hover {
  background: #d62828;
  color: #fff;
  border-color: #d62828;
}


.avatar-upload-group .input-group-text {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.avatar-spark-blue { background: linear-gradient(135deg, #e0f2ff, #cce5ff); color: #0b4d74; }
.avatar-focus-coral { background: linear-gradient(135deg, #ffe3e3, #ffd1d1); color: #8c1c3d; }
.avatar-calm-purple { background: linear-gradient(135deg, #efe6ff, #e0d4ff); color: #4b2c92; }
.avatar-bold-gold { background: linear-gradient(135deg, #fff4da, #ffe9b8); color: #7a5600; }
.avatar-fresh-mint { background: linear-gradient(135deg, #ddf7f2, #c1f0e4); color: #106f54; }
.avatar-sunset-orange { background: linear-gradient(135deg, #ffe1cc, #ffb68b); color: #8c3b06; }
.avatar-aqua-cyan { background: linear-gradient(135deg, #d9f8ff, #b9ecff); color: #0c5f74; }
.avatar-deep-navy { background: linear-gradient(135deg, #dbe4ff, #c7d2ff); color: #1e3a8a; }
.avatar-rose-flare { background: linear-gradient(135deg, #ffe4f0, #ffc6dc); color: #9d174d; }
.avatar-steel-gray { background: linear-gradient(135deg, #e5e7eb, #cbd5e1); color: #111827; }

.profile-edit {
  border: 1px dashed #dbe5f0;
}

.lb-avatar {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.lb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: none;
  box-shadow: none;
}

.lb-avatar.lb-placeholder {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.5);
}

.lb-avatar.lb-placeholder i {
  font-size: 12px;
  color: #e9edf2;
  line-height: 1;
}

.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e7ecf2;
}

.leaderboard-item:last-child {
  border-bottom: none;
}

.leaderboard-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f6f8fb;
  border: 1px solid #e1e7ef;
  color: #0f1a24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.leaderboard-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.wizard-step-indicator {
  border: 1px dashed #c1cbd4;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #00425e;
  background: #f8fbff;
}

.wizard-step-indicator span {
  background: #00425e;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.wizard-step-indicator.active {
  border-color: #e63946;
  background: #fff5f5;
  color: #e63946;
}

.wizard-step-indicator.active span {
  background: #e63946;
}

.wizard-step-indicator.completed {
  border-color: #1db954;
  background: #f2fff6;
  color: #0f3e1f;
}

.wizard-step-indicator.completed span {
  background: #1db954;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.performance-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-tile {
  background: #c1121f;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  border: 1px solid #a30f1a;
  box-shadow: 0 10px 20px rgba(193, 18, 31, 0.2);
  color: #fff;
  flex: 1 1 150px;
  min-width: 140px;
}

.stat-tile .small {
  color: rgba(255, 255, 255, 0.82) !important;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-number {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f2f5f9;
  border: 1px solid #e3e8ef;
  font-weight: 700;
  color: #0f1a24;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-areas: 'play' 'board' 'log';
  }
}
