/* ═══════════════════════════════════════════════════════════════════════════
   ARS MAGICA CHARACTER CREATOR - BG3 / MMO STYLE
   Fullscreen character with glassmorphism overlay panels
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Crimson+Pro:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap');

/* ─────────────────────────────────────────────────────────────────────────────
   CSS VARIABLES
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  /* Glass panel colors */
  --glass-bg: rgba(15, 12, 25, 0.85);
  --glass-bg-solid: rgba(20, 16, 32, 0.95);
  --glass-border: rgba(180, 160, 120, 0.3);
  --glass-border-bright: rgba(212, 175, 100, 0.5);
  --glass-highlight: rgba(255, 255, 255, 0.05);

  /* Accent colors */
  --gold: #c9a55c;
  --gold-bright: #e8c778;
  --gold-dim: #8b7340;
  --gold-glow: rgba(201, 165, 92, 0.4);

  --arcane-blue: #5588cc;
  --arcane-glow: rgba(85, 136, 204, 0.5);

  --virtue-green: #5a9a6a;
  --virtue-glow: rgba(90, 154, 106, 0.5);

  --flaw-red: #a85555;
  --flaw-glow: rgba(168, 85, 85, 0.5);

  --mana-purple: #8866aa;
  --mana-glow: rgba(136, 102, 170, 0.5);

  /* Text */
  --text-bright: #e8e4d9;
  --text-normal: #ccc8bc;
  --text-muted: #8a8680;
  --text-gold: #c9a55c;

  /* Misc */
  --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.6);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────────────────────────────────────
   GAME-ICONS (game-icons.net, CC BY 3.0)
   Inline SVG icon base styles
   ───────────────────────────────────────────────────────────────────────────── */
.gi {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
  flex-shrink: 0;
}

/* Lock icon inside ability lock-tag */
.lock-tag .gi-lock {
  width: 0.85em;
  height: 0.85em;
  opacity: 0.8;
}

/* Affinity diamond icon */
.affinity-indicator .gi-affinity {
  width: 0.65em;
  height: 0.65em;
  filter: drop-shadow(0 0 3px currentColor);
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Crimson Pro', Georgia, serif;
  color: var(--text-normal);
  line-height: 1.5;
  background: #0a0810;
}

/* ─────────────────────────────────────────────────────────────────────────────
   FULLSCREEN 3D VIEWPORT
   ───────────────────────────────────────────────────────────────────────────── */
#model-viewport {
  position: fixed;
  inset: 0;
  z-index: 0;

  /* Mystical Library Background */
  background:
    /* Floating particles */
    radial-gradient(2px 2px at 20% 30%, rgba(201, 165, 92, 0.3), transparent),
    radial-gradient(2px 2px at 70% 20%, rgba(136, 102, 170, 0.25), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(85, 136, 204, 0.2), transparent),
    radial-gradient(2px 2px at 80% 80%, rgba(201, 165, 92, 0.2), transparent),
    /* Library backdrop gradient */
    radial-gradient(ellipse 120% 100% at 50% 100%, #1a1428 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 30% 20%, rgba(136, 102, 170, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 70% 30%, rgba(85, 136, 204, 0.1) 0%, transparent 50%),
    /* Base gradient - deep mystical */
    linear-gradient(180deg, #0c0814 0%, #12101c 20%, #1a1428 50%, #14101e 80%, #0a0810 100%);
  background-size:
    300px 300px,
    400px 400px,
    350px 350px,
    450px 450px,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%;
  animation: particleFloat 40s linear infinite;
}

@keyframes particleFloat {
  0% {
    background-position:
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0;
  }
  100% {
    background-position:
      300px 200px,
      -200px 300px,
      150px -100px,
      -300px 150px,
      0 0,
      0 0,
      0 0,
      0 0;
  }
}

#model-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Vignette overlay */
.viewport-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    transparent 0%,
    rgba(10, 8, 16, 0.7) 100%
  );
}

/* Placeholder label overlay */
.viewport-placeholder-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.15);
  pointer-events: none;
  user-select: none;
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* ─────────────────────────────────────────────────────────────────────────────
   TOP NAVIGATION TABS
   ───────────────────────────────────────────────────────────────────────────── */
#top-tabs {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0.5rem 1rem;
  background: linear-gradient(180deg, rgba(15, 12, 25, 0.9) 0%, transparent 100%);
}

.tabs-left,
.tabs-right {
  display: flex;
  gap: 0.25rem;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 1.25rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 4px 4px 8px 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, var(--glass-highlight) 0%, transparent 50%);
    pointer-events: none;
  }

  &:hover {
    background: rgba(25, 20, 40, 0.9);
    border-color: var(--glass-border-bright);
    transform: translateY(-2px);
  }

  &.active {
    background: rgba(30, 25, 50, 0.95);
    border-color: var(--gold);
    box-shadow:
      0 4px 20px var(--gold-glow),
      inset 0 0 20px rgba(201, 165, 92, 0.1);

    .tab-icon {
      filter: drop-shadow(0 0 6px var(--gold-glow));
      color: var(--gold-bright);
    }

    .tab-label {
      color: var(--gold-bright);
    }

    &::after {
      content: '';
      position: absolute;
      bottom: -1px;
      left: 15%;
      right: 15%;
      height: 3px;
      background: var(--gold);
      border-radius: 2px 2px 0 0;
      box-shadow: 0 0 12px var(--gold-glow);
    }
  }
}

.tab-icon {
  font-size: 1.25rem;
  filter: brightness(1.3) saturate(1.2);
  transition: var(--transition-smooth);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-icon .gi-tab {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.15));
  transition: var(--transition-smooth);
}

.tab.active .tab-icon .gi-tab {
  color: var(--gold-bright);
  filter: drop-shadow(0 0 6px var(--gold-glow));
}

.tab-label {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

/* Compass Seal */
.compass-seal {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seal-outer {
  position: absolute;
  width: 80px;
  height: 80px;
  border: 2px solid var(--gold-dim);
  border-radius: 50%;
  animation: sealRotate 60s linear infinite;

  &::before,
  &::after {
    content: '';
    position: absolute;
    background: var(--gold-dim);
  }

  &::before {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 12px;
  }

  &::after {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 12px;
  }
}

@keyframes sealRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.seal-inner {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, rgba(30, 25, 45, 0.9) 0%, rgba(15, 12, 25, 0.95) 100%);
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 20px var(--gold-glow),
    inset 0 0 15px rgba(201, 165, 92, 0.2);
}

.seal-icon {
  font-size: 1.5rem;
  color: var(--gold-bright);
  text-shadow: 0 0 10px var(--gold-glow);
  animation: sealPulse 3s ease-in-out infinite;
}

@keyframes sealPulse {
  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.seal-text {
  position: absolute;
  bottom: -8px;
  font-family: 'Cinzel', serif;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold-glow);
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────────────────
   GLASS PANELS
   ───────────────────────────────────────────────────────────────────────────── */
.glass-panel {
  position: fixed;
  top: 100px;
  width: 400px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  box-shadow: var(--shadow-heavy);
  z-index: 50;

  /* Inner glow */
  &::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, transparent 35%);
    pointer-events: none;
  }

  /* Custom scrollbar */
  &::-webkit-scrollbar {
    width: 8px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 4px;

    &:hover {
      background: var(--gold);
    }
  }
}

