/* AI Arena — layout and theme */

.arena-wrap {
  max-width: 1100px;
  width: 100%;
}

.arena-body .hub-game-shell {
  max-width: 1100px;
  background: rgba(8, 10, 18, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(6px);
}

.arena-app {
  color: #f5f5f5;
}

.arena-top-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.arena-title-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.arena-title-icon {
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.35);
}

.arena-top-bar h1 {
  margin: 0;
  font-size: 1.5rem;
}

.loadout-hint {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.inventory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.inventory-chip {
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.inventory-chip:hover {
  border-color: #6366f1;
}

.inventory-chip.selected {
  border-color: #4ade80;
  background: #12241a;
}

.inventory-empty {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

.loadout-slots {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.loadout-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid #1e293b;
}

.loadout-unit-name {
  flex: 1;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.loadout-slot {
  min-width: 120px;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px dashed #475569;
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  font-size: 0.76rem;
  text-align: center;
  cursor: pointer;
}

.loadout-slot.has-item {
  border-style: solid;
  border-color: #6366f1;
  color: #e0e7ff;
  background: rgba(49, 46, 129, 0.35);
}

.loadout-slot.pending-target {
  border-color: #4ade80;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35);
}

.loadout-placeholder {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

.arena-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  color: #94a3b8;
}

.arena-meta-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.arena-meta-summary span {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 0.85rem;
  color: #cbd5f5;
}

.arena-layout {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1rem;
}

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

.arena-panel {
  background: rgba(17, 23, 42, 0.92);
  border: 1px solid rgba(51, 65, 85, 0.65);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.arena-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  color: #e2e8f0;
}

.arena-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.unit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.unit-card {
  flex: 1 1 140px;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #151b30;
  border: 1px solid #222a44;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}

.unit-card:hover {
  transform: translateY(-1px);
}

.unit-card.selected {
  border-color: #4ade80;
  background: #12241a;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.25);
}

.unit-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.35rem;
}

.unit-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.rarity-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rarity-color, #94a3b8);
  border: 1px solid var(--rarity-color, #94a3b8);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}

.unit-card p {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #cbd5f5;
}

.unit-stats {
  color: #94a3b8 !important;
}

.unit-evo {
  font-size: 0.75rem !important;
  color: #a5b4fc !important;
}

.team-count {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
}

.arena-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.arena-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.12s;
}

.arena-btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
}

.arena-btn-boss {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff;
}

.arena-btn-ghost {
  background: rgba(51, 65, 85, 0.6);
  color: #e2e8f0;
  border: 1px solid rgba(100, 116, 139, 0.5);
}

.arena-btn-danger {
  background: rgba(127, 29, 29, 0.55);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

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

.shop-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.55rem;
}

.shop-card {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid #1e293b;
  font-size: 0.82rem;
}

.shop-card strong {
  display: block;
  margin-bottom: 0.2rem;
}

.shop-rarity {
  font-size: 0.7rem;
  color: #a5b4fc;
}

.shop-cost {
  color: #fbbf24;
  margin: 0.35rem 0 !important;
}

.shop-owned {
  color: #4ade80;
  font-style: normal;
}

.shop-card button {
  margin-top: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  border: none;
  background: #4f46e5;
  color: #fff;
  font-size: 0.78rem;
  cursor: pointer;
}

#daily-quests {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

#daily-quests li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
}

#daily-quests li.quest-done {
  color: #4ade80;
}

.arena-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.arena-teams ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.arena-teams li {
  padding: 0.25rem 0;
  color: #e2e8f0;
}

.arena-teams li.ko {
  opacity: 0.45;
  text-decoration: line-through;
}

.arena-log {
  background: #050816;
  border-radius: 8px;
  padding: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.45;
  border: 1px solid #1f2937;
}

.log-line {
  margin-bottom: 0.25rem;
}

.log-line.system {
  color: #93c5fd;
}

.log-line.player {
  color: #bbf7d0;
}

.log-line.ai {
  color: #fecaca;
}

#meta-dashboard p {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.dev-panel {
  margin-top: 0.5rem;
  padding: 0.65rem;
  border-radius: 8px;
  background: rgba(30, 27, 75, 0.55);
  border: 1px dashed rgba(129, 140, 248, 0.45);
}

.dev-panel p {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: #a5b4fc;
}

