/* ==========================================================================
   NARUTO TEAM BATTLE - MODERN COMBAT STYLESHEET
   ========================================================================== */

:root {
    /* Anime / Ninja Palette */
    --naruto-orange: #ff7b00;
    --naruto-orange-glow: rgba(255, 123, 0, 0.45);
    --naruto-blue: #0088ff;
    --naruto-blue-glow: rgba(0, 136, 255, 0.45);
    --naruto-red: #ff3344;
    --naruto-red-glow: rgba(255, 51, 68, 0.45);
    --naruto-green: #2ecc71;
    --naruto-green-glow: rgba(46, 204, 113, 0.45);
    --naruto-purple: #9b51e0;
    --naruto-purple-glow: rgba(155, 81, 224, 0.45);
    --naruto-gold: #f1c40f;
    
    /* Neutral Surfaces */
    --bg-dark: #0d0f14;
    --card-bg: rgba(22, 26, 38, 0.85);
    --card-border: rgba(255, 255, 255, 0.12);
    --panel-bg: rgba(14, 17, 24, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;

    /* Fonts */
    --font-heading: 'Bebas Neue', sans-serif, system-ui;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   RESET & GLOBAL SETUP
   ========================================================================== */

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: clamp(10px, 3vw, 25px);
    overflow-x: hidden;
}

/* Fundo da página numa camada fixa própria (desempenho): o antigo "background-attachment: fixed" no body
   obrigava o navegador a repintar o fundo inteiro durante animações e rolagem. O visual é o mesmo. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 50% 20%, rgba(255, 123, 0, 0.15), transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(0, 136, 255, 0.12), transparent 50%),
        url('../assets/images/background.jpg');
    background-size: cover;
    background-position: center;
    background-blend-mode: multiply;
}

/* Main Responsive Container */
.container {
    width: 100%;
    max-width: 1360px;
    /* Sem backdrop-filter (desempenho): com fundo 92% opaco o desfoque quase não aparecia, mas era recalculado
       a cada quadro de animação do combate. Opacidade levemente maior para compensar. */
    background: rgba(13, 16, 23, 0.94);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 123, 0, 0.08);
    padding: clamp(16px, 3vw, 32px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--naruto-orange), var(--naruto-blue), transparent);
}

/* ==========================================================================
   HEADER & BRANDING
   ========================================================================== */

.game-header {
    text-align: center;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Banner hero ilustrado do cabeçalho do Menu Principal (NanoBanana: Konoha / Monte Hokage no crepúsculo) */
.main-menu-hero-header {
    position: relative;
    width: 100%;
    padding: 14px 20px 16px;
    margin-bottom: 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 140, 0, 0.22);
    background:
        radial-gradient(ellipse at 50% 42%, rgba(13, 16, 24, 0.45) 0%, rgba(11, 14, 22, 0.88) 78%),
        linear-gradient(180deg, rgba(10, 13, 20, 0.35) 0%, rgba(10, 13, 20, 0.92) 100%),
        url('../assets/images/gui/menu_header_banner.png') center 38% / cover no-repeat;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.header-crest-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 2px;
    background: radial-gradient(circle, rgba(255, 123, 0, 0.35), transparent 70%);
    box-shadow: 0 0 22px rgba(255, 123, 0, 0.35);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-crest-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 152, 0, 0.65);
}

.game-title {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 6vw, 4rem);
    letter-spacing: 3px;
    color: var(--naruto-orange);
    text-shadow: 0 0 20px var(--naruto-orange-glow), 2px 2px 0 #000;
    line-height: 1.1;
}

.title-sub {
    color: var(--naruto-blue);
    text-shadow: 0 0 20px var(--naruto-blue-glow), 2px 2px 0 #000;
}

/* Logo do menu principal (imagem vetorial transparente, gerada — ver assets/images/gui/logo_naruto_team_battle.svg) */
.game-logo {
    margin: 0;
    line-height: 0;
    display: flex;
    justify-content: center;
}

.game-logo-frame {
    position: relative;
    display: block;
    width: min(480px, 92%);
    margin: -14px 0 -8px; /* o SVG tem bordas transparentes (brilho do círculo de chakra); assim o menu cabe na tela */
}

.game-logo-img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Brilho que passa uma vez pelo logo ao abrir o menu (máscara em css/logo_brilho.css, gerada junto com o logo).
   Animação curta e finita: só transform de uma faixa; reiniciada por playLogoShine() em showMainMenu(). */
.game-logo-shine {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.game-logo-shine::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 28%;
    background: linear-gradient(105deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.75) 50%, rgba(255, 255, 255, 0) 100%);
    transform: translateX(-120%);
    opacity: 0;
}

.game-logo-frame.shine-play .game-logo-shine::before {
    animation: logoShine 1.1s ease-in-out 0.35s 1 both;
}

@keyframes logoShine {
    0% { transform: translateX(-120%); opacity: 1; }
    100% { transform: translateX(380%); opacity: 1; }
}

.selection-subtitle {
    font-size: clamp(0.85rem, 2vw, 1.05rem);
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 4px;
}

/* Botão da Wiki no Menu Principal */
.main-menu-wiki-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.wiki-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 123, 0, 0.12);
    border: 1px solid rgba(255, 123, 0, 0.45);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.25s ease;
    cursor: pointer;
}

.wiki-link-btn:hover {
    background: var(--naruto-orange);
    color: #111;
    border-color: var(--naruto-orange);
    box-shadow: 0 4px 18px var(--naruto-orange-glow);
    transform: translateY(-2px);
}

.wiki-link-icon {
    font-size: 1rem;
}

.wiki-link-icon-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 196, 74, 0.65);
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.45);
    flex-shrink: 0;
}

.wiki-mini-icon-img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 196, 74, 0.6);
    flex-shrink: 0;
}

.wiki-link-text {
    letter-spacing: 0.5px;
}

.wiki-link-arrow {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.wiki-link-btn:hover .wiki-link-arrow {
    transform: translateX(3px);
}

/* Mini link da Wiki na barra de seleção */
.wiki-nav-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 123, 0, 0.12);
    border: 1px solid rgba(255, 123, 0, 0.4);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.wiki-nav-mini-btn:hover {
    background: var(--naruto-orange);
    color: #111;
    border-color: var(--naruto-orange);
    transform: translateY(-1px);
}

/* ==========================================================================
   SELECTION SCREEN
   ========================================================================== */

#character-selection-screen {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Details Panel (Top Inspector) */
#selection-details-panel {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 123, 0, 0.4);
    border-radius: 16px;
    padding: 16px 22px;
    min-height: 240px;
    height: 240px;
    max-height: 240px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.6), 0 8px 25px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

#selection-details-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 50%, rgba(255, 123, 0, 0.08), transparent 40%);
    pointer-events: none;
}

.selection-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
    height: 100%;
}

.placeholder-icon {
    font-size: 2.5rem;
    animation: gentleRotate 6s linear infinite;
    display: inline-block;
}

.placeholder-crest-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 123, 0, 0.6);
    box-shadow: 0 0 18px rgba(255, 123, 0, 0.45);
    animation: gentleFloatCrest 3s ease-in-out infinite alternate;
}

@keyframes gentleFloatCrest {
    from { transform: translateY(-2px) scale(0.98); box-shadow: 0 0 12px rgba(255, 123, 0, 0.35); }
    to { transform: translateY(3px) scale(1.04); box-shadow: 0 0 22px rgba(255, 123, 0, 0.65); }
}

@keyframes gentleRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.placeholder-text {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    max-width: 500px;
    line-height: 1.4;
}

.selection-active-info {
    display: flex;
    align-items: center;
    gap: clamp(15px, 2.5vw, 26px);
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    animation: fadeInQuick 0.2s ease-out;
}

@keyframes fadeInQuick {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.selection-portrait-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.selection-preview-img {
    width: clamp(85px, 10vw, 105px);
    height: clamp(85px, 10vw, 105px);
    border-radius: 14px;
    border: 3px solid var(--naruto-orange);
    object-fit: cover;
    object-position: top center;
    box-shadow: 0 0 20px var(--naruto-orange-glow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.selection-preview-img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px var(--naruto-orange);
}

.inspect-hint {
    font-size: 0.7rem;
    color: var(--naruto-orange);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
}

.selection-info-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.selection-header-line {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#selected-character-name {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    color: var(--naruto-blue);
    letter-spacing: 1.5px;
    text-shadow: 0 0 15px var(--naruto-blue-glow);
    line-height: 1;
}

/* Badges de Atributos */
.selection-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    font-weight: 600;
}

.stat-gui-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.stat-badge.hp {
    border-color: rgba(255, 51, 68, 0.4);
    background: rgba(255, 51, 68, 0.1);
    color: #ff6b7a;
}

.stat-badge.chakra {
    border-color: rgba(0, 136, 255, 0.4);
    background: rgba(0, 136, 255, 0.1);
    color: #5bb3ff;
}

.stat-badge.atk {
    border-color: rgba(255, 180, 0, 0.4);
    background: rgba(255, 180, 0, 0.1);
    color: #ffca4a;
}

.badge-val {
    font-weight: 800;
    font-size: 0.95rem;
}

.jutsus-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: bold;
    letter-spacing: 1px;
}

.selection-jutsus-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 110px;
    overflow-y: auto;
}

.jutsu-preview-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(0, 136, 255, 0.4);
    border-radius: 8px;
    padding: 3px 9px 3px 6px;
    transition: transform 0.2s, border-color 0.2s;
}

.jutsu-preview-chip:hover {
    border-color: var(--naruto-blue);
    transform: translateY(-2px);
}

.jutsu-preview-chip img {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    object-fit: cover;
}

.chip-details {
    display: flex;
    flex-direction: column;
}

.chip-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e2e8f0;
}

.chip-cost {
    font-size: 0.7rem;
    color: #60a5fa;
    font-weight: 600;
}

/* ==========================================================================
   GRID DE SELEÇÃO DE NINJAS
   ========================================================================== */

.selection-main-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.grid-label, .preview-label {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-align: left;
}

#selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    max-height: 340px;
    overflow-y: auto;
}

.selection-character-card {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 2px solid rgba(0, 136, 255, 0.4);
    background: #11141d;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: flex-end;
}

.selection-character-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.3s ease;
}

.selected-checkmark {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: var(--naruto-orange);
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 900;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px var(--naruto-orange);
    z-index: 3;
}

.selection-character-card:hover {
    transform: translateY(-4px) scale(1.04);
    border-color: var(--naruto-orange);
    box-shadow: 0 6px 18px var(--naruto-orange-glow);
    z-index: 5;
}

.selection-character-card:hover img {
    transform: scale(1.08);
}

