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

.title,
.subtitle,
.welcome-card,
.question-card h3,
.answer-btn,
.result-card h2,
.result-card p,
.result-traits,
.btn,
.back-link,
.question-counter,
.magic-decoration,
.character-avatar,
.dashboard-link,
.footer {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body {
    font-family: 'Crimson Text', serif;
    line-height: 1.6;
    color: #e8e8e8;
    background: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 0, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(25, 25, 112, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(72, 61, 139, 0.25) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: paintedShift 12s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 15% 25%, rgba(139, 0, 0, 0.6), transparent),
        radial-gradient(1px 1px at 85% 75%, rgba(25, 25, 112, 0.5), transparent),
        radial-gradient(2px 2px at 50% 50%, rgba(72, 61, 139, 0.5), transparent);
    background-size: 400% 400%;
    pointer-events: none;
    z-index: -1;
    animation: paintSparkle 5s ease-in-out infinite;
}

@keyframes paintedShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.03); }
}

@keyframes paintSparkle {
    0%, 100% { background-position: 0% 0%; opacity: 1; }
    50% { background-position: 100% 100%; opacity: 0.75; }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.hero {
    text-align: center;
    padding: 40px 0;
    background: rgba(13, 13, 26, 0.7);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    margin-bottom: 30px;
    border: 2px solid rgba(139, 0, 0, 0.5);
    box-shadow: 0 8px 32px rgba(139, 0, 0, 0.4), 0 0 50px rgba(72, 61, 139, 0.2);
}

.back-link {
    display: inline-block;
    color: rgba(220, 20, 60, 0.9);
    text-decoration: none;
    font-size: 1rem;
    margin-bottom: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(220, 20, 60, 0.3);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.back-link:focus,
.back-link:active {
    outline: none;
}

.back-link:hover {
    background: rgba(220, 20, 60, 0.2);
    transform: translateX(-5px);
}

.title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 600;
    background: linear-gradient(135deg, #8b0000, #483d8b, #191970, #dc143c);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: paintGradient 4s ease infinite;
    text-shadow: 0 0 20px rgba(139, 0, 0, 0.5);
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(72, 61, 139, 0.6));
}

@keyframes paintGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(232, 232, 232, 0.9);
    margin-bottom: 20px;
}

.magic-decoration {
    font-size: 2rem;
    margin-top: 20px;
    animation: weaponGlow 2s ease-in-out infinite alternate;
}

@keyframes weaponGlow {
    0% { transform: scale(1) rotate(0deg); opacity: 0.8; filter: drop-shadow(0 0 5px rgba(139, 0, 0, 0.5)); }
    100% { transform: scale(1.1) rotate(5deg); opacity: 1; filter: drop-shadow(0 0 15px rgba(220, 20, 60, 0.8)); }
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

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

.welcome-card {
    background: rgba(13, 13, 26, 0.85);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(139, 0, 0, 0.5), inset 0 0 30px rgba(72, 61, 139, 0.1);
    border: 2px solid rgba(139, 0, 0, 0.4);
}

.welcome-card h2 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: #dc143c;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
}

.welcome-card p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: rgba(232, 232, 232, 0.9);
}

.quiz-container {
    background: rgba(13, 13, 26, 0.85);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(139, 0, 0, 0.5), inset 0 0 30px rgba(72, 61, 139, 0.1);
    border: 2px solid rgba(139, 0, 0, 0.4);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b0000, #dc143c, #483d8b, #191970);
    background-size: 200% 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
    width: 0%;
    animation: progressShimmer 2s linear infinite;
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.6);
}

@keyframes progressShimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.question-counter {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(220, 20, 60, 0.9);
    margin-bottom: 30px;
    font-weight: 600;
}

.question-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: #dc143c;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 0 10px rgba(220, 20, 60, 0.4);
}

.answers {
    display: grid;
    gap: 15px;
}

.answer-btn {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(139, 0, 0, 0.3);
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
    color: rgba(232, 232, 232, 0.9);
    position: relative;
    overflow: hidden;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.answer-btn:focus,
.answer-btn:active {
    outline: none;
}

.answer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 20, 60, 0.3), rgba(72, 61, 139, 0.3), transparent);
    transition: left 0.5s ease;
}

.answer-btn:hover {
    border-color: #dc143c;
    background: rgba(40, 40, 60, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.5), 0 0 20px rgba(72, 61, 139, 0.3);
}

.answer-btn:hover::before {
    left: 100%;
}

.answer-btn.selected {
    border-color: #dc143c;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.3), rgba(72, 61, 139, 0.3));
    color: #fff;
    font-weight: 500;
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.6), inset 0 0 20px rgba(139, 0, 0, 0.2);
}

.result-card {
    background: rgba(13, 13, 26, 0.85);
    backdrop-filter: blur(10px);
    padding: 25px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(139, 0, 0, 0.5), inset 0 0 30px rgba(72, 61, 139, 0.1);
    border: 2px solid rgba(139, 0, 0, 0.4);
}

