/* ============================================
   BATALHA - Design System
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Orbitron:wght@400;700;900&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #22223a;
    --bg-glass: rgba(26, 26, 46, 0.7);
    --text-primary: #f0f0f5;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.3);
    --danger: #ef4444;
    --success: #22c55e;
    --border: rgba(255,255,255,0.06);
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Rarity */
    --rarity-comum: #9CA3AF;
    --rarity-incomum: #22C55E;
    --rarity-raro: #3B82F6;
    --rarity-epico: #A855F7;
    --rarity-lendario: #F59E0B;
    --rarity-rei: #EF4444;
}

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

html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100vw; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background animated gradient */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(168,85,247,0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(239,68,68,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { transition: var(--transition); }
button { cursor: pointer; }

/* Lore tabs */
.lore-tab { transition: var(--transition) !important; }
.lore-tab:hover { color: var(--text-primary) !important; }
.lore-tab.active { color: var(--accent) !important; border-bottom: 2px solid var(--accent) !important; font-weight: 600 !important; }

/* Percentile tooltip */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
    content: attr(data-tooltip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    background: var(--bg-primary); color: var(--text-secondary); padding: 4px 8px; border-radius: 6px;
    font-size: 0.6rem; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.2s;
    border: 1px solid var(--border); z-index: 10;
}
[data-tooltip]:hover::after { opacity: 1; }

img { max-width: 100%; height: auto; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.navbar-brand {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem; font-weight: 900;
    background: linear-gradient(135deg, var(--accent), #a855f7, var(--danger));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}
.navbar-nav { display: flex; gap: 8px; list-style: none; align-items: center; }
.navbar-nav a {
    color: var(--text-secondary); padding: 8px 16px; border-radius: 8px;
    font-size: 0.875rem; font-weight: 500; transition: var(--transition);
}
.navbar-nav a:hover, .navbar-nav a.active { color: var(--text-primary); background: var(--bg-card); }
.nav-cta {
    background: linear-gradient(135deg, var(--accent), #8b5cf6) !important;
    color: #fff !important; font-weight: 600 !important;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }

/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; right: 0; min-width: 200px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); z-index: 200; padding: 8px 0;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block; padding: 8px 16px; color: var(--text-secondary); font-size: 0.85rem;
    text-decoration: none; transition: var(--transition);
}
.nav-dropdown-menu a:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* Mobile menu */
.menu-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }

/* ============================================
   PLAYER STATUS BAR
   ============================================ */
.player-bar {
    background: rgba(10,10,15,0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 6px 24px;
    position: sticky; top: 64px; z-index: 99;
}
.level-badge {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem; font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    color: #fff; padding: 3px 8px; border-radius: 6px;
    min-width: 36px; text-align: center;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* ============================================
   HERO
   ============================================ */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(99,102,241,0.05) 60deg, transparent 120deg, rgba(168,85,247,0.05) 180deg, transparent 240deg, rgba(239,68,68,0.05) 300deg, transparent 360deg);
    animation: heroRotate 20s linear infinite;
    z-index: 0;
}
@keyframes heroRotate { to { transform: rotate(360deg); } }

.hero h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 50%, #c084fc 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
    position: relative; z-index: 1;
}
.hero p { font-size: 1.2rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 40px; position: relative; z-index: 1; }
.hero-stats {
    display: flex; justify-content: center; gap: 48px; flex-wrap: wrap;
    position: relative; z-index: 1;
}
.hero-stat { text-align: center; }
.hero-stat-value {
    font-family: 'Orbitron', sans-serif; font-size: 2rem; font-weight: 900;
    background: linear-gradient(135deg, var(--gold), #fbbf24);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: 10px; font-weight: 600;
    font-size: 0.9rem; border: none; cursor: pointer;
    transition: var(--transition); text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); color: #fff; }
.btn-outline {
    background: transparent; border: 1px solid var(--border); color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--accent); background: var(--bg-card); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #d97706); color: #000; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 0 20px var(--gold-glow); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #dc2626); color: #fff; }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(239,68,68,0.3); }
.btn-mana {
    background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff;
    padding: 6px 14px; font-size: 0.75rem; border-radius: 8px;
    transition: var(--transition);
}
.btn-mana:hover { transform: translateY(-1px); box-shadow: 0 0 12px rgba(99,102,241,0.4); }
.pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }
@keyframes pulseGlow {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.8; filter: brightness(1.3); }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes typeReveal {
    from { max-height: 0; opacity: 0; }
    to { max-height: 200px; opacity: 1; }
}
.dialogue-quote {
    animation: slideIn 0.6s ease, typeReveal 0.8s ease;
    overflow: hidden;
}
.mana-label {
    display: inline-block; font-size: 0.6rem; margin-left: 4px;
    opacity: 0.85; vertical-align: middle; font-family: 'Inter', sans-serif;
}
.buff-indicator {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.4);
    color: #22c55e; padding: 3px 10px; border-radius: 20px;
    font-size: 0.7rem; font-weight: 600; animation: pulseGlow 2s infinite;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================
   CARDS (UI cards, not game cards)
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}
.card:hover { transform: translateY(-4px); border-color: rgba(99,102,241,0.2); box-shadow: var(--shadow); }
/* Prevent card hover transform inside inline sections (causes layout jump) */
.card-spotlight .game-card:hover,
.card > .game-card:hover { transform: none; }
.card-spotlight { overflow: hidden; position: relative; }

/* ============================================
   GAME CARD (Character card) — Card Frame System V2
   Designed by: Rush (Art Director)
   ============================================ */
.game-card {
    position: relative;
    width: 260px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    border: 2px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}
.game-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.game-card:hover .game-card-img img { transform: scale(1.1); }

/* === CARD FRAME SYSTEM — 6 Molduras por Raridade === */
.game-card.rarity-comum {
    border-color: var(--rarity-comum);
    border-width: 1px;
}
.game-card.rarity-incomum {
    border-color: var(--rarity-incomum);
    border-width: 2px;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.15);
}
.game-card.rarity-incomum::after {
    content: '🌿'; position: absolute; top: 4px; left: 4px; font-size: 0.7rem; opacity: 0.5;
}
.game-card.rarity-raro {
    border-color: var(--rarity-raro);
    border-width: 2px;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}
.game-card.rarity-raro::before {
    content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    border-radius: 14px;
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}
.game-card.rarity-epico {
    border-color: var(--rarity-epico);
    border-width: 2px;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.25);
}
.game-card.rarity-epico::before {
    content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    border-radius: 14px;
    background: radial-gradient(ellipse at 50% 0%, rgba(168,85,247,0.08) 0%, transparent 60%);
    box-shadow: inset 0 0 30px rgba(168, 85, 247, 0.15);
}
@keyframes epicGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(168,85,247,0.2); }
    50% { box-shadow: 0 0 30px rgba(168,85,247,0.35); }
}
.game-card.rarity-lendario {
    border-color: var(--rarity-lendario);
    border-width: 3px;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.3);
}
.game-card.rarity-lendario::before {
    content: ''; position: absolute; inset: -1px; z-index: 1; pointer-events: none;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(245,158,11,0.1) 0%, transparent 40%, rgba(245,158,11,0.05) 60%, transparent 100%);
    box-shadow: inset 0 0 40px rgba(245, 158, 11, 0.1);
}
@keyframes legendGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(245,158,11,0.2); border-color: #f59e0b; }
    50% { box-shadow: 0 0 40px rgba(245,158,11,0.4); border-color: #fbbf24; }
}
.game-card.rarity-rei {
    border-color: var(--rarity-rei);
    border-width: 3px;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}
.game-card.rarity-rei::before {
    content: ''; position: absolute; inset: -2px; z-index: 1; pointer-events: none;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(239,68,68,0.12) 0%, transparent 30%, rgba(239,68,68,0.08) 70%, rgba(245,158,11,0.1) 100%);
    box-shadow: inset 0 0 50px rgba(239, 68, 68, 0.15);
}
.game-card.rarity-rei::after {
    content: '👑'; position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
    font-size: 1.2rem; z-index: 5; filter: drop-shadow(0 0 8px rgba(239,68,68,0.6));
    animation: crownFloat 3s ease-in-out infinite;
}
@keyframes reiGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(239,68,68,0.3); }
    50% { box-shadow: 0 0 45px rgba(239,68,68,0.6); }
}
@keyframes crownFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

