:root {
  --bg-oled: #05070a;
  --bg-surface: #0a0e17;
  --bg-surface-elevated: #131926;
  --border-color: #1e283d;
  --border-glow: #3b82f6;

  --color-red: #ef4444;
  --color-green: #10b981;
  --color-blue: #3b82f6;
  --color-purple: #8b5cf6;
  --color-gold: #f59e0b;
  --color-gold-glow: rgba(245, 158, 11, 0.5);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Dimensões Dinâmicas e Fluidas (Tablet & Desktop) */
  --card-w: clamp(56px, 6.8vw, 76px);
  --card-h: calc(var(--card-w) * 1.42);
  --life-col-w: clamp(62px, 7.5vw, 78px);
  --deck-col-w: clamp(58px, 7.2vw, 74px);
  --hand-h: clamp(102px, 14.5vh, 124px);
  --hand-card-w: clamp(64px, 7.5vw, 78px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* OBRIGATÓRIO: 100dvh (Dynamic Viewport Height) para Android/Tablet Chrome */
html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden; /* ZERO SCROLL NO NAVEGADOR */
  background-color: var(--bg-oled);
  color: var(--text-main);
  font-family: var(--font-family);
  user-select: none;
}

/* --- Top Navigation Bar --- */
.header-bar {
  background-color: rgba(10, 14, 23, 0.95);
  border-bottom: 1px solid var(--border-color);
  padding: 4px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  flex-shrink: 0;
  z-index: 50;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.nav-btn.primary {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: #ef4444;
  color: #fff;
}

.nav-btn.gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #f59e0b;
  color: #000;
}

/* --- Container & Views --- */
.main-content {
  width: 100%;
  height: calc(100vh - 42px);
  height: calc(100dvh - 42px);
  max-height: calc(100vh - 42px);
  max-height: calc(100dvh - 42px);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.view-section {
  display: none;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  min-height: 0;
}

.view-section.active {
  display: flex;
  flex-direction: column;
}

/* --- Hub & Deckbuilder Views --- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 10px auto;
  width: 100%;
  padding: 12px;
}

.hub-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s;
}

.hub-card:hover {
  border-color: var(--border-glow);
}

.hub-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ======================================================== */
/* 🏴‍☠️ BATTLE BOARD - 100% DVH SEM NENHUM OVERFLOW          */
/* ======================================================== */
.game-screen {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at center, #0d1424 0%, #05070a 100%);
  min-height: 0;
}

/* 1. Header de Fases e Turno (38px flex-shrink: 0) */
.turn-phase-header {
  height: 38px;
  flex-shrink: 0;
  background: rgba(10, 14, 23, 0.9);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 0.8rem;
  z-index: 20;
}

.phase-track {
  display: flex;
  align-items: center;
  gap: 4px;
}

.phase-step {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.phase-step.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* 2. Área do Campo (Arena Central) - min-height: 0 permite encolher */
.board-arena {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 8px;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* ======================================================== */
/* 2. PLAYMAT OFICIAL ONE PIECE CARD GAME (ZONAS DEMARCADAS)*/
/* ======================================================== */
.playmat-half {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  flex: 1;
  background: rgba(12, 17, 29, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  padding: 2px 8px;
  position: relative;
}

.player-info-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1px 8px;
  height: 24px;
  flex-shrink: 0;
}

.stats-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.7rem;
}

.badge-life {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-don {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.badge-hand {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Grid do Playmat: Coluna Life | Coluna Central | Coluna Deck/Trash */
.playmat-grid {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

.playmat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.playmat-col-life {
  width: var(--life-col-w, 78px);
  flex-shrink: 0;
  gap: 2px;
  border-right: 1px dashed rgba(148, 163, 184, 0.15);
  padding-right: 4px;
}

.playmat-col-center {
  flex: 1;
  max-width: 660px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-height: 0;
}

.playmat-col-deck-trash {
  width: var(--deck-col-w, 74px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  border-left: 1px dashed rgba(148, 163, 184, 0.15);
  padding-left: 4px;
}

/* Linhas do Playmat: Battle Line (Frente) & Support Line (Fundo) */
.playmat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
}

.battle-line {
  height: var(--card-h, 112px);
}

.support-line {
  height: 54px;
}

/* Slots Demarcados no Estilo do Playmat Oficial */
.playmat-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px dashed rgba(234, 179, 8, 0.25);
  background: rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  flex-shrink: 0;
}

.slot-label, .zone-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: rgba(234, 179, 8, 0.7);
  text-transform: uppercase;
  pointer-events: none;
  line-height: 1;
}

.zone-label {
  margin-bottom: 2px;
  color: #f87171;
}

/* Slot de Líder */
.leader-slot {
  width: var(--card-w, 76px);
  height: var(--card-h, 108px);
  border-color: rgba(234, 179, 8, 0.5);
  background: rgba(234, 179, 8, 0.05);
}

.leader-slot .slot-label {
  position: absolute;
  top: 2px;
  left: 3px;
  z-index: 1;
}

/* Fileira de Personagens (5 slots) */
.characters-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.character-slot {
  width: var(--card-w, 76px);
  height: var(--card-h, 108px);
  border-color: rgba(148, 163, 184, 0.25);
}

.character-slot.empty-slot {
  border-style: dashed;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-slot.empty-slot .slot-label {
  color: rgba(148, 163, 184, 0.4);
}

/* DON!! Deck Slot */
.don-deck-slot {
  width: 68px;
  height: 50px;
  border-color: rgba(245, 158, 11, 0.4);
  padding: 1px;
}

.don-deck-slot .slot-label {
  font-size: 0.52rem;
  margin-bottom: 1px;
}

.don-deck-card {
  width: 60px;
  height: 38px;
  border-radius: 4px;
  background-image: url('/cards/don-card.svg');
  background-size: cover;
  background-position: center;
  border: 1px solid #f59e0b;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.don-deck-card.empty-don-deck {
  background: rgba(0,0,0,0.4);
  border: 1px dashed #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cost Area Slot */
.cost-area-slot {
  flex: 1;
  height: 50px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 1px 8px;
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.04);
  overflow: hidden;
}

.cost-area-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.don-hint-touch {
  font-size: 0.65rem;
  color: #fbbf24;
  font-weight: 700;
  margin-left: 4px;
  animation: pulseSelect 1.5s infinite;
}

/* Cartas Físicas de DON!! na Cost Area */
.physical-don-row {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  max-width: 100%;
  padding: 2px 0;
  min-height: 40px;
}

.physical-don-card {
  width: 28px;
  height: 38px;
  border-radius: 3px;
  background-image: url('/cards/don-card.svg');
  background-size: cover;
  background-position: center;
  border: 1px solid #f59e0b;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.physical-don-card.active {
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
  cursor: pointer;
  animation: pulseDonActive 2s infinite;
}

.physical-don-card.active:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.95);
  border-color: #fde047;
}

.physical-don-card.rested {
  transform: rotate(90deg) scale(0.85);
  margin: 0 4px;
  border-color: #475569;
  filter: brightness(0.65) saturate(0.8);
  opacity: 0.8;
}

@keyframes pulseDonActive {
  0%, 100% { box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
  50% { box-shadow: 0 0 14px rgba(245, 158, 11, 0.9); }
}

.mini-don-svg-chip {
  display: inline-block;
  width: 10px;
  height: 14px;
  background-image: url('/cards/don-card.svg');
  background-size: cover;
  border-radius: 2px;
  border: 1px solid #f59e0b;
  margin-right: 3px;
  vertical-align: -2px;
}

.don-chip {
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.don-chip-active {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

.don-chip-rested {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid #475569;
}

/* Deck & Trash Slots */
.deck-slot, .trash-slot {
  width: 64px;
  height: 48px;
  padding: 1px;
}

.deck-slot .slot-label, .trash-slot .slot-label {
  font-size: 0.52rem;
  margin-bottom: 1px;
}

.deck-card-back {
  width: 58px;
  height: 38px;
  border-radius: 4px;
  background-image: url('/cards/card-back.svg');
  background-size: cover;
  background-position: center;
  border: 1px solid #eab308;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.trash-card-box {
  width: 58px;
  height: 38px;
  border-radius: 4px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.trash-card-box.has-cards {
  border-style: solid;
  border-color: #94a3b8;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.trash-count-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: rgba(15, 23, 42, 0.95);
  color: #cbd5e1;
  border: 1px solid #64748b;
  font-weight: 800;
  font-size: 0.65rem;
  padding: 0 4px;
  border-radius: 8px;
}

/* Pilha Visual de Cartas de Vida Reais em Cascata */
.life-card-cascade {
  width: calc(var(--life-col-w, 78px) - 8px);
  height: calc(var(--card-h, 106px) - 4px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.life-card-face-down {
  position: absolute;
  width: calc(var(--life-col-w, 78px) - 14px);
  height: calc(var(--card-h, 106px) - 18px);
  border-radius: 5px;
  background-image: url('/cards/card-back.svg');
  background-size: cover;
  background-position: center;
  border: 1px solid #eab308;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Badge numérico sobreposto na pilha de vida */
.life-count-pill {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: rgba(239, 68, 68, 0.95);
  color: #fff;
  border: 1px solid #fca5a5;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.8);
  z-index: 15;
}

.life-count-pill.pill-gold {
  background: #f59e0b;
  color: #000;
  border-color: #fef08a;
}

.life-count-pill.pill-blue {
  background: #2563eb;
  color: #fff;
  border-color: #93c5fd;
}

/* Slot Vazio com 0 Vidas - Perigo Letal */
.life-slot-empty {
  width: calc(var(--life-col-w, 78px) - 14px);
  height: calc(var(--card-h, 106px) - 18px);
  border-radius: 6px;
  border: 2px dashed #ef4444;
  background: rgba(239, 68, 68, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  font-weight: 900;
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.1;
  animation: pulseLethal 1.2s infinite;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

@keyframes pulseLethal {
  0%, 100% { border-color: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
  50% { border-color: #f87171; box-shadow: 0 0 18px rgba(239, 68, 68, 0.9); }
}

/* Linha Divisória de Clash / Banner Central */
.clash-divider {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 1px 0;
}

.clash-banner {
  font-weight: 800;
  font-size: 0.8rem;
  color: #fbbf24;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 1px 12px;
  border-radius: 12px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

/* ======================================================== */
/* 3. BARRA DA BASE: MÃO DO JOGADOR + AÇÕES (ZERO OVERLAP)  */
/* ======================================================== */
.bottom-play-bar {
  height: var(--hand-h, 120px);
  max-height: var(--hand-h, 120px);
  flex-shrink: 0;
  background: rgba(6, 9, 15, 0.98);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: stretch;
  position: relative;
  z-index: 30;
  width: 100%;
}

.hand-container {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 2px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
}

/* --- Card Frame & Visuals --- */
.card-frame {
  width: var(--card-w, 74px);
  height: var(--card-h, 106px);
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #1e293b;
  border: 2px solid #334155;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.card-frame:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.6);
  border-color: var(--border-glow);
  z-index: 10;
}

.card-frame.card-rested {
  transform: rotate(90deg) scale(0.92);
  border-color: #64748b;
  opacity: 0.85;
}

.card-frame.selectable {
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.9);
  animation: pulseSelect 1.5s infinite;
}

.card-frame.valid-target {
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.95);
  animation: pulseTarget 1.2s infinite;
}

/* Botão de Zoom 🔍 Dedicado na Carta */
.card-zoom-btn {
  position: absolute;
  top: 2px;
  left: 2px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: 4px;
  font-size: 0.72rem;
  padding: 2px 4px;
  cursor: pointer;
  z-index: 15;
  line-height: 1;
}

.card-zoom-btn:hover {
  background: #3b82f6;
  border-color: #60a5fa;
}

.card-power-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  font-weight: 900;
  font-size: 0.8rem;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.card-don-badge {
  position: absolute;
  top: 24px;
  left: 2px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 900;
  font-size: 0.72rem;
  padding: 2px 5px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.9);
  line-height: 1;
  display: flex;
  align-items: center;
}

.card-cost-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  border: 1px solid #94a3b8;
  font-weight: 900;
  font-size: 0.78rem;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
}

.hand-card {
  width: var(--hand-card-w, 78px);
  height: calc(var(--hand-card-w, 78px) * 1.42);
}

/* ======================================================== */
/* ⚡ DOCK DE AÇÃO E TURNO NA BASE (ZERO SOBREPOSIÇÃO)     */
/* ======================================================== */
.base-action-dock, .giant-action-panel {
  width: clamp(140px, 18vw, 190px);
  flex-shrink: 0;
  background: rgba(10, 14, 23, 0.95);
  border-left: 1px solid var(--border-color);
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.base-action-btn, .giant-btn {
  flex: 1;
  border-radius: 6px;
  padding: 2px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
  min-height: 38px;
}

.base-action-btn:active, .giant-btn:active {
  transform: scale(0.97);
}

.base-action-btn .btn-main-label {
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.1;
}

.base-action-btn .btn-sub-label {
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.85;
  line-height: 1;
}

.base-action-btn.end-turn-btn, .giant-btn-end-turn {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border-color: #f87171;
}

.base-action-btn.end-turn-btn.active-turn, .giant-btn-end-turn.active-turn {
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.8);
  animation: pulseTurn 2s infinite;
}

.base-action-btn.end-turn-btn:disabled, .giant-btn-end-turn:disabled {
  background: #1e293b;
  border-color: #334155;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
  animation: none;
}

.base-action-btn.attach-don-btn, .giant-btn-attach-don {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.base-action-btn.attach-don-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
}

.base-action-btn.attach-don-btn:disabled, .giant-btn-attach-don:disabled {
  background: #1e293b;
  border-color: #334155;
  color: #64748b;
  cursor: not-allowed;
}

/* Toast Notifier Grande para Compra de Cartas e DON */
.game-toast-container {
  position: absolute;
  top: 45px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.game-toast {
  background: rgba(10, 14, 23, 0.95);
  border: 2px solid #f59e0b;
  color: #fbbf24;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.8);
  animation: toastFade 3s forwards;
  text-align: center;
}

/* Combat & Counter HUD Overlay */
.combat-hud {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 14, 23, 0.98);
  border: 2px solid #ef4444;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
  z-index: 100;
  max-width: 440px;
  width: 90%;
  text-align: center;
  display: none;
}

.combat-hud.active {
  display: block;
}

.combat-hud-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: #ef4444;
  text-transform: uppercase;
}

.counter-calc-box {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 6px;
  margin: 8px 0;
  font-weight: 800;
  font-size: 1rem;
  color: #fbbf24;
}

.counter-cards-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px 0;
  flex-wrap: wrap;
}

.counter-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.75rem;
}

.counter-btn.selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

/* Card Zoom Modal */
.card-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 14px;
}

.card-modal-backdrop.active {
  display: flex;
}

.card-modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  max-width: 580px;
  width: 100%;
  display: flex;
  gap: 14px;
  padding: 16px;
  position: relative;
}

.modal-card-img {
  width: 200px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.7);
  flex-shrink: 0;
}

.modal-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.modal-close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: color 0.15s;
}

.modal-close-btn:hover {
  color: #fff;
}

/* ======================================================== */
/* 👑 DEDICATED LEADER SELECTOR MODAL                       */
/* ======================================================== */
.leader-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 250;
  padding: 12px;
  box-sizing: border-box;
}

.leader-modal-backdrop.active {
  display: flex;
}

.leader-modal-window {
  background: var(--bg-surface);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.9), 0 0 24px rgba(245, 158, 11, 0.2);
  width: 95vw;
  max-width: 1040px;
  height: 90dvh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}

.leader-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.leader-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leader-modal-title h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fbbf24;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.leader-modal-title small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.leader-modal-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.leader-modal-controls {
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.leader-modal-search-wrap input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.leader-modal-search-wrap input:focus {
  border-color: #f59e0b;
}

.leader-modal-color-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.leader-pill-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.leader-pill-btn:hover {
  border-color: #fbbf24;
  color: #fff;
}

.leader-pill-btn.active {
  background: #f59e0b;
  border-color: #fbbf24;
  color: #000;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.leader-pill-btn.color-red.active { background: #ef4444; border-color: #f87171; color: #fff; }
.leader-pill-btn.color-green.active { background: #10b981; border-color: #34d399; color: #fff; }
.leader-pill-btn.color-blue.active { background: #3b82f6; border-color: #60a5fa; color: #fff; }
.leader-pill-btn.color-purple.active { background: #8b5cf6; border-color: #a78bfa; color: #fff; }
.leader-pill-btn.color-black.active { background: #475569; border-color: #94a3b8; color: #fff; }
.leader-pill-btn.color-yellow.active { background: #eab308; border-color: #fde047; color: #000; }

.leader-modal-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  align-content: start;
}

.leader-select-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.leader-select-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: #f59e0b;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.leader-select-card.selected {
  border-color: #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.8);
}

.leader-card-art {
  width: 100%;
  aspect-ratio: 5 / 7;
  background-size: cover;
  background-position: center;
  position: relative;
}

.leader-card-art .leader-life-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 4px;
}

.leader-card-art .leader-power-tag {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: #fbbf24;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.leader-card-footer {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(0, 0, 0, 0.4);
}

.leader-card-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-card-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.leader-color-badge {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 3px;
}

.leader-id-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Animations */
@keyframes pulseSelect {
  0%, 100% { box-shadow: 0 0 6px rgba(59, 130, 246, 0.6); }
  50% { box-shadow: 0 0 16px rgba(59, 130, 246, 1); }
}

@keyframes pulseTarget {
  0%, 100% { box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
  50% { box-shadow: 0 0 16px rgba(239, 68, 68, 1); }
}

@keyframes pulseTurn {
  0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
  50% { box-shadow: 0 0 20px rgba(239, 68, 68, 1); }
}

@keyframes toastFade {
  0% { opacity: 0; transform: translateY(-8px); }
  15% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}

/* ======================================================== */
/* ⚡ HABILIDADES ATIVADAS & MODO DE SELEÇÃO DE ALVO        */
/* ======================================================== */
.card-ability-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  border: 1px solid #fbbf24;
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 0.65rem;
  font-weight: 900;
  cursor: pointer;
  z-index: 15;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
  animation: pulseGoldBadge 1.8s infinite ease-in-out;
  transition: transform 0.15s;
}

.card-ability-badge:hover {
  transform: scale(1.15);
}

.card-ability-badge.leader {
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
}

.card-ability-badge.leader:hover {
  transform: translateX(-50%) scale(1.15);
}

@keyframes pulseGoldBadge {
  0%, 100% { box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
  50% { box-shadow: 0 0 16px rgba(245, 158, 11, 1); }
}

/* Targeting Mode Styles */
.card-frame.targeting-valid-target {
  cursor: pointer;
  border-color: #06b6d4 !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.9), inset 0 0 10px rgba(6, 182, 212, 0.5) !important;
  animation: pulseCyanTarget 1.4s infinite ease-in-out !important;
  transform: translateY(-2px);
  z-index: 20;
}

@keyframes pulseCyanTarget {
  0%, 100% { box-shadow: 0 0 8px rgba(6, 182, 212, 0.7); }
  50% { box-shadow: 0 0 22px rgba(6, 182, 212, 1); }
}

.targeting-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.targeting-msg {
  font-weight: 800;
  color: #fbbf24;
}

.targeting-cancel-btn {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid #ef4444;
  color: #fca5a5;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.targeting-cancel-btn:hover {
  background: #ef4444;
  color: #fff;
}

/* ======================================================== */
/* 🎵 RÁDIO ONE PIECE (PLAYER COMPACTO & POPOVER FLUTUANTE) */
/* ======================================================== */
.op-radio-pill {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 20px;
  padding: 2px 10px;
  gap: 8px;
  height: 32px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.op-radio-pill:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.radio-track-info {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  max-width: 170px;
}

.radio-icon {
  font-size: 0.95rem;
  animation: pulseRadio 2.5s infinite;
}

@keyframes pulseRadio {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.radio-marquee {
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fbbf24;
  text-overflow: ellipsis;
  max-width: 145px;
}

.radio-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.radio-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.85rem;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.15s;
}

.radio-btn:hover {
  color: #f59e0b;
  transform: scale(1.15);
}

.radio-btn-play {
  color: #f59e0b;
  font-size: 1rem;
}

.radio-btn-play.playing {
  color: #10b981;
}

.radio-volume-box {
  display: flex;
  align-items: center;
  gap: 4px;
}

.radio-vol-icon {
  cursor: pointer;
  font-size: 0.85rem;
  user-select: none;
}

.radio-slider {
  width: 50px;
  height: 4px;
  accent-color: #f59e0b;
  cursor: pointer;
}

.radio-btn-list {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  gap: 3px;
}

.radio-btn-list:hover {
  background: rgba(245, 158, 11, 0.3);
}

/* Popover Flutuante com a Playlist */
.radio-playlist-popover {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  max-width: 95vw;
  max-height: 480px;
  background: rgba(10, 14, 23, 0.98);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 15px rgba(245, 158, 11, 0.25);
  display: flex;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(15, 23, 42, 0.6);
}

.radio-mode-btn {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #fff;
  border-radius: 4px;
  font-size: 0.85rem;
  padding: 2px 6px;
  cursor: pointer;
}

.radio-mode-btn.active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.2);
}

.radio-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0 4px;
}

.radio-close-btn:hover {
  color: #ef4444;
}

.popover-search {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.popover-search input {
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-size: 0.82rem;
}

.popover-search input:focus {
  outline: none;
  border-color: #f59e0b;
}

.popover-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.playlist-category-header {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #f59e0b;
  letter-spacing: 0.5px;
  padding: 6px 8px 2px 8px;
}

.radio-playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.radio-playlist-item:hover {
  background: rgba(245, 158, 11, 0.15);
}

.radio-playlist-item.active {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

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

.track-play-indicator {
  font-size: 0.8rem;
  color: #f59e0b;
  width: 14px;
}

.track-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.track-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radio-playlist-item.active .track-name {
  color: #fde047;
}

.track-artist {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ======================================================== */
/* 🎴 PRO DECKBUILDER STYLES                                */
/* ======================================================== */
.deckbuilder-layout {
  display: flex;
  gap: 12px;
  padding: 10px;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  min-height: 0;
}

.deckbuilder-left-panel {
  width: clamp(320px, 32vw, 400px);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex-shrink: 0;
}

.deck-new-btn-prominent {
  width: 100%;
  padding: 10px 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: 1px solid #fde047;
  border-radius: 8px;
  color: #000;
  font-weight: 900;
  font-size: 0.88rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}

.deck-new-btn-prominent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.6);
  border-color: #fff;
}

.deck-input-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  display: block;
}

.deck-meta-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.deck-select-dropdown {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
}

.deck-btn-group {
  display: flex;
  gap: 4px;
}

.deck-tool-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.deck-tool-btn:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.2);
}

.deck-tool-btn.danger:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.deck-name-row input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}

.deck-name-row input:focus {
  outline: none;
  border-color: #f59e0b;
}

/* Leader Slot */
.deck-leader-slot-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 8px;
  position: relative;
}

.leader-preview-box {
  width: 60px;
  height: 84px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  border: 2px solid #f59e0b;
  position: relative;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.leader-preview-box:hover {
  transform: scale(1.05);
}

/* Empty Leader Slot State */
.leader-preview-box.empty-slot {
  border: 2px dashed #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: pulseGoldBorder 2.5s infinite ease-in-out;
}

@keyframes pulseGoldBorder {
  0%, 100% { border-color: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.3); }
  50% { border-color: #fbbf24; box-shadow: 0 0 16px rgba(245, 158, 11, 0.7); }
}

.empty-leader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}

.empty-leader-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.empty-leader-text {
  font-size: 0.58rem;
  font-weight: 800;
  color: #fbbf24;
  text-align: center;
  line-height: 1.1;
}

.leader-badge-pill {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-weight: 900;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 8px;
  border: 1px solid #fca5a5;
}

.leader-meta-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.leader-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.leader-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-id-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
}

.leader-stats-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.color-tag.green { background: rgba(16, 185, 129, 0.2); color: #34d399; border-color: rgba(16, 185, 129, 0.4); }
.color-tag.blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border-color: rgba(59, 130, 246, 0.4); }
.color-tag.purple { background: rgba(139, 92, 246, 0.2); color: #c084fc; border-color: rgba(139, 92, 246, 0.4); }
.color-tag.black { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; border-color: rgba(100, 116, 139, 0.4); }
.color-tag.yellow { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border-color: rgba(245, 158, 11, 0.4); }

.power-tag {
  font-size: 0.7rem;
  font-weight: 800;
  color: #fbbf24;
}

.leader-identity-rule {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Curve Panel */
.deck-curve-panel {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.curve-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fbbf24;
  letter-spacing: 0.5px;
}

.deck-count-badge {
  font-size: 0.75rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.deck-count-badge.complete {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.5);
}

.deck-count-badge.overflow {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
}

.cost-bars-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 44px;
  padding: 2px 0;
}

.cost-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.cost-bar-count {
  font-size: 0.55rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.cost-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.2s ease;
}

.cost-bar-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1;
}

.deck-stats-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.stat-chip {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.stat-chip.gold {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Deck Cards List */
.deck-card-list-wrapper {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  padding-right: 2px;
}

.deck-empty-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 20px;
}

.deck-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 6px;
  transition: background 0.15s;
}

.deck-card-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.card-row-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.deck-cost-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-row-type {
  font-size: 0.72rem;
  flex-shrink: 0;
}

.card-row-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-row-counter {
  font-size: 0.65rem;
  font-weight: 800;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  padding: 1px 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.card-row-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.deck-qty-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
}

.deck-qty-btn:hover {
  background: #3b82f6;
  border-color: #60a5fa;
}

.deck-qty-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fbbf24;
  min-width: 20px;
  text-align: center;
}

