body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #111;
    font-family: monospace;
}

.arena {
    width: 800px;
    height: 400px;
    border: 2px solid #444;
    position: relative;
    background: linear-gradient(45deg, #2c3e50, #34495e);
    overflow: hidden;
}

.stats {
    position: absolute;
    top: 10px;
    color: #fff;
    width: 100%;
    text-align: center;
    text-shadow: 2px 2px 2px #000;
    font-size: 18px;
    font-weight: bold;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 3px;
    max-height: 70vh;
    overflow-y: auto;
}

.character-card {
    border: 1px solid #444;
    padding: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 70px;
    overflow: hidden;
}

.character-card:hover {
    transform: scale(1.05);
    border-color: #0f0;
}

.character-card.selected {
    border-color: yellow;
    background: rgba(255, 255, 0, 0.2);
}

.character-card img {
    max-width: 30px;
    max-height: 30px;
    object-fit: contain;
}

.character-card div {
    font-size: 6px;
    margin-top: 1px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.robot {
    width: 100px;
    height: 120px;
    position: absolute;
    bottom: 20px;
    transition: left 0.5s, transform 0.3s, bottom 0.3s;
}

.robot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.health-bar {
    position: absolute;
    top: -20px;
    width: 100%;
    height: 10px;
    background: #333;
}

.health-remaining {
    height: 100%;
    background: #0f0;
    transition: width 0.3s;
}

.jumping {
    animation: jump 0.5s ease-out;
}

@keyframes jump {
    0% { bottom: 20px; }
    50% { bottom: 150px; }
    100% { bottom: 20px; }
}

.speech-bubble {
    position: absolute;
    top: -50px;
    width: 150px;
    left: 50%;
    transform: translateX(-50%);
    color: yellow;
    text-shadow: 2px 2px 2px black;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
}

.combo-text {
    position: absolute;
    color: red;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 2px black;
    animation: fadeOut 1s forwards;
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-50px); }
}

.explosion {
    position: absolute;
    width: 100px;
    height: 100px;
    animation: explode 0.5s forwards;
    opacity: 0;
}

@keyframes explode {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.screen {
    display: none;
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    text-align: center;
    max-width: 800px;
    width: 100%;
}

.back-button {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 10px 20px;
    background-color: #ff4136;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.back-button:hover {
    background-color: #ff6b5b;
}

.team-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    position: absolute;
    bottom: 20px;
}

.team-side {
    display: flex;
    gap: 20px;
}

.winner-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    color: white;
    text-shadow: 2px 2px 4px black;
    z-index: 10;
}

#win-screen {
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    text-align: center;
}

.win-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.win-message {
    font-size: 48px;
    margin-bottom: 20px;
    color: #00ff00;
}

.winning-team-details {
    font-size: 24px;
    margin-bottom: 30px;
}

.win-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.win-actions button {
    padding: 10px 20px;
    font-size: 18px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.win-actions button:hover {
    background-color: #45a049;
}

#character-select {
    color: white;
}

#character-select h1 {
    color: white;
}

#character-select .character-card div {
    color: white;
}

#character-select .selected-team {
    color: white;
}

#team-size-select label {
    color: white;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    padding: 5px;
    max-height: 50vh;
    overflow-y: auto;
}

.map-card {
    border: 2px solid #444;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    max-height: 150px;
}

.map-card:hover {
    transform: scale(1.05);
    border-color: #0f0;
}

.map-card.selected {
    border-color: yellow;
    background: rgba(255, 255, 0, 0.2);
}

.map-card img {
    max-width: 70px;
    max-height: 70px;
    object-fit: cover;
    margin-bottom: 5px;
}

.map-card div {
    margin-top: 3px;
    font-size: 10px;
}

.map-description {
    color: #aaa;
    font-style: italic;
    font-size: 8px;
}

.punch-effect {
    position: absolute;
    pointer-events: none;
    animation: punch-animation 0.5s ease-out;
    opacity: 1;
    transform-origin: center;
}

.punch-spark,
.punch-impact,
.punch-explosion {
    width: 50px;
    height: 50px;
}

@keyframes punch-animation {
    0% { 
        opacity: 1; 
        transform: scale(0.5);
    }
    70% { 
        opacity: 0.7; 
        transform: scale(1.2);
    }
    100% { 
        opacity: 0; 
        transform: scale(1.5);
    }
}

.character-search {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #444;
    background-color: #222;
    color: white;
    font-size: 16px;
    box-sizing: border-box;
}

.character-search:focus {
    outline: none;
    border-color: #0f0;
}