/* ═══════════════════════════════════════════════════════════
   base.css — Consolidated
   Foundation styles: CSS reset, typography, layout, color variables, responsive breakpoints
   Generated by Scripts/consolidate-css.js
   Source files: base.css
   ═══════════════════════════════════════════════════════════ */

/* ─── Source: base.css ───────────────────────────────── */

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --bg-color: #1a1a1a;
    --text-color: #fff;
    --success-color: #51cf66;
    --danger-color: #ff8787;
}

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

html,
body {
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
}

#gameContainer {
    width: 100%;
    height: 100%;
    position: relative;
}

.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 1;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen.hidden {
    display: none;
    opacity: 0;
}

/* Skill Level Up Notifications */
.skill-level-up-notification {
    animation: skillLevelUpPulse 0.5s ease-in-out;
}

@keyframes skillLevelUpPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* TITLE SCREEN */
.titleContent {
    text-align: center;
    color: var(--text-color);
}

.titleContent h1 {
    font-size: 4rem;
    margin-bottom: 3rem;
    text-shadow: 2px 2px 4px rgb(0 0 0 / 80%);
    color: var(--primary-color);
}

.titleMenu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

.titleBtn,
.battleMenuBtn,
.itemSelectBtn,
.captureBtn,
.backBtn,
.continueBtn,
.learnMoveBtn,
.settingsBtn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: linear-gradient(135deg, var(--primary-color), #e05555);
    color: white;
    font-weight: bold;
    box-shadow:
        0 2px 8px rgb(0 0 0 / 30%),
        inset 0 1px 0 rgb(255 255 255 / 15%);
    position: relative;
}