/* === ART-04: FOIL Holographic Effect (premium TCG feel) === */
.game-card.foil {
    --foil-angle: 135deg;
}
.game-card.foil::before {
    content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(var(--foil-angle),
        transparent 0%,
        rgba(255,0,0,0.05) 10%,
        rgba(255,165,0,0.08) 20%,
        rgba(255,255,0,0.06) 30%,
        rgba(0,255,0,0.08) 40%,
        rgba(0,255,255,0.06) 50%,
        rgba(0,0,255,0.08) 60%,
        rgba(128,0,255,0.06) 70%,
        rgba(255,0,255,0.05) 80%,
        transparent 100%
    );
    background-size: 250% 250%;
    animation: foilHolo 6s ease-in-out infinite alternate;
    border-radius: 14px;
    mix-blend-mode: screen;
}
.game-card.foil::after {
    content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background: linear-gradient(115deg,
        transparent 20%,
        rgba(255,255,255,0.12) 40%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.12) 60%,
        transparent 80%
    );
    background-size: 300% 300%;
    animation: foilShimmer 3s linear infinite;
    border-radius: 14px;
}
@keyframes foilHolo {
    0% { background-position: 0% 0%; filter: hue-rotate(0deg); }
    50% { background-position: 100% 100%; filter: hue-rotate(60deg); }
    100% { background-position: 200% 200%; filter: hue-rotate(120deg); }
}
@keyframes foilShimmer {
    0% { background-position: 200% 50%; }
    100% { background-position: -200% 50%; }
}

.game-card-img {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}
.game-card-img picture {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.game-card-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}
.game-card-body { padding: 16px; }
.game-card-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem; font-weight: 700;
    margin-bottom: 4px;
}
.game-card-title { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; font-style: italic; }
.game-card-power {
    position: absolute; top: 12px; right: 12px;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
    border-radius: 8px; padding: 4px 10px;
    font-family: 'Orbitron', sans-serif; font-size: 0.8rem; font-weight: 700;
}
.game-card-rarity {
    position: absolute; top: 12px; left: 12px;
}
.game-card-king-badge {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    font-size: 3rem; opacity: 0.15; pointer-events: none;
}
.game-card-attrs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.game-card-attr {
    font-size: 0.65rem; padding: 2px 8px; border-radius: 4px;
    background: rgba(255,255,255,0.05); color: var(--text-secondary);
}

/* ============================================
   RARITY BADGE
   ============================================ */
.rarity-badge {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    background: color-mix(in srgb, var(--rarity-color) 20%, transparent);
    color: var(--rarity-color); border: 1px solid color-mix(in srgb, var(--rarity-color) 30%, transparent);
}

/* ============================================
   ATTRIBUTE BARS
   ============================================ */
