* {
    box-sizing: border-box
}

:root {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #222;
    background: #f5f5f7
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f5f5f7
}

button {
    font: inherit;
    -webkit-tap-highlight-color: transparent
}

.app {
    width: 100%;
    max-width: 1100px;
    margin: auto;
    padding: 12px
}

.screen {
    display: none
}

.screen.active {
    display: block
}

#start-screen.active {
    min-height: calc(100vh - 24px);
    display: flex;
    align-items: center;
    justify-content: center
}

.hero {
    text-align: center;
    padding: 36px 20px
}

.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(32px, 8vw, 60px);
    line-height: 1.15
}

.hero p {
    margin: 0 0 28px
}

.primary-button,
.secondary-button {
    border: 0;
    border-radius: 14px;
    padding: 15px 26px;
    min-height: 52px;
    cursor: pointer;
    font-weight: 700
}

.primary-button {
    background: #222;
    color: #fff
}

.secondary-button {
    background: #ddd;
    color: #222
}

header {
    text-align: center;
    margin: 8px 0 14px
}

header h2 {
    margin: 0 0 5px;
    font-size: clamp(22px, 5vw, 32px)
}

header p {
    margin: 0;
    color: #666
}

.hint {
    text-align: center;
    margin: 10px 0 18px;
    color: #555
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px
}

.character-card {
    border: 1px solid #ddd;
    border-radius: 13px;
    background: #fff;
    padding: 7px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    transition: transform .12s ease
}

.character-card:active {
    transform: scale(.97)
}

.character-card img {
    display: block;
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: contain;
    border-radius: 9px;
    background: #eee
}

.character-card span {
    display: block;
    padding: 7px 2px 3px;
    font-weight: 700;
    font-size: clamp(11px, 2.5vw, 16px);
    line-height: 1.25
}

.picked-area {
    margin-top: 20px;
    background: #fff;
    border-radius: 13px;
    padding: 12px
}

.picked-area h3 {
    margin: 0 0 8px
}

.picked-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px
}

.picked-list li {
    display: grid;
    grid-template-columns: auto 34px 1fr;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 4px;
    background: #f3f3f3;
    border-radius: 8px;
    font-size: 11px
}

.picked-list img {
    width: 34px;
    height: 45px;
    object-fit: contain;
    border-radius: 4px
}

.picked-list span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.result-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 7px
}

.result-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 7px 10px;
    background: #fff;
    border-radius: 11px
}

.result-list img {
    width: 45px;
    height: 60px;
    object-fit: contain;
    border-radius: 5px;
    background: #eee
}

.result-list span {
    font-weight: 700
}

.result-actions {
    text-align: center;
    padding: 20px 0 35px
}

.result-actions button {
    margin: 5px
}

#vote-status {
    min-height: 1.4em;
    color: #555
}

@media(max-width:600px) {
    .app {
        padding: 8px
    }

    .card-grid {
        gap: 6px
    }

    .character-card {
        padding: 5px;
        border-radius: 10px
    }

    .character-card span {
        font-size: 11px;
        padding-top: 5px
    }

    .picked-list {
        grid-template-columns: repeat(2, 1fr)
    }

    .picked-list li {
        grid-template-columns: auto 29px 1fr;
        font-size: 10px
    }

    .picked-list img {
        width: 29px;
        height: 39px
    }
}