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

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

body {
    font-family: 'Courier New', 'Courier', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0f0f1e 100%);
    color: #d0d0d0;
    line-height: 1.7;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

/* Rain effect overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(100, 150, 200, 0.03) 2px,
            rgba(100, 150, 200, 0.03) 4px
        );
    pointer-events: none;
    z-index: 1;
}

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: rgba(26, 35, 50, 0.95);
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    margin: -20px -20px 20px -20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    color: #d0d0d0;
    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;
    font-weight: bold;
}

.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: #bfc9d6;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 1.1rem;
    font-family: 'Cinzel', serif;
}

.nav-links a:hover {
    color: #00ffff;
}

/* 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: #d0d0d0;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
    opacity: 1 !important;
    filter: none !important;
}

.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);
}

/* Ensure hamburger button is always visible and clickable */
.mobile-menu-toggle {
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(20, 20, 30, 0.95);
    padding: 40px;
    border-radius: 2px;
    box-shadow:
        0 0 40px rgba(0, 255, 255, 0.1),
        0 10px 50px rgba(0, 0, 0, 0.8),
        inset 0 0 100px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
}

h1 {
    font-size: 2.5em;
    color: #00ffff;
    margin-bottom: 15px;
    text-shadow:
        0 0 10px rgba(0, 255, 255, 0.5),
        0 0 20px rgba(0, 255, 255, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: normal;
    letter-spacing: 3px;
}

.subtitle {
    font-size: 1.1em;
    color: #00cccc;
    font-style: italic;
    margin-bottom: 20px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.description {
    text-align: left;
    margin-bottom: 15px;
    color: #b0b0b0;
    line-height: 1.8;
}

.instructions {
    text-align: left;
    color: #888;
    font-size: 0.9em;
    font-style: italic;
    border-left: 3px solid rgba(255, 100, 100, 0.5);
    padding-left: 15px;
    margin-top: 20px;
}

.question {
    background: rgba(30, 30, 45, 0.8);
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 2px;
    border-left: 4px solid rgba(0, 255, 255, 0.4);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.question:hover {
    background: rgba(35, 35, 50, 0.9);
    border-left-color: rgba(0, 255, 255, 0.7);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.2);
}

.question-text {
    font-size: 1.05em;
    margin-bottom: 15px;
    color: #e0e0e0;
    font-weight: bold;
}

.question label {
    display: block;
    padding: 12px 15px;
    margin: 8px 0;
    background: rgba(20, 20, 30, 0.7);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.95em;
}

.question label:hover {
    background: rgba(40, 40, 55, 0.9);
    border-color: rgba(0, 255, 255, 0.5);
    transform: translateX(5px);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.question input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
    accent-color: #00ffff;
}

.question input[type="radio"]:checked + label,
.question label:has(input[type="radio"]:checked) {
    background: rgba(0, 100, 100, 0.4);
    border-color: #00ffff;
    color: #ffffff;
    font-weight: bold;
    box-shadow:
        0 0 15px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.submit-container {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(0, 255, 255, 0.3);
}

.submit-btn, .retry-btn, .home-btn {
    background: linear-gradient(135deg, #004d4d 0%, #006666 100%);
    color: #00ffff;
    border: 2px solid #00ffff;
    padding: 15px 50px;
    font-size: 1.2em;
    font-family: 'Courier New', monospace;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.5);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    display: inline-block;
}

.submit-btn:hover, .retry-btn:hover, .home-btn:hover {
    background: linear-gradient(135deg, #006666 0%, #008080 100%);
    transform: translateY(-2px);
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.5),
        0 7px 20px rgba(0, 0, 0, 0.7);
    color: #ffffff;
}

.submit-btn:active, .retry-btn:active, .home-btn:active {
    transform: translateY(0);
}

.results {
    text-align: center;
    padding: 30px;
}

.results.hidden {
    display: none;
}

.results h2 {
    color: #00ffff;
    font-size: 2em;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

#result-content {
    background: rgba(30, 30, 45, 0.9);
    padding: 40px;
    border-radius: 2px;
    margin-bottom: 30px;
    border: 3px solid;
    animation: fadeIn 0.8s ease;
    box-shadow:
        0 0 30px rgba(0, 0, 0, 0.8),
        inset 0 0 50px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calling-title {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: bold;
}

.calling-subtitle {
    font-size: 1.2em;
    font-style: italic;
    margin-bottom: 25px;
    opacity: 0.9;
}

.calling-description {
    text-align: left;
    font-size: 1.05em;
    line-height: 1.9;
    margin-bottom: 20px;
}

.calling-description p {
    margin-bottom: 15px;
}

.calling-description strong {
    color: #00ffff;
    font-weight: bold;
}

.calling-abilities {
    text-align: left;
    margin-top: 25px;
}

.calling-abilities h3 {
    color: #00cccc;
    margin-bottom: 15px;
    font-size: 1.3em;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.calling-abilities ul {
    list-style: none;
    padding-left: 0;
}

.calling-abilities li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    border-left: 2px solid rgba(0, 255, 255, 0.2);
    margin-bottom: 5px;
}

.calling-abilities li:before {
    content: "▸";
    position: absolute;
    left: 8px;
    color: #00ffff;
    font-weight: bold;
}

/* Calling-specific colors */
.investigator-result {
    border-color: #8b7355;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.9) 0%, rgba(40, 35, 30, 0.9) 100%);
}

.investigator-result .calling-title {
    color: #d4a574;
    text-shadow: 0 0 10px rgba(212, 165, 116, 0.5);
}

.rumormonger-result {
    border-color: #9370db;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.9) 0%, rgba(35, 30, 45, 0.9) 100%);
}

.rumormonger-result .calling-title {
    color: #ba9ddb;
    text-shadow: 0 0 10px rgba(147, 112, 219, 0.5);
}

.demonologist-result {
    border-color: #dc143c;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.9) 0%, rgba(45, 20, 25, 0.9) 100%);
}

.demonologist-result .calling-title {
    color: #ff4444;
    text-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
}

.agent-result {
    border-color: #00ced1;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.9) 0%, rgba(20, 35, 40, 0.9) 100%);
}

.agent-result .calling-title {
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 206, 209, 0.5);
}

.haunted-result {
    border-color: #708090;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.9) 0%, rgba(30, 30, 35, 0.9) 100%);
}

.haunted-result .calling-title {
    color: #b0b0b0;
    text-shadow: 0 0 10px rgba(112, 128, 144, 0.5);
}

.retry-btn {
    margin-top: 20px;
    margin-right: 15px;
}

.back-home {
    margin-top: 20px;
    display: inline-block;
}

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

    nav {
        margin: 0 0 20px 0;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(26, 35, 50, 0.98);
        border-left: 1px solid rgba(0, 255, 255, 0.3);
        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 rgba(0, 255, 255, 0.2);
        width: 100%;
    }

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

    body.menu-open {
        background: #0a0a0a;
    }

    body.menu-open nav {
        background: rgba(26, 35, 50, 1);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }

    .container {
        padding: 20px;
        margin: 20px;
    }

    h1 {
        font-size: 2em;
        letter-spacing: 2px;
    }

    .question {
        padding: 15px;
    }

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

    .poll-results-section h2 {
        font-size: 1.5em;
    }

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

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

    .poll-table td.calling-name {
        font-size: 0.95em;
    }
}

/* Neon flicker effect */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

h1, .calling-title {
    animation: flicker 3s ease-in-out infinite;
}

/* Score breakdown styling */
.score-breakdown {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(0, 255, 255, 0.2);
}

.score-breakdown h3 {
    color: #00cccc;
    margin-bottom: 15px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.score-item {
    margin-bottom: 10px;
}

.score-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: #b0b0b0;
}

.score-bar-container {
    background: rgba(20, 20, 30, 0.7);
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.score-bar {
    background: linear-gradient(90deg, rgba(0, 100, 100, 0.8), rgba(0, 255, 255, 0.6));
    height: 100%;
    transition: width 1s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

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

.poll-results-section h2 {
    color: #00ffff;
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.poll-subtitle {
    color: #00cccc;
    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, 30, 45, 0.8);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.poll-table thead {
    background: rgba(0, 100, 100, 0.5);
}

.poll-table th {
    padding: 15px;
    text-align: left;
    color: #00ffff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
    border-bottom: 2px solid rgba(0, 255, 255, 0.5);
}

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

.poll-table tbody tr {
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    transition: background 0.2s ease;
}

.poll-table tbody tr:hover {
    background: rgba(40, 40, 55, 0.6);
}

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

.poll-table td {
    padding: 15px;
    color: #d0d0d0;
}

.poll-table td.calling-name {
    font-weight: bold;
    color: #00cccc;
    font-size: 1.05em;
}

.poll-table td.count {
    text-align: left;
    color: #b0b0b0;
    font-family: 'Courier New', monospace;
}

.poll-table td.percentage {
    text-align: left;
    color: #00ffff;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

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

.visual-bar-container {
    background: rgba(20, 20, 30, 0.7);
    border-radius: 10px;
    height: 25px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 255, 0.2);
    position: relative;
}

.visual-bar-fill {
    background: linear-gradient(90deg, rgba(0, 100, 100, 0.8), rgba(0, 255, 255, 0.6));
    height: 100%;
    transition: width 1.5s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.visual-bar-percentage {
    color: #ffffff;
    font-size: 0.8em;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

.poll-note {
    color: #888;
    font-size: 0.85em;
    font-style: italic;
    margin-top: 15px;
}

.poll-table td.loading {
    text-align: center;
    padding: 30px;
    color: #00cccc;
    font-style: italic;
}

/* Calling-specific row colors */
.poll-table tbody tr.investigator-row:hover {
    background: rgba(139, 115, 85, 0.1);
}

.poll-table tbody tr.rumormonger-row:hover {
    background: rgba(147, 112, 219, 0.1);
}

.poll-table tbody tr.demonologist-row:hover {
    background: rgba(220, 20, 60, 0.1);
}

.poll-table tbody tr.agent-row:hover {
    background: rgba(0, 206, 209, 0.1);
}

.poll-table tbody tr.haunted-row:hover {
    background: rgba(112, 128, 144, 0.1);
}