#left-panel {
  left: 20px;
  padding: 1rem;
}

#right-panel {
  right: 20px;
  width: 460px;
  padding: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   PANEL HEADERS
   ───────────────────────────────────────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);

  h3 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
  }
}

.points-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  background: rgba(85, 136, 204, 0.2);
  border: 1px solid var(--arcane-blue);
  color: var(--arcane-blue);
  text-shadow: 0 0 8px var(--arcane-glow);

  &.xp {
    background: rgba(90, 154, 106, 0.2);
    border-color: var(--virtue-green);
    color: var(--virtue-green);
    text-shadow: 0 0 8px var(--virtue-glow);
  }

  &.arcane {
    background: rgba(136, 102, 170, 0.2);
    border-color: var(--mana-purple);
    color: var(--mana-purple);
    text-shadow: 0 0 8px var(--mana-glow);
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   LEFT PANEL - CHARACTER SUMMARY
   ───────────────────────────────────────────────────────────────────────────── */
.summary-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--glass-border);

  &:last-child {
    border-bottom: none;
  }

  h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
  }
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.summary-item {
  display: flex;
  flex-direction: column;

  &:last-child {
    grid-column: 1 / -1;
  }
}

.summary-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.summary-value {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--text-bright);
}

/* Hexagon Stats Grid */
.hex-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.hex-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  transition: var(--transition-smooth);

  &:hover {
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
  }

  &.positive .hex-value {
    color: var(--virtue-green);
    text-shadow: 0 0 8px var(--virtue-glow);
  }

  &.negative .hex-value {
    color: var(--flaw-red);
    text-shadow: 0 0 8px var(--flaw-glow);
  }
}

.hex-value {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
}

.hex-label {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Balance Meters */
.balance-meters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.balance-meter {
  display: grid;
  grid-template-columns: 60px 1fr 40px;
  align-items: center;
  gap: 0.5rem;
}

.meter-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.meter-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.balance-meter.virtue .meter-fill {
  background: linear-gradient(90deg, #3a6a4a 0%, var(--virtue-green) 100%);
  box-shadow: 0 0 10px var(--virtue-glow);
}

.balance-meter.flaw .meter-fill {
  background: linear-gradient(90deg, #6a3a3a 0%, var(--flaw-red) 100%);
  box-shadow: 0 0 10px var(--flaw-glow);
}

.meter-value {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--text-normal);
  text-align: right;
}

/* Tag List for Selected Preview */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tag {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 3px;
  color: var(--text-normal);

  &.virtue {
    border-color: var(--virtue-green);
    color: var(--virtue-green);
  }

  &.virtue.house-virtue {
    background: rgba(90, 154, 106, 0.15);
    border-style: dashed;
  }

  &.flaw {
    border-color: var(--flaw-red);
    color: var(--flaw-red);
  }

  &.flaw.house-flaw {
    background: rgba(168, 85, 85, 0.15);
    border-style: dashed;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   UX ENHANCEMENTS
   ───────────────────────────────────────────────────────────────────────────── */

/* Subtle section divider between ability categories */
.ability-category + .ability-category {
  margin-top: 0.25rem;
}

/* Virtue/Flaw column header transition feedback */
.vf-header {
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.vf-header.virtue-header:hover {
  box-shadow: 0 0 12px var(--virtue-glow);
}

.vf-header.flaw-header:hover {
  box-shadow: 0 0 12px var(--flaw-glow);
}

/* ─────────────────────────────────────────────────────────────────────────────
   RIGHT PANEL - STEPS
   ───────────────────────────────────────────────────────────────────────────── */
.step {
  display: none;
  padding: 1.5rem;
  animation: stepFadeIn 0.4s ease-out;

  &.active {
    display: block;
  }

  .panel-header {
    margin: -1.5rem -1.5rem 1.5rem;
    padding: 1rem 1.5rem;
  }
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Step description text */
.step-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 1rem 1rem 1rem;
  line-height: 1.5;
}

/* Type Selection Grid */
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.type-card {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;

  &:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--gold-dim);
    transform: translateY(-2px);
  }

  &.selected {
    background: rgba(201, 165, 92, 0.1);
    border-color: var(--gold);
    box-shadow:
      0 0 20px var(--gold-glow),
      inset 0 0 20px rgba(201, 165, 92, 0.05);
  }

  h3 {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 0.25rem;
  }

  .type-info {
    font-size: 0.75rem;
    color: var(--text-muted);
  }
}

/* Import Divider */
.import-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  gap: 1rem;

  &::before,
  &::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--glass-border), transparent);
  }

  span {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
  }
}

/* Import Card (on type selection step) */
.import-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  padding: 1.25rem 1rem;
  border-style: dashed;

  .import-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    opacity: 0.8;
  }

  .import-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
  }

  &:hover {
    border-style: dashed;
    background: rgba(201, 165, 92, 0.05);
  }
}

/* Form Elements */
.form-group {
  margin-bottom: 1rem;

  label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
  }

  input,
  select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: 'Crimson Pro', serif;
    font-size: 1rem;
    color: var(--text-bright);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    transition: var(--transition-smooth);

    &::placeholder {
      color: var(--text-muted);
      font-style: italic;
      opacity: 0.85;
    }

    &:focus {
      outline: none;
      border-color: var(--gold);
      box-shadow: 0 0 15px var(--gold-glow);
    }
  }

  select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c9a55c' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
  }
}

.hidden {
  display: none !important;
}

/* Characteristics Grid */
.characteristics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.char-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  transition: var(--transition-smooth);

  &:hover {
    border-color: var(--gold-dim);
  }
}

.char-name {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-normal);
}

.char-controls {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.char-value {
  width: 1.75rem;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
}

.char-item button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--gold);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover:not(:disabled) {
    background: rgba(201, 165, 92, 0.2);
    border-color: var(--gold);
  }

  &:disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }
}

/* Size Row */
.size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  margin-top: 0.625rem;
  border-top: 1px solid var(--glass-border);
}

.size-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.size-value {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--gold);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;

  input,
  select {
    padding: 0.5rem 0.75rem;
    font-family: 'Crimson Pro', serif;
    font-size: 0.9rem;
    color: var(--text-bright);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    transition: var(--transition-smooth);

    &:focus {
      outline: none;
      border-color: var(--gold);
    }
  }

  input {
    flex: 1;
  }

  select {
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23c9a55c' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
  }
}