.deck-action-footer {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.deck-action-footer .nav-btn {
  flex: 1;
  justify-content: center;
  padding: 8px 4px;
  font-size: 0.76rem;
}

/* Right Panel: Catalog */
.deckbuilder-right-panel {
  flex: 1;
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.catalog-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.filter-row-top {
  display: flex;
  gap: 6px;
}

.filter-row-top input {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 7px 10px;
  color: #fff;
  font-size: 0.84rem;
}

.filter-row-top input:focus {
  outline: none;
  border-color: #f59e0b;
}

.filter-reset-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-reset-btn:hover {
  color: #fff;
  border-color: #94a3b8;
}

.filter-row-bottom {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-row-bottom select {
  flex: 1;
  min-width: 120px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 5px 8px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
}

.pro-catalog-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
  padding: 2px;
  min-height: 0;
}

.pro-catalog-card {
  aspect-ratio: 1 / 1.42;
  border-radius: 5px;
  background-size: cover;
  background-position: center;
  background-color: #1e293b;
  border: 1px solid #334155;
  position: relative;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.pro-catalog-card:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  z-index: 5;
}

.pro-catalog-card.incompatible-color {
  filter: grayscale(0.7) opacity(0.45);
}

.catalog-card-cost {
  position: absolute;
  top: 2px;
  left: 2px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  font-weight: 900;
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1;
}

.catalog-card-cost.leader {
  background: #ef4444;
  border-color: #fca5a5;
  color: #fff;
}

.catalog-card-counter {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(16, 185, 129, 0.95);
  color: #000;
  font-weight: 900;
  font-size: 0.6rem;
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
}

.catalog-card-power {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0,0,0,0.9);
  color: #fbbf24;
  font-weight: 900;
  font-size: 0.65rem;
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
}

.catalog-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.catalog-card-overlay span {
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  background: #2563eb;
  padding: 2px 6px;
  border-radius: 4px;
}

.pro-catalog-card:hover .catalog-card-overlay {
  opacity: 1;
}

.catalog-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 2px 4px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.pagination-count-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-nav-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.page-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-current-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fbbf24;
  padding: 0 4px;
}

