/* ========================================
   DOOM QUIZ - Choose Your Apocalypse
   ======================================== */

/* Quiz Container */
.doom-quiz-container {
    background: linear-gradient(135deg, var(--bg-secondary), rgba(220, 38, 38, 0.05));
    border: 2px solid #dc2626;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    position: relative;
    overflow: hidden;
}

/* Question wrapper for animation */
.quiz-content-wrapper {
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.doom-quiz-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        #dc2626 0%,
        #7c3aed 25%,
        #0891b2 50%,
        #dc2626 75%,
        #7c3aed 100%);
    animation: slide 3s linear infinite;
}

@keyframes slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Quiz Header */
.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-title {
    font-size: 1.8rem;
    color: #dc2626;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
}

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

/* Progress Bar */
.quiz-progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #7c3aed);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.quiz-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Question Section */
.quiz-question {
    animation: slideInRight 0.4s ease;
    position: relative;
}

.quiz-question.slide-out {
    animation: slideOutLeft 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 1;
        transform: translateX(-100%);
    }
}

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

.question-number {
    display: inline-block;
    background: #dc2626;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    margin: auto;
  display: block;
  width: 327px;
  text-align: center;
  font-size: var(--fs-h4);
  font-weight: bold;
  padding: 0.5rem 1rem;
}

.question-text {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Answer Options */
.quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer-option {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.answer-option::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.2), transparent);
    transition: all 0.5s ease;
    transform: translate(-50%, -50%);
}

.answer-option:hover {
    background: var(--bg-secondary);
    border-color: #dc2626;
    transform: translateX(5px);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.2);
}

.answer-option:hover::before {
    width: 100%;
    height: 100%;
}

.answer-text {
    color: var(--text-primary);
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.answer-option.selected {
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(220, 38, 38, 0.1));
    border-color: #dc2626;
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Results Section */
.quiz-results {
    text-align: center;
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.result-apocalypse {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    animation: glitch 2s infinite;
}

@keyframes glitch {
    0%, 100% {
        text-shadow:
            0.05em 0 0 rgba(255, 0, 0, 0.75),
            -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
            0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    14% {
        text-shadow:
            0.05em 0 0 rgba(255, 0, 0, 0.75),
            -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
            0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    15% {
        text-shadow:
            -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
            0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
            -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    49% {
        text-shadow:
            -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
            0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
            -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    50% {
        text-shadow:
            0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
            0.05em 0 0 rgba(0, 255, 0, 0.75),
            0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    99% {
        text-shadow:
            0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
            0.05em 0 0 rgba(0, 255, 0, 0.75),
            0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
}

.result-icon {
    font-size: 5rem;
    margin: 1rem 0;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.result-description {
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 1rem 0;
    color: var(--text-primary);
}

.result-quote {
    font-style: italic;
    color: var(--text-secondary);
    margin: 2rem 0;
    padding: 1rem;
    border-left: 3px solid #dc2626;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-item {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Control Buttons */
.quiz-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.quiz-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quiz-btn:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.3);
}

.quiz-btn:active {
    transform: translateY(0);
}

.quiz-btn-secondary {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    color: var(--text-primary);
}

.quiz-btn-secondary:hover {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
}

/* Start Screen */
.quiz-start {
    text-align: center;
    padding: 2rem;
    position: relative;
}

.start-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse-glow 2s infinite;
    display: inline-block;
    position: relative;
    z-index: 10;
}

.start-icon.skull-consume {
    animation: skullConsume 1.2s ease-in forwards;
}

@keyframes skullConsume {
    0% {
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.5));
    }
    50% {
        transform: scale(3) translateY(-20px);
        filter: drop-shadow(0 0 30px rgba(220, 38, 38, 1));
    }
    100% {
        transform: scale(15) translateY(-100px);
        opacity: 0;
        filter: drop-shadow(0 0 100px rgba(220, 38, 38, 0));
    }
}

/* Elements that fall */
.quiz-start.falling .quiz-title,
.quiz-start.falling .quiz-subtitle,
.quiz-start.falling .start-warning,
.quiz-start.falling .quiz-controls {
    animation: fallDown 0.8s ease-in forwards;
}

.quiz-start.falling .quiz-title {
    animation-delay: 0s;
}

.quiz-start.falling .quiz-subtitle {
    animation-delay: 0.1s;
}

.quiz-start.falling .start-warning {
    animation-delay: 0.2s;
}

.quiz-start.falling .quiz-controls {
    animation-delay: 0.3s;
}

@keyframes fallDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(500px);
        opacity: 0;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.5));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(220, 38, 38, 0.8));
    }
}

.start-warning {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid #dc2626;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 2rem 0;
}

.warning-title {
    color: #dc2626;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .doom-quiz-container {
        padding: 1.5rem;
        margin: 1rem;
    }

    .quiz-title {
        font-size: 1.5rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .answer-option {
        padding: 1rem;
    }

    .answer-text {
        font-size: 1rem;
    }

    .result-icon {
        font-size: 3rem;
    }

    .result-apocalypse {
        font-size: 1.5rem;
    }
}

/* Corruption Effect Overlay */
.corruption-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 2s ease;
}

.corruption-active {
    opacity: 1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(220, 38, 38, 0.03) 2px,
        rgba(220, 38, 38, 0.03) 4px
    );
    animation: corruption-scan 8s linear infinite;
}

@keyframes corruption-scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(20px); }
}