/* House Grid */
.house-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.house-tile {
  padding: 0.625rem 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;

  &:hover {
    border-color: var(--gold-dim);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 8px var(--gold-glow);
  }

  &.selected {
    border-color: var(--gold);
    background: rgba(201, 165, 92, 0.15);
    box-shadow: 0 0 12px var(--gold-glow);
  }

  .house-name {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-normal);
    display: block;
  }

  &.selected .house-name {
    color: var(--gold-bright);
  }
}

/* Virtue/Flaw Columns */
.virtue-flaw-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.vf-column {
  display: flex;
  flex-direction: column;
}

.vf-header {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  text-align: center;

  &.virtue-header {
    background: rgba(90, 154, 106, 0.15);
    color: var(--virtue-green);
    border: 1px solid rgba(90, 154, 106, 0.3);
  }

  &.flaw-header {
    background: rgba(168, 85, 85, 0.15);
    color: var(--flaw-red);
    border: 1px solid rgba(168, 85, 85, 0.3);
  }
}

/* Tile Grid for Virtues/Flaws */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;

  &::-webkit-scrollbar {
    width: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 2px;
  }
}

.item {
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
  word-break: break-word;
  overflow: hidden;

  &:hover:not(.disabled) {
    border-color: var(--gold-dim);
    background: rgba(20, 16, 32, 0.6);
    transform: translateY(-1px);
  }

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

  .item-name {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-normal);
    display: block;
    margin-bottom: 0.125rem;
  }

  .item-cost {
    font-size: 0.7rem;
    color: var(--text-muted);
  }

  .item-desc {
    display: none;
  }
}

#virtue-list .item:hover:not(.disabled) {
  border-color: var(--virtue-green);
  box-shadow: 0 0 10px var(--virtue-glow);
}

#flaw-list .item:hover:not(.disabled) {
  border-color: var(--flaw-red);
  box-shadow: 0 0 10px var(--flaw-glow);
}

/* Selected Section */
.selected-section {
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);

  h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
  }
}

.selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.selected-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-normal);

  .remove-btn {
    background: none;
    border: none;
    color: var(--flaw-red);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
    transition: var(--transition-smooth);

    &:hover {
      opacity: 1;
      transform: scale(1.1);
    }
  }
}

/* Ability List */
.ability-list {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 1rem;

  &::-webkit-scrollbar {
    width: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 2px;
  }
}

.ability-category {
  margin-bottom: 0.5rem;

  h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.5rem 0.75rem;
    background: rgba(201, 165, 92, 0.1);
    border-left: 2px solid var(--gold);
    margin: 0;
  }
}

.ability-item {
  padding: 0.75rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-top: none;
  transition: var(--transition-smooth);

  &:last-child {
    border-radius: 0 0 4px 4px;
  }

  &:hover:not(.disabled) {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--glass-border-bright);
  }

  &.disabled {
    opacity: 0.4;
  }
}

.ability-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ability-name {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-bright);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ability-controls {
  display: flex;
  align-items: center;
  gap: 0.375rem;

  button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--glass-border);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--gold);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: bold;
    transition: var(--transition-smooth);

    &:hover:not(:disabled) {
      background: rgba(201, 165, 92, 0.2);
      border-color: var(--gold);
    }

    &:disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }
  }
}

.ability-score {
  width: 1.5rem;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--arcane-blue);
  text-shadow: 0 0 8px var(--arcane-glow);
}

.ability-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}

/* Parametered Abilities (Area Lore, Craft, etc.) */
.ability-item.parametered-ability {
  background: rgba(85, 136, 204, 0.08);
  border-color: rgba(85, 136, 204, 0.3);
}

.ability-item.parametered-ability:hover:not(.disabled) {
  background: rgba(85, 136, 204, 0.15);
  border-color: var(--arcane-blue);
}

.ability-add-btn {
  flex-shrink: 0;
  min-width: 3.5rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--arcane-blue);
  border-radius: 3px;
  background: rgba(85, 136, 204, 0.15);
  color: var(--arcane-blue);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.ability-add-btn:hover:not(:disabled) {
  background: rgba(85, 136, 204, 0.3);
  box-shadow: 0 0 8px var(--arcane-glow);
}

.ability-add-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.instance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 0.375rem;
  background: var(--arcane-blue);
  border-radius: 9px;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
}

.ability-item.ability-instance {
  padding: 0.375rem 0.75rem;
  padding-left: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--arcane-blue);
  margin-left: 0;
}

.ability-item.ability-instance .ability-name {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-normal);
}

.ability-item.ability-instance .instance-name {
  color: var(--text-bright);
}

/* Ability Modal Styles */
#ability-modal .instances-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

#ability-modal .instance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.375rem 0.625rem;
  background: rgba(85, 136, 204, 0.1);
  border: 1px solid rgba(85, 136, 204, 0.3);
  border-radius: 3px;
  font-size: 0.8rem;
}

#ability-modal .instance-name {
  color: var(--text-bright);
  font-weight: 500;
}

#ability-modal .instance-score {
  color: var(--arcane-blue);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
}

/* Arts Grid */
.arts-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.arts-section h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mana-purple);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--mana-purple);
}

.arts-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.375rem;
}

.art-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  transition: var(--transition-smooth);

  &:hover {
    border-color: var(--mana-purple);
    box-shadow: 0 0 10px var(--mana-glow);
  }
}

.art-name {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-normal);
  margin-bottom: 0.25rem;
}

.art-score {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mana-purple);
  text-shadow: 0 0 8px var(--mana-glow);
  margin-bottom: 0.25rem;
}

.puissant-indicator {
  font-size: 0.65rem;
  color: var(--gold-accent);
  margin-left: 2px;
  font-weight: 600;
  text-shadow: 0 0 4px var(--gold-glow);
}

.art-item.has-puissant {
  border-color: var(--gold-accent);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.art-item.has-puissant .art-score {
  color: var(--gold-accent);
}

/* Affinity with Art styling - cyan/teal to distinguish from gold Puissant */
.affinity-indicator {
  color: #5cb3c9;
  margin-left: 2px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.art-item.has-affinity {
  border-color: #5cb3c9;
  box-shadow: 0 0 8px rgba(92, 179, 201, 0.3);
}

.art-item.has-affinity .art-score {
  color: #5cb3c9;
}

/* Combined Puissant + Affinity styling - dual glow */
.art-item.has-puissant.has-affinity {
  border-color: var(--gold-accent);
  box-shadow:
    0 0 8px rgba(212, 175, 55, 0.3),
    0 0 12px rgba(92, 179, 201, 0.3);
}

.art-item.has-puissant.has-affinity .art-score {
  color: var(--gold-accent);
  text-shadow:
    0 0 6px var(--gold-glow),
    0 0 10px rgba(92, 179, 201, 0.5);
}

.art-controls {
  display: flex;
  gap: 0.25rem;

  button {
    width: 18px;
    height: 18px;
    border: 1px solid var(--mana-purple);
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--mana-purple);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    transition: var(--transition-smooth);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover:not(:disabled) {
      background: rgba(136, 102, 170, 0.2);
    }

    &:disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }
  }
}

