/* ABSOLUTE CHAOS CSS - BRAIN ROT MODE ACTIVATED! 🔥💀 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow-x: hidden; /* Prevent horizontal scroll from chaos */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation; /* Optimize touch interactions */
}

.container {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    position: relative;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: pageEnter 0.5s ease-out;
}

@keyframes pageEnter {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: rainbowText 3s linear infinite;
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.button-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.game-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border: none;
    padding: 1.5rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    user-select: none;
}

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

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

.game-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 25px rgba(0,0,0,0.3);
    animation: glitch 0.3s ease-in-out;
}

.game-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: transform 0.1s ease;
}

@keyframes glitch {
    0% { transform: translateY(-3px) scale(1.05) skew(0deg); }
    25% { transform: translateY(-3px) scale(1.05) skew(2deg); }
    50% { transform: translateY(-3px) scale(1.05) skew(-2deg); }
    75% { transform: translateY(-3px) scale(1.05) skew(1deg); }
    100% { transform: translateY(-3px) scale(1.05) skew(0deg); }
}

.game-btn.truth {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    animation: pulse 2s ease-in-out infinite;
}

.game-btn.dare {
    background: linear-gradient(45deg, #4834d4, #686de0);
    animation: shake 3s ease-in-out infinite;
}

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

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    user-select: none;
}

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

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

.back-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px) scale(1.05);
    animation: wiggle 0.5s ease-in-out;
}

.back-btn:active {
    transform: translateY(0px) scale(1.02);
    transition: transform 0.1s ease;
}

@keyframes wiggle {
    0%, 100% { transform: translateY(-2px) scale(1.05) rotate(0deg); }
    25% { transform: translateY(-2px) scale(1.05) rotate(-5deg); }
    75% { transform: translateY(-2px) scale(1.05) rotate(5deg); }
}

.challenge-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.challenge-card:hover::before {
    transform: translateX(100%);
}

.challenge-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    animation: cardGlow 2s ease-in-out infinite;
}

@keyframes cardGlow {
    0%, 100% { box-shadow: 0 15px 40px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 15px 40px rgba(255,215,0,0.3); }
}

.challenge-text {
    font-size: 1.4rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    animation: textFloat 3s ease-in-out infinite;
}

@keyframes textFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.instagram-link {
    background: linear-gradient(45deg, #e1306c, #fd1d1d, #fcb045);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
    animation: instagramPulse 2s ease-in-out infinite;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    user-select: none;
}

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

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

.instagram-link:hover::before {
    left: 100%;
}

.instagram-link:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    animation: instagramSpin 0.5s ease-in-out;
}

.instagram-link:active {
    transform: translateY(0px) scale(1.05);
    transition: transform 0.1s ease;
}

@keyframes instagramSpin {
    0% { transform: translateY(-2px) scale(1.1) rotate(0deg); }
    100% { transform: translateY(-2px) scale(1.1) rotate(360deg); }
}

.emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: emojiBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
}

@keyframes emojiBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.2) rotate(0deg); }
    75% { transform: scale(1.1) rotate(-5deg); }
}

.truth-questions {
    text-align: left;
    margin: 2rem 0;
}

.truth-questions ul {
    list-style: none;
    padding: 0;
}

.truth-questions li {
    background: rgba(255,255,255,0.1);
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #ff6b6b;
    transition: all 0.3s ease;
}

.truth-questions li:hover {
    transform: translateX(10px);
    background: rgba(255,255,255,0.2);
    animation: listItemGlow 1s ease-in-out infinite;
}

@keyframes listItemGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(255,107,107,0.5); }
    50% { box-shadow: 0 0 20px rgba(255,107,107,0.8); }
}

/* Truth input styles */
.truth-input-container {
    margin: 2rem 0;
}

.truth-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(255,215,0,0.3);
    border-radius: 15px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1rem;
    resize: vertical;
    margin: 1rem 0;
    transition: all 0.3s ease;
    animation: inputGlow 2s ease-in-out infinite;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
}

@keyframes inputGlow {
    0%, 100% { border-color: rgba(255,215,0,0.3); box-shadow: 0 0 5px rgba(255,215,0,0.3); }
    50% { border-color: rgba(255,215,0,0.8); box-shadow: 0 0 15px rgba(255,215,0,0.6); }
}

.truth-input::placeholder {
    color: rgba(255,215,0,0.7);
    animation: placeholderPulse 2s ease-in-out infinite;
}

@keyframes placeholderPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.truth-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255,215,0,0.5);
    transform: scale(1.02);
    animation: inputFocus 0.3s ease-out;
}

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

/* File upload styles */
.file-upload-container {
    margin: 2rem 0;
    text-align: center;
}

.file-upload-label {
    display: inline-block;
    padding: 1rem 2rem;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    animation: uploadPulse 2s ease-in-out infinite;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    user-select: none;
}

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

.file-upload-label:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    animation: uploadSpin 0.5s ease-in-out;
}

.file-upload-label:active {
    transform: translateY(0px) scale(1.05);
    transition: transform 0.1s ease;
}

@keyframes uploadSpin {
    0% { transform: translateY(-2px) scale(1.1) rotate(0deg); }
    100% { transform: translateY(-2px) scale(1.1) rotate(360deg); }
}