.selection-character-card.selected {
    border-color: var(--naruto-orange);
    box-shadow: 0 0 16px var(--naruto-orange), inset 0 0 10px var(--naruto-orange-glow);
    transform: translateY(-2px);
}

.selection-character-card.selected .selected-checkmark {
    display: flex;
}

.selection-character-card.locked {
    filter: grayscale(0.8) brightness(0.65);
    border-color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
}

.selection-character-card.locked:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 80, 80, 0.5);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
    filter: grayscale(0.5) brightness(0.8);
}

.locked-icon-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: rgba(0, 0, 0, 0.45);
    z-index: 3;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.lock-notice-badge {
    background: rgba(255, 77, 77, 0.15);
    border: 1px solid rgba(255, 77, 77, 0.45);
    border-radius: 8px;
    padding: 3px 10px;
    font-size: 0.78rem;
    color: #ff8585;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}

/* ==========================================================================
   TEAM PREVIEW SLOTS
   ========================================================================== */

.team-preview-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.selection-preview-area {
    display: flex;
    justify-content: center;
    gap: clamp(12px, 3vw, 24px);
    width: 100%;
}

.preview-slot {
    width: clamp(80px, 14vw, 105px);
    height: clamp(80px, 14vw, 105px);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(255, 255, 255, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
}

.preview-slot .slot-num {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--text-muted);
}

.preview-slot .slot-empty-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.preview-slot.filled {
    border: 2px solid var(--naruto-orange);
    border-style: solid;
    box-shadow: 0 0 15px var(--naruto-orange-glow);
    cursor: pointer;
    background: #000;
}

.preview-slot.filled img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.3s;
}

.slot-remove-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: var(--naruto-red);
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(255, 51, 68, 0.8);
}

.preview-slot.filled:hover .slot-remove-badge {
    display: flex;
}

.preview-slot.filled:hover img {
    filter: brightness(0.7);
}

/* Botão de Iniciar Combate */
#start-battle-btn {
    align-self: center;
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    letter-spacing: 2px;
    padding: 14px 45px;
    border: none;
    border-radius: 12px;
    color: #111;
    background: linear-gradient(135deg, #ff9500, #ff5e00);
    box-shadow: 0 8px 25px var(--naruto-orange-glow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    touch-action: manipulation;
}

#start-battle-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(255, 94, 0, 0.7);
    filter: brightness(1.1);
}

#start-battle-btn:active:not(:disabled) {
    transform: translateY(0);
}

#start-battle-btn:disabled {
    background: #333a46;
    color: #718096;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ==========================================================================
   SELETOR DE CENÁRIO (ARENA PICKER)
   ========================================================================== */

.arena-picker-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    margin-bottom: 5px;
}

.arena-picker-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.arena-chips-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.arena-chip {
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    user-select: none;
}

.arena-chip:hover {
    border-color: var(--naruto-orange);
    color: #ffffff;
    transform: translateY(-2px);
    background: rgba(255, 123, 0, 0.1);
}

.arena-chip.active {
    background: linear-gradient(135deg, rgba(255, 123, 0, 0.3), rgba(255, 94, 0, 0.15));
    border-color: var(--naruto-orange);
    color: #ffffff;
    box-shadow: 0 0 14px var(--naruto-orange-glow);
    font-weight: 700;
}

/* ==========================================================================
   BATTLE ARENA (COMBATE 3v3) COM CENÁRIOS DINÂMICOS
   ========================================================================== */

#game-screen {
    display: none;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    position: relative;
    border-radius: 18px;
    padding: clamp(14px, 2.5vw, 24px);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-image 0.6s ease-in-out;
    overflow: hidden;
}

#game-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(13, 16, 23, 0.6) 0%, rgba(8, 10, 15, 0.88) 100%);
    pointer-events: none;
    z-index: 0;
}

#game-screen > * {
    position: relative;
    z-index: 1;
}

/* Battle Header & Arena Badge */
.battle-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 5px;
    position: relative;
}

.speed-toggle-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(255, 123, 0, 0.2), rgba(20, 24, 34, 0.9));
    border: 1px solid var(--naruto-orange);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 1px;
    z-index: 10;
}

.speed-toggle-btn:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 0 16px var(--naruto-orange-glow);
    border-color: #ff9800;
}

.speed-toggle-btn.speed-active {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: #111111;
    font-weight: 900;
    border-color: #ffd54f;
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.8), 0 0 35px rgba(255, 87, 34, 0.5);
    animation: speedPulse 1.2s infinite alternate ease-in-out;
}

@keyframes speedPulse {
    from { transform: translateY(-50%) scale(1); filter: brightness(1); }
    to { transform: translateY(-50%) scale(1.06); filter: brightness(1.2); }
}

@media (max-width: 640px) {
    .speed-toggle-btn {
        position: static;
        transform: none;
        margin-top: 4px;
    }
    .speed-toggle-btn:hover {
        transform: scale(1.05);
    }
}

.battle-arena-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 123, 0, 0.5);
    border-radius: 20px;
    padding: 4px 18px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-transform: uppercase;
}

/* Selo fixo da IA única do adversário (sem níveis de dificuldade) */
.ai-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ff4757;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 71, 87, 0.6);
    border-radius: 20px;
    padding: 3px 14px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 12px rgba(255, 71, 87, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-transform: uppercase;
}

/* Botão de Ação Defensiva / Tática */
.skill-btn.defense-btn {
    border-color: rgba(46, 204, 113, 0.6);
    background: radial-gradient(circle at center, rgba(46, 204, 113, 0.25), rgba(15, 25, 20, 0.9));
}

.skill-btn.defense-btn:hover:not(:disabled) {
    border-color: #2ecc71;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
    transform: translateY(-3px) scale(1.05);
}

.defense-skill-icon {
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.def-role-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #0d1f17;
    border: 1px solid #2ecc71;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    line-height: 1;
    z-index: 4;
    pointer-events: none;
}

/* Indicador de Guarda / Defesa no Portrait */
.guard-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(46, 204, 113, 0.9);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 4;
    animation: pulseGuard 1.2s infinite alternate;
}

@keyframes pulseGuard {
    from { transform: scale(0.95); opacity: 0.85; }
    to { transform: scale(1.05); opacity: 1; }
}

/* Efeito de impacto do Bloqueio / Substituição */
.guard-block-impact {
    animation: guardBlockFlash 0.5s ease-out;
}