.art-xp {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.ability-xp {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

/* Preview */
.preview {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 1rem;
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  color: var(--text-normal);
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1rem;

  &::-webkit-scrollbar {
    width: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 2px;
  }
}

/* Errors */
.errors {
  margin-bottom: 1rem;
}

.error {
  background: rgba(168, 85, 85, 0.15);
  border: 1px solid var(--flaw-red);
  color: #e8a0a0;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;

  &::before {
    content: '⚠ ';
    color: var(--flaw-red);
  }

  code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.125rem 0.375rem;
    border-radius: 2px;
    font-style: italic;
  }

  a {
    color: var(--gold);

    &:hover {
      color: var(--gold-bright);
    }
  }
}

/* Export Buttons */
.export-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.625rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-normal);
  cursor: pointer;
  transition: var(--transition-smooth);

  &:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--gold);
    color: var(--gold);
  }

  &:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
}

.btn-primary {
  background: rgba(201, 165, 92, 0.2);
  border-color: var(--gold);
  color: var(--gold);

  &:hover:not(:disabled) {
    background: rgba(201, 165, 92, 0.3);
    box-shadow: 0 0 15px var(--gold-glow);
  }
}

.btn-danger {
  background: rgba(168, 85, 85, 0.2);
  border-color: var(--flaw-red);
  color: var(--flaw-red);

  &:hover:not(:disabled) {
    background: rgba(168, 85, 85, 0.3);
    box-shadow: 0 0 15px rgba(168, 85, 85, 0.4);
  }
}

.btn-secondary {
  background: rgba(139, 137, 132, 0.2);
  border-color: var(--text-dim);
  color: var(--text-light);
  cursor: pointer;

  &:hover:not(:disabled) {
    background: rgba(139, 137, 132, 0.3);
    border-color: var(--text-light);
    box-shadow: 0 0 10px rgba(139, 137, 132, 0.3);
  }
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.65rem;
}

/* Share Code Section */
.share-code-section {
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
}

.share-code-section h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.code-export-area {
  margin-bottom: 1rem;
}

.code-output-container {
  margin-top: 0.75rem;
  position: relative;
}

.code-output-container textarea,
.code-import-area textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  padding-right: 70px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  color: var(--text-normal);
  resize: vertical;
  word-break: break-all;
}

.code-output-container textarea:focus,
.code-import-area textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.code-output-container .btn-small {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.code-import-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.code-import-area textarea {
  padding-right: 0.75rem;
}

.code-import-area .btn {
  align-self: flex-start;
}

.import-status {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.import-status.success {
  color: var(--virtue-green);
}

.import-status.error {
  color: var(--flaw-red);
}

/* ─────────────────────────────────────────────────────────────────────────────
   BOTTOM NAME PLATE
   ───────────────────────────────────────────────────────────────────────────── */
#name-plate {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.name-plate-frame {
  display: flex;
  align-items: center;
  background: var(--glass-bg-solid);
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  box-shadow:
    var(--shadow-heavy),
    0 0 30px var(--gold-glow);
  position: relative;
}

.name-plate-ornament {
  width: 30px;
  height: 30px;
  position: relative;

  &::before,
  &::after {
    content: '';
    position: absolute;
    background: var(--gold);
  }

  &.left {
    &::before {
      width: 2px;
      height: 20px;
      top: 5px;
      left: 10px;
    }
    &::after {
      width: 10px;
      height: 2px;
      top: 14px;
      left: 0;
    }
  }

  &.right {
    &::before {
      width: 2px;
      height: 20px;
      top: 5px;
      right: 10px;
    }
    &::after {
      width: 10px;
      height: 2px;
      top: 14px;
      right: 0;
    }
  }
}

#name-plate input {
  width: 300px;
  padding: 0.5rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  background: transparent;
  border: none;
  outline: none;

  &::placeholder {
    color: var(--gold-dim);
    font-style: italic;
    font-weight: 400;
    font-size: 0.9rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   LIGHTING TOGGLE
   ───────────────────────────────────────────────────────────────────────────── */
.lighting-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--glass-bg-solid);
  box-shadow:
    var(--shadow-heavy),
    0 0 20px var(--gold-glow);
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  z-index: 100;

  &:hover {
    transform: scale(1.1);
    box-shadow:
      var(--shadow-heavy),
      0 0 30px var(--gold-glow);
  }

  &.night {
    border-color: var(--arcane-blue);
    box-shadow:
      var(--shadow-heavy),
      0 0 20px var(--arcane-glow);

    &:hover {
      box-shadow:
        var(--shadow-heavy),
        0 0 30px var(--arcane-glow);
    }
  }

  .icon-sun,
  .icon-moon {
    filter: brightness(1.4) saturate(1.3);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   TYPE-SPECIFIC ELEMENTS
   ───────────────────────────────────────────────────────────────────────────── */

/* Magus-only elements */
.magus-only {
  display: none;
}

body.is-magus .magus-only {
  display: block;
}

/* Magic Character-only elements */
.magic-character-only {
  display: none;
}

body.is-magic-character .magic-character-only {
  display: block;
}

/* Type-specific tabs - visibility controlled by JavaScript */
.type-specific-tab {
  display: none; /* Hidden by default, JS controls visibility */
}

/* Summary sections - hidden by default */
.magus-only-summary {
  display: none;
}

body.is-magus .magus-only-summary {
  display: block;
}

.magic-character-only-summary {
  display: none;
}

body.is-magic-character .magic-character-only-summary {
  display: block;
}

/* Arts Summary in left panel */
.arts-summary {
  padding: 0.5rem 0;
}

.arts-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}

.arts-summary-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  opacity: 0.7;

  &:first-child {
    margin-top: 0;
  }
}

.art-abbr {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--text-muted);

  span {
    color: var(--mana-purple);
    font-weight: 600;
    text-shadow: 0 0 6px var(--mana-glow);
  }

  /* Puissant Art indicator in arts summary */
  span.has-puissant {
    color: var(--gold-accent);
    text-shadow: 0 0 6px var(--gold-glow);
  }
}

/* Might Summary in left panel */
.might-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.might-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.might-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.might-value {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mana-purple);
  text-shadow: 0 0 6px var(--mana-glow);
}

/* ─────────────────────────────────────────────────────────────────────────────
   QUALITIES STEP (MAGIC CHARACTER)
   ───────────────────────────────────────────────────────────────────────────── */
.qualities-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.qualities-section h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mana-purple);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--mana-purple);
}

.placeholder-text {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.placeholder-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.placeholder-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--glass-border);
  border-radius: 4px;
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  text-align: center;
}

.placeholder-tile.inferiority {
  border-color: rgba(168, 85, 85, 0.4);
}

