:root {
    --bg: #15151a;
    --surface: #212129;
    --text: #e8e6e3;
    --muted: #9a98a0;
    --accent: #b3261e;
    --accent-hover: #d4342b;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

/* Navigation */

.navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 16px;
    background: #0d0d10;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.button {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
}

.button:hover {
    background: var(--accent-hover);
}

.nav-links .button,
.button-secondary {
    background: var(--surface);
}

.nav-links .button:hover,
.button-secondary:hover {
    background: #2e2e38;
}

/* Loadout */

.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0 16px;
}

.toolbar .button {
    font-size: 18px;
    padding: 12px 28px;
}

.seed {
    color: var(--muted);
    font-family: ui-monospace, monospace;
}

.loadout {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.card {
    margin: 0;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    text-align: center;
}

.card figcaption {
    margin-top: 8px;
}

.portrait {
    flex: 0 1 240px;
}

.portrait img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

.portrait figcaption {
    font-size: 20px;
    font-weight: 600;
}

.perks,
.equipment-row {
    flex: 1 1 min(400px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 16px;
}

.icon {
    width: 128px;
    height: 128px;
    margin: 0 auto;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

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

.win-condition {
    flex: 1 1 min(260px, 100%);
    text-align: left;
}

.win-condition h2 {
    margin: 0 0 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.difficulty {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
    color: #15151a;
}

.difficulty-easy {
    background: #7fc97f;
}

.difficulty-medium {
    background: #f0c75e;
}

.difficulty-hard {
    background: #e8735a;
}

.difficulty-fun {
    background: #b79cf2;
}

.win-condition-name {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 4px;
}

.hint {
    color: var(--muted);
    align-self: center;
}

.notice {
    max-width: 560px;
    margin: 48px auto;
    padding: 24px;
}

/* Smartphones */

@media (max-width: 480px) {
    .perks,
    .equipment-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .icon {
        width: 96px;
        height: 96px;
    }

    .portrait {
        flex-basis: 100%;
    }

    .portrait img {
        max-width: 240px;
    }
}