/* ======================================================== */
/* 📱 RESPONSIVIDADE MULTI-ORIENTAÇÃO (PORTRAIT & LANDSCAPE) */
/* ======================================================== */

/* 1. Orientação Vertical (Portrait - Tablet em pé / Celular) */
@media (orientation: portrait) {
  :root {
    --card-w: clamp(44px, 11vw, 64px);
    --card-h: calc(var(--card-w) * 1.42);
    --life-col-w: clamp(48px, 10.5vw, 62px);
    --deck-col-w: clamp(46px, 10vw, 60px);
    --hand-h: clamp(96px, 13.5vh, 114px);
    --hand-card-w: clamp(54px, 12vw, 68px);
  }

  .board-arena {
    padding: 2px 4px;
    overflow-x: hidden;
  }

  .playmat-half {
    padding: 2px 4px;
    gap: 1px;
  }

  .playmat-grid {
    gap: 3px;
  }

  .characters-row {
    gap: 3px;
  }

  .playmat-row {
    gap: 3px;
  }

  .support-line {
    height: clamp(38px, 5.5vh, 46px);
  }

  .don-deck-slot, .deck-slot, .trash-slot {
    width: clamp(44px, 9.5vw, 56px);
    height: clamp(32px, 4.5vh, 40px);
    padding: 0;
  }

  .don-deck-card, .deck-card-back, .trash-card-box {
    width: clamp(38px, 8.5vw, 50px);
    height: clamp(24px, 3.8vh, 32px);
  }

  .physical-don-row {
    min-height: 32px;
    gap: 2px;
  }

  .physical-don-card {
    width: 20px;
    height: 28px;
  }

  .hand-container {
    padding: 2px 6px;
    gap: 4px;
  }

  .bottom-play-bar {
    height: var(--hand-h, 105px);
    max-height: var(--hand-h, 105px);
  }

  .base-action-dock, .giant-action-panel {
    width: clamp(105px, 25vw, 135px);
    padding: 3px 4px;
    gap: 3px;
    position: static;
  }

  .base-action-btn .btn-main-label, .giant-btn {
    font-size: 0.72rem;
    min-width: 0;
  }

  .base-action-btn .btn-sub-label {
    font-size: 0.58rem;
  }

  /* Compactação de header em telas verticais */
  .header-bar {
    padding: 2px 8px;
    height: 38px;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .op-radio-pill {
    max-width: 160px;
    padding: 2px 6px;
  }

  .radio-marquee-text {
    max-width: 75px;
    font-size: 0.72rem;
  }

  .radio-vol-slider {
    width: 32px;
  }

  .radio-popover {
    width: min(320px, 92vw);
    left: auto;
    right: 4px;
  }

  /* Deckbuilder Adaptado para Retrato */
  .deckbuilder-layout {
    flex-direction: column;
    padding: 6px;
    gap: 6px;
  }

  .deckbuilder-left-panel {
    width: 100%;
    max-height: 45%;
    padding: 6px;
  }

  .deckbuilder-right-panel {
    width: 100%;
    flex: 1;
    padding: 6px;
  }

  .cost-bars-row {
    height: 32px;
  }

  .leader-modal-window {
    width: 98vw;
    height: 94dvh;
    max-height: 94dvh;
    border-radius: 10px;
  }

  .leader-modal-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 8px;
    padding: 10px;
  }
}

