:root {
  --bg-deep: #131c18;
  --bg-mid: #1c2923;
  --bg-surface: #24342d;
  --bg-card: #2b3e35;
  --bg-card-elevated: #32483e;
  --bg-cream: #f6f3ea;
  --bg-cream-card: #ece6d5;
  --text-primary: #f6f5ef;
  --text-secondary: #c9d4cc;
  --text-muted: #93a69b;
  --text-dark: #1c2822;
  --accent-gold: #e6b34b;
  --accent-gold-bright: #f4c867;
  --accent-coral: #e06d53;
  --accent-teal: #48a999;
  --accent-indigo: #6b84c4;
  --accent-plum: #c46d96;
  --accent-sage: #67b062;
  --border-subtle: rgba(246, 245, 239, 0.14);
  --border-strong: rgba(230, 179, 75, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.42);
  --shadow-md: 0 8px 22px rgba(0, 0, 0, 0.28);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
}

body.high-contrast {
  --bg-deep: #000000;
  --bg-mid: #0a0a0a;
  --bg-surface: #141414;
  --bg-card: #1c1c1c;
  --bg-card-elevated: #262626;
  --text-primary: #ffffff;
  --text-secondary: #f0f0f0;
  --text-muted: #d0d0d0;
  --accent-gold: #ffd700;
  --border-subtle: rgba(255, 255, 255, 0.45);
  --border-strong: #ffd700;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(circle at 50% 0%, #263d32 0%, var(--bg-deep) 75%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Top Navigation Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: rgba(19, 28, 24, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hayloft-home-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(246, 245, 239, 0.08);
  border: 1px solid var(--border-subtle);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.hayloft-home-logo:hover,
.hayloft-home-logo:focus-visible {
  background: rgba(230, 179, 75, 0.18);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

.brand-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}

.brand-title-btn:hover,
.brand-title-btn:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.draft-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(230, 179, 75, 0.16);
  color: var(--accent-gold-bright);
  border: 1px solid rgba(230, 179, 75, 0.35);
}

.room-code-pill {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(72, 169, 153, 0.2);
  color: #84e6d6;
  border: 1px solid rgba(72, 169, 153, 0.45);
}

.icon-pill-btn {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-pill-btn:hover,
.icon-pill-btn:focus-visible {
  background: var(--bg-card-elevated);
  border-color: var(--accent-gold);
}

/* Main Container */
.app-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.hidden {
  display: none !important;
}

/* Hero & Main Menu */
.hero-card {
  background: linear-gradient(145deg, rgba(43, 62, 53, 0.94), rgba(28, 41, 35, 0.96));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  margin-bottom: 24px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 900;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.hero-subtitle {
  max-width: 660px;
  margin: 0 auto 24px;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.menu-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  max-width: 920px;
  margin: 0 auto;
}

.menu-primary-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.menu-primary-card:hover,
.menu-primary-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
  background: var(--bg-card-elevated);
}

.menu-primary-card.featured {
  background: linear-gradient(135deg, rgba(230, 179, 75, 0.22), rgba(72, 169, 153, 0.16));
  border-color: var(--accent-gold);
}

.menu-card-icon {
  font-size: 1.65rem;
  margin-bottom: 8px;
}

.menu-card-title {
  font-size: 1.12rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.menu-card-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

/* Mode Showcase Table on Home */
.modes-table-section {
  max-width: 920px;
  margin: 26px auto 0;
  text-align: left;
}

.modes-table-wrap {
  background: rgba(28, 41, 35, 0.84);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.modes-overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.modes-overview-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  background: rgba(20, 30, 25, 0.65);
  border-bottom: 1px solid var(--border-strong);
}

.modes-overview-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.modes-overview-table tbody tr:last-child td {
  border-bottom: none;
}

.mode-table-row {
  cursor: pointer;
  transition: background 0.14s ease;
}

.mode-table-row:hover {
  background: rgba(230, 179, 75, 0.08);
}

.mode-table-name {
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}

.mode-table-players {
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.mode-table-desc {
  color: var(--text-secondary);
  line-height: 1.4;
}

.mode-mini-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-gold-bright);
  background: rgba(230, 179, 75, 0.14);
  border: 1px solid rgba(230, 179, 75, 0.35);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.modes-more-details-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* Panels & Cards */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.panel-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
}

.panel-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease;
  min-height: 44px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--accent-gold);
  color: #16201b;
  border-color: var(--accent-gold-bright);
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible:not(:disabled) {
  background: var(--accent-gold-bright);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover:not(:disabled),
.btn-secondary:focus-visible:not(:disabled) {
  background: var(--bg-card-elevated);
  border-color: var(--accent-gold);
}

.btn-teal {
  background: var(--accent-teal);
  color: #0e1d1a;
}

.btn-danger {
  background: rgba(224, 109, 83, 0.2);
  color: #ff9c87;
  border-color: rgba(224, 109, 83, 0.45);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  min-height: 34px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.text-input, .select-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  min-height: 44px;
}

.text-input:focus, .select-input:focus {
  outline: 2px solid var(--accent-gold);
  border-color: transparent;
}

/* Avatar Grid */
.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.avatar-option-btn {
  position: relative;
  width: 58px;
  height: 58px;
  padding: 3px;
  border-radius: 50%;
  background: var(--bg-mid);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.avatar-option-btn:hover,
.avatar-option-btn:focus-visible {
  transform: scale(1.06);
  border-color: rgba(230, 179, 75, 0.6);
}

.avatar-option-btn.selected {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(230, 179, 75, 0.28);
}

.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-mid);
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.avatar-circle svg,
.avatar-circle img,
.avatar-option-btn svg,
.avatar-option-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-lg {
  width: 68px;
  height: 68px;
}

.avatar-sm {
  width: 30px;
  height: 30px;
}

/* Lobby Layout */
.lobby-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr;
  gap: 18px;
}

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

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.roster-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.roster-name {
  font-weight: 700;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.badge-host {
  background: rgba(230, 179, 75, 0.22);
  color: var(--accent-gold-bright);
}

.badge-online {
  background: rgba(103, 176, 98, 0.22);
  color: #98e693;
}

.badge-offline {
  background: rgba(224, 109, 83, 0.22);
  color: #ff9d88;
}

.badge-locked {
  background: rgba(72, 169, 153, 0.25);
  color: #88ebe0;
}

/* QR & Share Box */
.share-room-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--bg-mid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.qr-preview-box {
  width: 96px;
  height: 96px;
  background: #fff;
  padding: 6px;
  border-radius: 10px;
  flex-shrink: 0;
}

.qr-preview-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.room-code-huge {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--accent-gold-bright);
  font-family: monospace;
}

