:root {
    --sf-red: #ea1e23;
    --sf-yellow: #fef102;
    --sf-blue: #0257a0;
    --bg-dark: #1a1a1a;
    --border-color: #888;
}

body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: var(--bg-dark);
    color: white;
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* Config Screen */
#config-screen {
    background: #333;
    padding: 2rem;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.step {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.grid-config {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.char-input-group {
    display: grid;
    grid-template-columns: 30px 1fr 1fr;
    gap: 10px;
    align-items: center;
}

/* Selector Screen */
#selector-screen {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #444 0%, #000 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    /* Allow scrolling on small screens if needed */
}

.sf-header {
    text-align: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.neon-text {
    color: var(--sf-yellow);
    text-shadow: 2px 2px 0px var(--sf-red);
    /* Simple retro shadow */
    font-style: italic;
    font-size: 2rem;
    margin: 0;
}

.main-stage {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 200px;
    flex-shrink: 0;
}

.player-area {
    position: relative;
    text-align: center;
}

#p1-big-img {
    height: 600px;
    /* Increased from 300px */
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    animation: zoom-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoom-in {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.char-name-big {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px #000;
    margin-top: -30px;
    position: relative;
    z-index: 2;
    -webkit-text-stroke: 1px black;
}

/* Grid */
.character-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    max-width: 900px;
    margin-bottom: 20px;
    flex-shrink: 0;
    /* Don't squash the grid */
}

.char-slot {
    width: 70px;
    /* Adjust size based on standard grid */
    height: 90px;
    background-color: #555;
    border: 2px solid #888;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 0 10px #000;
    transition: transform 0.1s;
}

.char-slot:hover {
    border-color: white;
}

.char-slot.active {
    border: 3px solid white;
    box-shadow: 0 0 10px var(--sf-yellow), inset 0 0 10px var(--sf-yellow);
    z-index: 10;
    transform: scale(1.1);
}

.char-slot.selected {
    border: 3px solid var(--sf-red);
    animation: flash 0.2s infinite alternate, pulse-scale 0.5s forwards;
    z-index: 20;
}

.char-slot.used {
    filter: grayscale(1) brightness(0.5);
    pointer-events: none;
    border-color: #333;
}

@keyframes pulse-scale {
    0% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1.3);
    }

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

@keyframes flash {
    from {
        filter: brightness(1);
    }

    to {
        filter: brightness(1.5);
    }
}

.controls-area {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.sf-btn {
    background: linear-gradient(to bottom, #f00, #900);
    border: 2px solid #fff;
    color: white;
    font-weight: bold;
    padding: 10px 20px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 5px 0 #500;
}

.sf-btn:active {
    transform: translateY(2px);
    box-shadow: 0 3px 0 #500;
}

.sf-btn.small {
    font-size: 0.8rem;
    background: #666;
    box-shadow: 0 5px 0 #333;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .neon-text {
        font-size: 1.5rem;
    }

    .char-slot {
        width: 45px;
        height: 60px;
    }

    .character-grid {
        gap: 2px;
        max-width: 100%;
        padding: 0 5px;
    }

    #p1-big-img {
        height: 300px;
        /* Increased from 180px */
    }

    .char-name-big {
        font-size: 2rem;
        margin-top: -20px;
    }

    .main-stage {
        min-height: 180px;
    }

    .sf-btn {
        padding: 8px 16px;
        font-size: 1rem;
    }
}