/* Apex randomizer pieces only. Page layout, header, nav and footer come from ../style.css */

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.controls button {
    border: 1px solid #242424;
    color: #fff;
    background: #242424;
    padding: 12px 18px;
    border-radius: 6px;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.controls button:hover {
    background: #444;
}

.controls button.secondary {
    background: #fff;
    color: #333;
    border-color: #ccc;
}

.controls button.secondary:hover {
    background: #e9e9e9;
}

.result-grid,
.result-grid * {
    box-sizing: border-box;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    min-height: 340px;
}

.legend-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 18px;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.portrait-wrap {
    height: 220px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: #242424;
    overflow: hidden;
}

.portrait {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.fallback-portrait {
    width: 138px;
    height: 138px;
    display: none;
    place-items: center;
    border-radius: 50%;
    border: 2px solid #555;
    color: #fff;
    font-size: 4rem;
    font-weight: bold;
}

.legend-info {
    padding-top: 18px;
}

.legend-name {
    margin: 0;
    font-size: 1.6rem;
}

.empty-state {
    grid-column: 1 / -1;
    border: 1px dashed #ccc;
    border-radius: 6px;
    min-height: 340px;
    display: grid;
    place-items: center;
    text-align: center;
    color: #777;
    padding: 24px;
}

footer p {
    margin: 4px 0;
}

@media (max-width: 820px) {
    .result-grid {
        grid-template-columns: 1fr;
    }
}
