body {
    font-family: Arial, sans-serif;
    background: #0f1115;
    color: #e6e6e6;
    margin: 0;
    padding: 20px;
}

.app {
    max-width: 800px;
    margin: 0 auto;
    background: #1a1f29;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

h1,
h2,
h3 {
    color: #f5f7fa;
}

.controls,
.pokemon-card,
.summary {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
}

select {
    padding: 10px 12px;
    margin-right: 10px;
    background: #11161f;
    color: #e6e6e6;
    border: 1px solid #313846;
    border-radius: 8px;
}

button {
    padding: 10px 16px;
    margin: 6px 6px 0 0;
    cursor: pointer;
    background: #2b3442;
    color: #f5f7fa;
    border: 1px solid #3c4657;
    border-radius: 8px;
}

button:hover {
    background: #374255;
}

.pokemon-card,
.summary {
    background: #131923;
    border: 1px solid #2b3442;
    border-radius: 10px;
    padding: 18px;
}

.battle-layout {
    display: grid;
    grid-template-columns: 180px 1fr 180px;
    gap: 24px;
    align-items: center;
}

.stats-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pokemon-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
}

#pokemon-image {
    width: 100%;
    height: 100%;
    max-width: 220px;
    max-height: 220px;
    object-fit: contain;
}

.stat-card {
    background: #232b38;
    border: 1px solid #3a4558;
    border-radius: 12px;
    padding: 16px 18px;
    cursor: pointer;
    color: #f5f7fa;
    transition: 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    font-weight: bold;
}

.stat-card:hover {
    background: #2e394a;
}

.stat-card.used {
    background: #2a2f38;
    border-color: #525c6d;
    color: #9aa6ba;
    cursor: not-allowed;
    opacity: 0.7;
}

.stat-card.selected {
    position: relative;
    overflow: hidden;
    background: #232b38;
    border-color: #ff5f73;
    color: #ffffff;
}

.stat-card.selected::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 95, 115, 0.75) 0%,
        rgba(255, 95, 115, 0.75) var(--stat-fill),
        rgba(0, 0, 0, 0) var(--stat-fill)
    );
    z-index: 0;
}

.stat-card.selected span {
    position: relative;
    z-index: 1;
}

.stat-name,
.stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
}

.stat-name {
    text-align: left;
}

.stat-value {
    text-align: right;
    min-width: 32px;
}

.control-label {
    margin-bottom: 10px;
    font-weight: 600;
}

.generation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.gen-btn {
    min-width: 44px;
    padding: 10px 14px;
}

.gen-btn.active {
    background: #7a1f2b;
    border-color: #ff5f73;
    color: #ffffff;
}

.live-total {
    margin-top: 8px;
    text-align: center;
}

.live-total span {
    display: block;
    font-size: 0.95rem;
    color: #9fb3c8;
    margin-bottom: 4px;
}

#battle-total,
#total {
    font-size: 1.8rem;
    font-weight: bold;
    color: #8fd3ff;
    margin: 0;
}

.image-frame {
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #101621;
    border: 1px solid #2e394a;
    border-radius: 16px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

#play-again-btn {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 700;
    background: #7a1f2b;
    border: 1px solid #ff5f73;
    color: #fff;
    border-radius: 10px;
}

#play-again-btn:hover {
    background: #922737;
}

.result-banner {
    margin: 0 0 14px;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.result-banner.win {
    color: #7ee787;
}

.result-banner.lose {
    color: #ff7b72;
}

.result-banner {
    margin: 0 0 20px;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
}

.result-banner.win {
    color: #7ee787;
}

.result-banner.lose {
    color: #ff7b72;
}

.result-columns {
    display: grid;
    grid-template-columns: repeat(2, 300px);
    justify-content: center;
    gap: 48px;
    margin: 0 auto 20px;
    width: fit-content;
    max-width: 100%;
}

.result-column {
    background: #101621;
    border: 1px solid #2e394a;
    border-radius: 12px;
    padding: 20px 20px;
    min-width: 0;
}

.result-column h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.result-total {
    margin: 0 0 14px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #8fd3ff;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 96px);
    column-gap: 16px;
    row-gap: 12px;
    width: max-content;
    margin: 12px auto 0;
}

.result-card {
    background: #131923;
    border: 1px solid #2e394a;
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
    width: 96px;
    box-sizing: border-box;
}
.hidden {
    display: none;
}

.result-screen {
    padding-top: 8px;
}

.result-card-image {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px;
}

.result-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-card-stat {
    margin: 0;
    font-size: 0.85rem;
    color: #9fb3c8;
    font-weight: 600;
}

.result-card-value {
    margin: 0;
    font-size: 1rem;
    color: #f5f7fa;
    font-weight: 700;
}

@media (max-width: 900px) {
    body {
        padding: 6px;
    }

    .app {
        padding: 12px;
        border-radius: 10px;
    }

    h1 {
        font-size: 1.05rem;
        line-height: 1.15;
        margin-bottom: 10px;
    }

    .controls {
        margin-bottom: 10px;
    }

    .control-label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .generation-buttons {
        display: grid;
        grid-template-columns: repeat(9, 1fr);
        gap: 6px;
        margin-bottom: 10px;
    }

    .gen-btn {
        min-width: 0;
        padding: 6px 0;
        font-size: 0.75rem;
        border-radius: 6px;
    }

    .pokemon-card {
        padding: 10px;
        overflow-x: hidden;
    }

    .battle-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stats-column {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .stat-card {
        width: 100%;
        min-width: 0;
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .stat-name,
    .stat-value {
        font-size: 0.8rem;
    }

    .pokemon-center {
        gap: 10px;
    }

    #pokemon-name {
        font-size: 0.95rem;
        margin: 0;
    }

    .image-frame {
        width: 100%;
        max-width: 190px;
        height: 190px;
        padding: 8px;
        margin: 0 auto;
    }

    #pokemon-image {
        max-width: 150px;
        max-height: 150px;
    }

    .live-total span {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }

    #battle-total {
        font-size: 1.2rem;
    }

    /* MOBILE RESULT SCREEN - ULTRA COMPACT */
        .result-screen {
        padding-top: 2px;
        width: 100%;
        overflow-x: hidden;
    }

    .result-banner {
        font-size: 0.95rem;
        margin-bottom: 6px;
        line-height: 1.2;
    }

    .result-columns {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
        margin: 0 0 8px;
    }

    .result-column {
        width: 100%;
        max-width: 100%;
        padding: 8px 6px;
        border-radius: 8px;
        box-sizing: border-box;
    }

    .result-column h3 {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .result-total {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }

    .result-grid {
        display: grid;
        grid-template-columns: repeat(2, 56px);
        justify-content: center;
        column-gap: 6px;
        row-gap: 6px;
        width: max-content;
        margin: 6px auto 0;
    }

    .result-card {
        width: 56px;
        padding: 4px 3px;
        border-radius: 8px;
        box-sizing: border-box;
    }

    .result-card-image {
        width: 32px;
        height: 32px;
        margin: 0 auto 2px;
    }

    .result-card-stat {
        font-size: 0.52rem;
        margin: 0;
        line-height: 1.1;
    }

    .result-card-value {
        font-size: 0.68rem;
        margin: 0;
        line-height: 1.1;
    }

    #play-again-btn {
        margin-top: 6px;
        padding: 7px 12px;
        font-size: 0.8rem;
    }

    .hidden {
        display: none !important;
    }

    .battle-layout.hidden,
    .result-screen.hidden {
        display: none !important;
    }
}