/* 2. Orientação Horizontal (Landscape - Tablet deitado / Desktop) */
@media (orientation: landscape) {
  :root {
    --card-w: clamp(56px, 6.5vw, 76px);
    --card-h: calc(var(--card-w) * 1.42);
    --life-col-w: clamp(62px, 7.2vw, 78px);
    --deck-col-w: clamp(58px, 6.8vw, 74px);
    --hand-h: clamp(102px, 15vh, 124px);
    --hand-card-w: clamp(64px, 7.2vw, 78px);
  }

  .board-arena {
    padding: 4px 8px;
  }

  .bottom-play-bar {
    height: var(--hand-h, 120px);
    max-height: var(--hand-h, 120px);
  }

  .base-action-dock, .giant-action-panel {
    width: clamp(140px, 16vw, 190px);
    position: static;
  }
}

/* 3. Telas Ultra-Compactas (Mobile Portrait < 480px) */
@media (max-width: 480px) {
  :root {
    --card-w: clamp(38px, 12vw, 48px);
    --card-h: calc(var(--card-w) * 1.42);
    --life-col-w: clamp(40px, 11vw, 48px);
    --deck-col-w: clamp(38px, 10.5vw, 46px);
    --hand-h: 90px;
    --hand-card-w: 48px;
  }

  .slot-label, .zone-label {
    font-size: 0.5rem;
  }

  .card-power-badge {
    font-size: 0.65rem;
    padding: 1px 3px;
  }

  .card-cost-badge {
    width: 16px;
    height: 16px;
    font-size: 0.65rem;
  }

  .bottom-play-bar {
    height: 90px;
    max-height: 90px;
  }

  .base-action-dock, .giant-action-panel {
    width: 95px;
    padding: 2px 3px;
    gap: 2px;
    position: static;
  }

  .base-action-btn .btn-main-label {
    font-size: 0.65rem;
  }

  .base-action-btn .btn-sub-label {
    font-size: 0.52rem;
  }
}
