/* ================================================================
   BecomeChampion - W40K Phase Prompt Tool
   Mobile-First Stylesheet | Warhammer 40K Dark Theme
   ================================================================ */

/* ============ CSS VARIABLES ============ */
:root {
  --bg-primary:    #0d0d1a;
  --bg-secondary:  #1a1a2e;
  --bg-card:       #16213e;
  --bg-elevated:   #0f3460;

  --accent-gold:     #c9a227;
  --accent-gold-dim: #a07c10;
  --accent-gold-bg:  rgba(201,162,39,0.08);

  --text-primary:   #e8e8e8;
  --text-secondary: #9090a8;
  --text-muted:     #505065;

  --border:         rgba(201,162,39,0.18);
  --border-hover:   rgba(201,162,39,0.45);

  --success:  #43a047;
  --danger:   #e53935;
  --info:     #1976d2;

  /* Per-phase accent colors */
  --phase-command:     #c9a227;
  --phase-movement:    #1976d2;
  --phase-shooting:    #c62828;
  --phase-charge:      #ef6c00;
  --phase-fight:       #7b1fa2;
  --phase-battleshock: #37474f;

  --radius:    12px;
  --radius-sm:  8px;
  --radius-xs:  5px;
  --transition: 0.18s ease;
  --shadow:     0 4px 20px rgba(0,0,0,0.5);
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }
input, textarea { font-family: inherit; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(201,162,39,0.25);
  border-radius: 2px;
}

/* ============ APP SHELL ============ */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ LOADING SCREEN ============ */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 14px;
}

.loading-logo {
  font-size: 72px;
  line-height: 1;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.93); }
}

.loading-text {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.loading-sub {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

/* ============ HEADER ============ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-titles { min-width: 0; }

.header-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ============ ICON BUTTON ============ */
.icon-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.icon-btn:hover  { color: var(--accent-gold); border-color: var(--border); }
.icon-btn:active { transform: scale(0.9); }

/* ============ BACK BUTTON ============ */
.back-btn {
  background: none;
  border: none;
  color: var(--accent-gold);
  font-size: 22px;
  cursor: pointer;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  flex-shrink: 0;
}
.back-btn:hover  { background: var(--accent-gold-bg); }
.back-btn:active { transform: scale(0.9); }

/* ============ MAIN CONTENT ============ */
.main-content {
  flex: 1;
  padding: 14px 16px 80px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

/* ============ BOTTOM ACTION BAR ============ */
.bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 90;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  /* safe area on iOS */
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

/* ============ GENERAL BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  min-height: 48px;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent-gold);
  color: #000;
  flex: 1;
}
.btn-primary:hover { background: var(--accent-gold-dim); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); color: var(--accent-gold); }

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-primary); }

.btn-danger {
  background: rgba(229,57,53,0.08);
  color: var(--danger);
  border: 1px solid rgba(229,57,53,0.25);
}
.btn-danger:hover { background: rgba(229,57,53,0.18); }

.btn-full { width: 100%; }

/* ============ PACK INFO CARD ============ */
.pack-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pack-info-text { flex: 1; min-width: 0; }

.pack-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pack-version {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.pack-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* ============ ROUND BAR ============ */
.round-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.round-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.round-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.round-number {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-gold);
  min-width: 28px;
  text-align: center;
  line-height: 1;
}

.round-adj-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}
.round-adj-btn:hover  { border-color: var(--accent-gold); color: var(--accent-gold); }
.round-adj-btn:active { transform: scale(0.9); }

/* ============ PHASE GRID ============ */
.phase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}

.phase-btn {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  color: var(--text-primary);
  /* per-phase color via inline style --phase-color */
}

.phase-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--phase-color, var(--accent-gold));
  transition: height var(--transition);
}

.phase-btn:hover {
  border-color: var(--phase-color, var(--accent-gold));
  background: var(--bg-elevated);
}
.phase-btn:hover::before { height: 5px; }
.phase-btn:active { transform: scale(0.97); }

.phase-icon { font-size: 30px; line-height: 1; }

.phase-name    { font-size: 14px; font-weight: 700; }
.phase-name-en { font-size: 10px; color: var(--text-secondary); margin-top: -2px; }