.placeholder-name {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-normal);
  margin-bottom: 0.25rem;
}

.placeholder-cost {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  #left-panel {
    width: 280px;
  }

  #right-panel {
    width: 340px;
  }
}

@media (max-width: 1000px) {
  #left-panel {
    display: none;
  }

  #right-panel {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 90%;
    max-width: 450px;
  }

  .compass-seal {
    display: none;
  }

  .tabs-left,
  .tabs-right {
    gap: 0.125rem;
  }

  .tab {
    padding: 0.5rem 0.75rem;
  }

  .tab-label {
    display: none;
  }
}

@media (max-width: 600px) {
  #top-tabs {
    padding: 0.25rem 0.5rem;
  }

  .tab {
    padding: 0.5rem;
  }

  .tab-icon {
    font-size: 1.1rem;
  }

  .tab-icon .gi-tab {
    width: 1.1rem;
    height: 1.1rem;
  }

  #right-panel {
    top: 70px;
    max-height: calc(100vh - 170px);
    width: 95%;
  }

  #name-plate input {
    width: 200px;
    font-size: 1rem;
  }

  .house-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .characteristics-grid {
    grid-template-columns: 1fr;
  }

  .virtue-flaw-columns {
    grid-template-columns: 1fr;
  }

  .tile-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .arts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   TOOLTIP SYSTEM
   ───────────────────────────────────────────────────────────────────────────── */
.tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 420px;
  min-width: 240px;
  padding: 1rem 1.25rem;
  background: var(--glass-bg-solid);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-bright);
  border-radius: 6px;
  box-shadow:
    var(--shadow-heavy),
    0 0 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;

  /* Inner glow */
  &::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, var(--glass-highlight) 0%, transparent 40%);
    pointer-events: none;
  }
}

.tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Type-specific border colors */
.tooltip.tooltip-virtue {
  border-color: var(--virtue-green);
  box-shadow:
    var(--shadow-heavy),
    0 0 15px var(--virtue-glow);
}

.tooltip.tooltip-flaw {
  border-color: var(--flaw-red);
  box-shadow:
    var(--shadow-heavy),
    0 0 15px var(--flaw-glow);
}

.tooltip.tooltip-ability {
  border-color: var(--arcane-blue);
  box-shadow:
    var(--shadow-heavy),
    0 0 15px var(--arcane-glow);
}

.tooltip.tooltip-character-type {
  border-color: var(--gold);
  box-shadow:
    var(--shadow-heavy),
    0 0 15px var(--gold-glow);
}

.tooltip.tooltip-technique,
.tooltip.tooltip-form {
  border-color: var(--mana-purple);
  box-shadow:
    var(--shadow-heavy),
    0 0 15px var(--mana-glow);
}

.tooltip.tooltip-spell {
  border-color: var(--mana-purple);
  box-shadow:
    var(--shadow-heavy),
    0 0 15px var(--mana-glow);
}

/* Tooltip content styling */
.tooltip-name {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.375rem;
  letter-spacing: 0.02em;
}

.tooltip-virtue .tooltip-name {
  color: var(--virtue-green);
}

.tooltip-flaw .tooltip-name {
  color: var(--flaw-red);
}

.tooltip-ability .tooltip-name {
  color: var(--arcane-blue);
}

.tooltip-character-type .tooltip-name {
  color: var(--gold);
}

.tooltip-technique .tooltip-name,
.tooltip-form .tooltip-name {
  color: var(--mana-purple);
}

.tooltip-spell .tooltip-name {
  color: var(--mana-purple);
}

.tooltip-spell-params {
  font-size: 0.85rem;
  color: var(--text-normal);
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(136, 102, 170, 0.15);
  border-radius: 3px;
  border-left: 2px solid var(--mana-purple);
}

.tooltip-type {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.tooltip-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-normal);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.tooltip-stats span {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

.tooltip-desc {
  font-size: 0.95rem;
  color: var(--text-normal);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.tooltip-extended {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-style: italic;
  padding-top: 0.5rem;
  border-top: 1px solid var(--glass-border);
}

.tooltip-category {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--glass-border);
  text-align: right;
}

.tooltip-specializations {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--glass-border);
}

.tooltip-spec-label {
  color: var(--text-normal);
  font-weight: 500;
}

/* Hide tooltips on touch devices */
@media (hover: none) {
  .tooltip {
    display: none;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   AGE/EXPERIENCE STEP
   ───────────────────────────────────────────────────────────────────────────── */
.age-panel {
  display: none;
}

.age-panel:not(.hidden) {
  display: block;
}

.age-input-group {
  margin-bottom: 1.25rem;

  label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
  }
}

.age-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  input[type='number'] {
    width: 80px;
    padding: 0.625rem 0.5rem;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: var(--gold-bright);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    transition: var(--transition-smooth);

    &:focus {
      outline: none;
      border-color: var(--gold);
      box-shadow: 0 0 15px var(--gold-glow);
    }

    /* Hide spinner buttons */
    &::-webkit-outer-spin-button,
    &::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
    -moz-appearance: textfield;
  }

  button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--gold);
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: bold;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover:not(:disabled) {
      background: rgba(201, 165, 92, 0.2);
      border-color: var(--gold);
      box-shadow: 0 0 10px var(--gold-glow);
    }

    &:disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }
  }
}

.age-hint {
  display: block;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

.age-fixed-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

.age-fixed-label {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.age-fixed-value {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-normal);
}

.age-summary {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1.5rem;
}

.age-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;

  &:not(:last-child) {
    border-bottom: 1px solid var(--glass-border);
  }

  &.total {
    background: rgba(201, 165, 92, 0.1);
    margin: -0.5rem -0.75rem;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;

    .age-summary-label {
      color: var(--gold);
      font-weight: 600;
    }

    .age-summary-value {
      color: var(--gold-bright);
      font-size: 1.1rem;
    }
  }
}

.age-summary-label {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.age-summary-value {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);

  &.xp {
    color: var(--virtue-green);
    text-shadow: 0 0 8px var(--virtue-glow);
  }

  &.arcane {
    color: var(--mana-purple);
    text-shadow: 0 0 8px var(--mana-glow);
  }
}

/* Season Selection */
.season-intro {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.season-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.season-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--glass-border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;

  &:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--gold-dim);
    transform: translateY(-2px);
  }

  &.selected {
    background: rgba(201, 165, 92, 0.15);
    border-color: var(--gold);
    box-shadow:
      0 0 20px var(--gold-glow),
      inset 0 0 15px rgba(201, 165, 92, 0.1);

    .season-name {
      color: var(--gold-bright);
    }

    .season-icon {
      transform: scale(1.1);
    }
  }
}

.season-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  transition: var(--transition-smooth);
  filter: brightness(1.3) saturate(1.2);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.season-name {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
}