.image-preview {
    margin: 1rem 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.image-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Message styles */
.message {
    padding: 1rem 2rem;
    margin: 1rem 0;
    border-radius: 15px;
    font-weight: bold;
    animation: messageSlide 0.5s ease-out;
}

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

.message.success {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    animation: successGlow 2s ease-in-out infinite;
}

@keyframes successGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(40,167,69,0.5); }
    50% { box-shadow: 0 0 20px rgba(40,167,69,0.8); }
}

.message.error {
    background: linear-gradient(45deg, #dc3545, #fd7e14);
    color: white;
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .container {
        width: 95%;
        padding: 1rem;
        margin: 0 auto;
    }
    
    h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        line-height: 1.4;
    }
    
    .button-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .game-btn {
        width: 100%;
        max-width: 280px;
        padding: 1.2rem 2rem;
        font-size: 1.2rem;
        margin: 0.5rem 0;
        min-height: 60px; /* Ensure minimum touch target size */
    }
    
    .back-btn {
        width: 100%;
        max-width: 200px;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        min-height: 50px; /* Ensure minimum touch target size */
    }
    
    .emoji {
        font-size: 3rem;
        margin-bottom: 0.8rem;
    }
    
    .challenge-card {
        padding: 1.5rem;
        margin: 1.5rem 0;
        border-radius: 15px;
    }
    
    .challenge-text {
        font-size: 1.1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    .truth-input {
        padding: 0.8rem;
        font-size: 0.9rem;
        margin: 0.8rem 0;
        min-height: 100px; /* Better mobile textarea size */
    }
    
    .file-upload-label {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        max-width: 250px;
        min-height: 50px; /* Ensure minimum touch target size */
    }
    
    .instagram-link {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        max-width: 280px;
        display: block;
        margin: 1rem auto;
        min-height: 50px; /* Ensure minimum touch target size */
    }
    
    .message {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        margin: 0.8rem 0;
    }
    
    /* Fix chaos indicator overlap on mobile */
    #chaosIndicator {
        position: fixed !important;
        top: 10px !important;
        right: 10px !important;
        font-size: 10px !important;
        padding: 5px 8px !important;
        border-radius: 15px !important;
        max-width: 120px !important;
        text-align: center !important;
        line-height: 1.2 !important;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    body {
        padding: 0.5rem;
        padding-top: 1rem;
    }
    
    .container {
        width: 98%;
        padding: 0.8rem;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.6rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .game-btn {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        max-width: 260px;
        min-height: 55px;
    }
    
    .back-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.8rem;
        max-width: 180px;
        min-height: 45px;
    }
    
    .emoji {
        font-size: 2.5rem;
    }
    
    .challenge-card {
        padding: 1.2rem;
        margin: 1.2rem 0;
    }
    
    .challenge-text {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .truth-input {
        padding: 0.7rem;
        font-size: 0.85rem;
        min-height: 80px;
    }
    
    .file-upload-label {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        max-width: 220px;
        min-height: 45px;
    }
    
    .instagram-link {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        max-width: 240px;
        min-height: 45px;
    }
    
    /* Further reduce chaos indicator size on very small screens */
    #chaosIndicator {
        font-size: 8px !important;
        padding: 4px 6px !important;
        max-width: 100px !important;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding-top: 0.5rem;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .emoji {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }
    
    .challenge-card {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    /* Adjust chaos indicator for landscape */
    #chaosIndicator {
        top: 5px !important;
        right: 5px !important;
        font-size: 9px !important;
        padding: 3px 6px !important;
    }
}

/* CHAOS MODE CSS - ABSOLUTE BRAIN ROT! 🔥💀 */
@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes explode {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

.game-btn:hover {
    animation: shake 0.3s ease-in-out;
}

.challenge-card:hover {
    animation: shake 0.2s ease-in-out;
}

/* Random chaos effects */
.chaos-mode .challenge-card {
    animation: rainbowBorder 2s linear infinite;
}

@keyframes rainbowBorder {
    0% { border-color: #ff0000; }
    16.66% { border-color: #ff7f00; }
    33.33% { border-color: #ffff00; }
    50% { border-color: #00ff00; }
    66.66% { border-color: #0000ff; }
    83.33% { border-color: #4b0082; }
    100% { border-color: #9400d3; }
}

/* Glitch text effect */
.glitch-text {
    position: relative;
    animation: glitchText 2s ease-in-out infinite;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    animation: glitchBefore 0.3s ease-in-out infinite;
    color: #ff0000;
    z-index: -1;
}

.glitch-text::after {
    animation: glitchAfter 0.3s ease-in-out infinite;
    color: #00ff00;
    z-index: -2;
}

@keyframes glitchText {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitchBefore {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, -2px); }
    40% { transform: translate(2px, 2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(-2px, 2px); }
}

@keyframes glitchAfter {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

/* Social Links Styling */
.social-link {
    position: relative;
    overflow: hidden;
}

.social-link::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;
}

.social-link:hover::before {
    left: 100%;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3) !important;
}

.social-link:active {
    transform: translateY(-1px);
}

/* GitHub specific hover effect */
.social-link[href*="github"]:hover {
    background: linear-gradient(135deg, #24292e, #333) !important;
}

/* LinkedIn specific hover effect */
.social-link[href*="linkedin"]:hover {
    background: linear-gradient(135deg, #00a0dc, #0077b5) !important;
}