.phase-badge {
  position: absolute;
  top: 7px; right: 9px;
  font-size: 10px;
  font-weight: 700;
  background: var(--phase-color, var(--accent-gold));
  color: #000;
  border-radius: 10px;
  padding: 1px 7px;
  line-height: 1.5;
}

/* ============ FILTER CHIPS ============ */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-chip:hover { border-color: var(--border-hover); color: var(--text-primary); }

.filter-chip.active {
  background: var(--phase-color, var(--accent-gold));
  border-color: var(--phase-color, var(--accent-gold));
  color: #000;
  font-weight: 700;
}

.detachment-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 0 10px;
}

.detachment-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.select-wrap {
  position: relative;
}

.select-arrow {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--phase-color, var(--accent-gold));
  border-bottom: 2px solid var(--phase-color, var(--accent-gold));
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  opacity: 0.9;
}

.detachment-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  min-height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 40px 0 12px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  box-shadow: inset 0 0 0 1px transparent;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.detachment-select:hover {
  border-color: var(--border-hover);
}

.detachment-select:focus {
  border-color: var(--phase-color, var(--accent-gold));
  box-shadow:
    inset 0 0 0 1px var(--phase-color, var(--accent-gold)),
    0 0 0 3px color-mix(in srgb, var(--phase-color, var(--accent-gold)) 18%, transparent);
  background: color-mix(in srgb, var(--phase-color, var(--accent-gold)) 6%, var(--bg-card));
}

.detachment-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ============ ABILITY CARDS ============ */
.ability-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ability-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), opacity var(--transition);
}

.ability-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--card-accent, var(--accent-gold));
}

.ability-card.is-used {
  opacity: 0.45;
}
.ability-card.is-used .used-btn {
  background: var(--accent-gold-bg);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.ability-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.ability-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.3;
}

/* Type badges */
.type-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  margin-top: 2px;
}
.badge-active     { background: rgba(201,162,39,0.15);  color: #c9a227; }
.badge-passive    { background: rgba(33,150,243,0.15);   color: #64b5f6; }
.badge-reaction   { background: rgba(244,67,54,0.15);    color: #ef9a9a; }
.badge-wargear    { background: rgba(156,39,176,0.15);   color: #ce93d8; }
.badge-stratagem  { background: rgba(76,175,80,0.15);    color: #a5d6a7; }
.badge-detachment { background: rgba(255,152,0,0.15);    color: #ffcc80; }
.badge-enhancement{ background: rgba(0,188,212,0.15);   color: #80deea; }

.ability-timing {
  font-size: 11px;
  color: #ffcc80;
  margin-bottom: 7px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.4;
}

.ability-details {
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}

.ability-details[open] {
  border-color: rgba(255,255,255,0.1);
}

.ability-details-toggle {
  position: relative;
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-gold);
  padding: 9px 34px 9px 12px;
}

.ability-details-toggle::-webkit-details-marker {
  display: none;
}

.ability-details-toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform var(--transition);
}

.ability-details[open] .ability-details-toggle::after {
  transform: translateY(-20%) rotate(225deg);
}

.ability-summary {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.65;
  white-space: pre-wrap;
  padding: 0 12px 12px;
}

.ability-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  gap: 8px;
}

.ability-source {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ability-cp {
  font-size: 12px;
  background: rgba(201,162,39,0.12);
  color: var(--accent-gold);
  border-radius: 6px;
  padding: 2px 9px;
  font-weight: 700;
  white-space: nowrap;
}

.used-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  min-height: 30px;
}
.used-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.used-btn:active { transform: scale(0.95); }

/* ============ SECTION HEADING ============ */
.section-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ============ PACK LIST (manage) ============ */
.pack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.pack-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.pack-item:hover          { border-color: var(--border-hover); }
.pack-item.is-active-pack { border-color: var(--accent-gold); background: var(--accent-gold-bg); }

.pack-radio {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  transition: all var(--transition);
}
.pack-item.is-active-pack .pack-radio {
  border-color: var(--accent-gold);
  background: var(--accent-gold);
  color: #000;
  font-weight: 700;
}

.pack-item-info { flex: 1; min-width: 0; }

.pack-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pack-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.pack-del-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  font-size: 17px;
  transition: color var(--transition);
  min-width: 34px; min-height: 34px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pack-del-btn:hover { color: var(--danger); }
.pack-del-btn:active { transform: scale(0.9); }

/* ============ MANAGE ACTIONS ============ */
.manage-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 20px;
}

/* ============ ROSTER / ARMY BUILDING ============ */
.roster-summary-card {
  background: linear-gradient(180deg, rgba(15,52,96,0.88), rgba(22,33,62,0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.roster-summary-text {
  flex: 1;
  min-width: 0;
}

.roster-summary-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold);
}

.roster-summary-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.roster-search-input {
  width: 100%;
  min-height: 46px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  padding: 0 14px;
  margin-bottom: 12px;
}

.roster-search-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.roster-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.roster-toolbar .btn {
  flex: 1;
}

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

.roster-unit-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  color: var(--text-primary);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.roster-unit-card:hover {
  border-color: var(--border-hover);
  background: rgba(15,52,96,0.55);
}

.roster-unit-card.is-selected {
  border-color: var(--accent-gold);
  background: var(--accent-gold-bg);
}

.roster-unit-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #000;
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}

.roster-unit-card.is-selected .roster-unit-check {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
}

.roster-unit-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.roster-unit-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.roster-unit-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.roster-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.roster-keyword {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(201,162,39,0.08);
  border: 1px solid rgba(201,162,39,0.18);
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-secondary);
}
.empty-icon  { font-size: 48px; margin-bottom: 12px; line-height: 1; }
.empty-title { font-size: 15px; font-weight: 600; margin-bottom: 7px; }
.empty-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.18s ease;
}

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

.modal-sheet {
  background: var(--bg-secondary);
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  animation: slideUp 0.28s cubic-bezier(0.25,0.8,0.25,1);
  max-width: 640px;
  margin: 0 auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-gold);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  min-width: 36px; min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs);
  transition: color var(--transition);
  line-height: 1;
}
.modal-close-btn:hover { color: var(--text-primary); }

