@font-face {
    font-family: 'Font Geist Mono';
    src: url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');
}

:root {
    --character-width: 120px;
    --character-height: 200px;
}

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: white;
    touch-action: manipulation;
    user-select: none;
}

.font-geist-mono {
    font-family: 'Font Geist Mono', monospace;
}

/* Character Selection */
.character-card {
    position: relative;
    width: 120px;
    height: 160px;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: rgba(30, 41, 59, 0.7);
    border: 2px solid transparent;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.character-card.selected {
    border-color: #3b82f6;
    transform: scale(1.05);
    box-shadow: 0 0 15px 5px rgba(59, 130, 246, 0.3);
}

.character-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.character-card .character-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* Game Arena */
.character-sprite {
    position: absolute;
    width: var(--character-width);
    height: var(--character-height);
    z-index: 10;
    transition: transform 0.1s ease;
}

.character-sprite .sprite-container {
    width: 100%;
    height: 100%;
    position: relative;
    transform-origin: bottom center;
}

.character-sprite img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    bottom: 0;
}

.character-sprite .character-name {
    position: absolute;
    top: -35px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
}

.character-sprite .health-bar {
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 6px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.character-sprite .health-fill {
    height: 100%;
    background-color: #10b981;
    transition: width 0.3s ease;
}

.character-sprite .energy-bar {
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
}

.character-sprite .energy-fill {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.flash {
    animation: flash 0.5s ease-in-out;
}

.float {
    animation: float 3s infinite ease-in-out;
}

/* Effects */
.damage-text {
    position: absolute;
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.8);
    z-index: 100;
    pointer-events: none;
    animation: floatUp 1s forwards ease-out;
    opacity: 0;
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}

.special-effect {
    position: absolute;
    z-index: 20;
    pointer-events: none;
}

/* Mobile Controls */
.direction-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.direction-pad .middle-row {
    display: flex;
    gap: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.control-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(59, 130, 246, 0.2);
    border: 2px solid rgba(59, 130, 246, 0.5);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.control-button:active {
    background-color: rgba(59, 130, 246, 0.5);
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    :root {
        --character-width: 80px;
        --character-height: 140px;
    }
    
    .character-card {
        width: 100px;
        height: 140px;
    }
    
    #mobile-controls {
        display: block;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Glass Effect */
.glass {
    background: rgba(17, 25, 40, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