.dev-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dev-actions button {
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(129, 140, 248, 0.4);
  background: rgba(49, 46, 129, 0.5);
  color: #e0e7ff;
  font-size: 0.75rem;
  cursor: pointer;
}

.arena-battle-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.arena-control-label {
  font-size: 0.78rem;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.arena-select {
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.78rem;
}

.arena-tutorial {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(49, 46, 129, 0.35);
  border: 1px solid rgba(99, 102, 241, 0.45);
}

.arena-tutorial p {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: #c7d2fe;
}

.arena-leaderboard p {
  margin: 0.2rem 0;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.arena-leaderboard .arena-my-rank {
  margin-top: 0.45rem;
  color: #a5b4fc;
  font-weight: 600;
}

.arena-muted {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

.arena-season {
  color: #a5b4fc !important;
  font-style: italic;
}

#arena-achievements p {
  margin: 0.2rem 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

#arena-achievements p.achievement-done {
  color: #4ade80;
}

#weekly-quests {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

#weekly-quests li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
}

#weekly-quests li.quest-done {
  color: #4ade80;
}

.unit-icon {
  margin-right: 0.15rem;
}

.arena-narrator-badge {
  font-size: 0.75rem !important;
  color: #94a3b8 !important;
  border-color: rgba(100, 116, 139, 0.4) !important;
}

.arena-narrator-badge.ai-live {
  color: #a5b4fc !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
}

.quick-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.arena-quick-team {
  padding: 0.35rem 0.55rem !important;
  font-size: 0.76rem !important;
}

.arena-panel-nested {
  margin-top: 0.65rem;
  padding: 0.55rem 0.65rem;
  background: rgba(15, 23, 42, 0.65);
  border-radius: 8px;
}

.arena-panel-nested h3 {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}

.preset-label {
  flex: 1 1 140px;
  color: #cbd5e1;
}

.arena-panel-compact {
  padding: 0.65rem 0.85rem;
}

.boss-preview-name {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: #fbbf24;
}

.boss-preview p {
  margin: 0.15rem 0;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.arena-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.arena-panel-head h2 {
  margin: 0 !important;
}

.arena-btn-small {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.72rem !important;
}

.title-picker {
  margin: 0.5rem 0;
}

/* Mobile shell — bottom nav + single-panel focus */
@media (max-width: 767px) {
  .arena-mobile-root {
    --shell-accent: #a5b4fc;
    --shell-accent-muted: rgba(165, 180, 252, 0.72);
    --shell-surface: rgba(20, 24, 40, 0.95);
    --shell-border: rgba(99, 102, 241, 0.28);
    --shell-text: #f8fafc;
    --shell-nav-active: #fbbf24;
  }

  .arena-mobile-root.game-mobile-mode .arena-layout {
    display: block;
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
  }

  .arena-mobile-root.game-mobile-mode .arena-mobile-column {
    display: none;
  }

  .arena-mobile-root.game-mobile-mode .arena-mobile-column.is-active {
    display: block;
  }

  .arena-mobile-root.game-mobile-mode .arena-panel[data-arena-mobile],
  .arena-mobile-root.game-mobile-mode .arena-tutorial[data-arena-mobile],
  .arena-mobile-root.game-mobile-mode .arena-mobile-hub[data-arena-mobile] {
    display: none;
  }

  .arena-mobile-root.game-mobile-mode .arena-panel[data-arena-mobile].is-mobile-visible,
  .arena-mobile-root.game-mobile-mode .arena-tutorial[data-arena-mobile].is-mobile-visible,
  .arena-mobile-root.game-mobile-mode .arena-mobile-hub[data-arena-mobile].is-mobile-visible {
    display: block;
  }

  .arena-mobile-root.game-mobile-mode .arena-top-bar.is-compact .arena-title-icon {
    width: 40px;
    height: 40px;
  }

  .arena-mobile-root.game-mobile-mode .arena-top-bar.is-compact h1 {
    font-size: 1.125rem;
  }

  .arena-mobile-root.game-mobile-mode .arena-top-bar.is-compact .arena-subtitle {
    display: none;
  }

  .arena-mobile-root.game-mobile-mode .arena-meta-summary {
    width: 100%;
    justify-content: flex-start;
  }

  .arena-mobile-back {
    margin-bottom: 0.75rem;
  }

  .arena-mobile-hub {
    margin-bottom: 0.75rem;
  }
}

.arena-actions-meta {
  margin-top: 0.5rem;
}
