/**
 * TIMBRIA TCG — SISTEMA DE DESIGN & TOKENS GLOBAIS
 * Direção de Arte: Fantasia Medieval / Game UI / Diegetic UI
 * Etapa 1: Tokens e Cores | Etapa 3: Tipografia Temática
 */

:root {
    /* ================= PALETA DE CORES PRIMÁRIA ================= */
    --bg-primary: #0D0F12;                  /* Fundo principal escuro, levemente texturizado/azulado */
    --bg-surface: #16191F;                  /* Superfície de cards e painéis */
    --bg-surface-elevated: #1F242C;         /* Camada superior / modais / popovers */
    --border-subtle: #2A2F3D;               /* Divisões neutras e bordas de contenção */
    --gold-primary: #D4AF37;                /* Ouro envelhecido metálico */
    --gold-accent: #C5A059;                 /* Ouro polido antigo */
    --gold-border: linear-gradient(180deg, #E6C875 0%, #8C6A28 100%);
    --bronze-action: #8C5828;               /* Bronze rústico para ações secundárias */
    --text-heading: #EADBB6;                /* Ouro marfim desbotado para cabeçalhos */
    --text-body: #C4BDB0;                   /* Pergaminho envelhecido para corpo (evita #fff puro) */
    --text-muted: #8A8477;                  /* Texto secundário e notas de rodapé */
    --accent-danger: #8B1E1E;               /* Vermelho carmesim escuro para alertas e remoções */

    /* ================= CORES DE ACENTO DIEGÉTICAS ================= */
    --accent-mana: #4A7A9E;                 /* Azul cobalto desbotado para Mana / PM */
    --accent-life: #7A3535;                 /* Vermelho sangue seco para Vida / HP */
    --accent-attack: #B38640;               /* Ouro bronzeado para Ataque / ATK */
    --accent-defense: #515E6D;              /* Aço forjado para Armadura / Defesa */
    --accent-nature: #3D5A45;               /* Musgo escuro para Druida */
    --accent-magic: #5E3C6E;                /* Ametista envelhecida para Feitiços */

    /* ================= TIPOGRAFIA TEMÁTICA ================= */
    --font-display: 'Cinzel', serif;
    --font-decorative: 'Cinzel Decorative', serif;
    --font-body: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-pixel: 'VT323', monospace;
}

/* ================= APLICAÇÃO GLOBAL DE BASE ================= */
html, body {
    background-color: var(--bg-primary);
    color: var(--text-body);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================= HIERARQUIA DE CABEÇALHOS (CINZEL) ================= */
h1, h2, h3, h4, h5, h6,
.font-tibia,
.font-cinzel,
.heading-medieval {
    font-family: var(--font-display);
    color: var(--text-heading);
    letter-spacing: 0.035em;
    font-weight: 700;
}

/* Títulos com aspecto decorativo ou de capa */
.font-decorative {
    font-family: var(--font-decorative);
    color: var(--text-heading);
    letter-spacing: 0.05em;
}

/* Corpo e Leitura Rápida (Outfit / Inter) */
p, span, label, input, textarea, button, .font-body {
    font-family: var(--font-body);
}

/* Contadores e Valores de Moedas em Cinzel */
.currency-val,
.font-currency,
#meta-gold-val,
#meta-crystals-val,
#shop-orbs-owned,
#hub-gold-count,
#hub-crystals-count,
#merchant-countdown {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* ================= TEXTURAS E FUNDOS DIEGÉTICOS (ESTILO ARENA TCG MODERNO) ================= */
.tibia-stone-bg {
    background:
        radial-gradient(circle at 50% 18%, rgba(38, 52, 82, 0.55) 0%, transparent 58%),
        radial-gradient(circle at 50% 85%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #161C28 0%, #0E121B 55%, #080A0F 100%) !important;
    box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.9);
}

/* ================= PAINÉIS FÍSICOS ESTILO CLASH ROYALE / SUPERCELL ================= */
.tibia-gold-border,
.medieval-frame {
    position: relative;
    border: 2px solid #3B4459 !important;
    background: linear-gradient(180deg, #1E2432 0%, #151923 100%);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.14),
        inset 0 -3px 0 rgba(0, 0, 0, 0.55),
        0 5px 0 #090B10,
        0 10px 24px rgba(0, 0, 0, 0.85) !important;
}

/* Cantoneiras Metálicas Cravadas nos 4 cantos dos painéis principais */
.tibia-gold-border::before,
.medieval-frame::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    z-index: 5;
    background:
        url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 18V6C1 3.23858 3.23858 1 6 1H18' stroke='%23E5B842' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='5.5' cy='5.5' r='1.6' fill='%23FFF0A8'/%3E%3C/svg%3E") top left no-repeat,
        url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 18V6C19 3.23858 16.7614 1 14 1H2' stroke='%23E5B842' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='14.5' cy='5.5' r='1.6' fill='%23FFF0A8'/%3E%3C/svg%3E") top right no-repeat,
        url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 2V14C1 16.7614 3.23858 19 6 19H18' stroke='%23E5B842' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='5.5' cy='14.5' r='1.6' fill='%23FFF0A8'/%3E%3C/svg%3E") bottom left no-repeat,
        url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 2V14C19 16.7614 16.7614 19 14 19H2' stroke='%23E5B842' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='14.5' cy='14.5' r='1.6' fill='%23FFF0A8'/%3E%3C/svg%3E") bottom right no-repeat;
}

/* Painéis Secundários / Wells Rebaixados (Profundidade Tátil de Jogo) */
.tibia-border {
    border: 2px solid #283042 !important;
    background: linear-gradient(180deg, #121620 0%, #171C28 100%);
    box-shadow:
        inset 0 3px 6px rgba(0, 0, 0, 0.75),
        0 1px 0 rgba(255, 255, 255, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

/* Well Rebaixado para Slots, Moedas e Listas */
.cr-well {
    background: #0B0E15;
    border: 2px solid #222938;
    border-radius: 12px;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Tipografia de Jogo com Contorno Nítido e Sombra Dura (Supercell Craft) */
.cr-text-outline {
    color: #FFFDF5;
    -webkit-text-stroke: 1.2px #080A0F;
    paint-order: stroke fill;
    text-shadow: 0 2px 0 #080A0F, 0 3px 5px rgba(0, 0, 0, 0.85);
}

.cr-text-gold {
    color: #FFE066;
    -webkit-text-stroke: 1.2px #1A1205;
    paint-order: stroke fill;
    text-shadow: 0 2px 0 #1A1205, 0 3px 6px rgba(0, 0, 0, 0.85);
}

/* Divisores Diegéticos com Chanfro 3D */
.divider-medieval {
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(229, 184, 66, 0.55) 50%, transparent 100%);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
    margin: 10px 0;
}

.divider-subtle {
    height: 2px;
    width: 100%;
    background: #0B0D13;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin: 8px 0;
}

/* Borda com chanfro inferior */
.border-gradient-fade-b {
    border: none !important;
    position: relative;
}
.border-gradient-fade-b::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2%;
    right: 2%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #090B10 20%, #090B10 80%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ================= SUBSTITUIÇÃO DE BADGES GENÉRICAS POR PLACAS TÁTEIS ================= */
/* Textos */
.text-amber-400, .text-amber-300, .text-yellow-300, .text-yellow-400 {
    color: #F6D054 !important;
}

.text-amber-200, .text-yellow-200 {
    color: #FFF2C2 !important;
}

.text-gray-300, .text-gray-400 {
    color: #C9D1E0 !important;
}

.text-gray-500, .text-gray-600 {
    color: #8792A6 !important;
}

/* Placas de Status (Substitui pills translúcidas de SaaS por placas de jogo chanfradas) */
.bg-amber-500\/20 {
    background: linear-gradient(180deg, #3D2D12 0%, #241A09 100%) !important;
    border: 1.5px solid #C59B38 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 0 #0B0D12 !important;
}

.bg-emerald-500\/20, .bg-emerald-950\/50, .bg-emerald-950\/80 {
    background: linear-gradient(180deg, #1E462D 0%, #122B1C 100%) !important;
    border: 1.5px solid #3CA360 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 0 #0B0D12 !important;
    color: #E2F8E9 !important;
}

.bg-sky-500\/20, .bg-sky-950\/50, .bg-sky-950\/35 {
    background: linear-gradient(180deg, #1B3F60 0%, #10263B 100%) !important;
    border: 1.5px solid #4593D6 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 0 #0B0D12 !important;
    color: #E0F2FE !important;
}

.bg-red-950, .bg-red-950\/70, .bg-red-950\/80 {
    background: linear-gradient(180deg, #52181B 0%, #300D0F 100%) !important;
    border: 1.5px solid #B8373D !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 0 #0B0D12 !important;
}

/* ================= BOTÕES 3D TÁTEIS ULTRA-POLIDOS (SUPERCELL / HEARTHSTONE CRAFT) ================= */
.btn-medieval-gold,
.btn-medieval-bronze,
.btn-medieval-stone,
.btn-medieval-danger,
.btn-medieval-mana,
.btn-medieval-arcane,
.btn-medieval-emerald {
    position: relative;
    user-select: none;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: 0.035em;
    paint-order: stroke fill;
    overflow: hidden;
    transition:
        transform 0.08s cubic-bezier(0.2, 0.85, 0.25, 1),
        filter 0.14s ease,
        box-shadow 0.08s ease;
}

/* Reflexo especular vítreo na metade superior de todos os botões 3D */
.btn-medieval-gold::after,
.btn-medieval-bronze::after,
.btn-medieval-stone::after,
.btn-medieval-danger::after,
.btn-medieval-mana::after,
.btn-medieval-arcane::after,
.btn-medieval-emerald::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 2px;
    right: 2px;
    height: 44%;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.04) 100%);
    pointer-events: none;
    z-index: 0;
}

.btn-medieval-gold > *,
.btn-medieval-bronze > *,
.btn-medieval-stone > *,
.btn-medieval-danger > *,
.btn-medieval-mana > *,
.btn-medieval-arcane > *,
.btn-medieval-emerald > * {
    position: relative;
    z-index: 1;
}

/* 1. Botão Ouro Real 3D (Ação Primária / Comprar / Confirmar) */
.btn-medieval-gold {
    background: linear-gradient(180deg, #FFEA79 0%, #F5B82E 46%, #D98A12 86%, #B86E08 100%);
    color: #FFFDF5 !important;
    -webkit-text-stroke: 1.15px #2B1702;
    text-shadow: 0 2px 0 #2B1702, 0 3px 5px rgba(0, 0, 0, 0.8);
    border: 2px solid #140D04 !important;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.82),
        inset 0 0 0 1px rgba(255, 240, 170, 0.35),
        inset 0 -3px 0 rgba(112, 58, 4, 0.65),
        0 4px 0 #744406,
        0 5px 0 #0A0703,
        0 8px 14px rgba(0, 0, 0, 0.75) !important;
}
.btn-medieval-gold:hover:not(:disabled) {
    filter: brightness(1.08) saturate(1.05);
    transform: translateY(-1.5px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 0 0 1px rgba(255, 240, 170, 0.45),
        inset 0 -3px 0 rgba(112, 58, 4, 0.65),
        0 5.5px 0 #744406,
        0 6.5px 0 #0A0703,
        0 10px 18px rgba(0, 0, 0, 0.8) !important;
}
.btn-medieval-gold:active:not(:disabled) {
    transform: translateY(3px) !important;
    filter: brightness(0.97);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 2px 4px rgba(0, 0, 0, 0.35),
        0 1px 0 #744406,
        0 2px 0 #0A0703,
        0 3px 6px rgba(0, 0, 0, 0.65) !important;
}

/* 2. Botão Bronze / Âmbar Forjado 3D (Ações Táticas / Poder Heroico / Forja) */
.btn-medieval-bronze {
    background: linear-gradient(180deg, #DC8D47 0%, #B26526 48%, #8B4916 86%, #6E370E 100%);
    color: #FFF8EB !important;
    -webkit-text-stroke: 1.05px #211004;
    text-shadow: 0 2px 0 #211004, 0 2px 4px rgba(0, 0, 0, 0.85);
    border: 2px solid #120B05 !important;
    box-shadow:
        inset 0 2px 0 rgba(255, 232, 195, 0.55),
        inset 0 0 0 1px rgba(255, 200, 140, 0.22),
        inset 0 -3px 0 rgba(48, 20, 4, 0.6),
        0 4px 0 #4A2309,
        0 5px 0 #090603,
        0 7px 12px rgba(0, 0, 0, 0.7) !important;
}
.btn-medieval-bronze:hover:not(:disabled) {
    filter: brightness(1.09);
    transform: translateY(-1.5px);
}
.btn-medieval-bronze:active:not(:disabled) {
    transform: translateY(3px) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 1px 0 #4A2309,
        0 2px 0 #090603,
        0 3px 5px rgba(0, 0, 0, 0.6) !important;
}

/* 3. Botão Ardósia / Aço Real 3D (Navegação Secundária, Utilitários e Filtros) */
.btn-medieval-stone {
    background: linear-gradient(180deg, #43506C 0%, #2C364B 48%, #1E2636 86%, #161C29 100%);
    color: #F1F5FC !important;
    -webkit-text-stroke: 1px #090D14;
    text-shadow: 0 2px 0 #090D14, 0 2px 4px rgba(0, 0, 0, 0.85);
    font-weight: 800;
    border: 2px solid #0A0E15 !important;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.32),
        inset 0 0 0 1px rgba(148, 163, 184, 0.18),
        inset 0 -3px 0 rgba(8, 11, 18, 0.65),
        0 4px 0 #111622,
        0 5px 0 #06080D,
        0 7px 12px rgba(0, 0, 0, 0.7) !important;
}
.btn-medieval-stone:hover:not(:disabled) {
    background: linear-gradient(180deg, #4E5D7D 0%, #344059 48%, #242E42 86%, #1B2232 100%);
    color: #FFFDF5 !important;
    transform: translateY(-1.5px);
}
.btn-medieval-stone:active:not(:disabled) {
    transform: translateY(3px) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 1px 0 #111622,
        0 2px 0 #06080D,
        0 3px 5px rgba(0, 0, 0, 0.6) !important;
}

/* 4. Botão Carmesim de Combate / Alerta 3D */
.btn-medieval-danger {
    background: linear-gradient(180deg, #F45252 0%, #CC2929 48%, #9E1B1B 86%, #7F1414 100%);
    color: #FFF5F5 !important;
    -webkit-text-stroke: 1.05px #240606;
    text-shadow: 0 2px 0 #240606, 0 2px 4px rgba(0, 0, 0, 0.85);
    border: 2px solid #170606 !important;
    box-shadow:
        inset 0 2px 0 rgba(255, 205, 205, 0.6),
        inset 0 0 0 1px rgba(255, 150, 150, 0.25),
        inset 0 -3px 0 rgba(68, 8, 8, 0.65),
        0 4px 0 #570B0B,
        0 5px 0 #0C0303,
        0 7px 12px rgba(0, 0, 0, 0.7) !important;
}
.btn-medieval-danger:hover:not(:disabled) {
    filter: brightness(1.09);
    transform: translateY(-1.5px);
}
.btn-medieval-danger:active:not(:disabled) {
    transform: translateY(3px) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 1px 0 #570B0B,
        0 2px 0 #0C0303,
        0 3px 5px rgba(0, 0, 0, 0.6) !important;
}

/* 5. Botão Safira / Mana 3D (Estilo Botão Azul Real do Clash Royale) */
.btn-medieval-mana {
    background: linear-gradient(180deg, #56B4FF 0%, #2680DF 48%, #185EB0 86%, #11478A 100%);
    color: #FFFFFF !important;
    -webkit-text-stroke: 1.05px #061A38;
    text-shadow: 0 2px 0 #061A38, 0 2px 4px rgba(0, 0, 0, 0.85);
    border: 2px solid #071222 !important;
    box-shadow:
        inset 0 2px 0 rgba(210, 240, 255, 0.7),
        inset 0 0 0 1px rgba(125, 211, 252, 0.3),
        inset 0 -3px 0 rgba(8, 36, 78, 0.65),
        0 4px 0 #0C3466,
        0 5px 0 #040B16,
        0 7px 12px rgba(0, 0, 0, 0.7) !important;
}
.btn-medieval-mana:hover:not(:disabled) {
    filter: brightness(1.09);
    transform: translateY(-1.5px);
}
.btn-medieval-mana:active:not(:disabled) {
    transform: translateY(3px) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 1px 0 #0C3466,
        0 2px 0 #040B16,
        0 3px 5px rgba(0, 0, 0, 0.6) !important;
}

/* 6. Botão Elixir / Ametista da Forja 3D */
.btn-medieval-arcane {
    background: linear-gradient(180deg, #B55CFF 0%, #862FD1 48%, #631CA3 86%, #4B1380 100%);
    color: #FAF5FF !important;
    -webkit-text-stroke: 1.05px #1D0636;
    text-shadow: 0 2px 0 #1D0636, 0 2px 4px rgba(0, 0, 0, 0.85);
    border: 2px solid #130621 !important;
    box-shadow:
        inset 0 2px 0 rgba(240, 210, 255, 0.65),
        inset 0 0 0 1px rgba(216, 180, 254, 0.28),
        inset 0 -3px 0 rgba(45, 10, 78, 0.65),
        0 4px 0 #380D5E,
        0 5px 0 #090312,
        0 7px 12px rgba(0, 0, 0, 0.7) !important;
}
.btn-medieval-arcane:hover:not(:disabled) {
    filter: brightness(1.09);
    transform: translateY(-1.5px);
}
.btn-medieval-arcane:active:not(:disabled) {
    transform: translateY(3px) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 1px 0 #380D5E,
        0 2px 0 #090312,
        0 3px 5px rgba(0, 0, 0, 0.6) !important;
}

/* 7. Botão Esmeralda 3D (Ação Pronta / Vitória / Confirmação Rápida) */
.btn-medieval-emerald {
    background: linear-gradient(180deg, #4ADE80 0%, #16A34A 48%, #15803D 86%, #116330 100%);
    color: #F0FDF4 !important;
    -webkit-text-stroke: 1.05px #052612;
    text-shadow: 0 2px 0 #052612, 0 2px 4px rgba(0, 0, 0, 0.85);
    border: 2px solid #04190C !important;
    box-shadow:
        inset 0 2px 0 rgba(210, 255, 225, 0.72),
        inset 0 0 0 1px rgba(134, 239, 172, 0.3),
        inset 0 -3px 0 rgba(6, 52, 24, 0.65),
        0 4px 0 #0B4620,
        0 5px 0 #030E06,
        0 7px 12px rgba(0, 0, 0, 0.7) !important;
}
.btn-medieval-emerald:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1.5px);
}
.btn-medieval-emerald:active:not(:disabled) {
    transform: translateY(3px) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 1px 0 #0B4620,
        0 2px 0 #030E06,
        0 3px 5px rgba(0, 0, 0, 0.6) !important;
}

/* Estado Desabilitado Físico */
.btn-medieval-gold:disabled,
.btn-medieval-bronze:disabled,
.btn-medieval-stone:disabled,
.btn-medieval-danger:disabled,
.btn-medieval-mana:disabled,
.btn-medieval-arcane:disabled,
.btn-medieval-emerald:disabled {
    filter: grayscale(0.45) brightness(0.8);
    cursor: not-allowed;
}

/* ================= COMPONENTES DE TOPO, DOCK & MODOS (CLASH ROYALE UI) ================= */

/* Contador de Recursos Rebaixado no Topo (Ouro / Crystal Coins) */
.cr-currency-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #090C12;
    border: 2px solid #2A3244;
    border-radius: 10px;
    padding: 2px 6px 2px 8px;
    height: 30px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cr-currency-plus {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: linear-gradient(180deg, #4ADE80 0%, #16A34A 100%);
    border: 1.5px solid #062812;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 #0B4F24;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
    transition: transform 0.08s ease, filter 0.12s ease;
}
.cr-currency-plus:hover {
    filter: brightness(1.1);
}
.cr-currency-plus:active {
    transform: translateY(1.5px);
    box-shadow: 0 0.5px 0 #0B4F24;
}

/* Banner de Perfil no Topo (Estilo Nível do Rei / Estandarte do Jogador) */
.cr-profile-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #242C3D 0%, #161B26 100%);
    border: 2px solid #0D1017;
    box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.18), 0 3px 0 #0B0D13, 0 4px 8px rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 3px 10px 3px 4px;
    transition: transform 0.08s ease, filter 0.12s ease;
}
.cr-profile-banner:hover {
    filter: brightness(1.06);
}
.cr-profile-banner:active {
    transform: translateY(2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 0 #0B0D13;
}

/* Dock Inferior de 5 Slots Estilo Clash Royale (Limitado a até 820px — Tablet 11" Vertical) */
.cr-bottom-dock {
    width: 100%;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(180deg, #1E2534 0%, #121722 45%, #0C0F17 100%);
    border-top: 3px solid #3C475E;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.85), inset 0 2px 0 rgba(255, 255, 255, 0.12);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: stretch;
    padding: 0;
}

@media (min-width: 821px) {
    .cr-bottom-dock {
        border-left: 3px solid #3C475E;
        border-right: 3px solid #3C475E;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }
    .cr-dock-slot:first-child {
        border-top-left-radius: 13px;
        border-left: none;
    }
    .cr-dock-slot:last-child {
        border-top-right-radius: 13px;
        border-right: none;
    }
}

.cr-dock-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(0, 0, 0, 0.65);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.18s ease, transform 0.18s cubic-bezier(0.2, 0.85, 0.25, 1);
    padding: 4px 2px 6px;
}

.cr-dock-slot.cr-dock-active {
    background: linear-gradient(180deg, rgba(245, 180, 41, 0.24) 0%, rgba(245, 158, 11, 0.06) 65%, transparent 100%);
    box-shadow: inset 0 3px 0 #FBBF24, inset 0 10px 18px rgba(251, 191, 36, 0.18);
}

.cr-dock-slot.cr-dock-active img {
    transform: translateY(-5px) scale(1.12);
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 10px rgba(251, 191, 36, 0.55));
}

.cr-dock-label {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9BA6B8;
    text-shadow: 0 2px 0 #07090E;
    margin-top: 2px;
    transition: color 0.15s ease, transform 0.15s ease;
}

.cr-dock-slot.cr-dock-active .cr-dock-label {
    color: #FFE066;
    -webkit-text-stroke: 0.6px #1A1205;
    paint-order: stroke fill;
    text-shadow: 0 2px 0 #07090E, 0 0 8px rgba(251, 191, 36, 0.45);
}

/* Cards de Modos de Batalha e Tasks Estilo Banner 3D */
.cr-mode-card {
    position: relative;
    border-radius: 14px;
    border: 2px solid #2D364B;
    background: linear-gradient(180deg, #212838 0%, #161B26 100%);
    box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.12), 0 4px 0 #0A0D13, 0 6px 12px rgba(0, 0, 0, 0.6);
    transition: transform 0.1s ease, border-color 0.15s ease, box-shadow 0.1s ease;
}
.cr-mode-card:hover {
    transform: translateY(-1px);
    border-color: #4D5B7A;
}
.cr-mode-card:active {
    transform: translateY(2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 #0A0D13;
}
.cr-mode-card.is-selected-gold {
    border: 2px solid #F6C445 !important;
    background: linear-gradient(180deg, #332917 0%, #1D1810 100%) !important;
    box-shadow: inset 0 2px 0 rgba(255, 230, 140, 0.3), 0 4px 0 #6B490E, 0 6px 14px rgba(0, 0, 0, 0.75) !important;
}
.cr-mode-card.is-selected-crimson {
    border: 2px solid #F87171 !important;
    background: linear-gradient(180deg, #3B1A1E 0%, #211013 100%) !important;
    box-shadow: inset 0 2px 0 rgba(255, 180, 180, 0.25), 0 4px 0 #5C1419, 0 6px 14px rgba(0, 0, 0, 0.75) !important;
}

/* Pedestal de Baú / Booster na Loja */
.cr-chest-card {
    position: relative;
    border-radius: 16px;
    border: 2px solid #354056;
    background: radial-gradient(circle at 50% 32%, rgba(71, 168, 255, 0.16) 0%, transparent 62%), linear-gradient(180deg, #202737 0%, #131722 100%);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.15),
        inset 0 -3px 0 rgba(0, 0, 0, 0.55),
        0 5px 0 #090C12,
        0 10px 22px rgba(0, 0, 0, 0.8);
    transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cr-chest-card:hover {
    transform: translateY(-3px);
}
.cr-chest-card--gold {
    border-color: #C59B38;
    background: radial-gradient(circle at 50% 32%, rgba(250, 204, 21, 0.2) 0%, transparent 62%), linear-gradient(180deg, #292318 0%, #15141A 100%);
}
.cr-chest-card--epic {
    border-color: #9353D3;
    background: radial-gradient(circle at 50% 32%, rgba(168, 85, 247, 0.24) 0%, transparent 62%), linear-gradient(180deg, #271B36 0%, #141220 100%);
}

/* ================= SISTEMA DE CARDS FÍSICOS TCG (ETAPA 5) ================= */

/* Proporção Real de Carta TCG: 2.5 x 3.5 (1 : 1.4) */
.tcg-physical-card {
    aspect-ratio: 2.5 / 3.5;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 9px;
    padding: 6px;
    background: #14171F;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: pan-y;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s ease;
    overflow: hidden;
}

.tcg-physical-card:hover {
    transform: translateY(-3px);
}

/* Feedback visual imediato ao clicar/segurar na carta para inspecionar */
.tcg-card-pressing {
    transform: scale(0.96) !important;
    filter: brightness(1.18) !important;
    transition: transform 0.1s ease-out, filter 0.1s ease-out !important;
}

/* Molduras Distintas por Raridade */
.tcg-frame-common {
    border: 1.5px solid #454B57 !important;
    background: linear-gradient(180deg, #181B22 0%, #101217 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), inset 0 0 12px rgba(0, 0, 0, 0.85);
}
.tcg-frame-common:hover {
    border-color: #646E80 !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.85), inset 0 0 14px rgba(0, 0, 0, 0.9);
}

.tcg-frame-uncommon,
.tcg-deck-slot.is-filled.tcg-frame-uncommon,
.tcg-card.rarity-glow-uncommon,
.rarity-glow-uncommon {
    border: 1.5px solid #38BDF8 !important;
    background: linear-gradient(180deg, #141B24 0%, #0D131A 100%);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.75), 0 0 24px rgba(14, 165, 233, 0.35), inset 0 0 8px rgba(56, 189, 248, 0.25) !important;
}
.tcg-frame-uncommon:hover,
.tcg-deck-slot.is-filled.tcg-frame-uncommon:hover,
.rarity-glow-uncommon:hover {
    border-color: #7DD3FC !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.9), 0 0 32px rgba(14, 165, 233, 0.5), inset 0 0 12px rgba(56, 189, 248, 0.35) !important;
}

.tcg-frame-rare,
.tcg-deck-slot.is-filled.tcg-frame-rare,
.tcg-card.rarity-glow-rare,
.rarity-glow-rare {
    border: 2px solid #F59E0B !important;
    background: linear-gradient(180deg, #1C1814 0%, #120F0D 100%);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.9), 0 0 40px rgba(217, 119, 6, 0.6), inset 0 0 14px rgba(254, 240, 138, 0.35) !important;
}
.tcg-frame-rare:hover,
.tcg-deck-slot.is-filled.tcg-frame-rare:hover,
.rarity-glow-rare:hover {
    border-color: #FDE047 !important;
    box-shadow: 0 0 28px rgba(250, 204, 21, 1), 0 0 55px rgba(245, 158, 11, 0.8), inset 0 0 18px rgba(254, 240, 138, 0.5) !important;
}

/* Moldura Especial para Feitiços / Magias */
.tcg-frame-spell {
    position: relative;
}
.tcg-frame-spell::before {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px dashed rgba(167, 139, 250, 0.25);
    border-radius: 7px;
    pointer-events: none;
}

/* Cartas Faltantes (Estética Apagada / Silhueta Silenciosa) */
.tcg-physical-card.tcg-unowned .tcg-layered-card,
.tcg-layered-card.card-unowned {
    filter: grayscale(0.75) brightness(0.7) opacity(0.85);
    transition: filter 0.2s ease, opacity 0.2s ease;
}
.tcg-physical-card.tcg-unowned:hover .tcg-layered-card,
.tcg-layered-card.card-unowned:hover {
    filter: grayscale(0.35) brightness(0.85) opacity(0.95);
}

/* Medalhão de Custo de Mana (Topo Esquerdo) */
.tcg-mana-medallion {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #38BDF8 0%, #0369A1 50%, #082F49 100%);
    border: 1.5px solid #7DD3FC;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 12px;
    color: #FFFFFF;
    z-index: 5;
    line-height: 1;
    -webkit-text-stroke: 1px #000000;
    paint-order: stroke fill;
    text-shadow: 0 1px 2px #000000;
}

@media (min-width: 640px) {
    .tcg-mana-medallion {
        width: 26px;
        height: 26px;
        font-size: 13.5px;
        -webkit-text-stroke: 1.2px #000000;
        paint-order: stroke fill;
    }
}

/* Botão de Inspecionar (Topo Direito) */
.tcg-inspect-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(13, 15, 18, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    z-index: 5;
    transition: all 0.15s ease;
}
.tcg-inspect-btn:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    background: rgba(22, 25, 31, 0.95);
    transform: scale(1.1);
}

/* Janela Central de Ilustração / Arte (Calibrada em 10%) */
.tcg-art-window {
    flex: 0 0 42%;
    max-height: 44%;
    margin-top: 11px;
    margin-bottom: 2px;
    border-radius: 6px;
    background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.7) 100%), #0A0C0F;
    border: 1px solid rgba(0, 0, 0, 0.6);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 48px;
}

.tcg-art-icon {
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.9));
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (min-width: 640px) {
    .tcg-art-icon {
        font-size: 30px;
    }
}
.tcg-physical-card:hover .tcg-art-icon {
    transform: scale(1.1);
}

/* Faixa de Vocação e Tipo na base da arte */
.tcg-vocation-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 12, 15, 0.95) 90%);
    padding: 1px 2px;
    text-align: center;
    font-size: 7px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Base da Carta: Título, Regras e Atributos */
.tcg-card-base {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2px;
    z-index: 2;
    min-height: 0;
}

.tcg-card-title {
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    padding: 0 2px;
}
@media (min-width: 640px) {
    .tcg-card-title {
        font-size: 12.5px;
    }
}

.tcg-card-rules {
    font-size: 9.5px;
    line-height: 1.25;
    color: #E2DDD5;
    background: rgba(10, 12, 16, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    padding: 2.5px 5px;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (min-width: 640px) {
    .tcg-card-rules {
        font-size: 10.5px;
        line-height: 1.3;
        min-height: 32px;
    }
}

/* Barra de Atributos de Combate (ATK / HP / Cap) */
.tcg-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1px;
    font-size: 9.5px;
    font-weight: 700;
}

.tcg-stat-atk {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #F3C465;
    background: rgba(30, 20, 10, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.35);
    padding: 1px 4px;
    border-radius: 4px;
}

.tcg-stat-hp {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #F87171;
    background: rgba(35, 12, 12, 0.7);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 1px 4px;
    border-radius: 4px;
}

.tcg-stat-aux {
    font-size: 8.5px;
    color: var(--text-muted);
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Barra de Ações Rápidas (Deck / Forja / Contagem) */
.tcg-action-bar {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
    padding-top: 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tcg-copy-badge {
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 8.5px;
    font-weight: 700;
    color: var(--text-muted);
}
.tcg-copy-badge.is-owned {
    color: #6EE7B7;
    border-color: rgba(110, 231, 183, 0.3);
}

/* Slots de Deck em Miniatura (Sub-Aba Decks - 20 Slots) */
.tcg-deck-slot {
    aspect-ratio: 682 / 1024;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 4px;
    transition: all 0.15s ease;
    cursor: pointer;
    overflow: hidden;
}

.tcg-deck-slot.is-empty {
    border: 1.5px dashed #2A2F3D;
    background: rgba(13, 15, 18, 0.5);
    color: var(--text-muted);
}
.tcg-deck-slot.is-empty:hover {
    border-color: var(--gold-accent);
    background: rgba(26, 29, 36, 0.7);
    color: var(--text-heading);
}

.tcg-deck-slot.is-filled {
    background: linear-gradient(180deg, #181C24 0%, #101218 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}
.tcg-deck-slot.is-filled:hover {
    border-color: var(--accent-danger) !important;
    transform: translateY(-2px);
}

/* ================= PWA NOTCH & FULLSCREEN DIEGÉTICO (ETAPA 6) ================= */
:fullscreen,
:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    background-color: var(--bg-primary) !important;
}

@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* ================= INDICADORES DE COMBATE & CARTAS JOGÁVEIS ================= */
.tcg-card.playable-glow,
.playable-glow {
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.9), 0 0 6px #22c55e, inset 0 0 8px rgba(34, 197, 94, 0.45) !important;
    border-color: #22c55e !important;
    border-width: 2px !important;
    animation: playableGlowPulse 1.6s infinite ease-in-out !important;
}

@keyframes playableGlowPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.7), inset 0 0 5px rgba(34, 197, 94, 0.35) !important;
        border-color: rgba(34, 197, 94, 0.85) !important;
    }
    50% {
        box-shadow: 0 0 22px rgba(34, 197, 94, 1), 0 0 8px #4ade80, inset 0 0 12px rgba(34, 197, 94, 0.55) !important;
        border-color: #4ade80 !important;
    }
}

/* ================= AURAS DE RARIDADE & BOOSTER REVEAL ================= */
.poke-stack-card .rarity-glow-rare,
#pack-cards-grid .rarity-glow-rare,
.tcg-deck-slot.is-filled.tcg-frame-rare {
    animation: rareCardAuraPulse 1.8s infinite ease-in-out !important;
}

@keyframes rareCardAuraPulse {
    0%, 100% {
        box-shadow: 0 0 18px rgba(245, 158, 11, 0.9), 0 0 35px rgba(217, 119, 6, 0.55), inset 0 0 12px rgba(254, 240, 138, 0.35) !important;
        border-color: #F59E0B !important;
    }
    50% {
        box-shadow: 0 0 30px rgba(250, 204, 21, 1), 0 0 60px rgba(245, 158, 11, 0.9), inset 0 0 18px rgba(254, 240, 138, 0.6) !important;
        border-color: #FEF08A !important;
    }
}