/* Scenario & Dilemma Card */
.scenario-card {
  background: linear-gradient(155deg, #f7f3e8, #eae2ce);
  color: var(--text-dark);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-lg);
  border: 2px solid #d7c7a2;
  margin-bottom: 20px;
}

.scenario-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.scenario-tag {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(38, 61, 50, 0.12);
  color: #263d32;
}

.scenario-title {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 800;
  margin: 0 0 10px;
  color: #16231c;
}

.scenario-body {
  font-size: clamp(1.04rem, 2.2vw, 1.22rem);
  line-height: 1.62;
  margin: 0;
  color: #223129;
}

.pair-context-banner {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(61, 139, 122, 0.14);
  border-left: 4px solid #2b6e5f;
  font-size: 0.9rem;
  font-weight: 600;
  color: #193c34;
}

/* Choice Cards */
.choices-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-mid);
  border: 2px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.12s ease;
}

.choice-btn:hover:not(:disabled),
.choice-btn:focus-visible:not(:disabled) {
  border-color: rgba(230, 179, 75, 0.65);
  background: var(--bg-card-elevated);
}

.choice-btn.selected {
  border-color: var(--accent-gold);
  background: rgba(230, 179, 75, 0.16);
  box-shadow: 0 0 0 2px rgba(230, 179, 75, 0.25);
}

.choice-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-gold-bright);
  font-weight: 900;
  font-size: 0.98rem;
  flex-shrink: 0;
}

.choice-btn.selected .choice-letter {
  background: var(--accent-gold);
  color: #16201b;
}

.choice-text {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

/* Compact option pills for predictions */
.pill-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pill-choice-btn {
  padding: 9px 15px;
  border-radius: 10px;
  background: var(--bg-mid);
  border: 2px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 42px;
}

.pill-choice-btn.selected {
  background: var(--accent-teal);
  color: #0d1d19;
  border-color: #82e8d8;
}

/* Pass-and-Play Privacy Shield */
.privacy-shield-card {
  background: linear-gradient(145deg, #1b2822, #121b17);
  border: 2px dashed var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin: 18px 0;
}

/* Consensus Meter & Vote Bars */
.consensus-meter-wrap {
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.vote-bar-row {
  margin-bottom: 14px;
}

.vote-bar-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.94rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.vote-bar-track {
  height: 16px;
  background: var(--bg-mid);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.vote-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-gold));
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Sliding Scale Slider & Dot Plot */
.scale-slider-box {
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.scale-value-readout {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-gold-bright);
  text-align: center;
  margin-bottom: 10px;
}

.range-slider {
  width: 100%;
  height: 10px;
  accent-color: var(--accent-gold);
  cursor: pointer;
}

.scale-endpoints-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 600;
}

.scale-plot-container {
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 20px 18px;
  margin-bottom: 16px;
}

.scale-axis-track {
  position: relative;
  height: 130px;
  border-bottom: 3px solid var(--text-secondary);
  margin: 14px 18px 10px;
}

.scale-dot {
  position: absolute;
  transform: translate(-50%, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: bottom 0.3s ease, left 0.3s ease;
}

.scale-dot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.gallery-pair-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

/* Jury Forecast Stepper & Comparison Chart */
.forecast-stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper-count {
  font-size: 1.3rem;
  font-weight: 900;
  min-width: 32px;
  text-align: center;
  color: var(--accent-gold-bright);
}

/* Timer Pill */
.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.05rem;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(230, 179, 75, 0.18);
  color: var(--accent-gold-bright);
  border: 1px solid var(--accent-gold);
}

.timer-badge.urgent {
  background: rgba(224, 109, 83, 0.28);
  color: #ffb09e;
  border-color: var(--accent-coral);
}

/* Warning / Info Alerts */
.alert-banner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.92rem;
  font-weight: 600;
}

.alert-warning {
  background: rgba(230, 179, 75, 0.16);
  border: 1px solid rgba(230, 179, 75, 0.5);
  color: #f9d889;
}

.alert-info {
  background: rgba(72, 169, 153, 0.16);
  border: 1px solid rgba(72, 169, 153, 0.45);
  color: #9ef0e4;
}

.alert-devil {
  background: linear-gradient(135deg, rgba(196, 77, 104, 0.25), rgba(224, 109, 83, 0.2));
  border: 1px solid #e06d53;
  color: #ffd0c6;
}

/* Toast */
.toast-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: #17231e;
  color: var(--text-primary);
  border: 2px solid var(--accent-gold);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  max-width: 92vw;
  text-align: center;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 15, 13, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 740px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
}

/* Tabs */
.tabs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.tab-btn {
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent-gold);
  color: #16201b;
  border-color: var(--accent-gold-bright);
}

/* Moral Profile Cards */
.profile-theme-card {
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.profile-poles-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-gold-bright);
  margin: 8px 0 6px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}