.season-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Shared Pool Note */
.shared-pool-note {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--mana-purple);
  text-align: center;
  padding: 0.375rem 0.75rem;
  margin-bottom: 0.75rem;
  background: rgba(136, 102, 170, 0.1);
  border: 1px solid rgba(136, 102, 170, 0.3);
  border-radius: 4px;
}

/* Native Language Section */
.native-language-section {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(139, 109, 48, 0.1));
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.native-language-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.native-language-label {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.05em;
}

.native-language-score {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--gold-dim);
}

#native-language-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);

  &:hover {
    border-color: var(--gold-dim);
  }

  &:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
  }

  option {
    background: var(--bg-darker);
    color: var(--text-primary);
  }
}

.selected-item.native-language {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(139, 109, 48, 0.2));
  border-color: var(--gold-dim);
}

.free-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  margin-left: 0.25rem;
}

/* Childhood ability indicator tag */
.childhood-tag {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  color: var(--arcane-blue);
  background: rgba(85, 136, 204, 0.2);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  margin-left: 0.25rem;
  cursor: help;
}

.puissant-tag {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  color: var(--gold-accent);
  background: rgba(212, 175, 55, 0.2);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  margin-left: 0.25rem;
  cursor: help;
}

.selected-item.has-puissant {
  border-color: var(--gold-accent);
}

.ability-item.has-puissant {
  border-color: var(--gold-accent);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

.ability-item.has-puissant .ability-score {
  color: var(--gold-accent);
}

/* Affinity with Ability styling - cyan/teal to match Art affinity */
.ability-item.has-affinity {
  border-color: #5cb3c9;
  box-shadow: 0 0 8px rgba(92, 179, 201, 0.2);
}

.ability-item.has-affinity .ability-score {
  color: #5cb3c9;
}

/* Combined Puissant + Affinity styling for abilities */
.ability-item.has-puissant.has-affinity {
  border-color: var(--gold-accent);
  box-shadow:
    0 0 8px rgba(212, 175, 55, 0.2),
    0 0 12px rgba(92, 179, 201, 0.2);
}

.ability-item.has-puissant.has-affinity .ability-score {
  color: var(--gold-accent);
  text-shadow:
    0 0 6px var(--gold-glow),
    0 0 10px rgba(92, 179, 201, 0.5);
}

/* XP cost display in selected items */
.xp-cost {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Validation messages */
.validation-message {
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: center;
}

.validation-message.success {
  background: rgba(90, 154, 106, 0.2);
  border: 1px solid var(--virtue-green);
  color: var(--virtue-green);
}

.validation-message.warning {
  background: rgba(201, 165, 92, 0.15);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
}

.validation-message.error {
  background: rgba(168, 85, 85, 0.2);
  border: 1px solid var(--flaw-red);
  color: var(--flaw-red);
}

/* Human-only content visibility */
.human-only {
  display: none;
}

body.is-human-character .human-only {
  display: block;
}

/* Later life note styling */
#later-life-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: rgba(85, 136, 204, 0.1);
  border-radius: 4px;
  border-left: 3px solid var(--arcane-blue);
}

/* Selected childhood abilities total */
.selected-item.total {
  background: rgba(85, 136, 204, 0.15);
  border-color: var(--arcane-blue);
  color: var(--text-bright);
}

/* Native language in ability list */
.ability-item.native-language-item {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(139, 109, 48, 0.1));
  border-color: var(--gold-dim);
}

.ability-item.native-language-item .ability-score.native-score {
  color: var(--gold-bright);
  font-weight: 700;
}

/* Age Summary Hint */
.age-summary-hint {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--glass-border);
}

/* ─────────────────────────────────────────────────────────────────────────────
   QUALITIES & INFERIORITIES STEP (MAGIC CHARACTER) - FULL IMPLEMENTATION
   ───────────────────────────────────────────────────────────────────────────── */

/* Might Configuration Section */
.might-config-section {
  background: linear-gradient(135deg, rgba(136, 102, 170, 0.1), rgba(85, 60, 130, 0.1));
  border: 1px solid var(--mana-purple);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.might-config-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
}

.might-score-group,
.might-form-group {
  flex: 1;
}

.might-score-group label,
.might-form-group label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--mana-purple);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.might-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.might-input-row input[type='number'] {
  width: 70px;
  padding: 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  color: var(--mana-purple);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--mana-purple);
  border-radius: 4px;
  text-shadow: 0 0 8px var(--mana-glow);

  &:focus {
    outline: none;
    box-shadow: 0 0 15px var(--mana-glow);
  }

  /* Hide spinner buttons */
  &::-webkit-outer-spin-button,
  &::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  -moz-appearance: textfield;
}

.might-input-row button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--mana-purple);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--mana-purple);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    background: rgba(136, 102, 170, 0.3);
    box-shadow: 0 0 10px var(--mana-glow);
  }
}

#might-form-select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  color: var(--text-bright);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--mana-purple);
  border-radius: 4px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238866aa' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;

  &:focus {
    outline: none;
    box-shadow: 0 0 15px var(--mana-glow);
  }
}

/* Magic Being Type Section */
.magic-type-section {
  margin-bottom: 1rem;

  > label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
  }
}

.magic-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.magic-type-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--glass-border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;

  &:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--mana-purple);
    transform: translateY(-2px);
  }

  &.selected {
    background: rgba(136, 102, 170, 0.2);
    border-color: var(--mana-purple);
    box-shadow:
      0 0 15px var(--mana-glow),
      inset 0 0 10px rgba(136, 102, 170, 0.1);

    .type-name {
      color: var(--mana-purple);
    }

    .type-icon {
      transform: scale(1.1);
    }
  }
}

.magic-type-option .type-icon {
  font-size: 1.5rem;
  margin-bottom: 0.375rem;
  transition: var(--transition-smooth);
}

.magic-type-option .type-name {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
}

.magic-type-option .type-hint {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.3;
}

/* Quality Points Summary */
.quality-points-summary {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.quality-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.375rem 0;

  &:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  &.total {
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
    border-bottom: none;

    .calc-label {
      font-weight: 600;
      color: var(--mana-purple);
    }

    .calc-value {
      font-size: 1.1rem;
      font-weight: 700;
      color: var(--mana-purple);
      text-shadow: 0 0 8px var(--mana-glow);
    }
  }
}

.calc-label {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.calc-value {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-normal);

  &.inferiority-bonus {
    color: var(--flaw-red);
  }

  &.quality-spent {
    color: var(--virtue-green);
  }
}

/* Quality/Inferiority Two-Column Layout */
.quality-inferiority-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.qi-column {
  display: flex;
  flex-direction: column;
}

.qi-header {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  text-align: center;

  &.quality-header {
    background: rgba(136, 102, 170, 0.15);
    color: var(--mana-purple);
    border: 1px solid rgba(136, 102, 170, 0.3);
  }

  &.inferiority-header {
    background: rgba(168, 85, 85, 0.15);
    color: var(--flaw-red);
    border: 1px solid rgba(168, 85, 85, 0.3);
  }
}