/* ============ IMPORT TABS & PANELS ============ */
.import-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.import-tab-btn {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.import-tab-btn.active {
  background: var(--accent-gold);
  color: #000;
  font-weight: 700;
}

.import-panel { display: none; }
.import-panel.active { display: block; }

.file-drop-area {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 12px;
}
.file-drop-area:hover {
  border-color: var(--accent-gold);
  background: var(--accent-gold-bg);
}
.file-drop-area input[type="file"] { display: none; }
.file-drop-icon { font-size: 38px; margin-bottom: 9px; line-height: 1; }
.file-drop-text { font-size: 14px; color: var(--text-secondary); }
.file-selected-name {
  font-size: 13px;
  color: var(--accent-gold);
  margin-top: 8px;
  word-break: break-all;
}

textarea.json-input {
  width: 100%;
  min-height: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Courier New', Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  padding: 12px;
  resize: vertical;
  margin-bottom: 12px;
  display: block;
}
textarea.json-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

/* ============ TOAST NOTIFICATION ============ */
.toast {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 300;
  max-width: 92vw;
  white-space: nowrap;
  box-shadow: var(--shadow);
  pointer-events: none;
  animation: toastIn 0.2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger);  color: #ef9a9a; }
.toast.info    { border-color: var(--info); }

/* ============ DATA SCHEMA SECTION ============ */
.schema-view {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}
.schema-view h4 {
  font-size: 13px;
  color: var(--accent-gold);
  margin-bottom: 8px;
}
.schema-view pre {
  font-size: 11px;
  color: var(--text-secondary);
  overflow-x: auto;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============ RESPONSIVE — WIDER SCREENS ============ */
@media (min-width: 420px) {
  .phase-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (min-width: 640px) {
  .main-content { padding: 20px 24px 90px; }
  .phase-grid { grid-template-columns: repeat(3, 1fr); }
  .phase-btn { min-height: 110px; }
  .ability-card { padding: 16px 16px 14px; }
}

@media (min-width: 768px) {
  .ability-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