@keyframes guardBlockFlash {
    0% { filter: brightness(2) drop-shadow(0 0 20px #2ecc71); }
    50% { transform: scale(0.95) rotate(-3deg); }
    100% { filter: brightness(1); transform: scale(1); }
}

/* Texto flutuante de Bloqueio */
.floating-text.block-text {
    color: #2ecc71;
    font-weight: 900;
    text-shadow: 0 0 12px rgba(46, 204, 113, 0.8), 0 2px 4px #000;
}

.turn-indicator {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: 3px;
    padding: 8px 30px;
    border-radius: 30px;
    text-align: center;
    text-transform: uppercase;
    position: relative;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.turn-indicator.player-turn {
    color: #ffffff;
    background: linear-gradient(90deg, transparent, rgba(255, 123, 0, 0.4), transparent);
    border: 1px solid var(--naruto-orange);
    text-shadow: 0 0 15px var(--naruto-orange);
}

.turn-indicator.enemy-turn {
    color: #ffffff;
    background: linear-gradient(90deg, transparent, rgba(255, 51, 68, 0.4), transparent);
    border: 1px solid var(--naruto-red);
    text-shadow: 0 0 15px var(--naruto-red);
}

.turn-indicator.banner-animate {
    animation: bannerPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bannerPop {
    0% { transform: scale(0.7) translateY(-15px); opacity: 0; }
    70% { transform: scale(1.08) translateY(2px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Teams Container Layout */
.teams-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: clamp(10px, 2vw, 25px);
    align-items: stretch;
    width: 100%;
}

.team {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: clamp(12px, 2vw, 20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.player-team-zone {
    border-top: 3px solid var(--naruto-orange);
}

.enemy-team-zone {
    border-top: 3px solid var(--naruto-red);
}

.team-title {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    letter-spacing: 1.5px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.team-badge {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 20px;
}

.player-badge {
    background: var(--naruto-orange);
    color: #111;
}

.enemy-badge {
    background: var(--naruto-red);
    color: #fff;
}

/* VS Divider */
.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-medallion {
    position: relative;
    width: clamp(54px, 6.5vw, 72px);
    height: clamp(54px, 6.5vw, 72px);
    border-radius: 50%;
    border: 2px solid rgba(255, 123, 0, 0.55);
    box-shadow: 0 0 20px rgba(255, 123, 0, 0.35), 0 0 20px rgba(0, 136, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0b0e15;
}

.vs-crest-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45;
    filter: saturate(1.2) contrast(1.1);
    pointer-events: none;
}

.vs-text {
    position: relative;
    z-index: 2;
    font-family: var(--font-heading);
    font-size: clamp(1.7rem, 3.2vw, 2.5rem);
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 2px 8px #000, 0 0 14px rgba(255, 123, 0, 0.85);
}

/* ==========================================================================
   CHARACTER CARDS (BATTLE FIELD)
   ========================================================================== */

.character-card {
    display: flex;
    align-items: center;
    background: rgba(10, 13, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px;
    gap: 12px;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
    min-height: 125px;
}

.player-character {
    border-left: 3px solid var(--naruto-blue);
}

.enemy-character {
    border-left: 3px solid var(--naruto-red);
}

/* Card States */
.character-card.active {
    border-color: var(--naruto-orange) !important;
    background: rgba(255, 123, 0, 0.08);
    box-shadow: 0 0 20px var(--naruto-orange-glow), inset 0 0 15px rgba(255, 123, 0, 0.15);
    transform: scale(1.02);
    z-index: 10;
}

.character-card.targetable {
    border-color: var(--naruto-green) !important;
    cursor: crosshair;
    animation: targetPulseGlow 1.2s infinite alternate ease-in-out;
}

@keyframes targetPulseGlow {
    from {
        box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
        border-color: var(--naruto-green);
    }
    to {
        box-shadow: 0 0 25px rgba(46, 204, 113, 0.9), inset 0 0 15px rgba(46, 204, 113, 0.3);
        border-color: #68d391;
    }
}

.character-card.dead {
    filter: grayscale(100%) brightness(0.45);
    opacity: 0.55;
    pointer-events: none;
    border-color: rgba(255, 255, 255, 0.05) !important;
    transform: none !important;
}

.character-card.dead .overlay {
    visibility: visible;
    opacity: 1;
}

/* Portrait Section */
.character-portrait-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 105px;
    flex-shrink: 0;
    position: relative;
}

.character-image {
    width: 75px;
    height: 75px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
    object-position: top center;
    background-color: #1a202c;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}

/* Status Bars (HP & Chakra) */
.status-bars {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.bar-container {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    height: 14px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bar-wrapper {
    position: relative;
    height: 100%;
    width: 100%;
}

.health-bar {
    height: 100%;
    background: linear-gradient(90deg, #990011, #ff3344);
    box-shadow: 0 0 8px rgba(255, 51, 68, 0.5);
    transition: width 0.35s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.chakra-bar {
    height: 100%;
    background: linear-gradient(90deg, #0055aa, #0088ff);
    box-shadow: 0 0 8px rgba(0, 136, 255, 0.5);
    transition: width 0.35s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    z-index: 2;
    letter-spacing: 0.5px;
}

/* Status Icons */
.status-icons {
    display: flex;
    gap: 4px;
    justify-content: center;
    min-height: 16px;
    margin-top: 3px;
}

.status-icon {
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-icon::after {
    content: attr(data-duration);
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 0.55rem;
    background: var(--naruto-orange);
    color: #000;
    border-radius: 4px;
    padding: 0 3px;
    font-weight: 900;
}

/* Stun Effect */
.stun-overlay {
    position: absolute;
    top: -6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: #ffeb3b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 0 12px #ffeb3b;
    visibility: hidden;
    opacity: 0;
    z-index: 4;
    transition: opacity 0.2s;
    animation: stunJitter 0.8s infinite;
}

.character-card.stunned .stun-overlay {
    visibility: visible;
    opacity: 1;
}

@keyframes stunJitter {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(-10deg); }
    75% { transform: scale(1.15) rotate(10deg); }
}

/* Overlay Caído */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: var(--naruto-red);
    text-shadow: 0 0 10px var(--naruto-red);
    visibility: hidden;
    opacity: 0;
    z-index: 5;
    border-radius: 12px;
    transition: opacity 0.3s;
}

/* ==========================================================================
   SKILLS & ACTIONS SECTION
   ========================================================================== */

.character-skills-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-height: 80px;
    padding: 10px 14px;
    background: rgba(18, 22, 33, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow-x: auto;
}

/* Custom Scrollbar for skills */
.character-skills-section::-webkit-scrollbar {
    height: 4px;
}
.character-skills-section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.skill-btn {
    position: relative;
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    background: #1a202c;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
    touch-action: manipulation;
}

.skill-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.skill-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.08);
    border-color: var(--naruto-orange);
    box-shadow: 0 0 12px var(--naruto-orange);
    z-index: 10;
}

.skill-btn:disabled,
.skill-btn[aria-disabled="true"],
.skill-btn.disabled-btn {
    cursor: not-allowed;
    opacity: 0.35;
    filter: grayscale(100%);
}

.cooldown-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 2;
    text-shadow: 0 0 8px #000;
}

.chakra-cost {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--naruto-blue);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.chakra-cost.insufficient {
    background: #e74c3c !important;
    color: #fff !important;
    border-color: #ff7675 !important;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.9) !important;
}

/* Badge de Atalho de Teclado (1, 2, 3, 4, 5) */
.hotkey-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #0f131c;
    color: #ffd54f;
    border: 1px solid rgba(255, 213, 79, 0.6);
    font-size: 0.65rem;
    font-weight: 800;
    width: 17px;
    height: 17px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    font-family: var(--font-body);
}

.skill-btn:hover:not(:disabled) .hotkey-badge {
    background: var(--naruto-orange);
    color: #111;
    border-color: #fff;
    box-shadow: 0 0 8px var(--naruto-orange-glow);
}

/* Jutsu fortalecido por uma postura ativa (Ex: Super Strength com a Inner Sakura): brilho rosa + selo "+N" */
.skill-btn.skill-buffed,
.enemy-skill-badge.skill-buffed {
    border-color: #f472b6;
    animation: skillBuffedGlow 1.4s infinite alternate ease-in-out;
}

.skill-buff-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 3;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 6px;
    border: 1px solid #fff;
    box-shadow: 0 0 8px rgba(244, 114, 182, 0.9);
    pointer-events: none;
}

@keyframes skillBuffedGlow {
    0% { box-shadow: 0 0 4px rgba(244, 114, 182, 0.5); }
    100% { box-shadow: 0 0 14px rgba(244, 114, 182, 1); }
}

/* Tooltips */
.skill-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 14, 22, 0.95);
    border: 1px solid var(--naruto-orange);
    border-radius: 8px;
    padding: 6px 12px;
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.3;
    white-space: nowrap;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.skill-btn:hover .skill-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Enemy Skills Preview */
.enemy-skills-section {
    background: rgba(30, 15, 20, 0.5);
    border-color: rgba(255, 51, 68, 0.15);
}

.enemy-skill-badge {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #181d28;
    border: 1px solid rgba(255, 51, 68, 0.3);
    border-radius: 8px;
    padding: 0;
    opacity: 0.9;
    transition: opacity 0.25s, filter 0.25s, border-color 0.25s;
}

.enemy-skill-badge.on-cooldown {
    opacity: 0.4;
    filter: grayscale(100%);
    border-color: rgba(255, 255, 255, 0.1);
}

.enemy-skill-badge .cooldown-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    color: #ff4757;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    z-index: 5;
    text-shadow: 0 0 8px rgba(255, 71, 87, 0.8), 0 2px 4px #000;
    pointer-events: none;
}

.enemy-skill-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

/* ==========================================================================
   COMBAT ANIMATIONS (ATTACK DASH, IMPACT SHAKE, JUTSU GLOW)
   ========================================================================== */

/* Player Attack Dash */
.attacking-dash-right {
    animation: dashRight 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 20;
}

@keyframes dashRight {
    0% { transform: translateX(0); }
    40% { transform: translateX(45px) scale(1.05); filter: drop-shadow(0 0 15px var(--naruto-orange)); }
    100% { transform: translateX(0); }
}

/* Enemy Attack Dash */
.attacking-dash-left {
    animation: dashLeft 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 20;
}

@keyframes dashLeft {
    0% { transform: translateX(0); }
    40% { transform: translateX(-45px) scale(1.05); filter: drop-shadow(0 0 15px var(--naruto-red)); }
    100% { transform: translateX(0); }
}

/* Hit Impact Shake */
.hit-impact {
    animation: impactShake 0.45s ease-in-out;
}

@keyframes impactShake {
    0% { transform: translateX(0); }
    15% { transform: translateX(-12px) rotate(-2deg); filter: brightness(2) contrast(1.3); }
    30% { transform: translateX(10px) rotate(2deg); }
    50% { transform: translateX(-7px); }
    70% { transform: translateX(5px); }
    100% { transform: translateX(0); filter: none; }
}

/* Heal Pulse */
.heal-impact {
    animation: healAura 0.6s ease-out;
}

@keyframes healAura {
    0% { box-shadow: 0 0 0 rgba(46, 204, 113, 0); }
    50% { box-shadow: 0 0 35px var(--naruto-green), inset 0 0 15px var(--naruto-green); transform: scale(1.03); }
    100% { box-shadow: 0 0 0 rgba(46, 204, 113, 0); transform: scale(1); }
}

/* Poison Impact */
.poison-impact {
    animation: poisonGlow 0.5s ease-out;
}

@keyframes poisonGlow {
    0% { box-shadow: 0 0 0 rgba(155, 81, 224, 0); }
    50% { box-shadow: 0 0 25px var(--naruto-purple), inset 0 0 15px var(--naruto-purple); }
    100% { box-shadow: 0 0 0 rgba(155, 81, 224, 0); }
}

/* Buff Impact */
.buff-impact {
    animation: buffFlash 0.55s ease-out;
}

@keyframes buffFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); box-shadow: 0 0 30px var(--naruto-gold); }
    100% { transform: scale(1); }
}

/* Jutsu Cast Glow */
.character-portrait-section.jutsu-glow {
    animation: jutsuCastAura 0.8s ease-in-out;
}

@keyframes jutsuCastAura {
    0% { transform: scale(1); }
    40% { transform: scale(1.1); filter: drop-shadow(0 0 25px var(--naruto-blue)); }
    100% { transform: scale(1); filter: none; }
}

/* Floating Combat Text */
.floating-text {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 2.8rem);
    letter-spacing: 1px;
    font-weight: 900;
    pointer-events: none;
    z-index: 30;
    white-space: nowrap;
    animation: combatPopUp 1.2s forwards cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes combatPopUp {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.6);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -20px) scale(1.25);
    }
    60% {
        opacity: 1;
        transform: translate(-50%, -40px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -65px) scale(0.9);
    }
}

.damage-text {
    color: var(--naruto-red);
    text-shadow: 0 0 15px rgba(255, 51, 68, 0.9), 2px 2px 0 #000;
}

.crit-damage-text {
    color: #ff9500;
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    text-shadow: 0 0 20px #ff9500, 2px 2px 0 #000;
}

.heal-text {
    color: var(--naruto-green);
    text-shadow: 0 0 15px rgba(46, 204, 113, 0.9), 2px 2px 0 #000;
}

.shield-text {
    color: var(--naruto-blue);
    font-size: 1.8rem;
    text-shadow: 0 0 15px rgba(0, 136, 255, 0.9), 2px 2px 0 #000;
}

.stun-text {
    color: #ffd600;
    font-size: 1.8rem;
    text-shadow: 0 0 15px #ffd600, 2px 2px 0 #000;
}

.poison-text {
    color: var(--naruto-purple);
    text-shadow: 0 0 15px var(--naruto-purple), 2px 2px 0 #000;
}

.dot-text, .dot-damage-text {
    color: #ff3366;
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 0 0 16px rgba(255, 51, 102, 0.95), 2px 2px 0 #000;
}

.purify-text {
    color: #00ffcc;
    font-size: 1.9rem;
    font-weight: 900;
    text-shadow: 0 0 18px rgba(0, 255, 204, 0.95), 2px 2px 0 #000;
}

.buff-text {
    color: var(--naruto-gold);
    font-size: 1.8rem;
    text-shadow: 0 0 15px var(--naruto-gold), 2px 2px 0 #000;
}

.chakra-gain-text {
    color: #00c3ff;
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 0 0 16px rgba(0, 195, 255, 0.9), 2px 2px 0 #000;
}

.chakra-lack-text {
    color: #ff4757;
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 0 0 16px rgba(255, 71, 87, 0.95), 2px 2px 0 #000;
}

.lock-warn-text {
    color: #ffa502;
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 0 0 16px rgba(255, 165, 2, 0.95), 2px 2px 0 #000;
}

/* Dreno de chakra do alvo (64 Golpes do Neji) */
.chakra-drain-text {
    color: #38bdf8;
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.95), 2px 2px 0 #000;
}

