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

body {
    font-family: 'Orbitron', monospace;
    color: #fff;
    min-height: 100dvh;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Email form styles for computer screen */
.email-screen {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    box-sizing: border-box;
}

.email-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #00ff00;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    margin-bottom: 15px;
    box-sizing: border-box;
    text-align: center;
}

.email-input:focus {
    outline: none;
    border-color: #00cc00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.email-input-display {
    padding: 0.25rem;
    font-family: 'Orbitron', monospace;
    font-size: 0.5rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid #fff;
    background: #ffffff10;
}

main {
    width: 100dvw;
    max-width: 100%;
    position: relative;
    height: 100dvh;
}

.parallax-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/assets/images/cabin-wall-hd-hole-transparent2.webp') center/cover;
    background-attachment: fixed;
    z-index: -2;
    transition: transform 0.3s ease-out;
}

.background-layer.zoomed {
    transform: scale(1.1);
}

.outside-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100dvw;
    height: 100dvh;
    background: url('/assets/images/outside.webp') center/auto;
    background-attachment: fixed;
    z-index: -3;
    animation: scrollLeft 30s linear infinite;
}

@keyframes scrollLeft {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: -100% center;
    }
}

/* Computer shadow zoom when computer is zoomed */
.computer-layer.zoomed ~ .computer-shadow {
    transform: translate(30px, 30px) scale(1.65);
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    color: #ffffff;
    text-align: center;
    letter-spacing: 2px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Simple touch scrolling - replaces complex JavaScript */
.response-text, .history-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 0, 0.3) transparent;
    max-height: 300px; /* Ensure scrollable area */
}

/* Custom scrollbar styling */
.response-text::-webkit-scrollbar,
.history-content::-webkit-scrollbar {
    width: 8px;
}

.response-text::-webkit-scrollbar-track,
.history-content::-webkit-scrollbar-track {
    background: transparent;
}

.response-text::-webkit-scrollbar-thumb,
.history-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 0, 0.3);
    border-radius: 4px;
}

.response-text::-webkit-scrollbar-thumb:hover,
.history-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 0, 0.5);
}

.computer-layer {
    transition: transform 0.15s ease-out;
    filter: drop-shadow(20px 20px 30px rgba(0, 0, 0, 0.8));
    scale: 1;
    transform-origin: center center;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width:100dvw;
    height:100dvh;
}

/* Zoom functionality for entire computer */
.computer-layer.zoomed {
    transform: scale(1.5) translateY(5%) !important;
}

/* Disable courage hand animations when zoomed */
body.zoomed .courage-container-typing .courage-hand {
    transition: none !important;
}

body.zoomed .courage-container-typing .courage-hand.animate-in,
body.zoomed .courage-container-typing .courage-hand.animate-out {
    bottom: -600px !important;
}

.computer-background {
    width: 800px;
    height: 600px;
    background: url('/assets/images/computer-on-small-desk-hd-no-screen.webp') center/contain no-repeat;
    z-index: 2;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    bottom: 190px;
}

/* Enhanced shadows for depth */
.computer-shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100dvw;
    height: 100dvh;
    background: radial-gradient(ellipse at center bottom, 
        rgba(0, 0, 0, 0.8) 0%, 
        rgba(0, 0, 0, 0.6) 30%, 
        rgba(0, 0, 0, 0.4) 60%, 
        transparent 80%);
    transform: translate(20px, 20px) scale(1.1);
    z-index: -1;
    filter: blur(2px);
}

/* Computer screen glow animation */
@keyframes screenGlow {
    0%, 100% { 
        box-shadow: 
            0 0 30px rgba(138, 218, 132, 0.9),
            0 0 60px rgba(138, 218, 132, 0.7),
            0 0 90px rgba(138, 218, 132, 0.5),
            0 0 120px rgba(138, 218, 132, 0.3),
            0 0 150px rgba(138, 218, 132, 0.2),
            inset 0 0 30px rgba(138, 218, 132, 0.6),
            inset 0 0 60px rgba(138, 218, 132, 0.4);
    }
    50% { 
        box-shadow: 
            0 0 40px rgba(138, 218, 132, 1.0),
            0 0 80px rgba(138, 218, 132, 0.8),
            0 0 120px rgba(138, 218, 132, 0.6),
            0 0 160px rgba(138, 218, 132, 0.4),
            0 0 200px rgba(138, 218, 132, 0.3),
            inset 0 0 40px rgba(138, 218, 132, 0.8),
            inset 0 0 80px rgba(138, 218, 132, 0.6);
    }
}

