body {
    font-family: 'Doto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #000; /* Black background */
    color: #fff; /* Default text white, will be overridden by aurora for specific elements */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    max-height: 100vh; /* Prevent content from exceeding viewport height */
    overflow: hidden; /* Prevent scrollbars from animation */
    animation: aurora-bg 20s ease infinite alternate;
    position: relative;
    transition: background-color 13s ease;
}

/* Dynamic vibrational background pulsing - extremely visible */
body.vibrational-pulse {
    animation: vibrational-background-pulse 14s ease-in-out infinite, aurora-bg 20s ease infinite alternate !important;
}

@keyframes vibrational-background-pulse {
    0% {
        background-color: #000000 !important;
    }
    25% {
        background-color: var(--vibe-color, #000000) !important;
    }
    50% {
        background-color: #000000 !important;
    }
    75% {
        background-color: var(--vibe-color, #000000) !important;
    }
    100% {
        background-color: #000000 !important;
    }
}

.astrological-wheel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70vmin;
    height: 70vmin;
    pointer-events: none;
    z-index: -1;
    opacity: 0.4;
    animation: chaotic-swirl 80s ease-in-out infinite;
}

@keyframes chaotic-swirl {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(-50%, -50%) rotate(90deg) scale(1.1);
    }
    50% {
        transform: translate(-50%, -50%) rotate(180deg) scale(0.9);
    }
    75% {
        transform: translate(-50%, -50%) rotate(270deg) scale(1.05);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
    }
}