@keyframes chakraShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.chakra-bar-container.chakra-shake {
    animation: chakraShake 0.35s ease-in-out;
    box-shadow: 0 0 14px rgba(255, 71, 87, 0.9) !important;
}

/* ==========================================================================
   BATTLE LOG & ACTION BAR
   ========================================================================== */

.game-info {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: stretch;
    width: 100%;
}

.log-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

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

.log-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.log-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.log-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.game-log {
    background: rgba(8, 10, 16, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.85rem;
    height: 100px;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.game-log p {
    margin: 3px 0;
    color: var(--text-secondary);
    line-height: 1.4;
}

.game-log p:first-child {
    color: #fff;
    font-weight: 600;
}

.game-log::-webkit-scrollbar {
    width: 5px;
}

.game-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* Battle Action Buttons */
.battle-actions-bar {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    min-width: 140px;
}

.cancel-target-btn {
    background: #4a5568;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: none;
    transition: background 0.2s;
}

.cancel-target-btn:hover {
    background: #718096;
}

.surrender-btn {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b7a;
    border: 1px solid rgba(220, 53, 69, 0.4);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.surrender-btn:hover {
    background: rgba(220, 53, 69, 0.4);
    transform: translateY(-2px);
}

/* ==========================================================================
   MODALS (FIM DE JOGO & DETALHES DE JUTSU)
   ========================================================================== */

.game-over-modal, #jutsu-details-modal {
    position: fixed;
    inset: 0;
    /* Sem backdrop-filter (desempenho): o desfoque da tela inteira era refeito a cada quadro enquanto o combate
       animava por trás, travando a tela final. Fundo um pouco mais escuro para compensar. */
    background: rgba(0, 0, 0, 0.92);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content, .jutsu-modal-content {
    background: linear-gradient(145deg, #181d28, #0e121a);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    position: relative;
    max-width: 480px;
    width: 100%;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.85) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content {
    border: 2px solid var(--naruto-orange);
    padding: 35px 25px;
    text-align: center;
}

.modal-content h2 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    letter-spacing: 2px;
    color: var(--naruto-orange);
    margin-bottom: 20px;
    text-shadow: 0 0 20px var(--naruto-orange-glow);
}

.restart-btn {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: 1.5px;
    padding: 12px 35px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--naruto-orange), #ff5e00);
    color: #111;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--naruto-orange-glow);
    transition: transform 0.2s;
}

.restart-btn:hover {
    transform: translateY(-2px) scale(1.03);
}

/* Jutsu Details Modal */
.jutsu-modal-content {
    border: 2px solid var(--naruto-blue);
    padding: 25px;
    max-width: 520px;
}

.jutsu-modal-content h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--naruto-blue);
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    text-shadow: 0 0 15px var(--naruto-blue-glow);
}

.jutsu-modal-content .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

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

.jutsu-modal-content ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
}

.jutsu-modal-content li {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
}

.jutsu-modal-content li img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid var(--naruto-blue);
    object-fit: cover;
}

.jutsu-modal-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 3px;
}

.jutsu-item-stats {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: var(--text-secondary);
    gap: 2px;
}

/* ==========================================================================
   RESPONSIVIDADE (TABLET & MOBILE)
   ========================================================================== */

/* Tablet & Médias Telas (< 992px) */
@media (max-width: 992px) {
    .teams-container {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .vs-divider {
        margin: -5px 0;
    }

    .vs-text {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    #selection-details-panel {
        min-height: 240px;
        height: 240px;
        max-height: 240px;
    }
}

/* Telas Pequenas & Mobile (< 768px) */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    .container {
        border-radius: 14px;
        padding: 14px;
        gap: 15px;
    }

    #selection-details-panel {
        height: auto;
        min-height: 380px;
        max-height: none;
    }

    .selection-active-info {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .selection-stats-row {
        justify-content: center;
    }

    .selection-jutsus-row {
        justify-content: center;
    }

    .character-card {
        padding: 10px;
        gap: 10px;
    }

    .character-portrait-section {
        width: 85px;
    }

    .character-image {
        width: 65px;
        height: 65px;
    }

    .skill-btn {
        width: 48px;
        height: 48px;
    }

    .game-info {
        flex-direction: column;
    }

    .battle-actions-bar {
        flex-direction: row;
        width: 100%;
    }

    .battle-actions-bar button {
        flex: 1;
    }
}

/* Telas Muito Pequenas (< 480px) */
@media (max-width: 480px) {
    #selection-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .character-card {
        flex-direction: column;
        align-items: stretch;
    }

    .character-portrait-section {
        width: 100%;
    }

    .character-skills-section {
        justify-content: center;
        width: 100%;
        min-height: 65px;
    }

    .skill-btn {
        width: 44px;
        height: 44px;
    }

    .enemy-skill-badge {
        width: 38px;
        height: 38px;
    }
}

/* ==========================================================================
   MAIN MENU & GAME MODES STYLES
   ========================================================================== */

#main-menu-screen {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    animation: fadeInQuick 0.3s ease-out;
}

.modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    width: 100%;
}

.mode-card {
    background: linear-gradient(165deg, rgba(24, 29, 44, 0.95), rgba(12, 16, 25, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 18px;
    padding: 0 0 18px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.mode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.mode-card:hover {
    transform: translateY(-6px);
    border-color: var(--naruto-orange);
    box-shadow: 0 15px 35px var(--naruto-orange-glow);
}

.mode-card.mode-missions-card:hover {
    border-color: var(--naruto-purple);
    box-shadow: 0 15px 35px var(--naruto-purple-glow);
}

/* Banner ilustrado de topo nos cards de modo (NanoBanana) */
.mode-card-banner {
    position: relative;
    width: 100%;
    height: 108px;
    overflow: hidden;
    background: #0b0e16;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-card-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 14, 22, 0.12) 0%,
        rgba(10, 14, 22, 0.32) 55%,
        rgba(14, 18, 28, 0.96) 100%
    );
    pointer-events: none;
}

.mode-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.35s ease;
}

.mode-card:hover .mode-banner-img {
    transform: scale(1.06);
}

.mode-card-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 9px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.mode-card-badge.available {
    background: rgba(16, 38, 28, 0.88);
    color: var(--naruto-green);
    border: 1px solid rgba(46, 204, 113, 0.55);
}

.mode-card-badge.highlight {
    background: rgba(42, 24, 10, 0.88);
    color: var(--naruto-orange);
    border: 1px solid rgba(255, 123, 0, 0.55);
}

.mode-card-badge.missions {
    background: rgba(30, 16, 46, 0.88);
    color: #c58af9;
    border: 1px solid rgba(155, 81, 224, 0.6);
}

.mode-icon-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(10, 13, 20, 0.92);
    border: 2.5px solid rgba(255, 123, 0, 0.55);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75), 0 0 15px rgba(255, 123, 0, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-top: -38px;
    z-index: 2;
    overflow: hidden;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.mode-missions-card .mode-icon-circle {
    border-color: rgba(155, 81, 224, 0.55);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75), 0 0 15px rgba(155, 81, 224, 0.25);
}

.mode-gui-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.mode-card:hover .mode-icon-circle {
    transform: scale(1.08);
    border-color: var(--naruto-orange);
    box-shadow: 0 8px 25px rgba(255, 123, 0, 0.5);
}

.mode-card.mode-missions-card:hover .mode-icon-circle {
    border-color: var(--naruto-purple);
    box-shadow: 0 8px 25px rgba(155, 81, 224, 0.55);
}

.mode-card:hover .mode-gui-icon {
    transform: scale(1.1);
}

.mode-card-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    padding: 0 18px;
}

.mode-card-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    letter-spacing: 1.5px;
    color: #fff;
    line-height: 1;
}

.mode-card-sub {
    font-size: 0.74rem;
    color: var(--naruto-orange);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.mode-missions-card .mode-card-sub {
    color: #bb86fc;
}

.mode-card-desc {
    font-size: 0.81rem;
    color: var(--text-secondary);
    line-height: 1.38;
    margin-top: 2px;
}

.mode-enter-btn {
    width: calc(100% - 36px);
    margin: 2px 18px 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 9px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    cursor: pointer;
    pointer-events: none; /* Deixa o card inteiro clicável */
}

.mode-card:hover .mode-enter-btn {
    background: var(--naruto-orange);
    color: #111;
    border-color: var(--naruto-orange);
}

.mode-card.mode-missions-card:hover .mode-enter-btn {
    background: var(--naruto-purple);
    color: #fff;
    border-color: var(--naruto-purple);
}

/* Barra de Perfil Ninja no Rodapé */
.player-profile-bar {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.profile-stat-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 8px 16px;
}

.profile-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 123, 0, 0.5);
    box-shadow: 0 0 12px rgba(255, 123, 0, 0.25);
    flex-shrink: 0;
}

.profile-stat-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.stat-box-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.stat-box-val {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--naruto-orange);
    letter-spacing: 1px;
}

/* Rank por XP no perfil (cor da borda/barra vem do rank em data/progression.js, aplicada pelo JS) */
.profile-rank-box {
    min-width: 230px;
}

.profile-rank-emblem {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid var(--naruto-orange);
    box-shadow: 0 0 12px rgba(255, 123, 0, 0.25);
    flex-shrink: 0;
    overflow: hidden;
}

.rank-emblem-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.profile-rank-box .profile-stat-info {
    flex: 1;
    min-width: 0;
}

.profile-rank-box .stat-box-val {
    font-size: 1.3rem;
    line-height: 1.1;
}

.profile-xp-track,
.xp-progress-track {
    width: 100%;
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-top: 4px;
}

.profile-xp-fill,
.xp-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 6px;
    background: var(--naruto-orange);
    transition: width 1.1s ease-out;
}

.profile-xp-text {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

/* ==========================================================================
   NAVIGATION & MODE BADGE ON SELECTION SCREEN
   ========================================================================== */

.selection-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 5px;
}

.back-nav-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid var(--card-border);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.back-nav-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateX(-3px);
}

.current-mode-tag {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 123, 0, 0.15);
    color: var(--naruto-orange);
    border: 1px solid rgba(255, 123, 0, 0.3);
}

/* ==========================================================================
   MISSIONS MODAL (NARUTO ARENA STYLE)
   ========================================================================== */

.missions-modal-content {
    max-width: 680px;
    padding: 30px 24px;
    border-color: var(--naruto-purple);
    box-shadow: 0 0 35px var(--naruto-purple-glow);
}