.screen-content {
    width: 280px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: absolute;
    bottom: 370px;
    z-index: 1;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    box-shadow:
        0 0 30px rgba(138, 218, 132, 0.9),
        0 0 60px rgba(138, 218, 132, 0.7),
        0 0 90px rgba(138, 218, 132, 0.5),
        0 0 120px rgba(138, 218, 132, 0.3),
        0 0 150px rgba(138, 218, 132, 0.2),
        inset 0 0 30px rgba(138, 218, 132, 0.6),
        inset 0 0 60px rgba(138, 218, 132, 0.4);
    filter: brightness(1.2) contrast(1.1);
    animation: screenGlow 3s ease-in-out infinite;
}

.response-text {
    width: 100%;
    height: 100%;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    max-width: 100%;
    color: #ffffff;
    text-transform: uppercase;
    text-align: left;
    overflow-y: auto;
    overflow-x: hidden;
    background: #69b263;
    padding: 2rem 2rem 2rem 2rem;
    word-wrap: break-word;
    z-index: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    will-change: scroll-position;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    font-weight: 900;
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
}

/* Hide scrollbar for webkit browsers */
.response-text::-webkit-scrollbar {
    display: none;
}

.loading {
    font-size: 1em;
    color: #fff;
    font-style: italic;
    color: rgb(136, 7, 7);
    background:rgba(255, 255, 255, 0.4);
    padding:0.25rem;
    border: 1px solid rgb(136, 7, 7);
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: center;
}

