@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    --dark-bg: #1a2332;
    --darker-bg: #0f1419;
    --accent-green: #6ee7b7;
    --accent-teal: #5eead4;
    --accent-blue: #3b82f6;
    --text-primary: #f8fafc;
    --text-secondary: #bfc9d6;
    --border-color: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--darker-bg);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
}

body.menu-open {
    overflow: hidden;
}

/* Navigation */
nav {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--dark-bg);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-primary);
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo span {
    font-family: 'Cinzel', serif;
    font-weight: 500;
}

.logo-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 1.1rem;
    font-family: 'Cinzel', serif;
}

.nav-links a:hover {
    color: var(--accent-green);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10000;
    position: relative;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 20px;
}

header {
    text-align: center;
    margin-bottom: 50px;
}

h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5em;
    color: var(--accent-green);
    margin-bottom: 15px;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.1em;
    color: var(--text-secondary);
    font-style: italic;
}

/* World Options */
.world-option {
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    padding: 30px;
    background: rgba(30, 41, 59, 0.6);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.world-option:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--accent-green);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Rank indicator */
.rank-indicator {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.world-content {
    flex: 1;
}

/* Ranked states */
.world-option.ranked-1 {
    background: rgba(110, 231, 183, 0.15);
    border-color: var(--accent-green);
    box-shadow: 0 0 30px rgba(110, 231, 183, 0.3);
}

.world-option.ranked-1 .rank-indicator {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-teal));
    border-color: var(--accent-green);
    color: var(--dark-bg);
    box-shadow: 0 0 20px rgba(110, 231, 183, 0.5);
}

.world-option.ranked-1 .rank-indicator::before {
    content: "1";
}

.world-option.ranked-2 {
    background: rgba(94, 234, 212, 0.1);
    border-color: var(--accent-teal);
    box-shadow: 0 0 20px rgba(94, 234, 212, 0.2);
}

.world-option.ranked-2 .rank-indicator {
    background: rgba(94, 234, 212, 0.8);
    border-color: var(--accent-teal);
    color: var(--dark-bg);
    box-shadow: 0 0 15px rgba(94, 234, 212, 0.4);
}

.world-option.ranked-2 .rank-indicator::before {
    content: "2";
}

.world-option.ranked-3 {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.world-option.ranked-3 .rank-indicator {
    background: rgba(59, 130, 246, 0.7);
    border-color: var(--accent-blue);
    color: var(--dark-bg);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.world-option.ranked-3 .rank-indicator::before {
    content: "3";
}

.world-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.world-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.8em;
    color: var(--accent-green);
    margin: 0;
}

.world-genre {
    font-size: 0.9em;
    color: var(--accent-teal);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.world-description {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05em;
}

.world-description strong {
    color: var(--accent-green);
    font-weight: 600;
}

/* Submit Button */
.submit-container {
    text-align: center;
    margin-top: 40px;
}

.selection-hint {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin-bottom: 20px;
    font-style: italic;
}

.submit-btn, .home-btn {
    background: var(--accent-green);
    color: var(--dark-bg);
    padding: 15px 50px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
}

.submit-btn:hover, .home-btn:hover {
    background: var(--accent-teal);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(110, 231, 183, 0.3);
}

/* Results Section */
.results {
    text-align: center;
    padding: 40px 20px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    margin-bottom: 40px;
}

.results.hidden {
    display: none;
}

.results h2 {
    font-family: 'Cinzel', serif;
    color: var(--accent-green);
    font-size: 2em;
    margin-bottom: 15px;
}

.thank-you-message {
    font-size: 1.1em;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.back-home {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Poll Results Section */
.poll-results-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

.poll-results-section h2 {
    font-family: 'Cinzel', serif;
    color: var(--accent-green);
    font-size: 2em;
    margin-bottom: 10px;
}

.poll-subtitle {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 30px;
    font-size: 1.05em;
}

.poll-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.poll-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 8px;
    overflow: hidden;
}

.poll-table thead {
    background: rgba(110, 231, 183, 0.1);
}

.poll-table th {
    padding: 15px;
    text-align: left;
    color: var(--accent-green);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
    border-bottom: 2px solid var(--border-color);
}

.poll-table th.visual-bar-header {
    text-align: center;
}

.poll-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.poll-table tbody tr:hover {
    background: rgba(110, 231, 183, 0.05);
}

.poll-table tbody tr:last-child {
    border-bottom: none;
}

.poll-table td {
    padding: 15px;
    color: var(--text-secondary);
}

.poll-table td.world-name {
    font-weight: 600;
    color: var(--accent-green);
    font-size: 1.05em;
}

.poll-table td.rank-count {
    text-align: center;
    color: var(--text-primary);
    font-weight: 500;
}

.poll-table td.first-choice {
    color: var(--accent-green);
    font-weight: 600;
}

.poll-table td.second-choice {
    color: var(--accent-teal);
}

.poll-table td.third-choice {
    color: var(--accent-blue);
}

.poll-table td.total-points {
    text-align: center;
    color: var(--accent-green);
    font-weight: 700;
    font-size: 1.1em;
}

.poll-table td.visual-bar {
    padding: 10px 15px;
}

.visual-bar-container {
    background: rgba(15, 20, 25, 0.8);
    border-radius: 10px;
    height: 25px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.visual-bar-fill {
    background: linear-gradient(90deg, var(--accent-green), var(--accent-teal));
    height: 100%;
    transition: width 1.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.visual-bar-percentage {
    color: var(--dark-bg);
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap;
}

.poll-note {
    color: var(--text-secondary);
    font-size: 0.85em;
    font-style: italic;
    margin-top: 15px;
    opacity: 0.7;
}

.poll-table td.loading {
    text-align: center;
    padding: 30px;
    color: var(--accent-green);
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    nav {
        margin: 0;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--dark-bg);
        border-left: 1px solid var(--border-color);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 5rem 2rem 2rem 2rem;
        transition: right 0.3s ease;
        z-index: 9999;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        margin-bottom: 1rem;
    }

    .nav-links a {
        display: block;
        padding: 1rem 0;
        font-size: 1.2rem;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }

    .mobile-menu-toggle {
        display: flex;
        position: relative;
        z-index: 10001;
    }

    .container {
        padding: 30px 15px;
    }

    h1 {
        font-size: 2em;
    }

    .world-option {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }

    .rank-indicator {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
        align-self: flex-start;
    }

    .world-header h2 {
        font-size: 1.4em;
    }

    .world-genre {
        font-size: 0.8em;
    }

    .world-description {
        font-size: 0.95em;
    }

    .submit-btn, .home-btn {
        padding: 12px 40px;
        font-size: 1em;
    }

    .back-home {
        flex-direction: column;
        align-items: center;
    }

    .poll-table th.visual-bar-header,
    .poll-table td.visual-bar {
        display: none;
    }

    .poll-table th,
    .poll-table td {
        padding: 10px 8px;
        font-size: 0.9em;
    }
}