.attr-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.attr-label { font-size: 0.75rem; font-weight: 600; width: 80px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.attr-short { display: none; }
.attr-track { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.attr-fill { height: 100%; border-radius: 4px; transition: width 1s ease-out; }
.attr-high { background: linear-gradient(90deg, #22c55e, #4ade80); }
.attr-mid { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.attr-low { background: linear-gradient(90deg, #ef4444, #f87171); }
.attr-value { font-family: 'Orbitron', sans-serif; font-size: 0.75rem; font-weight: 700; width: 30px; text-align: right; }

/* ============================================
   SCENARIO CARD
   ============================================ */
.scenario-card {
    position: relative; border-radius: var(--radius-lg); overflow: hidden;
    background: var(--bg-card); border: 1px solid var(--border);
    transition: var(--transition); min-height: 200px;
    display: flex; flex-direction: column; justify-content: flex-end; padding: 24px;
}
.scenario-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
}
.scenario-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.scenario-card-icon { font-size: 3rem; position: absolute; top: 20px; right: 20px; z-index: 2; opacity: 0.6; }
.scenario-card-content { position: relative; z-index: 2; }
.scenario-card h3 { font-family: 'Orbitron', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.scenario-card p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.scenario-card-meta { display: flex; gap: 12px; font-size: 0.75rem; color: var(--text-muted); flex-wrap: wrap; }

/* ============================================
   SECTIONS
   ============================================ */
.section { padding: 80px 0; position: relative; z-index: 1; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 {
    font-family: 'Orbitron', sans-serif; font-size: 2rem; font-weight: 700; margin-bottom: 8px;
}
.section-header p { color: var(--text-secondary); max-width: 500px; margin: 0 auto; }
.section-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 0; }

/* ============================================
   GRIDS
   ============================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 24px; justify-items: center; max-width: 100%; }

/* Global overflow protection */
.container, .section, .card, .game-card, .scenario-card { max-width: 100%; overflow-wrap: break-word; }
main, section { max-width: 100vw; overflow-x: hidden; }

/* ============================================
   PROBABILITY PANEL
   ============================================ */
.prob-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px; margin: 24px 0;
}
.prob-panel h3 { font-family: 'Orbitron', sans-serif; font-size: 1rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.prob-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.prob-row:last-child { border-bottom: none; }
.prob-pct { font-family: 'Orbitron', sans-serif; font-weight: 700; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-secondary); border-top: 1px solid var(--border);
    padding: 48px 0 24px; margin-top: 80px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-brand { font-family: 'Orbitron', sans-serif; font-size: 1.2rem; font-weight: 900; margin-bottom: 12px; color: var(--accent); }
.footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; color: var(--text-primary); }
.footer a { color: var(--text-muted); font-size: 0.85rem; display: block; margin-bottom: 8px; }
.footer a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-muted); }

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs { padding: 16px 0; font-size: 0.8rem; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 8px; color: var(--text-secondary); opacity: 0.7; }

/* ============================================
   PERSONAGEM DETAIL GRID
   ============================================ */
.personagem-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .navbar-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-primary); flex-direction: column; padding: 16px; border-bottom: 1px solid var(--border); z-index: 999; }
    .navbar-nav.open { display: flex; }
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 24px; }
    .hero p { font-size: 0.9rem; }
    .section-header h2 { font-size: 1.5rem; }
    .container { padding: 0 12px; }
    .section { padding: 32px 0; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    .player-status-bar { font-size: 0.7rem; padding: 6px 12px; }
    .player-status-bar .status-right { display: none; }
    .personagem-grid { grid-template-columns: 1fr; gap: 20px; }
    .personagem-grid > div:first-child { max-width: 320px; margin: 0 auto; }
    .personagem-grid > div:first-child .game-card { width: 100%; }
}
@media (max-width: 480px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .hero h1 { font-size: 1.5rem; }
    .section-header h2 { font-size: 1.2rem; }
    .game-card-body { padding: 10px; }
    .game-card-name { font-size: 0.85rem; }
    .game-card-title { font-size: 0.6rem; }
    .game-card-attrs { font-size: 0.55rem; }
    .btn { padding: 10px 16px; font-size: 0.85rem; }
    .game-card-img { aspect-ratio: 3 / 4; }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.animate-in { animation: fadeInUp 0.6s ease-out forwards; }
.animate-fade { animation: fadeIn 0.4s ease-out forwards; }

/* Staggered animations for card grids */
.card-grid > *:nth-child(1) { animation-delay: 0.05s; }
.card-grid > *:nth-child(2) { animation-delay: 0.1s; }
.card-grid > *:nth-child(3) { animation-delay: 0.15s; }
.card-grid > *:nth-child(4) { animation-delay: 0.2s; }
.card-grid > *:nth-child(5) { animation-delay: 0.25s; }
.card-grid > *:nth-child(6) { animation-delay: 0.3s; }
.card-grid > *:nth-child(7) { animation-delay: 0.35s; }
.card-grid > *:nth-child(8) { animation-delay: 0.4s; }

/* Search term highlight */
mark.search-highlight { background: rgba(99,102,241,0.3); color: var(--text-primary); border-radius: 2px; padding: 0 2px; }

/* Loading dots animation (matchmaking) */
.loading-dots::after { content: ''; animation: loadDots 1.4s infinite steps(4); }
@keyframes loadDots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* Loja POSSUI badge */
.badge-owns { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.5); border-radius: 14px; z-index: 3; pointer-events: none; }
.badge-owns span { background: var(--success); color: #000; padding: 4px 16px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }

/* Responsive grid for tablets */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================
   MOBILE RESPONSIVE (Fix #6, #10, #19)
   ============================ */
@media (max-width: 768px) {
    /* Container padding */
    .container { padding-left: 12px; padding-right: 12px; }
    
    /* Card grids: 2 columns on mobile */
    .card-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
    
    /* Section headers */
    .section-header h1, .section-header h2 { font-size: 1.4rem !important; }
    .section { padding: 24px 0 !important; }
    
    /* Buttons: bigger touch targets */
    .btn { min-height: 44px; font-size: 0.85rem; }
    .btn-lg { width: 100%; justify-content: center; }
    
    /* Game cards: tighter on mobile */
    .game-card { border-radius: 10px; }
    .game-card-body { padding: 8px !important; }
    .game-card-name { font-size: 0.75rem !important; }
    .game-card-power { font-size: 0.65rem !important; padding: 2px 6px !important; }
    .game-card-attrs { gap: 2px !important; }
    
    /* Prob rows: stack on small screens */
    .prob-row { flex-wrap: wrap; gap: 4px; padding: 10px 12px !important; }
    
    /* Tables: horizontal scroll */
    table { display: block; overflow-x: auto; white-space: nowrap; }
    
    /* Footer: stack */
    footer .container > div:first-child { grid-template-columns: 1fr !important; text-align: center; }
    
    /* Reading widget: full width */
    #reading-widget { right: 12px !important; left: 12px !important; max-width: none !important; }
    
    /* Cenário hero: stack vertically */
    .cenario-hero { flex-direction: column !important; text-align: center !important; gap: 12px !important; }
    
    /* Breadcrumbs: scroll */
    .breadcrumbs { overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
    
    /* Player bar compact */
    .player-bar { font-size: 0.7rem !important; padding: 6px 12px !important; }
    
    /* Nav */
    .nav-links { gap: 4px !important; }
    .nav-links a { font-size: 0.65rem !important; }
    
    /* Carta do Dia spotlight: stack vertically */
    .card-spotlight { max-width: 140px !important; }
    .card-spotlight .game-card { width: 130px !important; }
    
    /* Quick Actions / bottom 3-column grid: stack */
    .grid-3 { grid-template-columns: 1fr !important; }
    
    /* Onboarding 4-step guide: 2 columns */
    #onboarding-steps { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Small phones */
@media (max-width: 400px) {
    .card-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .game-card-img { height: 120px !important; }
    h1 { font-size: 1.2rem !important; }
    h2 { font-size: 1rem !important; }
}

/* === ITEM 11: GLOBAL RESPONSIVENESS PATCH === */
/* Ensure no horizontal overflow anywhere */
html, body { overflow-x: hidden; }

/* Battle board mobile */
@media (max-width: 768px) {
    .battle-board { padding: 12px !important; }
    .battle-scoreboard { padding: 10px !important; }
    /* Temporada hero */
    [data-countdown] { font-size: 0.8rem !important; }
    /* Admin tables: compact */
    .finput { font-size: 0.75rem !important; padding: 6px 8px !important; }
    .lbl { font-size: 0.6rem !important; }
    /* Compare cards side by side */
    .compare-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
    /* Ranking table rows */
    .ranking-row td { padding: 6px 4px !important; font-size: 0.75rem !important; }
    /* Season battle pass horizontal scroll */
    [style*="min-width:900px"] { min-width: 600px !important; }
    /* Modal full-width */
    [id$="-modal"] > div { max-width: 100% !important; padding: 12px !important; }
    [id$="-modal"] .card { padding: 16px !important; }
    /* Contos reading */
    .conto-content { font-size: 0.95rem !important; line-height: 1.8 !important; }
    .conto-content img { max-width: 100% !important; height: auto !important; }
    /* Footer */
    .footer { padding: 24px 0 16px !important; margin-top: 40px !important; }
}

/* Touch-friendly: all interactive elements minimum 44px */
@media (pointer: coarse) {
    button, .btn, a.btn, select, input[type="checkbox"] {
        min-height: 44px;
        min-width: 44px;
    }
    /* Scenario card touch */
    .scenario-card { min-height: 160px !important; }
    /* Battle card touch targets */
    .battle-card { min-height: 80px !important; }
}

/* === ART-07: ANIMATED SCENARIO BACKGROUNDS === */
.scenario-bg {
    position: relative;
    overflow: hidden;
}
.scenario-bg::before {
    content: '';
    position: absolute;
    inset: -50%;
    z-index: 0;
    opacity: 0.15;
    pointer-events: none;
    animation: scenarioFloat 20s ease-in-out infinite;
}
@keyframes scenarioFloat {
    0%, 100% { transform: translate(0,0) rotate(0deg); }
    25% { transform: translate(2%,-1%) rotate(1deg); }
    50% { transform: translate(-1%,2%) rotate(-0.5deg); }
    75% { transform: translate(1%,-2%) rotate(0.5deg); }
}

/* Fire scenarios (Cozinha, Hells) */
.scenario-bg--fire::before {
    background: radial-gradient(ellipse at 30% 80%, #ef444440 0%, transparent 50%),
                radial-gradient(ellipse at 70% 20%, #f97316330 0%, transparent 40%);
}
/* Ocean scenarios (Mar Abissal) */
.scenario-bg--ocean::before {
    background: radial-gradient(ellipse at 20% 60%, #0ea5e940 0%, transparent 50%),
                radial-gradient(ellipse at 80% 30%, #06b6d430 0%, transparent 50%);
    animation: scenarioFloat 25s ease-in-out infinite;
}
/* Dark/Horror scenarios */
.scenario-bg--dark::before {
    background: radial-gradient(ellipse at 50% 50%, #7c3aed30 0%, transparent 60%),
                radial-gradient(ellipse at 20% 80%, #ef444420 0%, transparent 40%);
}
/* Nature scenarios (Selva, Fazenda) */
.scenario-bg--nature::before {
    background: radial-gradient(ellipse at 40% 70%, #22c55e30 0%, transparent 50%),
                radial-gradient(ellipse at 70% 30%, #84cc1620 0%, transparent 40%);
}
/* Tech/Cyber scenarios */
.scenario-bg--cyber::before {
    background: radial-gradient(ellipse at 30% 50%, #06b6d440 0%, transparent 50%),
                radial-gradient(ellipse at 80% 70%, #6366f130 0%, transparent 40%);
}
/* Celestial/Magic scenarios */
.scenario-bg--cosmic::before {
    background: radial-gradient(ellipse at 50% 30%, #a855f740 0%, transparent 50%),
                radial-gradient(ellipse at 30% 80%, #ec489930 0%, transparent 40%);
}
/* Desert/Ancient scenarios */
.scenario-bg--desert::before {
    background: radial-gradient(ellipse at 60% 80%, #f59e0b30 0%, transparent 50%),
                radial-gradient(ellipse at 30% 20%, #d9770620 0%, transparent 40%);
}

/* Animated particles overlay */
.scenario-bg--particles::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: 
        radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px, 30px 30px;
    background-position: 0 0, 25px 25px;
    animation: particleDrift 30s linear infinite;
    pointer-events: none;
}
@keyframes particleDrift {
    from { background-position: 0 0, 25px 25px; }
    to { background-position: 50px 50px, 75px 75px; }
}

/* === ART-08: CARD BACK DESIGNS === */
.card-back {
    width: 100%; aspect-ratio: 2/3;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem; color: rgba(255,255,255,0.3);
    border: 2px solid rgba(255,255,255,0.1);
}
.card-back::before {
    content: ''; position: absolute; inset: 0;
    pointer-events: none; z-index: 1;
}
/* Classic */
.cb-classic {
    background: linear-gradient(145deg, #1e1b4b 0%, #0f172a 50%, #1e1b4b 100%);
}
.cb-classic::before {
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(99,102,241,0.05) 10px, rgba(99,102,241,0.05) 20px);
}
/* Obsidian */
.cb-obsidian {
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #0a0a0a);
    border-color: rgba(255,255,255,0.05);
}
.cb-obsidian::before {
    background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 70%);
    animation: scenarioFloat 15s ease infinite;
}
/* Aurora */
.cb-aurora {
    background: linear-gradient(135deg, #0f172a, #1e1b4b);
}
.cb-aurora::before {
    background: linear-gradient(45deg, 
        rgba(99,102,241,0.2), rgba(168,85,247,0.15), rgba(236,72,153,0.2),
        rgba(14,165,233,0.15), rgba(34,197,94,0.2));
    background-size: 400% 400%;
    animation: foilHolo 8s ease-in-out infinite alternate;
}
/* Dragon */
.cb-dragon {
    background: linear-gradient(145deg, #1e1b4b, #3b0764, #1e1b4b);
    border-color: rgba(168,85,247,0.3);
}
.cb-dragon::before {
    background: radial-gradient(circle at 50% 40%, rgba(168,85,247,0.15) 0%, transparent 60%);
}
/* A Voz */
.cb-avoz {
    background: linear-gradient(135deg, #0f172a, #1e3a5f, #0f172a);
    border-color: rgba(245,158,11,0.3);
}
.cb-avoz::before {
    background: radial-gradient(circle at 50% 50%, rgba(245,158,11,0.15) 0%, transparent 50%);
    animation: cutsceneGlow 3s ease infinite;
}
/* Fratura */
.cb-fratura {
    background: linear-gradient(135deg, #1e1b4b, #0f172a);
    border-color: rgba(239,68,68,0.3);
}
.cb-fratura::before {
    background: 
        linear-gradient(45deg, transparent 40%, rgba(239,68,68,0.15) 41%, rgba(239,68,68,0.15) 42%, transparent 43%),
        linear-gradient(-45deg, transparent 40%, rgba(168,85,247,0.15) 41%, rgba(168,85,247,0.15) 42%, transparent 43%),
        linear-gradient(135deg, transparent 48%, rgba(245,158,11,0.1) 49%, rgba(245,158,11,0.1) 51%, transparent 52%);
}

/* === ART-06: SCENARIO EMBLEM STYLES === */
.scenario-emblem {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    border: 2px solid rgba(255,255,255,0.1);
    position: relative; overflow: hidden;
}
.scenario-emblem::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

/* === ART-03: SCENARIO DNA VISUAL SYSTEM === */
/* Each scenario gets unique border glow, gradient, texture */
.game-card[data-scenario="arena-dos-titas"] { --scene-color: #ef4444; --scene-glow: rgba(239,68,68,0.3); }
.game-card[data-scenario="galaxia-perdida"] { --scene-color: #6366f1; --scene-glow: rgba(99,102,241,0.3); }
.game-card[data-scenario="terras-encantadas"] { --scene-color: #22c55e; --scene-glow: rgba(34,197,94,0.3); }
.game-card[data-scenario="selva-primordial"] { --scene-color: #15803d; --scene-glow: rgba(21,128,61,0.3); }
.game-card[data-scenario="metropole-sombria"] { --scene-color: #64748b; --scene-glow: rgba(100,116,139,0.3); }
.game-card[data-scenario="olimpo-furioso"] { --scene-color: #f59e0b; --scene-glow: rgba(245,158,11,0.3); }
.game-card[data-scenario="cyberpunk-2199"] { --scene-color: #06b6d4; --scene-glow: rgba(6,182,212,0.3); }
.game-card[data-scenario="mar-abissal"] { --scene-color: #0ea5e9; --scene-glow: rgba(14,165,233,0.3); }
.game-card[data-scenario="idade-do-ferro"] { --scene-color: #78716c; --scene-glow: rgba(120,113,108,0.3); }
.game-card[data-scenario="dimensao-zero"] { --scene-color: #a855f7; --scene-glow: rgba(168,85,247,0.3); }
.game-card[data-scenario="cozinha-infernal"] { --scene-color: #f97316; --scene-glow: rgba(249,115,22,0.3); }
.game-card[data-scenario="escola-de-horrores"] { --scene-color: #dc2626; --scene-glow: rgba(220,38,38,0.3); }
.game-card[data-scenario="olimpiadas-do-absurdo"] { --scene-color: #eab308; --scene-glow: rgba(234,179,8,0.3); }
.game-card[data-scenario="tribunal-cosmico"] { --scene-color: #8b5cf6; --scene-glow: rgba(139,92,246,0.3); }

/* Apply scenario DNA when data-scenario is present */
.game-card[data-scenario] {
    border-color: var(--scene-color, var(--border-dim)) !important;
    box-shadow: 0 0 12px var(--scene-glow, transparent), inset 0 0 20px rgba(0,0,0,0.3);
}
.game-card[data-scenario]:hover {
    box-shadow: 0 0 20px var(--scene-glow), 0 8px 32px rgba(0,0,0,0.4);
}
/* Scenario watermark on card */
.game-card[data-scenario]::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 60px; height: 60px;
    background: var(--scene-color);
    opacity: 0.04;
    mask: radial-gradient(circle, white 30%, transparent 70%);
    -webkit-mask: radial-gradient(circle, white 30%, transparent 70%);
    pointer-events: none;
}

/* Lucide Icons - Inline styling */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; stroke-width: 2; }

/* ============================================
   AI-08: CARD 3D TILT PARALLAX (Akira Ito)
   GPU-accelerated, perspective-based hover
   ============================================ */
.game-card {
    transform-style: preserve-3d;
    perspective: 800px;
}
.game-card:hover {
    transform: translateY(-8px) scale(1.02) rotateX(2deg) rotateY(-3deg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px var(--scene-glow, rgba(99,102,241,0.15));
}
.game-card .game-card-img img,
.game-card .game-card-img {
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.game-card:hover .game-card-img img,
.game-card:hover .game-card-img {
    transform: scale(1.08) translateZ(10px);
}

/* ============================================
   CR-11: FOIL V2 — RAINBOW HOLOGRAPHIC (Rush)
   Conic gradient with hue-rotate, noise overlay
   ============================================ */
.game-card.foil-v2::before {
    content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(255,0,0,0.12) 0deg,
        rgba(255,127,0,0.10) 51deg,
        rgba(255,255,0,0.12) 102deg,
        rgba(0,255,0,0.10) 153deg,
        rgba(0,127,255,0.12) 204deg,
        rgba(127,0,255,0.10) 255deg,
        rgba(255,0,127,0.12) 306deg,
        rgba(255,0,0,0.12) 360deg
    );
    border-radius: 14px;
    mix-blend-mode: screen;
    animation: foilV2Rotate 8s linear infinite;
    filter: blur(2px);
}
.game-card.foil-v2::after {
    content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background: 
        linear-gradient(125deg, transparent 25%, rgba(255,255,255,0.25) 45%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.25) 55%, transparent 75%);
    background-size: 250% 250%;
    animation: foilV2Sweep 4s ease-in-out infinite;
    border-radius: 14px;
}
@keyframes foilV2Rotate {
    from { filter: hue-rotate(0deg) blur(2px); }
    to { filter: hue-rotate(360deg) blur(2px); }
}
@keyframes foilV2Sweep {
    0% { background-position: 200% 0%; }
    100% { background-position: -200% 0%; }
}

/* ============================================
   CR-20: LOADING SKELETON SHIMMER (Rush)
   Placeholder while images load
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 400% 100%;
    animation: shimmerLoad 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}
.skeleton-card {
    width: 100%; aspect-ratio: 2/3;
    border-radius: 16px;
}
.skeleton-text {
    height: 14px; width: 80%;
    border-radius: 4px;
    margin-bottom: 6px;
}
.skeleton-text-sm {
    height: 10px; width: 60%;
    border-radius: 3px;
}
@keyframes shimmerLoad {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   CR-10: REI FRAME PULSING PARTICLES (Rush)
   Animated border with particle-like CSS dots
   ============================================ */
.game-card.rarity-rei {
    --rei-particle-1: rgba(239,68,68,0.5);
    --rei-particle-2: rgba(245,158,11,0.4);
}
@keyframes reiParticles {
    0% { background-position: 0% 50%, 100% 50%; }
    50% { background-position: 100% 50%, 0% 50%; }
    100% { background-position: 0% 50%, 100% 50%; }
}

/* ============================================
   AI-27: HOVER MICRO-ANIMATIONS (Akira Ito)
   Subtle lift + glow on card grid hover
   ============================================ */
.card-grid .game-card {
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1), 
                box-shadow 0.35s cubic-bezier(0.23, 1, 0.32, 1),
                border-color 0.35s ease;
    will-change: transform;
}
.card-grid .game-card:hover {
    z-index: 10;
}
.card-grid .game-card:hover .game-card-name {
    color: var(--accent-hover);
    transition: color 0.3s ease;
}
.card-grid .game-card:hover .game-card-power {
    background: rgba(99,102,241,0.85);
    color: #fff;
    transition: background 0.3s ease;
}

/* ============================================
   CR-18: CARD SPOTLIGHT (Rush)
   Featured card on home with floating animation
   ============================================ */
.card-spotlight {
    position: relative;
    animation: spotlightFloat 4s ease-in-out infinite;
}
@keyframes spotlightFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.card-spotlight::after {
    content: '';
    position: absolute;
    bottom: -20px; left: 10%; right: 10%;
    height: 20px;
    background: radial-gradient(ellipse, rgba(99,102,241,0.15) 0%, transparent 70%);
    filter: blur(8px);
    animation: spotlightShadow 4s ease-in-out infinite;
}
@keyframes spotlightShadow {
    0%, 100% { opacity: 1; transform: scaleX(1); }
    50% { opacity: 0.5; transform: scaleX(0.85); }
}

/* ============================================
   VT-20: LOGIN STREAK VISUAL (Victoria)
   Fire badge styling for consecutive days
   ============================================ */
.streak-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.7rem; font-weight: 700;
    background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(239,68,68,0.15));
    color: var(--gold);
    border: 1px solid rgba(245,158,11,0.3);
    animation: streakPulse 2s ease-in-out infinite;
}
.streak-badge--epic {
    background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(239,68,68,0.2));
    color: var(--rarity-epico);
    border-color: rgba(168,85,247,0.4);
    box-shadow: 0 0 12px rgba(168,85,247,0.2);
}
@keyframes streakPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ============================================
   AI-05: FRAME GLOW BY SCENARIO (Akira Ito)
   Dual identity: rarity frame + scenario glow
   ============================================ */
.game-card[data-scenario]:hover::before {
    box-shadow: inset 0 0 30px var(--scene-glow, rgba(99,102,241,0.1));
}

/* ============================================
   CO-11: BATTLE MOMENT BANNER (Chris Olah)
   Narrative moment display styling
   ============================================ */
.battle-moment {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(168,85,247,0.05));
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius);
    padding: 16px 20px;
    font-style: italic;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}
.battle-moment::before {
    content: '"';
    position: absolute; top: -10px; left: 10px;
    font-size: 4rem; color: rgba(99,102,241,0.1);
    font-family: Georgia, serif;
}

/* ============================================
   DG-22: VOLUME MIXER PANEL (David García)
   ============================================ */
.audio-mixer {
    position: fixed; bottom: 20px; right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-width: 280px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    backdrop-filter: blur(20px);
    animation: fadeInUp 0.3s ease;
    display: none;
}
.audio-mixer.active { display: block; }
.audio-mixer h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem; color: var(--accent);
    margin-bottom: 16px; letter-spacing: 1px;
    text-transform: uppercase;
}
.audio-mixer-slider {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}
.audio-mixer-slider label {
    font-size: 0.75rem; color: var(--text-secondary);
    min-width: 60px;
}
.audio-mixer-slider input[type="range"] {
    flex: 1; height: 4px;
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.1);
    border-radius: 2px; outline: none;
}
.audio-mixer-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
}

/* ============================================
   VT-17: NOTIFICATION CENTER (Victoria)
   ============================================ */
.notif-bell {
    position: relative;
    cursor: pointer;
}
.notif-bell .notif-count {
    position: absolute; top: -6px; right: -8px;
    min-width: 16px; height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 0.55rem; font-weight: 700;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    animation: notifBounce 0.5s ease;
}
@keyframes notifBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ============================================
   YT-08: VS RIVALRY CUTSCENE SPLIT (Tanimura)
   Screen split animation for rival encounters
   ============================================ */
.rivalry-splash {
    position: fixed; inset: 0; z-index: 9999;
    display: flex;
    background: #000;
    animation: rivalryFlash 3s ease forwards;
}
.rivalry-splash .left,
.rivalry-splash .right {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.rivalry-splash .left {
    background: linear-gradient(135deg, #0a0a2e, #1e1b4b);
    animation: rivalSlideLeft 0.6s ease-out;
}
.rivalry-splash .right {
    background: linear-gradient(135deg, #1e0000, #2d0a0a);
    animation: rivalSlideRight 0.6s ease-out;
}
.rivalry-splash .vs {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem; font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(245,158,11,0.6);
    z-index: 2;
    animation: vsZoom 0.4s 0.5s ease-out both;
}
@keyframes rivalSlideLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
@keyframes rivalSlideRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
@keyframes vsZoom {
    from { transform: translate(-50%,-50%) scale(3); opacity: 0; }
    to { transform: translate(-50%,-50%) scale(1); opacity: 1; }
}
@keyframes rivalryFlash {
    0%, 80% { opacity: 1; }
    100% { opacity: 0; pointer-events: none; }
}

/* ============================================
   CR-22: LEGENDARY PULL FULL-SCREEN (Rush)
   Full-screen reveal for REI/Legendary cards
   ============================================ */
.legendary-reveal {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.95);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    animation: legendRevealIn 0.5s ease;
}
.legendary-reveal .reveal-card {
    animation: legendCardZoom 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}
.legendary-reveal .reveal-particles {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(245,158,11,0.15) 0%, transparent 60%);
    animation: legendParticles 2s ease-in-out infinite;
}
.legendary-reveal .reveal-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem; font-weight: 900;
    color: var(--gold);
    margin-top: 24px;
    animation: fadeInUp 0.5s ease 1s both;
    text-shadow: 0 0 20px rgba(245,158,11,0.5);
}
@keyframes legendRevealIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes legendCardZoom {
    from { transform: scale(0.3) rotateY(180deg); opacity: 0; }
    to { transform: scale(1) rotateY(0); opacity: 1; }
}
@keyframes legendParticles {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* ============================================
   DS-29: WIN STREAK FIRE BADGES (Dishsoap)
   ============================================ */
.win-streak {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.7rem; font-weight: 700;
    padding: 2px 8px; border-radius: 12px;
}
.win-streak--hot {
    background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(245,158,11,0.15));
    color: var(--danger);
    animation: streakPulse 1.5s ease-in-out infinite;
}
.win-streak--fire {
    background: linear-gradient(135deg, rgba(245,158,11,0.3), rgba(239,68,68,0.25));
    color: var(--gold);
    box-shadow: 0 0 10px rgba(245,158,11,0.2);
    animation: streakPulse 1s ease-in-out infinite;
}
.win-streak--inferno {
    background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(239,68,68,0.3));
    color: #ff6b6b;
    box-shadow: 0 0 15px rgba(239,68,68,0.3);
    animation: streakPulse 0.8s ease-in-out infinite;
}

/* ============================================
   TI-01: DAILY LOGIN CALENDAR (Ishihara)
   ============================================ */
.login-calendar {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.login-calendar-day {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 600;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition);
}
.login-calendar-day.claimed {
    background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(34,197,94,0.1));
    border-color: rgba(34,197,94,0.3);
    color: var(--success);
}
.login-calendar-day.today {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(168,85,247,0.15));
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulseGlow 2s infinite;
}
.login-calendar-day.locked {
    opacity: 0.4;
}

/* ============================================
   CUTSCENE & DIALOGUE SYSTEMS (Tanimura/Konieczka)
   ============================================ */
@keyframes cutsceneGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(245,158,11,0.1); }
    50% { box-shadow: 0 0 30px rgba(245,158,11,0.3); }
}
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}
.typewriter-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent);
    animation: typewriter 2s steps(40) forwards, blink 0.7s step-end infinite;
}
@keyframes blink {
    50% { border-color: transparent; }
}

/* === IC-15: WIN CONDITION ANIMATIONS === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes legendCardZoom {
    0% { opacity: 0; transform: scale(0.3) rotateZ(-10deg); }
    60% { opacity: 1; transform: scale(1.2) rotateZ(2deg); }
    100% { transform: scale(1) rotateZ(0); }
}
@keyframes legendParticles {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

/* === DS-06: LEAGUE BADGES (Player Bar) === */
.league-badge-animated {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* === DS-29: WIN STREAK FIRE BADGES === */
.win-streak { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; }
.win-streak--hot { color: #F59E0B; text-shadow: 0 0 8px rgba(245,158,11,0.4); }
.win-streak--fire { color: #EF4444; text-shadow: 0 0 12px rgba(239,68,68,0.5); animation: pulseGlow 1.5s infinite; }
.win-streak--inferno { color: #EF4444; text-shadow: 0 0 20px rgba(239,68,68,0.7), 0 0 40px rgba(245,158,11,0.3); animation: pulseGlow 0.8s infinite; font-size: 1.1em; }

/* === VT-20: LOGIN STREAK BADGE === */
.streak-badge {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: 6px; font-size: 0.65rem; font-weight: 600;
    background: rgba(34,197,94,0.1); color: var(--success); border: 1px solid rgba(34,197,94,0.2);
}
.streak-badge--epic {
    background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(239,68,68,0.1));
    color: var(--gold); border: 1px solid rgba(245,158,11,0.3);
    animation: pulseGlow 2s infinite;
}

/* === IC-07: ARENA CARD HOVER STATS === */
.arena-card:hover .card-stats-overlay {
    opacity: 1; transform: translateY(0);
}
.card-stats-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 8px; opacity: 0; transform: translateY(4px);
    transition: all 0.3s ease; font-size: 0.6rem;
}

/* === CO-05: BOT NPC AVATAR GLOW === */
.arena-avatar.opp.named { box-shadow: 0 0 12px rgba(239,68,68,0.4); }
.arena-avatar.opp.aggressive { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 0 16px rgba(239,68,68,0.5); }
.arena-avatar.opp.analytical { background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 0 16px rgba(59,130,246,0.5); }
.arena-avatar.opp.adaptive { background: linear-gradient(135deg, #a855f7, #7c3aed); box-shadow: 0 0 16px rgba(168,85,247,0.5); }

/* === MO-09: RANKING LEAGUE DISPLAY === */
.ranking-league-icon { display: inline-flex; align-items: center; gap: 4px; }
.ranking-row:nth-child(1) { background: linear-gradient(90deg, rgba(255,215,0,0.08), transparent) !important; }
.ranking-row:nth-child(2) { background: linear-gradient(90deg, rgba(192,192,192,0.06), transparent) !important; }
.ranking-row:nth-child(3) { background: linear-gradient(90deg, rgba(205,127,50,0.06), transparent) !important; }

/* === AI-15: CARD EVOLUTION SHIMMER === */
@keyframes shimmerGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* === CK-01: CAMPAIGN TIMELINE === */
.campaign-chapter:hover .chapter-card {
    border-color: var(--gold) !important;
    transform: translateX(4px);
}

/* === DG-16: VOICE LINE PLAYER === */
@keyframes waveBar {
    from { height: 3px; }
    to { height: 14px; }
}
#voice-player:hover { border-color: rgba(99,102,241,0.3); }
#voice-btn:hover { background: rgba(99,102,241,0.1); transform: scale(1.1); }

/* === IC-07: DECK HAND PREVIEW === */
.deck-hand-preview {
    display: flex; gap: 0; justify-content: center; perspective: 800px;
}
.deck-hand-card {
    width: 60px; height: 84px; border-radius: 6px; border: 2px solid var(--border);
    background: var(--bg-card); transition: all 0.3s; cursor: pointer; overflow: hidden;
    position: relative;
}
.deck-hand-card:hover {
    transform: translateY(-12px) scale(1.15); z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); border-color: var(--gold);
}
.deck-hand-card:not(:first-child) { margin-left: -12px; }
.deck-hand-card img { width: 100%; height: 100%; object-fit: cover; }

/* === YT-12: REPLAY TIMELINE === */
.replay-timeline {
    display: flex; gap: 2px; align-items: flex-end; height: 30px;
    padding: 4px 0; overflow-x: auto;
}
.replay-turn-bar {
    flex: 1; min-width: 8px; border-radius: 2px 2px 0 0;
    transition: all 0.3s; cursor: pointer; position: relative;
}
.replay-turn-bar:hover { opacity: 1 !important; filter: brightness(1.3); }
.replay-turn-bar.win { background: var(--success); }
.replay-turn-bar.lose { background: var(--danger); }
.replay-turn-bar.draw { background: var(--text-muted); }

/* ============================================
   GL-10: GLOBAL POLISH
   ============================================ */

/* Focus ring for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Smooth card entrance */
.card, .game-card {
    opacity: 0;
    animation: cardEntrance 0.5s ease forwards;
}
/* Combine entrance + rarity animations so both play */
.game-card.rarity-epico {
    animation: cardEntrance 0.5s ease forwards, epicGlow 3s ease-in-out 0.5s infinite;
}
.game-card.rarity-lendario {
    animation: cardEntrance 0.5s ease forwards, legendGlow 3s ease-in-out 0.5s infinite;
}
.game-card.rarity-rei {
    animation: cardEntrance 0.5s ease forwards, reiGlow 2s ease-in-out 0.5s infinite;
}
@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Chip/tag base style */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Selection color */
::selection {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
}

/* Skeleton loading placeholder */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    from { background-position: -200% 0; }
    to { background-position: 200% 0; }
}

/* Print styles */
@media print {
    .navbar, .player-bar, .footer, .btn { display: none !important; }
    body { background: #fff; color: #000; }
    .card { border: 1px solid #ccc; box-shadow: none; }
}

/* ============================================
   MOBILE RESPONSIVENESS V2 — Complete Overhaul
   ============================================ */

/* === TABLET (max-width: 1024px) === */
@media (max-width: 1024px) {
    .hero { padding: 60px 0 40px; }
    .hero h1 { font-size: 2.5rem; }
    .hero-stats { gap: 32px; }
    .hero-stat-value { font-size: 1.6rem; }
    
    /* Onboarding: 2 cols on tablet */
    #onboarding-steps { grid-template-columns: repeat(2, 1fr) !important; }
}

/* === MOBILE (max-width: 768px) === */
@media (max-width: 768px) {
    /* --- NAVBAR --- */
    .menu-toggle { 
        display: flex !important; 
        align-items: center; 
        justify-content: center;
        background: none; 
        border: none; 
        color: var(--text-primary); 
        font-size: 1.5rem; 
        cursor: pointer;
        width: 44px;
        height: 44px;
        border-radius: 8px;
        transition: var(--transition);
    }
    .menu-toggle:hover { background: var(--bg-card); }
    
    .navbar-nav { 
        display: none !important; 
        position: fixed; 
        top: 64px; left: 0; right: 0; bottom: 0;
        background: rgba(10,10,15,0.98); 
        backdrop-filter: blur(20px);
        flex-direction: column; 
        padding: 24px 16px; 
        gap: 4px;
        z-index: 999;
        overflow-y: auto;
        animation: slideDown 0.3s ease-out;
    }
    .navbar-nav.open { display: flex !important; }
    @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
    
    .navbar-nav a {
        padding: 14px 16px !important;
        font-size: 1rem !important;
        border-radius: 10px;
        border-bottom: 1px solid var(--border);
    }
    .navbar-nav a:last-child { border-bottom: none; }
    .navbar-brand { font-size: 1.2rem; }
    
    /* --- HERO --- */
    .hero { padding: 48px 0 32px; }
    .hero h1 { font-size: 1.8rem !important; line-height: 1.2; margin-bottom: 12px; }
    .hero p { font-size: 0.85rem !important; margin-bottom: 24px; padding: 0 8px; }
    .hero-stats { gap: 16px; }
    .hero-stat-value { font-size: 1.4rem; }
    .hero-stat-label { font-size: 0.65rem; }
    
    /* Hero buttons: stack */
    .hero .container > div[style*="display:flex"] { 
        flex-direction: column !important; 
        align-items: center !important;
        gap: 8px !important;
    }
    .hero .btn-lg { 
        width: 90% !important; 
        max-width: 320px;
        justify-content: center;
        padding: 14px 24px !important;
        font-size: 1rem !important;
    }
    .hero .btn-outline {
        width: 90% !important;
        max-width: 320px;
        justify-content: center;
        padding: 10px 16px !important;
        font-size: 0.85rem !important;
    }
    
    /* --- ONBOARDING --- */
    #onboarding-steps { 
        grid-template-columns: 1fr 1fr !important; 
        gap: 8px !important; 
    }
    #onboarding-steps .card { 
        padding: 12px 8px !important; 
    }
    #onboarding-steps .card div[style*="font-size:1.8rem"] { 
        font-size: 1.4rem !important; 
        margin-bottom: 4px !important; 
    }
    #onboarding-steps .card strong { font-size: 0.7rem; }
    #onboarding-steps .card p { font-size: 0.6rem !important; }
    
    /* --- CARTA DO DIA / SPOTLIGHT --- */
    .card-spotlight, 
    div[style*="display:flex"][style*="gap:32px"] {
        flex-direction: column !important;
        align-items: center !important;
        gap: 16px !important;
        text-align: center !important;
    }
    .card-spotlight { 
        max-width: 180px !important; 
        margin: 0 auto !important;
    }
    .card-spotlight .game-card { 
        width: 160px !important; 
    }
    
    /* --- CARDS GRID --- */
    .card-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px !important; 
    }
    .game-card { border-radius: 10px; overflow: hidden; }
    .game-card-body { padding: 8px !important; }
    .game-card-name { font-size: 0.75rem !important; line-height: 1.2; }
    .game-card-title { font-size: 0.55rem !important; }
    .game-card-power { font-size: 0.6rem !important; padding: 2px 6px !important; }
    .game-card-attrs { gap: 2px !important; font-size: 0.5rem !important; }
    .game-card-img { aspect-ratio: 3/4; object-fit: cover; }
    
    /* --- PERSONAGEM PAGE --- */
    .personagem-grid { 
        grid-template-columns: 1fr !important; 
        gap: 16px !important; 
    }
    .personagem-grid > div {
        min-width: 0 !important;
        overflow: hidden !important;
        max-width: 100% !important;
    }
    .personagem-grid > div:first-child { 
        max-width: 280px !important; 
        margin: 0 auto !important; 
        overflow: visible !important;
    }
    
    /* Stats bars */
    .stat-row { 
        flex-direction: column !important;
        gap: 4px !important;
        margin-bottom: 8px;
    }
    .stat-row label, .stat-row .stat-name { 
        font-size: 0.7rem !important;
        min-width: auto !important;
    }
    .stat-bar { height: 8px !important; }
    
    /* Audio players: stack vertically */
    div[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    audio { width: 100% !important; height: 36px; }
    
    /* Tabs: scroll horizontal */
    .lore-tabs, div[style*="display:flex"][style*="border-bottom"] {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .lore-tabs::-webkit-scrollbar { display: none; }
    .lore-tab { 
        white-space: nowrap !important; 
        flex-shrink: 0 !important;
        font-size: 0.75rem !important;
        padding: 8px 12px !important;
    }
    
    /* --- SECTIONS --- */
    .section { padding: 24px 0 !important; }
    .section-header { margin-bottom: 16px !important; }
    .section-header h2 { font-size: 1.3rem !important; }
    
    /* --- CENÁRIOS PAGE --- */
    .scenario-card { 
        min-height: 120px !important; 
        padding: 16px !important;
    }
    .scenario-card h3 { font-size: 1rem !important; }
    .scenario-card p { font-size: 0.75rem !important; }
    
    /* --- CONTAINER --- */
    .container { padding: 0 12px !important; }
    
    /* --- TYPOGRAPHY --- */
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.2rem !important; }
    h3 { font-size: 1rem !important; }
    
    /* --- GRIDS: Stack vertically --- */
    .grid-2, .grid-3, .grid-4, .grid-5 { 
        grid-template-columns: 1fr !important; 
        gap: 12px !important;
    }
    
    /* --- FOOTER --- */
    .footer { padding: 24px 0 12px !important; }
    .footer-grid { grid-template-columns: 1fr !important; text-align: center !important; gap: 16px !important; }
    .footer-bottom { 
        flex-direction: column !important; 
        gap: 8px !important; 
        text-align: center !important; 
        padding-top: 12px !important;
    }
    
    /* --- MODALS: Full-screen on mobile --- */
    [id$="-modal"] > div,
    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 12px 12px 0 0 !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
    }
    
    /* --- TABLES: Horizontal scroll --- */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    th, td { padding: 8px 6px !important; font-size: 0.75rem !important; white-space: nowrap; }
    
    /* --- BATTLE UI --- */
    .battle-board { padding: 8px !important; }
    .battle-card { min-height: 60px !important; padding: 8px !important; }
    .battle-card img { width: 40px !important; height: 40px !important; }
    
    /* --- BREADCRUMBS --- */
    .breadcrumbs { 
        overflow-x: auto; 
        white-space: nowrap; 
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .breadcrumbs::-webkit-scrollbar { display: none; }
    
    /* --- PLAYER BAR --- */
    .player-bar { padding: 4px 12px !important; }
    .player-bar .container { font-size: 0.65rem; }
    .player-bar .status-right { display: none !important; }
    
    /* --- CONTOS --- */
    .conto-content { 
        font-size: 0.9rem !important; 
        line-height: 1.75 !important; 
        padding: 0 4px !important;
    }
    .conto-content img { 
        max-width: 100% !important; 
        height: auto !important; 
        border-radius: 8px;
    }
    
    /* --- FORMS --- */
    input, select, textarea {
        font-size: 16px !important; /* Prevent iOS zoom */
        width: 100% !important;
    }
    
    /* --- MISC --- */
    .badge, .tag { font-size: 0.6rem !important; padding: 2px 6px !important; }
    .card { border-radius: 10px !important; }
    
    /* Reading widget: bottom sheet */
    #reading-widget {
        left: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        max-width: none !important;
        border-radius: 12px !important;
    }
    
    /* --- PERSONAGEM PAGE: Inline style overrides --- */
    /* Ability & Weakness 2-col -> 1-col */
    div[style*="grid-template-columns:1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    /* Battle stats 3-col -> 3-col compressed */
    div[style*="grid-template-columns:repeat(3"] {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    
    /* Ascension panel 5-col -> scrollable */
    div[style*="grid-template-columns:repeat(5"] {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 3px !important;
    }
    
    /* Vozes da Arena: stack */
    div[style*="minmax(300px"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="minmax(280px"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Battle barks 2-col -> 1-col */
    div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Character name on detail page */
    h1[style*="font-size:2rem"] {
        font-size: 1.3rem !important;
    }
    
    /* CTA buttons: full width */
    div[style*="display:flex"][style*="gap:12px"][style*="flex-wrap:wrap"] {
        flex-direction: column !important;
    }
    div[style*="display:flex"][style*="gap:12px"][style*="flex-wrap:wrap"] .btn {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Lore tabs container */
    #lore-tabs {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: -20px -12px 16px !important;
        padding: 0 12px !important;
    }
    #lore-tabs::-webkit-scrollbar { display: none; }
    #lore-tabs button {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        font-size: 0.7rem !important;
        padding: 8px 10px !important;
    }
    
    /* Combat profile on mobile */
    .combat-profile { gap: 8px !important; }
    .combat-profile > div { padding: 8px !important; }
    
    /* ========================================================
       NUCLEAR INLINE-STYLE MOBILE OVERRIDES
       These override inline styles on PHP templates
       ======================================================== */
    
    /* Kill ALL min-width on mobile - major overflow culprit */
    [style*="min-width"] {
        min-width: 0 !important;
    }
    
    /* Force ALL flex containers to wrap on mobile */
    [style*="display:flex"],
    [style*="display: flex"] {
        flex-wrap: wrap !important;
    }
    
    /* Carta do Dia: stack vertically */
    .card[style*="gap:32px"],
    .card[style*="gap: 32px"] {
        flex-direction: column !important;
        gap: 16px !important;
        padding: 16px !important;
    }
    
    /* Card spotlight: center and size */
    .card-spotlight {
        max-width: 200px !important;
        margin: 0 auto !important;
        width: 100% !important;
    }
    
    /* Activity Feed: hide on mobile (too noisy) */
    [style*="border-left:1px solid var(--border)"][style*="min-width:200px"] {
        display: none !important;
    }
    
    /* Probability panel: stack */
    .prob-panel {
        flex-direction: column !important;
        gap: 16px !important;
        padding: 16px !important;
    }
    .prob-panel [style*="display:flex"][style*="gap:16px"] {
        justify-content: center !important;
        gap: 12px !important;
    }
    
    /* Cenário da semana: stack */
    .card[style*="gap:16px"][style*="flex-wrap:wrap"] {
        gap: 12px !important;
    }
    
    /* Citação: menos padding lateral */
    .battle-moment {
        padding: 16px 12px !important;
    }
    
    /* Quick links grid: 2 cols */
    [style*="minmax(140px"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    /* Campaign progress card */
    .card[style*="border-left:3px"] {
        gap: 10px !important;
    }
    
    /* Personagem page: inline style grid overrides */
    div[style*="grid-template-columns:1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    /* Battle stats 3-col: keep but compress */
    div[style*="grid-template-columns:repeat(3"] {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }
    
    /* Ascension panel 5-col */
    div[style*="grid-template-columns:repeat(5"] {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 2px !important;
    }
    
    /* Vozes da Arena + Rivalidades: 1 col */
    div[style*="minmax(300px"],
    div[style*="minmax(280px"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Character name */
    h1[style*="font-size:2rem"] {
        font-size: 1.3rem !important;
    }
    
    /* CTA buttons: full width stack */
    div[style*="display:flex"][style*="gap:12px"][style*="flex-wrap"] {
        flex-direction: column !important;
    }
    div[style*="display:flex"][style*="gap:12px"][style*="flex-wrap"] > .btn,
    div[style*="display:flex"][style*="gap:12px"][style*="flex-wrap"] > a {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    /* Social share buttons: wrap properly */
    div[style*="display:flex"][style*="gap:6px"] {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
    
    /* Lore tabs: horizontal scroll */
    #lore-tabs {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: -20px -12px 16px !important;
        padding: 0 12px !important;
    }
    #lore-tabs::-webkit-scrollbar { display: none; }
    #lore-tabs button {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        font-size: 0.7rem !important;
        padding: 8px 10px !important;
    }
    
    /* Voice player: compact */
    #voice-player {
        flex-wrap: nowrap !important;
        gap: 8px !important;
        padding: 10px 12px !important;
    }
    #voice-player select {
        max-width: 70px !important;
        font-size: 0.55rem !important;
    }
    
    /* Voice player card button */
    #voice-player-card .btn {
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
    }
    
    /* Cenário page stats grid */
    .cenarios-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Attribute bars: use short labels on mobile */
    .attr-full { display: none !important; }
    .attr-short { display: inline !important; }
    .attr-label {
        width: 32px !important;
        font-size: 0.65rem !important;
        letter-spacing: 0 !important;
    }
    .attr-value {
        width: 24px !important;
        font-size: 0.65rem !important;
    }
    .attr-bar {
        gap: 4px !important;
    }
    
    /* Lore text: prevent overflow - override card overflow:hidden */
    .lore-panel,
    .lore-panel p,
    .card p {
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Card content: ensure no horizontal overflow */
    .card {
        overflow: hidden !important;
        word-break: break-word !important;
    }
    
    /* Lore card: fix text wrapping within card bounds */
    .card.lore-card {
        overflow: hidden !important;
        padding: 16px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .card.lore-card p {
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        max-width: 100% !important;
    }
    /* Fix lore-tabs negative margin causing card width expansion */
    .card.lore-card #lore-tabs {
        overflow-x: auto !important;
        margin-left: -16px !important;
        margin-right: -16px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        max-width: calc(100% + 32px) !important;
        box-sizing: border-box !important;
    }
    
    /* Personagem detail grid: force single column */
    .personagem-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .personagem-grid > div:first-child {
        max-width: 300px !important;
        margin: 0 auto !important;
    }
    
    /* NUCLEAR: Force all elements within viewport on mobile */
    .container {
        max-width: 100vw !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        overflow: hidden !important;
    }
    
    .card, .prob-panel, section, main {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Override all inline padding on cards */
    .card[style*="padding:24px"],
    .card[style*="padding: 24px"],
    .card[style*="padding:24px 32px"] {
        padding: 16px !important;
    }
}


/* === SMALL PHONES (max-width: 400px) === */
@media (max-width: 400px) {
    .hero h1 { font-size: 1.4rem !important; }
    .hero p { font-size: 0.8rem !important; }
    .hero-stat-value { font-size: 1.2rem !important; }
    .hero-stats { gap: 12px; }
    
    .card-grid { gap: 6px !important; }
    .game-card-body { padding: 6px !important; }
    .game-card-name { font-size: 0.65rem !important; }
    .game-card-img { height: 110px !important; }
    
    #onboarding-steps { grid-template-columns: 1fr !important; }
    
    .navbar-brand { font-size: 1rem; }
    .container { padding: 0 8px !important; }
    
    /* Buttons: full width */
    .btn { width: 100%; justify-content: center; }
}

/* === TOUCH DEVICES === */
@media (pointer: coarse) {
    /* Ensure min 44px tap targets */
    button, .btn, a.btn, select, 
    .navbar-nav a, .lore-tab,
    input[type="checkbox"], input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Larger game card touch area */
    .game-card { cursor: pointer; }
    .game-card:active { transform: scale(0.97); }
    
    /* Remove hover effects that don't work on touch */
    .game-card:hover { transform: none; }
    .card:hover { transform: none; }
    
    /* Scroll snap for horizontal carousels */
    .scroll-x {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .scroll-x > * { scroll-snap-align: start; }
}

/* === LANDSCAPE MOBILE === */
@media (max-height: 500px) and (orientation: landscape) {
    .hero { padding: 20px 0; }
    .hero h1 { font-size: 1.5rem !important; }
    .hero p { display: none; }
    .hero-stats { gap: 16px; }
    .navbar .container { height: 48px; }
    .player-bar { display: none; }
}

/* === SAFE AREA (iPhone notch) === */
@supports (padding: max(0px)) {
    .navbar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
    .footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    .container { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
}

/* === SMOOTH SCROLLING GLOBALLY === */
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