.input-container {
    position: fixed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem;
    background: linear-gradient(145deg, #ffde63, #ffd700, #ffde63);
    border: 3px solid #443114;
    min-height: 196px;
}

.conversation-status {
    color: #00ff00;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.input-form,
.email-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 800px;
    max-width: 100vw;
    flex-wrap:wrap;
    flex-direction: column;
    padding: 0 1rem;
}

.input-section {
    width: 100%;
    max-width: 800px;
}

.input-section textarea,
.input-section input {
    width: 100%;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    padding: 1rem;
    resize: none;
    outline: none;
    border: 2px solid #000;
    background: rgba(255, 255, 255, 0.9);
    display: block;
    height: 80px;
}

.input-section textarea:focus,
.input-section input:focus {
    border-color:#000;
}

.button-group {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
}

.btn {
    color: #000;
    padding: 15px 25px;
    background: linear-gradient(145deg, #ffde63, #ffd700, #ffde63);
    border: 3px solid #443114;
    border-bottom: 6px solid #443114;
    border-right: 6px solid #443114;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.1s ease;
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: perspective(100px) rotateX(0deg);
    transform-style: preserve-3d;
    flex: 1;
}

.btn:hover {
    background: linear-gradient(145deg, #ffd700, #ffde63, #ffd700);
    transform: perspective(100px) rotateX(2deg) translateY(-1px);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.4),
        0 6px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: perspective(100px) rotateX(0deg) translateY(2px);
    border-bottom: 2px solid #443114;
    border-right: 2px solid #443114;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 -1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(145deg, #ffd700, #ffde63, #ffd700);
}

.btn-animating {
    transform: perspective(100px) rotateX(0deg) translateY(2px) !important;
    border-bottom: 2px solid #443114 !important;
    border-right: 2px solid #443114 !important;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 -1px 0 rgba(255, 255, 255, 0.3) !important;
    background: linear-gradient(145deg, #ffd700, #ffde63, #ffd700) !important;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: perspective(100px) rotateX(0deg);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.error {
    font-size: 1rem;
    color: #fff;
    font-style: italic;
    color: rgb(136, 7, 7);
    background: rgba(255, 255, 255, 0.4);
    padding: 0.25rem;
    border: 2px solid rgb(136, 7, 7);
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: center;
}

.courage-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width:100dvw;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 1000;
}

.courage-body {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.courage-hand {
    position: relative;
    bottom: -600px;
    z-index: 1000;
    pointer-events: none;
    transition: bottom 0.3s ease-out;
}

/* Courage's hand animation */
.courage-right-hand {
    right: -52dvw;
}

.courage-left-hand {
    left: -52dvw;
}

.courage-hand.animate-in {
    bottom: -420px;
}

.courage-hand.animate-out {
    bottom: -600px;
}

/* Typing hands container - positioned behind input forms but in front of computer */
.courage-container-typing {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width:100dvw;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 50;
}

.courage-container-typing .courage-hand {
    position: relative;
    bottom: -600px;
    z-index: 50;
    pointer-events: none;
    transition: bottom 0.2s ease-out;
}

.courage-container-typing .courage-right-hand { right: -20dvw; }
.courage-container-typing .courage-left-hand { left: -20dvw; }
.courage-container-typing .courage-hand.animate-in { bottom: -200px; }
.courage-container-typing .courage-hand.animate-out { bottom: -500px; }

.courage-container-typing .courage-hand img {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.courage-hand img {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Spooky dark theme */
.spooky-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, 
        rgba(0, 0, 0, 0.1) 0%, 
        rgba(0, 0, 0, 0.1) 50%, 
        rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.lightning {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.05s ease;
    mix-blend-mode: overlay;
}

.lightning.flash {
    opacity: 1;
}

/* Lightning animation */
@keyframes lightning {
    0%, 90%, 100% { 
        opacity: 0; 
        background: rgba(255, 255, 255, 0);
    }
    5%, 15% { 
        opacity: 1; 
        background: rgba(255, 255, 255, 0.1);
    }
    10% { 
        opacity: 1; 
        background: rgba(255, 255, 255, 0.1);
    }
}

.lightning.flash {
    animation: lightning 0.3s ease-in-out;
}


/* User Profile Button and Menu */
.user-profile-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.user-profile-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #443114;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffde63, #ffd700, #ffde63);
    color: #443114;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.user-profile-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.user-profile-btn svg {
    width: 24px;
    height: 24px;
    stroke: #443114;
}

.user-menu {
    position: absolute;
    top: 60px;
    right: 0;
    background: linear-gradient(145deg, #ffde63, #ffd700, #ffde63);
    border: 2px solid #443114;
    border-radius: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    color: #443114;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    padding: 12px 16px;
    border-bottom: 1px solid #000;
}

.user-menu-item:last-child {
    border-bottom: none;
}

.menu-item-btn {
    background: none;
    border: none;
    font-family: 'Orbitron', monospace;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
    width: 100%;
    text-align: left;
    font-size: 1rem;
}

.menu-logout-btn:hover {
    color: #ff6666;
}

.menu-item-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.menu-item-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    display: flex;
    flex-direction: row;
    align-items: center;
}

/* Mobile responsive adjustments */
@media (max-width: 800px) {
    .courage-hand img { width: 150px; }
    .courage-right-hand { right: -52dvw; }
    .courage-left-hand { left: -52dvw; }
    .courage-hand.animate-in { bottom: -380px; }
    .courage-hand.animate-out { bottom: -500px; }

    .courage-container-typing .courage-right-hand { right: -25dvw; }
    .courage-container-typing .courage-left-hand { left: -25dvw; }
    .courage-container-typing .courage-hand.animate-in { bottom: -200px; }
    .courage-container-typing .courage-hand.animate-out { bottom: -600px; }

    .background-layer {
        background: url('/assets/images/cabin-wall-hd-hole-transparent2.webp') center/cover no-repeat;
    }

    .user-profile-container {
        top: 15px;
        right: 15px;
    }
    
    .user-profile-btn {
        width: 40px;
        height: 40px;
    }
    
    .user-profile-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .user-menu {
        min-width: 180px;
    }
}

@media (max-width: 500px) {
    .courage-hand.animate-in { bottom: -340px; }
    .courage-container-typing .courage-hand.animate-in { bottom: -160px; }

    .computer-background {
        width: 600px;
        bottom: 140px;
    }

    .screen-content {
        width: 230px;
        height: 180px;
        bottom: 340px;
    }
    .courage-container-typing .courage-hand img,
    .courage-hand img {
        width: 100px;
    }

    .response-text {
        font-size: 0.4rem;
    }

    .button-group {
        gap:0.25rem;
    }

    .user-profile-container {
        top: 10px;
        right: 10px;
    }
    
    .user-profile-btn {
        width: 36px;
        height: 36px;
    }
    
    .user-profile-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .user-menu {
        min-width: 160px;
        right: -10px;
    }
}

/* Modal styling */
.paper-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    pointer-events: auto;
}

.paper {
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #000;
    padding: 2rem;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    position: relative;
}

.paper-header {
    font-weight: bold;
    color: #000;
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.paper-content {
    flex-grow: 1;
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding-right: 1rem;
}

.paper-content a {
    color: #1da1f2;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
}

.paper-content a:hover {
    text-decoration: underline;
}

.paper-content svg {
    width: 16px;
    height: 16px;
}

/* Credit packages styling */
.credit-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.credit-package {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.credit-package:hover {
    transform: translateY(-5px);
    border-color: #007bff;
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.2);
}

.credit-package:active {
    transform: translateY(-2px);
}

.package-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.package-credits {
    font-size: 1.5rem;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 0.5rem;
}

.package-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 0.5rem;
}

.package-bonus {
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 4px;
    display: inline-block;
}

/* Mobile responsive for credit packages */
@media (max-width: 600px) {
    .credit-packages {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .credit-package {
        padding: 1rem;
    }
    
    .package-name {
        font-size: 1rem;
    }
    
    .package-credits {
        font-size: 1.2rem;
    }
    
    .package-price {
        font-size: 1.4rem;
    }
}

.entry-header {
    font-weight: bold;
    color: #000;
}

.entry-role {
    text-transform: uppercase;
    font-size: 1rem;
    color: #616161;
}

.entry-timestamp {
    float: right;
    font-size: 0.8rem;
    color: #999;
    font-weight: normal;
}

.paper-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4444;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    z-index: 10001;
}