.g82-app {
  background: var(--card);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.g82-shared-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: 14px;
}
.g82-shared-actions { display: flex; align-items: center; gap: 12px; }

/* Floating Mobile/Desktop Toast */
.g82-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(16px);
  z-index: 90;
  background: var(--text);
  color: var(--card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  text-align: center;
  transition: opacity .18s ease, transform .18s ease;
}
.g82-toast.g82-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.g82-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.g82-switches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.g82-seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
}
.g82-seg-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}
.g82-seg-btn[aria-pressed="true"] {
  background: var(--primary);
  color: #ffffff;
}
.g82-top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.g82-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}

/* Compact Mobile Mini-Roster Strip (always visible on small screens!) */
.g82-mini-strip {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.g82-mini-chip {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g82-mini-chip.g82-mini-filled {
  border-style: solid;
  border-color: var(--primary);
  background: var(--surface);
  font-weight: 600;
}
.g82-mini-pos { color: var(--primary); font-weight: 700; margin-right: 4px; }

/* Main 2-column stage */
.g82-main {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Vintage Drawn Team Card */
.g82-draw-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}
.g82-draw-card.g82-classic-pull {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(224, 160, 58, .25);
}
.g82-draw-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.g82-round-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
  letter-spacing: 0.04em;
}
.g82-team-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 6px solid var(--primary);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.g82-team-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}
.g82-era-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-ink);
  white-space: nowrap;
}
.g82-pick-hint {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 12px;
}
.g82-player-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.g82-player-row {
  display: grid;
  grid-template-columns: 20px 44px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
  min-height: 54px;
  user-select: none;
  transition: border-color .15s ease, background-color .15s ease, opacity .12s ease;
}
.g82-player-row:hover { border-color: var(--primary); background: var(--surface); }
.g82-player-row.g82-dragging { opacity: .45; cursor: grabbing; }
.g82-player-row.g82-disabled { opacity: .5; cursor: not-allowed; }
.g82-grip {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}
.g82-pos-chip {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
}
.g82-p-name { font-weight: 600; font-size: 15px; display: block; line-height: 1.2; }
.g82-p-sub { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.g82-p-ovr {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}
.g82-quick-add {
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.g82-quick-add:hover { background: var(--primary-hover); }
.g82-quick-add:disabled { opacity: .45; cursor: not-allowed; }

.g82-draw-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Live 82-Game Season Simulation Stage */
.g82-sim-stage {
  background: var(--bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.g82-sim-stage.g82-mood-hot {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 86, 47, .24);
}
.g82-sim-stage.g82-mood-immortal {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 160, 58, .35);
}
.g82-sim-stage.g82-mood-cold {
  border-color: #64748b;
  background: #ede9e3;
}
.g82-sim-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.g82-mood-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  background: var(--primary);
  color: #ffffff;
}
.g82-mood-badge.g82-badge-gold { background: var(--accent); color: var(--text); }
.g82-mood-badge.g82-badge-cold { background: #475569; color: #ffffff; }
.g82-mood-badge.g82-badge-upset { background: #991b1b; color: #ffffff; }

.g82-sim-scoreline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.g82-live-rec {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.g82-live-game-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

/* Progress Bar */
.g82-prog-track {
  height: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.g82-prog-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width .08s linear, background-color .2s ease;
}
.g82-sim-stage.g82-mood-immortal .g82-prog-fill { background: var(--accent); }
.g82-sim-stage.g82-mood-cold .g82-prog-fill { background: #64748b; }

/* Live Season Game Log Ticker */
.g82-log-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  margin-bottom: 12px;
}
.g82-log-item {
  display: grid;
  grid-template-columns: 44px 28px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.g82-log-item.g82-log-loss { border-left: 4px solid #991b1b; background: #fdf3f1; }
.g82-log-item.g82-log-hot { border-left: 4px solid var(--accent); }
.g82-log-g { font-family: var(--font-display); font-weight: 700; color: var(--muted); font-size: 12px; }
.g82-wl {
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  border-radius: 6px;
  padding: 2px 4px;
}
.g82-wl-w { background: #dcfce7; color: #166534; }
.g82-wl-l { background: #fee2e2; color: #991b1b; }

/* Right: 6-man Vintage Squad Board */
.g82-squad-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.g82-squad-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.g82-squad-head h2 { margin: 0; font-size: 22px; }
.g82-squad-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}
.g82-ovr-tag {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
}
.g82-slots {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.g82-slot-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 54px;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.g82-slot-card.g82-filled {
  border-style: solid;
  border-width: 1px;
  border-left: 5px solid var(--primary);
  cursor: grab;
}
.g82-slot-card.g82-filled:hover { border-color: var(--primary); }
.g82-slot-card.g82-drop-open { border-color: var(--accent); background: var(--surface); }
.g82-slot-card.g82-drop-best {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(194, 86, 47, .22);
}
.g82-slot-card.g82-drag-over {
  border-style: solid;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(194, 86, 47, .3);
}
.g82-slot-card.g82-swap-selected {
  border: 2px solid var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(224, 160, 58, .35);
}
.g82-slot-pos {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
}
.g82-slot-empty { color: var(--muted); font-size: 14px; }
.g82-slot-player { font-weight: 600; font-size: 15px; display: block; line-height: 1.2; }
.g82-slot-meta { font-size: 12px; color: var(--muted); display: block; }
.g82-slot-right { display: flex; align-items: center; gap: 8px; }
.g82-slot-ovr { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text); }

/* Chemistry meters */
.g82-chem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.g82-chem-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}
.g82-chem-lbl { font-size: 12px; color: var(--muted); }
.g82-chem-val { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text); }

/* Result & Near-Miss Emotion Stage */
.g82-result-card {
  background: var(--bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
}
.g82-result-card.g82-immortal {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 160, 58, .35);
}
.g82-stamp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.g82-tier-stamp {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.g82-big-record {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
  margin: 0 0 8px;
}
.g82-near-miss {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
}
.g82-checkpoints {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.g82-cp {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}
.g82-cp-lbl { font-size: 12px; color: var(--muted); }
.g82-cp-val { font-family: var(--font-display); font-size: 18px; font-weight: 700; }

.g82-story-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 14px;
}
.g82-story-box strong { display: block; margin-bottom: 4px; color: var(--primary); }
.g82-diag { color: var(--muted); margin-top: 6px; display: block; }

.g82-recap-details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.g82-recap-details summary {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}
.g82-recap-details .g82-log-list { margin-top: 10px; margin-bottom: 0; max-height: 190px; }

/* Submit score & Flex share */
.g82-submit-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.g82-nick-input {
  flex: 1;
  min-width: 160px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 16px;
}
.g82-flex-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.g82-msg { font-size: 14px; color: var(--primary); font-weight: 600; min-height: 20px; }
.g82-scroll-hint {
  display: none;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Dedicated Standalone Leaderboard Section BELOW Simulator */
.g82-lb-section {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.g82-lb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.g82-lb-title-wrap h2 { margin: 0 0 4px; font-size: 22px; }
.g82-lb-date-note { font-size: 14px; color: var(--muted); margin: 0; }
.g82-lb-scroll {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.g82-lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.g82-lb-table th, .g82-lb-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.g82-lb-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
}
.g82-lb-table td.g82-lb-rec, .g82-lb-table th:last-child { text-align: right; font-weight: 700; color: var(--primary); }
.g82-lb-table td.g82-lb-date-col { color: var(--muted); font-size: 12px; }
.g82-lb-table tr.g82-lb-me td {
  background: rgba(224, 160, 58, .22);
  font-weight: 700;
}
.g82-you-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}
@keyframes g82Pulse {
  0% { box-shadow: inset 0 0 0 2px var(--primary); background: rgba(194, 86, 47, .26); }
  100% { box-shadow: inset 0 0 0 0 transparent; background: rgba(224, 160, 58, .22); }
}
.g82-lb-flash td { animation: g82Pulse 1.6s ease; }

@media (max-width: 640px) {
  .g82-app, .g82-lb-section { padding: 16px; }
  .g82-mini-strip { display: grid; }
  .g82-scroll-hint { display: block; }
  .g82-main { grid-template-columns: 1fr; }
  .g82-player-row { grid-template-columns: 40px 1fr auto; gap: 8px; }
  .g82-grip, .g82-p-ovr { display: none; }
  .g82-big-record, .g82-live-rec { font-size: 36px; }
  .g82-checkpoints, .g82-chem-grid { grid-template-columns: repeat(2, 1fr); }
  .g82-flex-actions .btn-primary, .g82-flex-actions .btn-outline, .g82-submit-row .btn-primary { width: 100%; }
}