* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

/* ===== Layout: Sidebar + Centered Main ===== */

.sidebar {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    max-width: 36vw;
}

.sidebar-toggle {
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #aaa;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-toggle:hover {
    color: #e94560;
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.08);
}

.sidebar-toggle.active {
    color: #e94560;
    border-color: #e94560;
}

.sidebar-content {
    display: none;
    margin-top: 10px;
    background: rgba(15, 15, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 12px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    width: 34vw;
    min-width: 320px;
    max-width: 600px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.sidebar-content.open {
    display: block;
}

.sidebar-entries {
    margin-bottom: 16px;
}

/* Main content stays perfectly centered regardless of sidebar */
.main-content {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    width: 100%;
    padding: 20px;
}

/* ===== Sidebar Entries List ===== */

.options-category {
    margin-bottom: 10px;
}

.options-category:last-child {
    margin-bottom: 0;
}

.options-category h4 {
    color: #e94560;
    font-size: 0.8rem;
    margin-bottom: 4px;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(233, 69, 96, 0.3);
}

.options-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.options-table th {
    text-align: left;
    padding: 1px 3px;
    color: #888;
    font-weight: 600;
    font-size: 0.63rem;
    text-transform: uppercase;
}

.options-table td {
    padding: 1px 3px;
    color: #ccc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.options-img-cell {
    width: 112px;
}

.options-img-cell img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 4px;
}

/* ===== Sidebar Recommend ===== */

.sidebar-recommend {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.sidebar-recommend h4 {
    color: #e94560;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.sidebar-recommend input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.sidebar-recommend input:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 6px rgba(233, 69, 96, 0.3);
}

.sidebar-recommend input::placeholder {
    color: #666;
}

.btn-rec {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: #e94560;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-rec:hover {
    background: #c73652;
}

.rec-status {
    font-size: 0.75rem;
    margin-top: 4px;
    min-height: 1em;
}

.rec-status.success {
    color: #4ecdc4;
}

.rec-status.error {
    color: #e94560;
}

/* ===== Main Voting UI ===== */

h1 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 8px;
    color: #e94560;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}

.subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 20px;
}

.stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
    font-size: 1rem;
    color: #ccc;
}

.stat strong {
    color: #e94560;
    font-size: 1.2rem;
}

/* Matchup Area */
.matchup {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
}

.card {
    flex: 1;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.3);
}

.card:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.card.selected {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.15);
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.3);
}

.card:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.3);
}

.card-image {
    width: 256px;
    height: 256px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-image .no-image {
    font-size: 3rem;
    opacity: 0.3;
}

.card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.card-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ffffff;
    line-height: 1.2;
}

.card-franchise {
    font-size: 1rem;
    color: #aaa;
    font-style: italic;
}

/* VS Badge */
.vs-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: #e94560;
    text-shadow: 0 0 15px rgba(233, 69, 96, 0.5);
    min-width: 50px;
}

/* Skip Button */
.skip-row {
    text-align: center;
    margin-bottom: 16px;
}

.btn-skip {
    padding: 8px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #999;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-skip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

/* Hint text */
.hint {
    text-align: center;
    font-size: 0.8rem;
    color: #555;
}

/* Feedback animation */
@keyframes voteFlash {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.card.flash {
    animation: voteFlash 0.3s ease;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .sidebar {
        position: static;
        max-width: 100%;
        margin-bottom: 16px;
        padding: 0 20px;
    }

    .sidebar-content {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        max-height: 50vh;
    }

    .main-content {
        min-height: auto;
    }
}

@media (max-width: 700px) {
    .matchup {
        flex-direction: column;
        align-items: center;
    }

    .card {
        max-width: 100%;
        width: 100%;
        min-height: 200px;
    }

    .vs-badge {
        min-width: auto;
        padding: 8px 0;
    }

    .card-image {
        width: 100px;
        height: 100px;
    }

    .card-name {
        font-size: 1.2rem;
    }

    h1 {
        font-size: 1.6rem;
    }
}