.missions-modal-header {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.modal-header-crest {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 2px;
    background: radial-gradient(circle, rgba(255, 152, 0, 0.35), transparent 72%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65), 0 0 16px rgba(255, 152, 0, 0.3);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-header-crest-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 196, 74, 0.6);
}

.missions-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.missions-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 5px;
}

.mission-card {
    background: rgba(20, 24, 36, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s;
}

.mission-card.completed {
    border-color: var(--naruto-green);
    background: rgba(46, 204, 113, 0.06);
}

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

.mission-title-text {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #fff;
    letter-spacing: 1px;
}

.mission-reward-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffca4a;
    background: rgba(255, 180, 0, 0.12);
    border: 1px solid rgba(255, 180, 0, 0.3);
    padding: 3px 8px;
    border-radius: 6px;
}

.mission-desc-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.mission-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mission-bar-track {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mission-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8a2be2, var(--naruto-purple));
    border-radius: 10px;
    transition: width 0.4s ease;
}

.mission-card.completed .mission-bar-fill {
    background: linear-gradient(90deg, #27ae60, var(--naruto-green));
}

.mission-progress-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    min-width: 45px;
    text-align: right;
}

/* ==========================================================================
   TOWER SELECTION MODAL
   ========================================================================== */

.tower-modal-content {
    max-width: 580px;
    padding: 30px 22px;
}

.tower-modal-header {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tower-tier-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tower-tier-card {
    background: rgba(18, 22, 33, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.tower-tier-row {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
}

.tower-tier-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 123, 0, 0.5);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65), 0 0 12px rgba(255, 123, 0, 0.25);
    flex-shrink: 0;
}

.tower-tier-card.locked-tier .tower-tier-icon {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

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

.tower-tier-card.active-tier:hover {
    transform: translateY(-3px);
    border-color: var(--naruto-orange);
    box-shadow: 0 8px 25px var(--naruto-orange-glow);
}

.tier-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 12px;
    background: rgba(46, 204, 113, 0.15);
    color: var(--naruto-green);
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.tier-badge.locked {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.1);
}

.tower-tier-card.locked-tier {
    opacity: 0.5;
    cursor: not-allowed;
}

.tower-tier-card h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: #fff;
    letter-spacing: 1px;
}

.tier-info {
    font-size: 0.75rem;
    color: var(--naruto-orange);
    font-weight: 700;
    text-transform: uppercase;
}

.tier-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.tier-btn {
    align-self: flex-start;
    margin-top: 6px;
    background: var(--naruto-orange);
    color: #111;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    pointer-events: none;
}

/* ==========================================================================
   FRONTEND DESIGN QUALITY FLOOR & ACCESSIBILITY
   ========================================================================== */

/* Tabular Numerals: Prevents UI jitter when health, chakra, or cooldowns tick */
.cooldown-overlay,
.selection-stats-row,
.floating-text,
#team-count {
    font-variant-numeric: tabular-nums lining-nums;
}

/* High-Contrast Accessible Keyboard Focus */
button:focus-visible,
.mode-card:focus-visible,
.preview-slot:focus-visible,
.arena-chip:focus-visible {
    outline: 2px solid var(--naruto-orange);
    outline-offset: 3px;
    box-shadow: 0 0 12px var(--naruto-orange-glow);
}

/* Tactile Active States on Interactive Elements */
button:active:not(:disabled),
.arena-chip:active,
.mode-card:active {
    transform: scale(0.98);
}

/* Reduced Motion Respect: Gracefully downgrade impact shakes and intense pulses */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hit-impact,
    .guard-block-impact,
    .poison-impact,
    .container {
        animation: none !important;
    }
}

/* ==========================================================================
   PREPARATION & PREREQUISITE MECHANICS (NARUTO ARENA STYLE)
   ========================================================================== */

/* Marcadores de Alvo (Ex: Caixão de Areia do Gaara) */
.status-icon.status-mark {
    background: rgba(220, 38, 38, 0.45);
    border: 2px solid var(--naruto-red);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
    padding: 1px;
    animation: markPulse 1.8s infinite ease-in-out;
}

.status-icon.status-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

@keyframes markPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }
    50% { transform: scale(1.18); box-shadow: 0 0 15px rgba(239, 68, 68, 0.95); }
}

/* Status de Modo / Stance Ativa (Ex: Oito Portões do Rock Lee) */
.status-icon.status-opened-gates {
    background: rgba(16, 185, 129, 0.45);
    border: 2px solid #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
    padding: 1px;
    animation: gateAura 1.4s infinite alternate;
}

@keyframes gateAura {
    0% { box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); transform: scale(1); }
    100% { box-shadow: 0 0 16px rgba(16, 185, 129, 0.95); transform: scale(1.12); }
}

/* Status de Contra-Ataque / Revide (Ex: Kaiten / Rotação do Neji) */
.status-icon.status-counter {
    background: rgba(59, 130, 246, 0.45);
    border: 2px solid #60a5fa;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.85);
    padding: 1px;
    animation: kaitenAura 2.2s infinite linear;
}

/* Imagem do jutsu preenchendo o ícone circular das stances */
.status-icon.status-opened-gates img,
.status-icon.status-counter img,
.status-icon.status-reflect img,
.status-icon.status-shadow-clones img,
.status-icon.status-kyuubi-cloak img,
.status-icon.status-sharingan-defense img,
.status-icon.status-sharingan-vulnerable img,
.status-icon.status-inner-sakura img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

@keyframes kaitenAura {
    0% { box-shadow: 0 0 8px rgba(59, 130, 246, 0.6); transform: scale(1) rotate(0deg); }
    50% { box-shadow: 0 0 18px rgba(96, 165, 250, 0.95); transform: scale(1.12) rotate(180deg); }
    100% { box-shadow: 0 0 8px rgba(59, 130, 246, 0.6); transform: scale(1) rotate(360deg); }
}

/* Status de Reflexão (Ex: Sharingan Refletor) */
.status-icon.status-reflect {
    background: rgba(220, 38, 38, 0.45);
    border: 2px solid #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.85);
    padding: 1px;
    animation: sharinganAura 2.5s infinite linear;
}

@keyframes sharinganAura {
    0% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); transform: scale(1) rotate(0deg); }
    50% { box-shadow: 0 0 18px rgba(248, 113, 113, 0.95); transform: scale(1.1) rotate(180deg); }
    100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); transform: scale(1) rotate(360deg); }
}

/* Status de Clones das Sombras (Naruto) */
.status-icon.status-shadow-clones {
    background: rgba(249, 115, 22, 0.4);
    border: 2px solid #f97316;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.75);
    padding: 1px;
}

/* Status de Manto da Kyuubi (Naruto) */
.status-icon.status-kyuubi-cloak {
    background: rgba(220, 38, 38, 0.45);
    border: 2px solid #ef4444;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.95), inset 0 0 6px rgba(220, 38, 38, 0.6);
    padding: 1px;
    animation: kyuubiAuraPulse 1.8s infinite alternate ease-in-out;
}

@keyframes kyuubiAuraPulse {
    0% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.7), inset 0 0 4px rgba(220, 38, 38, 0.5); transform: scale(1); }
    100% { box-shadow: 0 0 20px rgba(248, 113, 113, 1), inset 0 0 8px rgba(239, 68, 68, 0.8); transform: scale(1.08); }
}

/* Status de Postura / Habilidade Secreta (Visível apenas para o jogador no seu próprio ninja) */
.status-icon.status-secret {
    position: relative;
    border-color: #a855f7 !important;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.85), inset 0 0 6px rgba(168, 85, 247, 0.5) !important;
    animation: secretStancePulse 1.8s infinite alternate ease-in-out;
}

.status-icon.status-secret::after {
    content: '👁️';
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.65rem;
    background: #0d1117;
    border-radius: 50%;
    padding: 1px 2px;
    line-height: 1;
    border: 1px solid #c084fc;
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.9);
}

@keyframes secretStancePulse {
    0% { transform: scale(1); box-shadow: 0 0 8px rgba(168, 85, 247, 0.6); }
    100% { transform: scale(1.08); box-shadow: 0 0 16px rgba(192, 132, 252, 0.95); }
}

/* Status: Sharingan - Previsão Defensiva (Sasuke) */
.status-icon.status-sharingan-defense {
    position: relative;
    background: rgba(220, 38, 38, 0.45);
    border: 2px solid #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.85);
    padding: 1px;
    animation: sharinganDefensePulse 2s infinite alternate ease-in-out;
}

@keyframes sharinganDefensePulse {
    0% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); transform: scale(1); }
    100% { box-shadow: 0 0 18px rgba(248, 113, 113, 1); transform: scale(1.08); }
}

/* Status: Na Mira do Sharingan - Vulnerabilidade / Supressão (Inimigo Marcado) */
.status-icon.status-sharingan-vulnerable {
    position: relative;
    background: rgba(185, 28, 28, 0.55);
    border: 2px dashed #f59e0b;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.9), inset 0 0 6px rgba(245, 158, 11, 0.7);
    padding: 1px;
    animation: sharinganVulnerablePulse 1.4s infinite alternate ease-in-out;
}

@keyframes sharinganVulnerablePulse {
    0% {
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.7), inset 0 0 4px rgba(245, 158, 11, 0.5);
        border-color: #f59e0b;
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 22px rgba(239, 68, 68, 1), inset 0 0 8px rgba(239, 68, 68, 0.9);
        border-color: #ef4444;
        transform: scale(1.12);
    }
}

/* Texto flutuante de Revelação de Habilidade Oculta / Segredo */
.floating-text.secret-reveal-text {
    color: #c084fc;
    font-weight: 900;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.95), 0 0 10px #7c3aed, 2px 2px 0 #000;
    animation: secretRevealFlash 0.8s ease-out;
}

@keyframes secretRevealFlash {
    0% { transform: translateY(0) scale(0.6); opacity: 0; filter: brightness(2); }
    30% { transform: translateY(-12px) scale(1.2); opacity: 1; filter: brightness(1.5); }
    100% { transform: translateY(-30px) scale(1); opacity: 1; filter: brightness(1); }
}

/* Botões de Jutsu Bloqueados por Pré-requisito (Ex: Falta Caixão de Areia ou Portão Aberto) */
.skill-btn.prerequisite-locked,
.enemy-jutsu-badge.prerequisite-locked {
    opacity: 0.38 !important;
    filter: grayscale(85%) contrast(85%);
    cursor: not-allowed !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    position: relative;
}