.result-image {
    margin-bottom: 15px;
}

.character-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border: 3px solid;
    position: relative;
    animation: characterGlow 2s ease-in-out infinite alternate;
}

.character-avatar.leader {
    background: linear-gradient(135deg, #8b0000, #dc143c, #b22222);
    border-color: #dc143c;
    color: #fff;
    box-shadow: 0 0 30px rgba(220, 20, 60, 0.8), 0 0 50px rgba(139, 0, 0, 0.5);
}

.character-avatar.warrior {
    background: linear-gradient(135deg, #483d8b, #6a5acd, #7b68ee);
    border-color: #7b68ee;
    color: #fff;
    box-shadow: 0 0 30px rgba(123, 104, 238, 0.8), 0 0 50px rgba(72, 61, 139, 0.5);
}

.character-avatar.strategist {
    background: linear-gradient(135deg, #191970, #000080, #4169e1);
    border-color: #4169e1;
    color: #fff;
    box-shadow: 0 0 30px rgba(65, 105, 225, 0.8), 0 0 50px rgba(25, 25, 112, 0.5);
}

.character-avatar.mystic {
    background: linear-gradient(135deg, #4b0082, #8b008b, #9370db);
    border-color: #9370db;
    color: #fff;
    box-shadow: 0 0 30px rgba(147, 112, 219, 0.8), 0 0 50px rgba(75, 0, 130, 0.5);
}

.character-avatar.support {
    background: linear-gradient(135deg, #2f4f4f, #556b2f, #6b8e23);
    border-color: #6b8e23;
    color: #fff;
    box-shadow: 0 0 30px rgba(107, 142, 35, 0.8), 0 0 50px rgba(47, 79, 79, 0.5);
}

@keyframes characterGlow {
    0% { 
        box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
        transform: scale(1);
    }
    100% { 
        box-shadow: 0 0 40px currentColor, 0 0 60px currentColor, 0 0 80px currentColor;
        transform: scale(1.05);
    }
}

.result-card h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: #dc143c;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
}

.result-card h2 small {
    display: block;
    font-size: 0.9rem;
    color: rgba(232, 232, 232, 0.7);
    font-weight: normal;
    margin-top: 3px;
}

.result-card p {
    font-size: 1rem;
    color: rgba(232, 232, 232, 0.85);
    margin-bottom: 15px;
    line-height: 1.6;
}

.result-traits {
    background: rgba(26, 26, 46, 0.5);
    backdrop-filter: blur(5px);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    text-align: left;
    border: 2px solid rgba(139, 0, 0, 0.3);
    box-shadow: inset 0 0 20px rgba(139, 0, 0, 0.1);
}

.result-traits h4 {
    font-family: 'Cinzel', serif;
    color: #dc143c;
    margin-bottom: 8px;
    text-align: center;
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(220, 20, 60, 0.4);
}

.result-traits ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 5px;
}

.result-traits li {
    padding: 3px 0;
    color: rgba(232, 232, 232, 0.85);
    font-size: 0.95rem;
}

.result-traits li:before {
    content: "⚔️ ";
    margin-right: 5px;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.btn {
    padding: 10px 25px;
    border: none;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:focus,
.btn:active {
    outline: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #8b0000, #dc143c, #483d8b);
    background-size: 200% 200%;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: buttonGradient 3s ease infinite;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.4);
}

@keyframes buttonGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.6), 0 0 30px rgba(72, 61, 139, 0.4);
}

.btn-secondary {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(5px);
    color: #dc143c;
    border: 2px solid #dc143c;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #8b0000, #dc143c);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(220, 20, 60, 0.5);
}

.footer {
    text-align: center;
    padding: 20px 0;
    color: rgba(232, 232, 232, 0.8);
    font-size: 0.9rem;
}

.dashboard-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 25px;
    background: linear-gradient(135deg, #8b0000, #dc143c);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.3);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.dashboard-link:focus,
.dashboard-link:active {
    outline: none;
}

.dashboard-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.5);
    background: linear-gradient(135deg, #dc143c, #8b0000);
}

.dashboard-link:visited {
    color: #fff;
}

.share-confirmation {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #483d8b, #191970);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 30px rgba(72, 61, 139, 0.5);
    border: 2px solid rgba(220, 20, 60, 0.4);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.share-confirmation.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.share-confirmation-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-check {
    font-size: 1.5rem;
    font-weight: bold;
    background: #dc143c;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: checkPop 0.3s ease;
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.6);
}

@keyframes checkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.share-confirmation-content p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2.2rem;
    }
    
    .welcome-card,
    .quiz-container,
    .result-card {
        padding: 25px;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .character-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .welcome-card,
    .quiz-container,
    .result-card {
        padding: 20px;
    }
    
    .character-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
}
