/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    min-height: 100vh;
}

/* ── Pixel art ─────────────────────────────────────────────── */
.pixel-art {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ── Layout ────────────────────────────────────────────────── */
#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    text-align: center;
    padding: 1.5rem 0 .5rem;
}
header h1 {
    font-size: 1.8rem;
    color: #e6edf3;
}
.subtitle {
    color: #8b949e;
    margin-top: .3rem;
}

/* ── States ────────────────────────────────────────────────── */
.state { text-align: center; }

#loading p { color: #8b949e; margin-top: 1rem; }
.spinner {
    width: 40px; height: 40px;
    margin: 3rem auto 0;
    border: 4px solid #30363d;
    border-top-color: #d4a726;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Category badge ────────────────────────────────────────── */
.category-badge {
    text-align: center;
    margin: 1rem 0;
}
.category-badge span {
    display: inline-block;
    background: #1c2333;
    border: 1px solid #30363d;
    padding: .35rem 1.2rem;
    border-radius: 20px;
    font-weight: 600;
    color: #d4a726;
    font-size: 1rem;
}

/* ── In-game preview section ───────────────────────────────── */
.preview-section {
    margin: 1rem 0 1.5rem;
}
.preview-heading {
    text-align: center;
    color: #8b949e;
    font-size: .85rem;
    margin-bottom: .5rem;
}
.preview-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.preview-wrapper {
    position: relative;
    display: inline-block;
    width: min(48%, 560px);
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}
.preview-wrapper .preview-label {
    position: absolute;
    top: 6px; right: 8px;
    background: rgba(0,0,0,.65);
    color: #c9d1d9;
    font-weight: 700;
    font-size: .85rem;
    padding: 2px 10px;
    border-radius: 4px;
    z-index: 2;
}
.preview-bg {
    width: 100%;
    display: block;
}
.laurel-overlay {
    position: absolute;
    /* Positioned inside the grey box, to the left of existing laurels */
    left: 2.5%;
    top: 0.0%;
    height: 26%;
    z-index: 1;
}

/* Hide preview on narrow screens */
@media (max-width: 700px) {
    .preview-section { display: none; }
}

/* ── Matchup grid ──────────────────────────────────────────── */
.matchup-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.submission-col {
    flex: 1 1 320px;
    max-width: 480px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
}
.sub-heading {
    font-size: 1.3rem;
    color: #e6edf3;
    margin-bottom: .6rem;
}
.vs {
    align-self: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #484f58;
    padding: 0 .4rem;
}

/* ── Notes ─────────────────────────────────────────────────── */
.notes { margin-bottom: .8rem; text-align: left; }
.note {
    font-size: .85rem;
    padding: .4rem .65rem;
    border-radius: 6px;
    margin-bottom: .4rem;
    line-height: 1.4;
}
.admin-note  { background: rgba(210,153,34,.12); color: #d29922; }
.submitter-note { background: rgba(56,139,253,.08); color: #79c0ff; }

/* ── Image grid (4 tier images per submission) ─────────────── */
.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
    margin-bottom: 1rem;
}
.tier-image {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.tier-image img {
    width: 100%;
    max-width: 140px;
    aspect-ratio: 1;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 4px;
}
.tier-label {
    font-size: .75rem;
    color: #8b949e;
    margin-top: .25rem;
}

/* On small screens, 2×2 grid */
@media (max-width: 500px) {
    .image-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Vote buttons ──────────────────────────────────────────── */
.vote-btn {
    display: inline-block;
    width: 100%;
    padding: .75rem 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.vote-btn:active { transform: scale(.97); }

.vote-a { background: #1f6feb; color: #fff; }
.vote-a:hover { background: #388bfd; }
.vote-b { background: #8b5cf6; color: #fff; }
.vote-b:hover { background: #a78bfa; }

/* ── Voted state ───────────────────────────────────────────── */
#voted h2 {
    color: #3fb950;
    margin-top: 3rem;
    font-size: 1.6rem;
}
#voted p {
    color: #8b949e;
    margin: .8rem 0;
}
.btn-again {
    background: #238636;
    color: #fff;
    border: none;
    padding: .7rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    margin-top: .5rem;
}
.btn-again:hover { background: #2ea043; }

/* ── Hint ──────────────────────────────────────────────────── */
.hint {
    text-align: center;
    color: #484f58;
    font-size: .8rem;
    margin-top: 1rem;
}
kbd {
    background: #21262d;
    border: 1px solid #30363d;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-size: .8rem;
}