.skill-btn.prerequisite-locked::after,
.enemy-jutsu-badge.prerequisite-locked::after {
    content: '🔒';
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 0.65rem;
    filter: drop-shadow(0 0 3px #000);
}

/* Botões de Habilidade com Chakra Insuficiente (Aviso Vermelho Sutil) */
.skill-btn.insufficient-chakra,
.enemy-jutsu-badge.insufficient-chakra {
    opacity: 0.42;
    filter: grayscale(70%) brightness(88%);
    border-color: rgba(231, 76, 60, 0.45) !important;
}

.skill-btn.insufficient-chakra:hover {
    border-color: #e74c3c !important;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.6) !important;
}

/* Alvo marcado com destaque especial durante a seleção de alvo */
.character-card.marked-target {
    box-shadow: 0 0 25px rgba(255, 51, 68, 0.95), inset 0 0 15px rgba(255, 51, 68, 0.5) !important;
    border-color: #ff3344 !important;
    animation: targetPulse 1.2s infinite ease-in-out;
}

/* Botão e Badge de Ataque Básico */
.skill-btn.basic-attack-btn {
    border-color: rgba(243, 156, 18, 0.4);
    background: radial-gradient(circle at center, rgba(243, 156, 18, 0.12), rgba(18, 22, 30, 0.95));
}

.skill-btn.basic-attack-btn:hover:not(:disabled) {
    border-color: #f39c12;
    box-shadow: 0 0 14px rgba(243, 156, 18, 0.6);
}

.enemy-skill-badge.enemy-basic-badge {
    border-color: rgba(243, 156, 18, 0.35);
    background: rgba(30, 25, 20, 0.6);
}

/* Botão de habilidade atualmente selecionada em modo de mira */
.skill-btn.active-skill {
    border-color: #f1c40f !important;
    box-shadow: 0 0 16px rgba(241, 196, 15, 0.9), inset 0 0 8px rgba(241, 196, 15, 0.5) !important;
    transform: translateY(-4px) scale(1.1) !important;
    z-index: 10;
}

/* ==========================================================================
   COMBAT ENGINE: DAMAGE TYPES, CONTINUOUS DAMAGE & REGENERATION
   ========================================================================== */

/* Badges de Tipo de Jutsu nos Tooltips */
.jutsu-type-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-left: 4px;
    text-transform: uppercase;
    vertical-align: middle;
}

.jutsu-type-tag.type-taijutsu {
    background: rgba(230, 126, 34, 0.25);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.6);
}

.jutsu-type-tag.type-ninjutsu {
    background: rgba(52, 152, 219, 0.25);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.6);
}

.jutsu-type-tag.type-genjutsu {
    background: rgba(155, 89, 182, 0.25);
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.6);
}

.jutsu-type-tag.type-defense {
    background: rgba(46, 204, 113, 0.25);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.6);
}

/* Badges no Painel de Seleção */
.chip-type-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.chip-type-badge.type-taijutsu {
    background: rgba(230, 126, 34, 0.2);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.4);
}

.chip-type-badge.type-ninjutsu {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.4);
}

.chip-type-badge.type-genjutsu {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.4);
}

.chip-type-badge.type-defense {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.45);
}

/* Badges no Modal de Detalhes dos Jutsus */
.jutsu-modal-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.jutsu-modal-type-badge.type-taijutsu {
    background: rgba(230, 126, 34, 0.25);
    color: #f39c12;
    border: 1px solid #f39c12;
}

.jutsu-modal-type-badge.type-ninjutsu {
    background: rgba(52, 152, 219, 0.25);
    color: #3498db;
    border: 1px solid #3498db;
}

.jutsu-modal-type-badge.type-genjutsu {
    background: rgba(155, 89, 182, 0.25);
    color: #9b59b6;
    border: 1px solid #9b59b6;
}

.jutsu-modal-type-badge.type-defense {
    background: rgba(46, 204, 113, 0.25);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

/* Status: Dano Contínuo (DoT Stacks) */
.status-icon.status-dot {
    background: rgba(231, 76, 60, 0.35);
    border: 1px solid #e74c3c;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: dotPulse 1.5s infinite alternate ease-in-out;
}

.status-icon.status-dot .status-stack-count,
.status-icon.status-regen .status-stack-count,
.status-icon.status-sharingan-defense .status-stack-count,
.status-icon.status-sharingan-vulnerable .status-stack-count,
.status-icon.status-inner-sakura .status-stack-count {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #111;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 0 3px;
    border-radius: 3px;
    border: 1px solid currentColor;
    line-height: 1;
}

.status-icon.status-dot .status-stack-count {
    color: #ff3366;
    border-color: #ff3366;
}

.status-icon.status-regen .status-stack-count {
    color: #2ecc71;
    border-color: #2ecc71;
}

.status-icon.status-sharingan-defense .status-stack-count {
    color: #ef4444;
    border-color: #ef4444;
}

.status-icon.status-sharingan-vulnerable .status-stack-count {
    color: #f59e0b;
    border-color: #f59e0b;
}

/* Postura Inner Sakura (Sakura Haruno): aura rosa pulsante */
.status-icon.status-inner-sakura {
    position: relative;
    background: rgba(236, 72, 153, 0.4);
    border: 2px solid #f472b6;
    box-shadow: 0 0 12px rgba(244, 114, 182, 0.85);
    padding: 1px;
    animation: innerSakuraPulse 1.8s infinite alternate ease-in-out;
}

.status-icon.status-inner-sakura .status-stack-count {
    color: #f472b6;
    border-color: #f472b6;
}

@keyframes innerSakuraPulse {
    0% { box-shadow: 0 0 6px rgba(244, 114, 182, 0.55); }
    100% { box-shadow: 0 0 16px rgba(251, 113, 133, 1); }
}

@keyframes dotPulse {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(231, 76, 60, 0.4); }
    100% { transform: scale(1.1); box-shadow: 0 0 12px rgba(231, 76, 60, 0.9); }
}

/* Status: Regeneração Contínua (HoT) */
.status-icon.status-regen {
    background: rgba(46, 204, 113, 0.3);
    border: 1px solid #2ecc71;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: regenAura 1.8s infinite alternate ease-in-out;
}

@keyframes regenAura {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(46, 204, 113, 0.4); }
    100% { transform: scale(1.1); box-shadow: 0 0 12px rgba(46, 204, 113, 0.9); }
}

/* ==========================================================================
   ACELERAÇÃO 2x DO MODO DE VELOCIDADE (QoL & Game Flow)
   ========================================================================== */

#game-screen.speed-2x .attacking-dash-right,
#game-screen.speed-2x .attacking-dash-left,
#game-screen.speed-2x .hit-impact,
#game-screen.speed-2x .heal-impact,
#game-screen.speed-2x .buff-impact,
#game-screen.speed-2x .guard-block-impact,
#game-screen.speed-2x .poison-impact,
#game-screen.speed-2x .jutsu-glow {
    animation-duration: 0.25s !important;
}

#game-screen.speed-2x .floating-text {
    animation-duration: 0.5s !important;
}

/* ==========================================================================
   TELA DE ESTATÍSTICAS PÓS-BATALHA & MVP SPOTLIGHT (QoL & Game Flow)
   ========================================================================== */

.modal-content.post-battle-modal-content {
    max-width: 820px;
    max-height: 88vh;
    padding: 28px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(160deg, #161b26 0%, #0d1017 100%);
    border: 2px solid var(--naruto-orange);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.95), 0 0 30px rgba(255, 123, 0, 0.2);
    /* Camada própria (desempenho): a rolagem das estatísticas é feita pela placa de vídeo em vez de repintar */
    will-change: transform;
}

.modal-content.post-battle-modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content.post-battle-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 123, 0, 0.4);
    border-radius: 6px;
}

.post-battle-stats-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Painel de XP da partida (renderMatchXp) */
.post-battle-xp {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 123, 0, 0.35);
    border-radius: 14px;
    padding: 14px 18px;
    text-align: left;
}

.xp-summary-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.xp-rank-emblem {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--naruto-orange);
    flex-shrink: 0;
    overflow: hidden;
}

.xp-summary-title {
    display: flex;
    flex: 1;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.xp-rank-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    letter-spacing: 1px;
    color: #fff;
}

.xp-gained {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    letter-spacing: 1px;
    color: #ffd54f;
    text-shadow: 0 0 12px rgba(255, 213, 79, 0.45);
}

.xp-breakdown {
    list-style: none;
    margin: 10px 0 6px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xp-breakdown li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    padding-bottom: 3px;
}

.xp-item-value {
    color: #ffd54f;
    font-weight: 700;
    white-space: nowrap;
}

.xp-progress-track {
    height: 9px;
}

.xp-progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: 600;
}

.xp-rankup-banner {
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #111;
    background: linear-gradient(90deg, #ffb300, #ffd54f, #ffb300);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 12px;
    animation: xpRankUpPulse 1.4s ease-in-out 3;
}

@keyframes xpRankUpPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 213, 79, 0); }
    50% { transform: scale(1.03); box-shadow: 0 0 22px rgba(255, 213, 79, 0.65); }
}

/* MVP Spotlight Card */
.mvp-spotlight-card {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(20, 24, 35, 0.95));
    border: 2px solid #ffd700;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.75), 0 0 26px rgba(255, 215, 0, 0.4);
    overflow: hidden;
}

/* Pulso dourado do MVP (desempenho): anima só a opacidade de um brilho interno e apenas ao abrir
   (3 pulsos, depois fica aceso). Com animação infinita a tela final nunca ficava parada: cada quadro
   recompunha a tela inteira, o que pesava em PCs sem aceleração de vídeo forte. */
.mvp-glow-ring {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 28px rgba(255, 215, 0, 0.45);
    pointer-events: none;
    opacity: 1;
    animation: mvpGlow 1.2s ease-in-out 3 alternate both;
}

@keyframes mvpGlow {
    from { opacity: 0.25; }
    to { opacity: 1; }
}

/* Combate coberto pelo modal de fim de jogo: escondido (sai da pintura e da composição, inclusive ao rolar
   as estatísticas) e com as animações pausadas. O modal já cobre 92% dele; volta em initGame(). */
#game-screen.behind-modal {
    visibility: hidden;
}
#game-screen.behind-modal,
#game-screen.behind-modal * {
    animation-play-state: paused !important;
}