/* Quality Items */
#quality-list .item.quality:hover:not(.disabled) {
  border-color: var(--mana-purple);
  box-shadow: 0 0 10px var(--mana-glow);
}

/* Inferiority Items */
.item.inferiority {
  border-color: rgba(168, 85, 85, 0.3);
  background: rgba(168, 85, 85, 0.05);

  .item-name {
    color: var(--flaw-red);
  }

  &:hover:not(.disabled) {
    border-color: var(--flaw-red);
    box-shadow: 0 0 10px var(--flaw-glow);
  }
}

/* Selected Items Colors */
.selected-item.quality {
  background: rgba(136, 102, 170, 0.2);
  border-color: var(--mana-purple);
  color: var(--mana-purple);
}

.selected-item.inferiority {
  background: rgba(168, 85, 85, 0.2);
  border-color: var(--flaw-red);
  color: var(--flaw-red);
}

/* Responsive adjustments for Qualities step */
@media (max-width: 600px) {
  .magic-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .might-config-row {
    flex-direction: column;
    gap: 1rem;
  }

  .quality-inferiority-columns {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   VIRTUE/FLAW PARAMETER MODAL
   ───────────────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-overlay.hidden {
  display: none;
}

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

.modal-panel {
  width: 90%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--glass-bg-solid);
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow:
    var(--shadow-heavy),
    0 0 40px var(--gold-glow);
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}

.modal-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: var(--transition-smooth);

  &:hover {
    color: var(--flaw-red);
    transform: scale(1.1);
  }
}

.modal-body {
  padding: 1.25rem;
}

.modal-body > p {
  font-size: 0.9rem;
  color: var(--text-normal);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.modal-section {
  margin-bottom: 1rem;

  &:last-child {
    margin-bottom: 0;
  }

  > label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
  }
}

.modal-section input[type='text'] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  color: var(--text-bright);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  transition: var(--transition-smooth);

  &::placeholder {
    color: var(--text-muted);
    font-style: italic;
  }

  &:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
  }

  &.error {
    border-color: var(--flaw-red);
    box-shadow: 0 0 10px var(--flaw-glow);
    animation: shake 0.3s ease-in-out;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Parameter quick-select options */
.parameter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.75rem;
}

.param-option-btn {
  padding: 0.375rem 0.625rem;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-normal);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);

  &:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--gold-dim);
  }

  &.selected {
    background: rgba(201, 165, 92, 0.2);
    border-color: var(--gold);
    color: var(--gold);
  }
}

/* Sub-parameter section for parametered abilities */
.modal-subsection {
  margin-top: 1rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--gold-dim);

  > label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.375rem;
  }

  input[type='text'] {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: 'Crimson Pro', serif;
    font-size: 0.95rem;
    color: var(--text-bright);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    transition: var(--transition-smooth);

    &::placeholder {
      color: var(--text-muted);
      font-style: italic;
    }

    &:focus {
      outline: none;
      border-color: var(--gold);
      box-shadow: 0 0 15px var(--gold-glow);
    }

    &.error {
      border-color: var(--flaw-red);
      box-shadow: 0 0 10px var(--flaw-glow);
      animation: shake 0.3s ease-in-out;
    }
  }
}

/* Severity toggle buttons */
.severity-options {
  display: flex;
  gap: 0.5rem;
}

.severity-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-normal);
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--glass-border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);

  &:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--glass-border-bright);
  }

  &.selected {
    color: var(--flaw-red);
    background: rgba(168, 85, 85, 0.15);
    border-color: var(--flaw-red);
    box-shadow: 0 0 15px var(--flaw-glow);
  }

  &[data-severity='major'].selected {
    box-shadow: 0 0 20px var(--flaw-glow);
  }
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.1);
}

/* Virtue/Flaw list item indicators */
.item .param-indicator {
  font-size: 0.6rem;
  color: var(--gold-dim);
  font-style: italic;
}

.item .multiple-indicator {
  font-size: 0.55rem;
  color: var(--mana-purple);
  margin-left: 0.25rem;
}

.item .major-indicator {
  font-size: 0.55rem;
  color: var(--flaw-red);
  margin-left: 0.25rem;
}

/* Selected item with parameter display */
.selected-item .item-parameter {
  font-size: 0.7rem;
  color: var(--gold);
  font-style: italic;
}

.selected-item .item-major-tag {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--flaw-red);
  margin-left: 0.25rem;
}

/* Disabled/forbidden items */
.item.forbidden {
  opacity: 0.35;
  cursor: not-allowed;

  &:hover {
    border-color: var(--glass-border);
    box-shadow: none;
    transform: none;
  }
}

.item .forbidden-indicator {
  font-size: 0.55rem;
  color: var(--flaw-red);
  display: block;
  margin-top: 0.125rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CUSTOM VIRTUE/FLAW
   ───────────────────────────────────────────────────────────────────────────── */

.selected-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.add-custom-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: var(--transition-smooth);

  &:hover {
    color: var(--gold);
    border-color: var(--gold-dim);
    background: rgba(0, 0, 0, 0.3);
  }
}

.custom-vf-type-toggle {
  display: flex;
  gap: 0.5rem;
}

.custom-toggle-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-normal);
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--glass-border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);

  &:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--glass-border-bright);
  }

  &.selected[data-kind='virtue'] {
    color: var(--virtue-green);
    background: rgba(90, 154, 106, 0.15);
    border-color: var(--virtue-green);
    box-shadow: 0 0 15px var(--virtue-glow);
  }

  &.selected[data-kind='flaw'] {
    color: var(--flaw-red);
    background: rgba(168, 85, 85, 0.15);
    border-color: var(--flaw-red);
    box-shadow: 0 0 15px var(--flaw-glow);
  }
}

.custom-tag {
  font-size: 0.55rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mana-purple);
  border: 1px solid rgba(136, 102, 170, 0.4);
  border-radius: 3px;
  padding: 0 0.25rem;
  margin-left: 0.2rem;
}

.tainted-tag {
  font-size: 0.55rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #c0392b;
  border: 1px solid rgba(192, 57, 43, 0.4);
  border-radius: 3px;
  padding: 0 0.25rem;
  margin-left: 0.2rem;
}

.selected-item.custom-vf {
  border-color: rgba(136, 102, 170, 0.3);
}

/* ─────────────────────────────────────────────────────────────────────────────
   HOUSE VIRTUE MODAL
   ───────────────────────────────────────────────────────────────────────────── */
.house-virtue-intro {
  font-size: 0.9rem;
  color: var(--text-normal);
  margin-bottom: 1rem;
}

.house-virtue-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.house-virtue-options.error {
  animation: shake 0.3s ease-in-out;
}

.house-virtue-option {
  padding: 0.875rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--glass-border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.house-virtue-option:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--gold-dim);
}