.titleBtn:hover,
.battleMenuBtn:hover,
.itemSelectBtn:hover,
.captureBtn:hover,
.backBtn:hover,
.continueBtn:hover,
.learnMoveBtn:hover,
.settingsBtn:hover {
    background: linear-gradient(135deg, var(--secondary-color), #3dbdb5);
    transform: translateY(-1px);
    box-shadow:
        0 4px 14px rgb(0 0 0 / 40%),
        inset 0 1px 0 rgb(255 255 255 / 25%);
}

.titleBtn:active,
.battleMenuBtn:active,
.itemSelectBtn:active,
.captureBtn:active,
.backBtn:active,
.continueBtn:active,
.learnMoveBtn:active,
.settingsBtn:active {
    transform: translateY(1px) scale(0.97);
    box-shadow:
        0 1px 4px rgb(0 0 0 / 40%),
        inset 0 3px 6px rgb(0 0 0 / 35%);
    transition: all 0.05s ease;
}

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

.titleBtn:disabled,
.captureBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.battleMenuBtn.full-release-ready {
    background: linear-gradient(45deg, #f0f, #f0a);
    color: #fff;
    font-weight: bold;
    animation: fullReleaseButtonPulse 1s infinite;
    box-shadow: 0 0 15px rgb(255 0 255 / 60%);
}

@keyframes fullReleaseButtonPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* CHARACTER SELECT SCREEN */
#selectScreen {
    background: linear-gradient(135deg, #0a0a1a, #1a0a2e, #0a1a2e, #0a0a1a);
    background-size: 400% 400%;
    animation: selectBgShift 20s ease infinite;
}

@keyframes selectBgShift {
    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.selectContent {
    width: 95%;
    height: 95%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.selectContent h2 {
    font-size: 2.8rem;
    text-align: center;
    color: var(--primary-color);
    text-shadow: 0 0 30px rgb(255 107 107 / 40%);
    letter-spacing: 3px;
}

.characterGrid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 2.5rem;
    overflow-y: auto;
    flex: 1;
    padding: 1rem 2rem;
    padding-right: 2.5rem;
}

.characterCard {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border-radius: 18px;
    overflow: visible;
    opacity: 0;
    transform: translateY(40px);
    animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: var(--card-delay, 0s);
    transition:
        filter 0.3s ease,
        transform 0.3s ease;
}

@keyframes cardEntrance {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.characterCard img {
    width: 300px;
    height: 380px;
    object-fit: contain;
    border-radius: 18px;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgb(255 255 255 / 3%);
}

/* Name overlay badge at bottom of image */
.characterCard .nameOverlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgb(0 0 0 / 88%));
    padding: 2.2rem 1rem 0.75rem;
    text-align: center;
    font-size: 1.05rem;
    font-weight: bold;
    color: #fff;
    border-radius: 0 0 18px 18px;
    letter-spacing: 0.5px;
}

/* Stat preview pills - appear on hover */
.characterCard .statPreview {
    position: absolute;
    top: 10px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.25s ease;
    pointer-events: none;
    z-index: 2;
}

.characterCard:hover .statPreview {
    opacity: 1;
    transform: translateY(0);
}

.statPreview .statPill {
    font-size: 0.68rem;
    font-weight: bold;
    padding: 3px 9px;
    border-radius: 100px;
    background: rgb(0 0 0 / 78%);
    backdrop-filter: blur(4px);
    color: #fff;
    white-space: nowrap;
    border: 1px solid rgb(255 255 255 / 15%);
}

.statPreview .statPill.hp {
    color: #4ecdc4;
}

.statPreview .statPill.mp {
    color: #74b9ff;
}

.statPreview .statPill.str {
    color: #ff6b6b;
}

.statPreview .statPill.agi {
    color: #f39c12;
}

.statPreview .statPill.element {
    color: #ffd700;
}

/* Hover effects */
.characterCard:hover img {
    transform: scale(1.06);
    filter: brightness(1.1);
}

.characterCard:hover {
    filter: drop-shadow(0 0 25px var(--glow-color, rgb(255 107 107 / 50%)));
}

/* Selection confirmation pulse */
.characterCard.selected {
    animation: selectPulse 0.7s ease-in-out;
    pointer-events: none;
}

@keyframes selectPulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    30% {
        transform: scale(1.12);
        filter: brightness(1.6) drop-shadow(0 0 40px var(--glow-color, #ff6b6b));
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Dim unselected cards during confirmation */
.characterCard.dimmed {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════
   IMAGE PROTECTION — Anti-theft measures
   ═══════════════════════════════════════════════════════════ */

/* Prevent dragging and selection on all images.
   NOTE: pointer-events is NOT set here — we rely on the document-level
   contextmenu/dragstart listeners in image-protection.js which check
   e.target.nodeName === 'IMG'. Setting pointer-events: none would make
   e.target point to the parent instead, breaking the check. */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Transparent overlay on static HTML image containers.
   The ::after pseudo-element catches right-clicks / drags by sitting
   on top of the image. The image inside remains visible.
   
   NOTE: .broImage is excluded because it already uses ::after for its
   capture sparkle animation (defined in screens.css, which loads after
   base.css and would override this rule). Right-click + drag prevention
   still protects broImage images. */
.characterPosition,
.statusCharImage {
    position: relative;
}

.characterPosition::after,
.statusCharImage::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    /* Transparent overlay catches right-clicks / drags on the image */
}

/* Lazy loading fade-in effect.
   .img-loading starts blurry + dim; .img-loaded transitions to clear + bright.
   This creates a subtle placeholder-like feel while images load. */
.img-loading {
    opacity: 0.3;
    filter: blur(8px);
    transition:
        opacity 0.4s ease,
        filter 0.4s ease;
}

.img-loaded {
    opacity: 1;
    filter: blur(0);
}

/* ─── End Image Protection ─────────────────────────────── */

/* SCROLLBAR STYLING */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgb(255 255 255 / 10%);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* RESPONSIVE */
@media (width <= 1024px) {
    .battleContainer {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        grid-template-areas: 'left' 'center' 'right';
    }

    .battleLeftPanel {
        flex-flow: row wrap;
        max-width: none;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
    }

    .battleLeftPanel .battleMenu {
        flex-flow: row wrap;
        justify-content: center;
    }

    .battleLeftPanel .battleMenuBtn {
        width: auto;
        text-align: center;
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
    }

    .battleRightPanel {
        flex-flow: row wrap;
        max-width: none;
        align-items: center;
        justify-content: center;
    }

    .battleField {
        padding: 0.5rem 1rem;
        gap: 1.5rem;
    }

    .characterPosition img {
        max-width: min(450px, 48vw);
        max-height: min(450px, 55vh);
        width: auto;
        height: auto;
        object-fit: contain;
    }
}