.zodiac-symbol {
    position: absolute;
    font-size: 24px;
    color: var(--aurora-color1, #4a00e0);
    text-shadow: 0 0 8px var(--aurora-color1, #4a00e0);
    animation: aurora-text-zodiac 15s ease infinite alternate, chaotic-counter-rotate 70s ease-in-out infinite;
    user-select: none;
    transform: translate(-50%, -50%);
}

@keyframes chaotic-counter-rotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    20% {
        transform: translate(-50%, -50%) rotate(-120deg) scale(1.2);
    }
    40% {
        transform: translate(-50%, -50%) rotate(-180deg) scale(0.8);
    }
    60% {
        transform: translate(-50%, -50%) rotate(-240deg) scale(1.1);
    }
    80% {
        transform: translate(-50%, -50%) rotate(-300deg) scale(0.9);
    }
    100% {
        transform: translate(-50%, -50%) rotate(-360deg) scale(1);
    }
}

@keyframes aurora-text-zodiac {
    0% { 
        color: var(--aurora-color1); 
        text-shadow: 0 0 8px var(--aurora-color1), 0 0 12px var(--aurora-color2); 
    }
    50% { 
        color: var(--aurora-color2); 
        text-shadow: 0 0 8px var(--aurora-color2), 0 0 12px var(--aurora-color3); 
    }
    100% { 
        color: var(--aurora-color3); 
        text-shadow: 0 0 8px var(--aurora-color3), 0 0 12px var(--aurora-color1); 
    }
}

.stars-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.stars-background::before,
.stars-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.stars-background::before {
    background-image: 
        radial-gradient(2px 2px at 20px 30px, var(--aurora-color1, #4a00e0), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--aurora-color2, #8e2de2), transparent),
        radial-gradient(1px 1px at 90px 40px, var(--aurora-color3, #24c6dc), transparent),
        radial-gradient(1px 1px at 130px 80px, var(--aurora-color1, #4a00e0), transparent),
        radial-gradient(2px 2px at 160px 30px, var(--aurora-color2, #8e2de2), transparent);
    background-repeat: repeat;
    background-size: 200px 120px;
    animation: swirl-stars-slow 60s linear infinite;
    opacity: 0.6;
}

.stars-background::after {
    background-image:
        radial-gradient(1px 1px at 15px 15px, var(--aurora-color3, #24c6dc), transparent),
        radial-gradient(1px 1px at 55px 45px, var(--aurora-color1, #4a00e0), transparent),
        radial-gradient(2px 2px at 85px 75px, var(--aurora-color2, #8e2de2), transparent),
        radial-gradient(1px 1px at 125px 25px, var(--aurora-color3, #24c6dc), transparent),
        radial-gradient(1px 1px at 170px 65px, var(--aurora-color1, #4a00e0), transparent);
    background-repeat: repeat;
    background-size: 180px 100px;
    animation: swirl-stars-fast 40s linear infinite reverse;
    opacity: 0.4;
}

@keyframes swirl-stars-slow {
    0% {
        transform: rotate(0deg) translateX(0px);
        opacity: 0.6;
    }
    25% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.6;
    }
    75% {
        opacity: 0.9;
    }
    100% {
        transform: rotate(360deg) translateX(20px);
        opacity: 0.6;
    }
}

@keyframes swirl-stars-fast {
    0% {
        transform: rotate(0deg) translateY(0px);
        opacity: 0.4;
    }
    25% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
    75% {
        opacity: 0.7;
    }
    100% {
        transform: rotate(-360deg) translateY(-15px);
        opacity: 0.4;
    }
}

.vibrational-symbols {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.vibrational-symbol {
    position: absolute;
    font-size: 24px;
    opacity: 0;
    animation: symbol-appear 3s ease-out forwards;
    user-select: none;
}

.vibrational-symbol.positive {
    color: var(--aurora-color1, #6c40c5);
    text-shadow: 0 0 10px var(--aurora-color1, #7946e0);
    animation: symbol-appear-positive 2s ease-out forwards, symbol-pulse-positive 3s ease-in-out infinite;
}

.vibrational-symbol.negative {
    color: #cc3939;
    text-shadow: 0 0 10px #ff4444;
    animation: symbol-appear-negative 2s ease-out forwards, symbol-pulse-negative 3s ease-in-out infinite;
}

@keyframes symbol-appear-positive {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(0deg);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.3) rotate(180deg);
    }
    100% {
        opacity: 0.8;
        transform: scale(1) rotate(360deg);
    }
}

@keyframes symbol-appear-negative {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(0deg);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.3) rotate(-180deg);
    }
    100% {
        opacity: 0.8;
        transform: scale(1) rotate(-360deg);
    }
}

@keyframes symbol-pulse-positive {
    0% {
        opacity: 0.8;
        transform: scale(1) rotate(0deg);
        text-shadow: 0 0 10px var(--aurora-color1, #4a00e0);
    }
    25% {
        opacity: 1;
        transform: scale(1.1) rotate(90deg);
        text-shadow: 0 0 15px var(--aurora-color2, #8e2de2), 0 0 25px var(--aurora-color1, #4a00e0);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.9) rotate(180deg);
        text-shadow: 0 0 12px var(--aurora-color3, #24c6dc);
    }
    75% {
        opacity: 1;
        transform: scale(1.05) rotate(270deg);
        text-shadow: 0 0 18px var(--aurora-color1, #4a00e0), 0 0 30px var(--aurora-color2, #8e2de2);
    }
    100% {
        opacity: 0.8;
        transform: scale(1) rotate(360deg);
        text-shadow: 0 0 10px var(--aurora-color1, #4a00e0);
    }
}

@keyframes symbol-pulse-negative {
    0% {
        opacity: 0.8;
        transform: scale(1) rotate(0deg);
        text-shadow: 0 0 10px #ff4444;
    }
    25% {
        opacity: 1;
        transform: scale(1.15) rotate(-90deg);
        text-shadow: 0 0 20px #ff4444, 0 0 30px #cc0000;
    }
    50% {
        opacity: 0.6;
        transform: scale(0.85) rotate(-180deg);
        text-shadow: 0 0 8px #ff6666;
    }
    75% {
        opacity: 0.95;
        transform: scale(1.08) rotate(-270deg);
        text-shadow: 0 0 16px #ff4444, 0 0 25px #990000;
    }
    100% {
        opacity: 0.8;
        transform: scale(1) rotate(-360deg);
        text-shadow: 0 0 10px #ff4444;
    }
}

@keyframes aurora-bg {
    0% {
        /* Using text-shadow for aurora effect on text/elements, not background */
        /* background: linear-gradient(45deg, #4a00e0, #8e2de2, #24c6dc, #514a9d); */
        /* background-size: 400% 400%; */
        /* background-position: 0% 50%; */
        --aurora-color1: #4a00e0; /* Purple */
        --aurora-color3: #24c6dc; /* Aqua */
        --aurora-color2: #8e2de2; /* Violet */
    }
    33% {
        --aurora-color1: #8e2de2; /* Violet */
        --aurora-color2: #24c6dc; /* Aqua */
        --aurora-color3: #514a9d; /* Deep Blue/Purple */
    }
    66% {
        --aurora-color3: #514a9d; /* Deep Blue/Purple */
        --aurora-color2: #24c6dc; /* Aqua */
        --aurora-color3: #4a00e0; /* Purple */
    }
    100% {
        --aurora-color1: #4a00e0; /* Purple */
        --aurora-color3: #24c6dc; /* Aqua */
        --aurora-color2: #8e2de2; /* Violet */
    }
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background:none; /* Slightly lighter than pitch black for depth */
    padding: 20px;
    border-radius: 15px;
    
    max-width: 800px;
    width: 90%;
}

.header-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 5%;
}

.speech-area {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

#wizard-ascii {
    font-family: monospace;
    font-size: clamp(8px, 1.5vw, 16px);
    line-height: 1;
    white-space: pre;
    animation: aurora-text-wizard 33s ease infinite alternate;
    margin: 0;
    width: 30%;
    flex-shrink: 0;
}

#wizard-title-text {
    width: 65%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.wizard-ascii-title {
    font-family: monospace;
    font-size: clamp(0.3rem, 1.2vw, 0.7rem);
    line-height: 1;
    animation: aurora-text-wizard 33s ease infinite alternate;
    white-space: pre;
    margin: 0;
    overflow-x: auto;
    color: var(--aurora-color1);
    text-align:left;
    text-shadow: 0 0 5px var(--aurora-color1);
}

.chat-title {
    font-family: 'Doto', sans-serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 700;
    animation: aurora-text-wizard 33s ease infinite alternate;
    color: var(--aurora-color1);
    text-shadow: 0 0 10px var(--aurora-color1), 0 0 20px var(--aurora-color2);
    margin: 0;
}

@keyframes aurora-text-wizard {
    0% { color: var(--aurora-color1); text-shadow: 0 0 3px var(--aurora-color1), 0 0 5px var(--aurora-color2); }
    50% { color: var(--aurora-color2); text-shadow: 0 0 3px var(--aurora-color2), 0 0 5px var(--aurora-color3); }
    100% { color: var(--aurora-color3); text-shadow: 0 0 3px var(--aurora-color3), 0 0 5px var(--aurora-color1); }
}

.chat-controls {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    width: 80%;
    transform:rotate(2deg);
}

#mic-button {
    background: none;
    border: 1px solid var(--aurora-color2);
    padding: 10px;
    margin-right: 10px;
    border-radius: 50%;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* color: var(--aurora-color1); Removed text color as it's icon only */
}

#mic-button svg {
    width: 24px;
    height: 24px;
    fill: var(--aurora-color1); /* Initial fill */
    transition: fill 5s ease;
}

#mic-button.recording svg {
    fill: #f557e5; /* Red when recording - distinct from aurora */
}

#mic-button.recording {
    border-color: #6005b0;  /* Red when recording - distinct from aurora */
}

#chat-input {
    flex-grow: 1;
    padding: 20px;
    border-radius: 33px 0px 33px 33px;
    border: 1px solid var(--aurora-color3);
    margin-right: 10px;
    background-color: #101010;
    color: #fff !important; /* User typing text will be white */
    font-family: 'Doto', sans-serif;
    resize: none;
    width:70%;
    height: 40px;filter:rotate(2deg);
    opacity:0.7;
}

#chat-input::placeholder {
    /* color: #aaa; */
    animation: aurora-text-placeholder 10s ease infinite alternate;
}

@keyframes aurora-text-placeholder {
    0% { color: var(--aurora-color3); }
    50% { color: var(--aurora-color1); }
    100% { color: var(--aurora-color2); }
}

#send-button {
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    background-color: transparent !important;
    /* color: #fff; */
    cursor: pointer;
    font-family: 'Doto', sans-serif;
    font-size: 33px;
    animation: aurora-button-send 10s ease infinite alternate;
}

@keyframes aurora-button-send {
    0% { background-color:#000;color:aquamarine;}
    50% { background-color:#320258;;color:#514a9d;}
    100% { background-color:#000;;color:#24c6dc;}
}

.chat-log {
    width: 70%;
    max-height: 300px;
    overflow-y: auto;
    border: none;
    padding: 10px;
    border-radius: 33px 33px 0px 33px;
    text-align: left;
    background:none;
    padding:20px;;
    transform:rotate(2deg);
}

.chat-log p {
    margin: 5px 0;
    line-height: 1.4;
    color:#333;
}

.user-message {
    /* color: #7f7; */
    text-align: right;
    color:#f1f1f1;
    animation: aurora-text-user 10s ease infinite alternate;
    margin-left: auto; /* Push user messages to the right */
    max-width: 70%; /* Prevent user messages from being too wide */
    word-wrap: break-word;
}

@keyframes aurora-text-user {
    0% { color: var(--aurora-color1); }
    50% { color: var(--aurora-color2); }
    100% { color: var(--aurora-color3); }
}

.wizard-message {
    /* This class might still be used for errors in the main log, or can be deprecated if all wizard actual responses go to bubble */
    /* color: #0ff; */
    animation: aurora-text-wizard-response 33s ease infinite alternate;
    max-width: 100%;
    word-wrap: break-word;
}

@keyframes aurora-text-wizard-response {
    0% { color: var(--aurora-color2); }
    50% { color: var(--aurora-color3); }
    100% { color: var(--aurora-color1); }
}

/* Style for dimmed processing message */
.user-message.dimmed {
    color: #aaa;
    font-style: italic;
}

/* Basic Wizard Animation Placeholder */
#wizard-ascii.speaking {
    animation: wizard-speak 3s infinite alternate, wizard-heartbeat 7s infinite;
}

@keyframes wizard-speak {
    0% { transform: translateY(0); }
    100% { transform: translateY(-2px); }
}

/* Heartbeat color animation between purple and teal */
@keyframes wizard-heartbeat {
    0% { 
        color: #8B00FF; /* Vibrant purple */
        text-shadow: 0 0 10px #8B00FF, 0 0 20px #8B00FF, 0 0 30px #8B00FF;
        transform: scale(1);
    }
    25% { 
        color: #9932CC; /* Medium purple */
        text-shadow: 0 0 8px #9932CC, 0 0 16px #9932CC, 0 0 24px #9932CC;
        transform: scale(1.02);
    }
    50% { 
        color: #008B8B; /* Dark teal */
        text-shadow: 0 0 10px #008B8B, 0 0 20px #008B8B, 0 0 30px #008B8B;
        transform: scale(1);
    }
    75% { 
        color: #20B2AA; /* Light sea green */
        text-shadow: 0 0 8px #20B2AA, 0 0 16px #20B2AA, 0 0 24px #20B2AA;
        transform: scale(1.02);
    }
    100% { 
        color: #8B00FF; /* Back to vibrant purple */
        text-shadow: 0 0 10px #8B00FF, 0 0 20px #8B00FF, 0 0 30px #8B00FF;
        transform: scale(1);
    }
}

.wizard-speech {
    min-height: 50px;
    width: 70%;
    max-width: none;
    padding: 15px;
    border-radius: 0px 33px 33px 33px;
    background:#0e0e0e;
    border: 1px solid var(--aurora-color2);
    animation: aurora-text-wizard-response 33s ease infinite alternate;
    margin: 0 auto;
    text-align: left;
    font-size: 0.9em;
    line-height: 1.4;
    box-shadow: 0 0 10px var(--aurora-color3);
    transform: rotate(2deg);
    transition: all 0.5s ease;
    opacity:0.7;
    color:#999 !important;
}

/* Conjuring loading text with gradient shine */
.wizard-speech.conjuring {
    font-style: italic;
    text-align: center;
    color: var(--aurora-color2) !important;
    position: relative;
}

.wizard-speech.conjuring::after {
    content: 'Conjuring...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(90deg, 
        var(--aurora-color1) 0%, 
        var(--aurora-color2) 25%,
        var(--aurora-color3) 50%,
        var(--aurora-color2) 75%,
        var(--aurora-color1) 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradient-shine 5s ease-in-out infinite;
    font-style: italic;
}

@keyframes gradient-shine {
    0% {
        background-position: -200% 0;
    }
    50% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Additional conjuring text styles for longer responses */
.conjuring-text {
    color: var(--aurora-color2) !important;
    font-style: italic;
    font-size: 1em;
    margin-bottom: 5px;
    text-shadow: 0 0 8px var(--aurora-color2);
    animation: aurora-text-wizard-response 10s ease infinite alternate;
}

.conjuring-subtext {
    color: var(--aurora-color3) !important;
    font-style: italic;
    font-size: 0.8em;
    opacity: 0.8;
    text-shadow: 0 0 5px var(--aurora-color3);
    animation: aurora-text-user 8s ease infinite alternate;
}

/* Wizard Ritual Experience Styles */
.ritual-phase {
    text-align: center;
    padding: 15px;
    color: var(--aurora-color2) !important;
}

.ritual-message {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--aurora-color1) !important;
    text-shadow: 0 0 10px var(--aurora-color1);
    animation: aurora-text-wizard-response 8s ease infinite alternate;
}

.ritual-description {
    font-size: 0.9em;
    margin-bottom: 10px;
    color: var(--aurora-color3) !important;
    font-style: italic;
    opacity: 0.9;
}

.ritual-timer {
    font-size: 0.75em;
    margin-bottom: 10px;
    color: #aaa;
    font-family: monospace;
}

.ritual-progress {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--aurora-color1), var(--aurora-color2), var(--aurora-color3));
    background-size: 200% 100%;
    animation: progress-shimmer 3s ease infinite;
    transition: width 1s ease;
}

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

.ritual-cancel {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 500;
    transition: all 0.2s;
}

.ritual-cancel:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, #ff5252, #e53e3e);
}

.ritual-complete {
    text-align: center;
    padding: 20px;
}

.completion-message {
    font-size: 1.3em;
    font-weight: bold;
    color: #4ade80 !important;
    text-shadow: 0 0 15px #4ade80;
    margin-bottom: 10px;
    animation: completion-pulse 2s ease infinite;
}

.completion-description {
    font-size: 0.9em;
    color: var(--aurora-color2) !important;
    font-style: italic;
}

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

.ritual-failed {
    text-align: center;
    padding: 15px;
}

.failure-message {
    font-size: 1.1em;
    font-weight: bold;
    color: #f87171 !important;
    text-shadow: 0 0 10px #f87171;
    margin-bottom: 8px;
}

.failure-description {
    font-size: 0.9em;
    color: #fbbf24 !important;
    margin-bottom: 15px;
    font-style: italic;
}

.ritual-failed button {
    background: linear-gradient(45deg, var(--aurora-color1), var(--aurora-color2));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
}

.ritual-failed button:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, var(--aurora-color2), var(--aurora-color3));
}

.ritual-symbol {
    position: absolute;
    font-size: 20px;
    opacity: 0;
    animation: ritual-symbol-appear 4s ease-out forwards, ritual-symbol-float 6s ease-in-out infinite;
    user-select: none;
    pointer-events: none;
    color: var(--aurora-color1);
    text-shadow: 0 0 12px var(--aurora-color1);
}

@keyframes ritual-symbol-appear {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        opacity: 0.9;
        transform: scale(1) rotate(360deg);
    }
}

@keyframes ritual-symbol-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(90deg);
    }
    50% {
        transform: translateY(5px) rotate(180deg);
    }
    75% {
        transform: translateY(-5px) rotate(270deg);
    }
}

.celebration-symbol {
    position: absolute;
    font-size: 24px;
    opacity: 0;
    animation: celebration-explosion 3s ease-out forwards;
    user-select: none;
    pointer-events: none;
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700;
}

@keyframes celebration-explosion {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(0deg) translateY(0);
    }
    20% {
        opacity: 1;
        transform: scale(1.5) rotate(180deg) translateY(-20px);
    }
    80% {
        opacity: 0.8;
        transform: scale(1) rotate(360deg) translateY(-40px);
    }
    100% {
        opacity: 0;
        transform: scale(0.3) rotate(540deg) translateY(-60px);
    }
}

/* Heartbeat animation for speech bubble when wizard is speaking */
#wizard-ascii.speaking + .wizard-speech {
    animation: aurora-text-wizard-response 33s ease infinite alternate, speech-bubble-heartbeat 5s infinite;
}

@keyframes speech-bubble-heartbeat {
    0% { 
        border-color: #8B00FF;
        box-shadow: 0 0 15px #8B00FF, 0 0 25px #8B00FF;
        transform: rotate(2deg) scale(1);
    }
    25% { 
        border-color: #9932CC;
        box-shadow: 0 0 12px #9932CC, 0 0 20px #9932CC;
        transform: rotate(2deg) scale(1.01);
    }
    50% { 
        border-color: #008B8B;
        box-shadow: 0 0 15px #008B8B, 0 0 25px #008B8B;
        transform: rotate(2deg) scale(1);
    }
    75% { 
        border-color: #20B2AA;
        box-shadow: 0 0 12px #20B2AA, 0 0 20px #20B2AA;
        transform: rotate(2deg) scale(1.01);
    }
    100% { 
        border-color: #8B00FF;
        box-shadow: 0 0 15px #8B00FF, 0 0 25px #8B00FF;
        transform: rotate(2deg) scale(1);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .chat-controls {
        width: 95%;
        margin-bottom: 10px;
    }
    
    #chat-input {
        width: 60%;
        padding: 15px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .chat-log {
        width: 95%;
        max-height: 200px;
    }
    
    .wizard-speech {
        width: 95%;
        padding: 10px;
        font-size: 0.85em;
    }
    
    .astrological-wheel {
        width: 60vmin;
        height: 60vmin;
    }
    
    .response-length-control {
        width: 95%;
        margin: 10px auto;
        padding: 12px;
        filter: rotate(2deg);
    }
}

@media (max-width: 480px) {
    .container {
        width: 98%;
        padding: 5px;
        max-height: 98vh;
    }
    
    .header-row {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .chat-controls {
        width: 98%;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    #chat-input {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
        opacity:0.7;
    }
    
    #send-button {
        width: 100%;
        padding: 15px;
    }
    
    .chat-log {
        width: 98%;
        max-height: 150px;
        padding: 10px;
    }
    
    .wizard-speech {
        width: 70%;
        padding: 8px;
        font-size: 0.8em;
        opacity:0.7;
    }
    
    .astrological-wheel {
        width: 50vmin;
        height: 50vmin;
    }
    
    .response-length-control {
        width: 98%;
        margin: 8px auto;
        padding: 8px;
        filter: rotate(2deg);
    }
    
    .slider-container {
        gap: 8px;
    }
    
    .mystical-slider {
        max-width: 150px;
    }
}

/* Response Length Control */
.response-length-control {
    width: 80%;
    margin: 10px auto;
    text-align: center;
    padding: 5px;
}

.response-length-label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.75em;
    color: var(--aurora-color2);
    text-shadow: 0 0 5px var(--aurora-color2);
}

.slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 5px;
}

.slider-label {
    font-size: 0.7em;
    color: var(--aurora-color1);
    min-width: 40px;
}

.mystical-slider {
    flex: 1;
    max-width: 120px;
    height: 4px;
    background: linear-gradient(90deg, var(--aurora-color1), var(--aurora-color3));
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.mystical-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--aurora-color3);
    cursor: pointer;
    border: 1px solid #fff;
}

.mystical-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--aurora-color3);
    cursor: pointer;
    border: 1px solid #fff;
}

.length-indicator {
    font-size: 0.7em;
    color: var(--aurora-color3);
    text-shadow: 0 0 5px var(--aurora-color3);
    transition: color 0.3s ease;
}

.length-indicator.reliable {
    color: #4ade80; /* Green for reliable modes */
    text-shadow: 0 0 8px #4ade80;
}

.length-indicator.unreliable {
    color: #f87171; /* Red for unreliable modes */
    text-shadow: 0 0 8px #f87171;
}

/* Landscape mobile orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .chat-log {
        max-height: 100px;
    }
    
    .wizard-speech {
        padding: 5px;
        font-size: 0.75em;
    }
    
    .response-length-control {
        padding: 8px;
        margin: 8px auto;
    }
}

/* Wizard Meme Modal Styles */
.wizard-meme-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wizard-meme-modal.active {
    opacity: 1;
    visibility: visible;
}

.wizard-meme-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: linear-gradient(135deg, var(--aurora-color1, #4a00e0) 0%, var(--aurora-color2, #8e2de2) 50%, var(--aurora-color3, #24c6dc) 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.5);
    animation: meme-appear 0.5s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes meme-appear {
    0% {
        transform: scale(0.7) rotate(-5deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.wizard-meme-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1001;
}

.wizard-meme-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.wizard-meme-header {
    text-align: center;
    margin-bottom: 15px;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.wizard-meme-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 5px 0;
    animation: aurora-text-wizard 3s ease infinite alternate;
}

.wizard-meme-subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin: 0;
}

.wizard-meme-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    object-fit: contain;
    animation: meme-glow 2s ease-in-out infinite alternate;
}

@keyframes meme-glow {
    0% {
        box-shadow: 0 0 20px rgba(138, 43, 226, 0.3), 0 0 40px rgba(74, 0, 224, 0.2);
    }
    100% {
        box-shadow: 0 0 30px rgba(138, 43, 226, 0.6), 0 0 60px rgba(74, 0, 224, 0.4);
    }
}

.wizard-meme-loading {
    text-align: center;
    color: white;
    font-size: 16px;
    animation: loading-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes loading-pulse {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.wizard-meme-error {
    text-align: center;
    color: #ff6b6b;
    font-size: 16px;
    background: rgba(255, 107, 107, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* Mobile responsive adjustments for meme modal */
@media (max-width: 768px) {
    .wizard-meme-content {
        max-width: 95vw;
        max-height: 95vh;
        padding: 15px;
    }
    
    .wizard-meme-image {
        max-height: 60vh;
    }
    
    .wizard-meme-title {
        font-size: 16px;
    }
    
    .wizard-meme-subtitle {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .wizard-meme-content {
        padding: 10px;
    }
    
    .wizard-meme-image {
        max-height: 50vh;
    }
    
    .wizard-meme-close {
        top: 5px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
} 