.house-virtue-option.selected {
  background: rgba(90, 154, 106, 0.15);
  border-color: var(--virtue-green);
  box-shadow: 0 0 15px var(--virtue-glow);
}

.virtue-option-name {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
}

.house-virtue-option.selected .virtue-option-name {
  color: var(--virtue-green);
}

.virtue-option-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* House virtue in selected list */
.selected-item.house-virtue {
  background: rgba(90, 154, 106, 0.2);
  border-color: var(--virtue-green);
}

.selected-item.house-virtue .free-tag {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--virtue-green);
  margin-left: 0.25rem;
}

/* House flaw in selected list (Ex Miscellanea) */
.selected-item.house-flaw {
  background: rgba(180, 100, 100, 0.2);
  border-color: var(--flaw-red);
}

.selected-item.house-flaw .house-flaw-tag {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--flaw-red);
  margin-left: 0.25rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   EX MISCELLANEA TRADITION MODAL
   ───────────────────────────────────────────────────────────────────────────── */
.ex-misc-panel {
  max-width: 700px;
  max-height: 85vh;
}

.ex-misc-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  max-height: 60vh;
}

.ex-misc-intro {
  font-size: 0.9rem;
  color: var(--text-normal);
  margin-bottom: 0.5rem;
}

.ex-misc-section {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.75rem;
}

.ex-misc-section.error {
  border-color: var(--flaw-red);
  animation: shake 0.3s ease-in-out;
}

.ex-misc-section-title {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ex-misc-section-title.virtue-title {
  color: var(--virtue-green);
}

.ex-misc-section-title.flaw-title {
  color: var(--flaw-red);
}

.ex-misc-section-title .free-tag {
  font-family: 'Crimson Text', serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--virtue-green);
  background: rgba(90, 154, 106, 0.2);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.ex-misc-section-title .required-tag {
  font-family: 'Crimson Text', serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--flaw-red);
  background: rgba(180, 100, 100, 0.2);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.ex-misc-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.ex-misc-option {
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--glass-border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.ex-misc-option:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--gold-dim);
}

.ex-misc-option.virtue-option.selected {
  background: rgba(90, 154, 106, 0.15);
  border-color: var(--virtue-green);
  box-shadow: 0 0 10px var(--virtue-glow);
}

.ex-misc-option.flaw-option.selected {
  background: rgba(180, 100, 100, 0.15);
  border-color: var(--flaw-red);
  box-shadow: 0 0 10px var(--flaw-glow);
}

.ex-misc-option-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-bright);
}

.ex-misc-option.selected .ex-misc-option-name {
  color: var(--virtue-green);
}

.ex-misc-option.flaw-option.selected .ex-misc-option-name {
  color: var(--flaw-red);
}

.ex-misc-param-row {
  margin-top: 0.35rem;
}

.ex-misc-param-input {
  width: 100%;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  color: var(--text-normal);
}

.ex-misc-param-input:focus {
  outline: none;
  border-color: var(--gold-dim);
}

.ex-misc-param-input.error {
  border-color: var(--flaw-red);
  animation: shake 0.3s ease-in-out;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SPELLS STEP
   ───────────────────────────────────────────────────────────────────────────── */

/* Spell List Container */
.spell-list {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 1rem;
  padding-right: 0.25rem;
}

.spell-list::-webkit-scrollbar {
  width: 4px;
}

.spell-list::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 2px;
}

.spell-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-style: italic;
}

/* Spell Form Section */
.spell-form-section {
  margin-bottom: 1rem;
}

.spell-form-header {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--mana-purple);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  background: rgba(136, 102, 170, 0.1);
  border-left: 2px solid var(--mana-purple);
  margin: 0 0 0.5rem 0;
}

/* Spell Grid */
.spell-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

/* Spell Card */
.spell-card {
  padding: 0.625rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
  overflow: hidden;
  min-width: 0;
}

.spell-card:hover:not(.disabled):not(.selected) {
  border-color: var(--mana-purple);
  background: rgba(136, 102, 170, 0.1);
  box-shadow: 0 0 10px var(--mana-glow);
}

.spell-card.selected {
  border-color: var(--gold);
  background: rgba(201, 165, 92, 0.15);
  opacity: 0.6;
  cursor: not-allowed;
}

.spell-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.spell-card.ritual {
  border-left: 3px solid var(--flaw-red);
}

/* Spell Card Contents */
.spell-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.spell-name {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ritual-tag {
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.35rem;
  background: rgba(168, 85, 85, 0.2);
  border: 1px solid rgba(168, 85, 85, 0.4);
  border-radius: 2px;
  color: var(--flaw-red);
}

.spell-card-arts {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mana-purple);
  margin-bottom: 0.25rem;
}

.spell-card-params {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.spell-card-desc {
  font-size: 0.7rem;
  color: var(--text-normal);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Selected Spells */
.selected-item.spell-item {
  background: rgba(136, 102, 170, 0.15);
  border-color: rgba(136, 102, 170, 0.4);
}

.selected-item.spell-item.ritual {
  border-left: 2px solid var(--flaw-red);
}

.no-spells {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
}

/* Spell Level Modal */
#spell-level-modal .modal-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#spell-level-modal label {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: var(--text-normal);
}

#spell-level-input {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  color: var(--text-bright);
}

#spell-level-input:focus {
  outline: none;
  border-color: var(--gold);
}

.level-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────────────────────────
   AUTH UI
   ───────────────────────────────────────────────────────────────────────────── */

#auth-area {
  position: fixed;
  top: 8px;
  right: 16px;
  z-index: 1100;
}

.auth-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  padding: 6px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  background: var(--glass-bg);
  color: var(--gold);
  cursor: pointer;
  transition: var(--transition-smooth);
  backdrop-filter: blur(8px);
}

.auth-btn:hover {
  border-color: var(--gold);
  background: rgba(201, 165, 92, 0.1);
}

.auth-user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
}

.auth-user-menu {
  position: relative;
}

.auth-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 160px;
  background: var(--glass-bg-solid);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-heavy);
}

.auth-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  color: var(--text-normal);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.auth-dropdown-item:hover {
  background: rgba(201, 165, 92, 0.1);
  color: var(--gold);
}

/* Login Modal */
.login-modal-panel {
  max-width: 380px;
}

.login-modal-body {
  text-align: center;
}

.login-intro {
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-bright);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.oauth-btn:hover {
  border-color: var(--gold-dim);
  background: rgba(201, 165, 92, 0.08);
}

.oauth-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* My Characters Modal */
.my-chars-panel {
  max-width: 500px;
  max-height: 70vh;
}

.my-chars-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.my-chars-loading,
.my-chars-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
}

.my-char-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.my-char-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.my-char-name {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--text-bright);
}

.my-char-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.my-char-actions {
  display: flex;
  gap: 6px;
}

.btn-sm {
  font-size: 0.7rem;
  padding: 4px 10px;
}