.mvp-trophy-badge {
    position: absolute;
    top: 10px;
    right: 15px;
    background: linear-gradient(135deg, #ffd700, #ff9800);
    color: #111;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 4px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.mvp-card-body {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.mvp-avatar-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    overflow: hidden;
    flex-shrink: 0;
    background: #0d1117;
}

.mvp-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mvp-details {
    flex: 1;
    min-width: 240px;
    text-align: left;
}

.mvp-name {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: #ffffff;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    line-height: 1.1;
    margin-bottom: 4px;
}

.mvp-team-badge {
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.mvp-team-badge.player {
    background: rgba(52, 152, 219, 0.25);
    border: 1px solid #3498db;
    color: #64b5f6;
}

.mvp-team-badge.enemy {
    background: rgba(231, 76, 60, 0.25);
    border: 1px solid #e74c3c;
    color: #e57373;
}

.mvp-highlights-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mvp-highlight-item {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.mvp-highlight-item .hl-value {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: #ffd700;
    line-height: 1;
}

.mvp-highlight-item .hl-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 3px;
    font-weight: 600;
}

/* Condecorações e Honras */
.post-battle-honors-section {
    background: rgba(18, 22, 33, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: left;
}

.honors-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.honors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.honor-badge-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 12px;
    transition: background 0.2s;
}

/* Sem translateY no hover (desempenho): ao rolar, o cursor passava pelos cards e disparava animações */
.honor-badge-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.honor-badge-card.player {
    border-left: 3px solid #3498db;
}

.honor-badge-card.enemy {
    border-left: 3px solid #e74c3c;
}

.honor-icon {
    font-size: 1.5rem;
}

.honor-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.honor-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Barra de Comparação de Dano Total */
.team-comparison-bar-container {
    background: rgba(15, 18, 27, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.team-comparison-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
}

.team-label.ally-label {
    color: #42a5f5;
}

.team-label.enemy-label {
    color: #ef5350;
}

.team-comparison-track {
    display: flex;
    height: 18px;
    width: 100%;
    border-radius: 9px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.team-bar-fill {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 900;
    color: #fff;
    transition: width 0.8s ease-out;
}

.team-bar-fill.ally-fill {
    background: linear-gradient(90deg, #1976d2, #42a5f5);
}

.team-bar-fill.enemy-fill {
    background: linear-gradient(90deg, #e53935, #ef5350);
}

/* Grade Detalhada por Ninja */
.teams-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
    width: 100%;
}

.team-stats-column {
    background: rgba(15, 19, 28, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.team-column-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.team-column-title.ally-title {
    color: #64b5f6;
}

.team-column-title.enemy-title {
    color: #e57373;
}

.team-score-badge {
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ninjas-stat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-ninja-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: border-color 0.2s;
}

.stat-ninja-card.is-mvp {
    border-color: rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.06), rgba(255, 255, 255, 0.02));
}

.stat-ninja-card.fallen {
    opacity: 0.75;
}

.stat-ninja-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-ninja-avatar {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    background: #000;
}

.stat-ninja-card.is-mvp .stat-ninja-avatar {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.stat-ninja-info {
    flex: 1;
}

.stat-ninja-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-mvp-badge {
    font-size: 0.65rem;
    background: #ffd700;
    color: #111;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.stat-ninja-status {
    font-size: 0.75rem;
    margin-top: 2px;
}

.stat-ninja-status.status-alive {
    color: #81c784;
}

.stat-ninja-status.status-dead {
    color: #e57373;
}

.stat-bars-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-bar-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.stat-bar-value {
    color: #fff;
}

.stat-progress-bg {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
}

.stat-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.stat-progress-fill.damage-fill {
    background: linear-gradient(90deg, #ff7b00, #ff3d00);
}

.stat-progress-fill.heal-fill {
    background: linear-gradient(90deg, #00c853, #69f0ae);
}

.stat-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.stat-mini-chip {
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cfd8dc;
    padding: 2px 7px;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .modal-content.post-battle-modal-content {
        padding: 20px 14px;
    }
    .teams-stats-grid {
        grid-template-columns: 1fr;
    }
    .mvp-card-body {
        justify-content: center;
        text-align: center;
    }
    .mvp-details {
        text-align: center;
    }
    .mvp-highlights-row {
        justify-content: center;
    }
}



/* ==========================================================================
   SISTEMA DE PALAVRAS-CHAVE & MECÂNICAS AVANÇADAS (SHIELD, TAGS, STUN CATEGORIA)
   ========================================================================== */

/* Barra de Escudo (Vida Temporária / Shield Pool) */
.shield-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
    transition: width 0.3s ease;
    z-index: 1;
    pointer-events: none;
    opacity: 0.85;
}

/* Status Ícones Específicos */
.status-icon.status-shield {
    background: rgba(14, 165, 233, 0.4);
    border-color: #38bdf8;
    color: #38bdf8;
}

.status-icon.status-category-stun {
    background: rgba(234, 179, 8, 0.4);
    border-color: #eab308;
    color: #fef08a;
}

.status-icon.status-invulnerable {
    background: rgba(168, 85, 247, 0.4);
    border-color: #c084fc;
    color: #f3e8ff;
}

/* Textos Flutuantes de Dano e Mecânicas Novas */
.floating-text.pierce-damage-text {
    color: #00e5ff;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.8);
    font-weight: 900;
}

.floating-text.true-damage-text {
    color: #c084fc;
    text-shadow: 0 0 10px rgba(192, 132, 252, 0.9);
    font-weight: 900;
}

.floating-text.shield-damage-text {
    color: #38bdf8;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
    font-weight: 800;
}

.floating-text.invulnerable-text {
    color: #f472b6;
    text-shadow: 0 0 10px rgba(244, 114, 182, 0.9);
    font-weight: 900;
}

.floating-text.category-stun-text {
    color: #facc15;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.8);
    font-weight: 900;
}

.floating-text.mental-text {
    color: #e879f9;
    text-shadow: 0 0 10px rgba(217, 70, 239, 0.9);
    font-weight: 900;
}

/* Botão Bloqueado por Atordoamento de Categoria */
.skill-btn.stun-locked {
    opacity: 0.4 !important;
    filter: grayscale(0.9) !important;
    cursor: not-allowed !important;
    border-color: rgba(234, 179, 8, 0.8) !important;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.5) inset !important;
}

/* Linha de Tags / Palavras-chave dos Jutsus */
.jutsu-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0 2px 0;
}

.jutsu-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.45);
    color: #e2e8f0;
    white-space: nowrap;
}

/* Cores das Tags */
.jutsu-tag.tag-taijutsu { color: #f97316; border-color: rgba(249, 115, 22, 0.4); background: rgba(249, 115, 22, 0.15); }
.jutsu-tag.tag-ninjutsu { color: #3b82f6; border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.15); }
.jutsu-tag.tag-genjutsu { color: #a855f7; border-color: rgba(168, 85, 247, 0.4); background: rgba(168, 85, 247, 0.15); }
.jutsu-tag.tag-melee { color: #ef4444; border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.15); }
.jutsu-tag.tag-ranged { color: #06b6d4; border-color: rgba(6, 182, 212, 0.4); background: rgba(6, 182, 212, 0.15); }
.jutsu-tag.tag-unico { color: #e2e8f0; border-color: rgba(226, 232, 240, 0.3); background: rgba(255, 255, 255, 0.08); }
.jutsu-tag.tag-aoe { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.15); }
.jutsu-tag.tag-dps { color: #f43f5e; border-color: rgba(244, 63, 94, 0.4); background: rgba(244, 63, 94, 0.15); }
.jutsu-tag.tag-piercing { color: #00e5ff; border-color: rgba(0, 229, 255, 0.5); background: rgba(0, 229, 255, 0.18); font-weight: 900; }
.jutsu-tag.tag-true_dmg, .jutsu-tag.tag-true-dmg { color: #c084fc; border-color: rgba(192, 132, 252, 0.6); background: rgba(192, 132, 252, 0.2); font-weight: 900; }
.jutsu-tag.tag-stun { color: #facc15; border-color: rgba(250, 204, 21, 0.4); background: rgba(250, 204, 21, 0.15); }
.jutsu-tag.tag-shield { color: #38bdf8; border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.15); }
.jutsu-tag.tag-invulneravel { color: #ec4899; border-color: rgba(236, 72, 153, 0.5); background: rgba(236, 72, 153, 0.2); }
.jutsu-tag.tag-counter { color: #10b981; border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.15); }
.jutsu-tag.tag-reflect { color: #8b5cf6; border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.15); }
.jutsu-tag.tag-mental { color: #d946ef; border-color: rgba(217, 70, 239, 0.5); background: rgba(217, 70, 239, 0.18); font-weight: 800; }
.jutsu-tag.tag-heal, .jutsu-tag.tag-regen { color: #22c55e; border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.15); }
/* Aviso de falha ao carregar data/characters.js (tela de seleção) */
.data-load-error {
    grid-column: 1 / -1;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #e74c3c;
    background: rgba(231, 76, 60, 0.15);
    color: #ffd2cc;
    text-align: center;
    line-height: 1.5;
}
/* ==========================================================================
   PERGAMINHO DE HABILIDADE & BATALHA EM TELA CHEIA
   Painel #skill-info-panel acima do log (detalhes da skill clicada, sua ou do inimigo, e confirmação
   das instantâneas). Em telas largas o campo de batalha + pergaminho cabem na altura da janela sem
   rolar; só o log fica abaixo da dobra.
   ========================================================================== */

.skill-info-panel {
    position: relative;
    height: var(--sp, 140px);
    padding: 0 14px;
    flex-shrink: 0;
}

.skill-scroll-paper {
    position: relative;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(180deg, #f8ead0 0%, #efdcb2 55%, #e0c48e 100%);
    border-top: 4px solid #b3261e;
    border-bottom: 4px solid #b3261e;
    box-shadow: inset 0 0 18px rgba(120, 72, 20, 0.35), 0 6px 18px rgba(0, 0, 0, 0.55);
    color: #2b1a0c;
    overflow: hidden;
}

/* Rolos de madeira nas pontas do pergaminho */
.skill-scroll-rod {
    position: absolute;
    top: -7px;
    bottom: -7px;
    width: 20px;
    border-radius: 10px;
    background: linear-gradient(90deg, #4a250c, #c08a45 45%, #6b3a14 70%, #2e1606);
    border: 2px solid #1d0e04;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    z-index: 2;
    pointer-events: none;
}

.skill-scroll-rod::before,
.skill-scroll-rod::after {
    content: '';
    position: absolute;
    left: 2px;
    width: 12px;
    height: 7px;
    border-radius: 3px;
    background: #2e1606;
}

.skill-scroll-rod::before { top: -6px; }
.skill-scroll-rod::after { bottom: -6px; }
.rod-left { left: 2px; }
.rod-right { right: 2px; }

/* Abertura do pergaminho a cada habilidade mostrada (curta e finita; prefers-reduced-motion encurta) */
.skill-info-panel.unrolling .skill-scroll-paper { animation: scrollUnroll 0.4s ease-out both; }
.skill-info-panel.unrolling .rod-left { animation: rodUnrollLeft 0.4s ease-out both; }
.skill-info-panel.unrolling .rod-right { animation: rodUnrollRight 0.4s ease-out both; }

@keyframes scrollUnroll {
    from { clip-path: inset(0 50% 0 50%); }
    to { clip-path: inset(0 0 0 0); }
}

@keyframes rodUnrollLeft {
    from { left: calc(50% - 10px); }
    to { left: 2px; }
}

@keyframes rodUnrollRight {
    from { right: calc(50% - 10px); }
    to { right: 2px; }
}

.skill-info-content {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 32px;
}

.skill-info-empty {
    flex: 1;
    text-align: center;
    font-style: italic;
    font-weight: 600;
    font-size: 0.9rem;
    color: #6b4a26;
}

.skill-info-visual {
    position: relative;
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 3px solid #3b2208;
    overflow: hidden;
    background: #1a202c;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.skill-info-visual.enemy { border-color: #8f1d16; }

.skill-info-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.skill-info-icon {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
}

.skill-info-cd {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 2rem;
}

.skill-info-main {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
}

.skill-info-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.skill-info-name {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    letter-spacing: 1px;
    line-height: 1;
    color: #b3261e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-info-owner {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.skill-info-owner.ally { background: rgba(30, 111, 217, 0.15); color: #154c9c; border: 1px solid rgba(30, 111, 217, 0.4); }
.skill-info-owner.enemy { background: rgba(179, 38, 30, 0.12); color: #8f1d16; border: 1px solid rgba(179, 38, 30, 0.4); }

/* Tags (keywords) numa faixa escura para continuarem legíveis sobre o papel */
.skill-info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-self: flex-start;
    background: #23160b;
    padding: 3px 5px;
    border-radius: 6px;
}

.skill-info-tags .jutsu-tag {
    font-size: 0.6rem;
    padding: 1px 5px;
}

.skill-info-desc {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.3;
    font-weight: 500;
    color: #2b1a0c;
    max-height: 3.9em;
    overflow-y: auto;
}

.skill-info-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    font-size: 0.74rem;
    font-weight: 800;
    color: #5a3410;
}

.skill-info-side {
    width: 215px;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding-left: 14px;
    border-left: 1px dashed rgba(90, 52, 16, 0.4);
}

.skill-info-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 0.78rem;
    color: #3b2208;
}

.skill-info-target {
    font-size: 0.78rem;
    font-weight: 700;
    color: #3b2208;
}

.skill-info-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
}

.skill-confirm-btn,
.skill-cancel-btn {
    border-radius: 8px;
    padding: 6px 10px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.skill-confirm-btn {
    flex: 1;
    background: linear-gradient(135deg, #2f9e44, #1f7a33);
    color: #fff;
    border: 2px solid #145a24;
}

.skill-confirm-btn:hover { filter: brightness(1.12); }

.skill-cancel-btn {
    background: rgba(59, 34, 8, 0.12);
    color: #5a3410;
    border: 2px solid rgba(90, 52, 16, 0.45);
}

.skill-cancel-btn:hover { background: rgba(59, 34, 8, 0.22); }

.skill-info-actions kbd {
    font-family: inherit;
    font-size: 0.62rem;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 4px;
    padding: 1px 4px;
    margin-left: 4px;
}

.skill-info-hint {
    font-size: 0.78rem;
    font-weight: 800;
    color: #5a3410;
}

.skill-info-hint.blocked { color: #b3261e; }
.skill-info-hint.done { color: #1f7a33; }

/* Habilidades do inimigo são clicáveis (abrem o pergaminho) */
.enemy-skill-badge { cursor: pointer; }

/* Botão ⏭️ Passar (cabeçalho da batalha, ao lado do indicador de turno): passa a vez do ninja ativo */
.pass-turn-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 213, 79, 0.75);
    background: linear-gradient(135deg, rgba(255, 213, 79, 0.18), rgba(20, 24, 34, 0.92));
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s, filter 0.18s;
    white-space: nowrap;
}
.pass-turn-btn kbd {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    background: #0f131c;
    color: #ffd54f;
    border: 1px solid rgba(255, 213, 79, 0.6);
}
.pass-turn-btn:hover:not(:disabled) {
    transform: scale(1.06);
    box-shadow: 0 0 14px rgba(255, 213, 79, 0.55);
}
.pass-turn-btn.active-skill {
    border-color: #ffd54f;
    box-shadow: 0 0 16px rgba(255, 213, 79, 0.8);
}
.pass-turn-btn:disabled {
    opacity: 0.35;
    filter: grayscale(100%);
    cursor: not-allowed;
}

/* Batalha em tela cheia: campo + pergaminho na altura da janela (o log fica logo abaixo) */
@media (min-width: 993px) and (min-height: 600px) {
    #game-screen {
        --bh: 44px;   /* altura do cabeçalho da batalha */
        --sp: 140px;  /* altura do pergaminho */
        gap: 12px;
        padding-top: 14px;
    }

    #game-screen .battle-header {
        flex-direction: row;
        justify-content: center;
        height: var(--bh);
        margin-bottom: 0;
        gap: 0;
    }

    #game-screen .battle-arena-badge {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
    }

    #game-screen .ai-badge {
        position: absolute;
        right: 90px;
        top: 50%;
        transform: translateY(-50%);
    }

    #game-screen .turn-indicator {
        font-size: clamp(1.05rem, 1.55vw, 1.45rem); /* encolhe em telas estreitas: o botão Passar fica ao lado */
        letter-spacing: 2px;
        padding: 3px 26px;
        white-space: nowrap;
    }

    #game-screen .pass-turn-btn { margin-left: 14px; }

    /* Altura = janela − (margem da página + borda/padding do container + cabeçalho + pergaminho + espaços) */
    #game-screen .teams-container {
        height: calc(100vh - clamp(10px, 3vw, 25px) - 1px - clamp(16px, 3vw, 32px) - 14px - var(--bh) - 24px - var(--sp) - 12px);
        height: calc(100dvh - clamp(10px, 3vw, 25px) - 1px - clamp(16px, 3vw, 32px) - 14px - var(--bh) - 24px - var(--sp) - 12px);
        min-height: 430px;
    }

    #game-screen .team {
        min-height: 0;
        gap: 8px;
        padding: 10px 12px;
    }

    #game-screen .team-title {
        font-size: 1.2rem;
        padding-bottom: 4px;
    }

    /* O card vira "container": retrato e habilidades crescem com a altura/largura dele */
    #game-screen .team > .character-card {
        flex: 1 1 0;
        min-height: 0;
        padding: 6px 10px;
        gap: 14px;
        container-type: size;
    }

    #game-screen .character-portrait-section {
        width: clamp(105px, calc(50cqh + 12px), 128px);
    }

    #game-screen .character-image {
        width: clamp(56px, 50cqh, 108px);
        height: clamp(56px, 50cqh, 108px);
    }

    /* --sk = lado do botão de habilidade (limitado pela altura e pela largura do card;
       a largura desconta o retrato, com a mesma fórmula acima) */
    #game-screen .character-skills-section {
        --sk: clamp(48px, min(50cqh, calc((100cqi - clamp(105px, calc(50cqh + 12px), 128px) - 42px) / 5.56)), 96px);
        gap: calc(var(--sk) * 0.14);
        justify-content: space-evenly;
        overflow: visible; /* botões já cabem; evita a barra de rolagem causada pelas dicas ocultas */
    }

    #game-screen .skill-btn,
    #game-screen .enemy-skill-badge {
        width: var(--sk);
        height: var(--sk);
        border-radius: calc(var(--sk) * 0.18);
    }

    #game-screen .skill-btn img,
    #game-screen .enemy-skill-badge img,
    #game-screen .skill-btn .cooldown-overlay,
    #game-screen .enemy-skill-badge .cooldown-overlay {
        border-radius: calc(var(--sk) * 0.15);
    }

    #game-screen .skill-btn .cooldown-overlay,
    #game-screen .enemy-skill-badge .cooldown-overlay {
        font-size: calc(var(--sk) * 0.46);
    }

    #game-screen .chakra-cost {
        font-size: clamp(0.7rem, calc(var(--sk) * 0.17), 0.95rem);
        padding: 1px calc(var(--sk) * 0.08);
    }

    #game-screen .hotkey-badge {
        width: clamp(17px, calc(var(--sk) * 0.27), 24px);
        height: clamp(17px, calc(var(--sk) * 0.27), 24px);
        font-size: clamp(0.65rem, calc(var(--sk) * 0.15), 0.85rem);
    }

    #game-screen .status-icons {
        min-height: 0;
        margin-top: 2px;
    }

    #game-screen .status-bars {
        margin-top: 3px;
        gap: 3px;
    }

    #game-screen .bar-container { height: clamp(12px, 7.5cqh, 18px); }
    #game-screen .bar-text { font-size: clamp(0.65rem, 5.2cqh, 0.82rem); }

    #game-screen .character-skills-section {
        min-height: 0;
        padding: 8px 12px;
        align-self: stretch;
    }
}

/* Cabeçalho da batalha entre 993 e 1279px: sem espaço para o selo "🧠 IA Ninja" (decorativo) ao lado de
   indicador de turno + botão Passar */
@media (min-width: 993px) and (max-width: 1279px) and (min-height: 600px) {
    #game-screen .ai-badge { display: none; }
}

/* Telas largas (ex.: 1920×1080): durante a batalha o container passa de 1360px para até 1720px,
   para os cards ficarem mais largos e as habilidades crescerem junto com a altura */
@media (min-width: 1500px) and (min-height: 600px) {
    .container:has(> #game-screen[style*="flex"]) {
        max-width: 1720px;
    }
}

/* Telas estreitas: pergaminho cresce com o conteúdo e a coluna lateral desce */
@media (max-width: 992px) {
    .skill-info-panel { height: auto; }
    .skill-info-content { flex-wrap: wrap; padding: 12px 30px; }
    .skill-info-main { height: auto; }
    .skill-info-head { flex-wrap: wrap; gap: 4px 8px; }
    .skill-info-name { white-space: normal; }
    .skill-info-desc { max-height: none; }
    .skill-info-side {
        width: 100%;
        height: auto;
        padding-left: 0;
        border-left: 0;
    }
}

/* Janelas baixas (ex.: 1280×720): cards e pergaminho um pouco mais compactos para tudo caber */
@media (min-width: 993px) and (min-height: 600px) and (max-height: 760px) {
    #game-screen { --sp: 128px; }
    #game-screen .team > .character-card { padding: 4px 10px; }
    #game-screen .skill-info-visual { width: 72px; height: 72px; }
}
