/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8b4513;
    --secondary-color: #654321;
    --accent-color: #d4af37;
    --success-color: #4caf50;
    --error-color: #f44336;
    --text-color: #ffffff;
    --bg-dark: #1a1a1a;
    --bg-darker: #0d0d0d;
    --locked-color: #666;
}

body {
    font-family: 'Courier New', monospace;
    background: #1a1a2e;
    color: var(--text-color);
    overflow-x: hidden;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    min-height: 100vh;
    position: relative;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Loading screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-darker);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.pixel-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    background: linear-gradient(45deg, 
        var(--primary-color) 25%, 
        transparent 25%, 
        transparent 75%, 
        var(--primary-color) 75%),
        linear-gradient(45deg, 
        var(--primary-color) 25%, 
        transparent 25%, 
        transparent 75%, 
        var(--primary-color) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    animation: pixelSpin 1s linear infinite;
}

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

/* Parallax background layers */
.parallax-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}

/* Star trails canvas (includes background and stars) */
.star-trails {
    z-index: 1;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Hills layer - farther back */
.hills-layer {
    bottom: 0;
    height: 45vh;
    z-index: 4;
    background-image: url('/images/04_Mountains.png'), url('/images/03_Mountains.png');
    background-size: auto 100%, auto 100%;
    background-position: left bottom, right bottom;
    background-repeat: no-repeat, no-repeat;
    will-change: transform, opacity;
}

/* Mountains layer - closer to viewer */
.mountains-back {
    background-image: url('/images/02_Hills.png');
    bottom: 0;
    height: 40vh;
    background-size: contain;
    background-position: center bottom;
    background-repeat: repeat-x;
    z-index: 5;
    will-change: transform, opacity;
}

/* Forest - foreground */
.forest-layer {
    background-image: url('/images/01_Forest.png');
    bottom: 0;
    height: 50vh;
    background-size: contain;
    background-position: center bottom;
    background-repeat: repeat-x;
    z-index: 6;
    will-change: transform, opacity;
}

/* Tower container */
#tower-container {
    min-height: 100vh;
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.tower-image-container {
    position: relative;
    width: 100%;
    max-width: 3200px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tower-image {
    width: 100%;
    max-width: 2400px;
    min-height: 100vh;
    background-image: url('/images/tower_full.png');
    background-size: contain;
    background-position: top center;
    background-repeat: repeat-y;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.7));
    margin-top: -150px;
}

#tower-floors {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 2400px;
    z-index: 2;
    pointer-events: none;
}

/* Floor styling */
.tower-floor {
    max-width: 450px;
    padding: 25px;
    background: rgba(139, 69, 19, 0.95);
    border: 4px solid var(--secondary-color);
    box-shadow: 
        0 4px 0 var(--secondary-color),
        0 8px 20px rgba(0, 0, 0, 0.7);
    position: relative;
    opacity: 0;
    transform: translateY(50px);
    animation: floorReveal 0.8s ease forwards;
    pointer-events: auto;
    backdrop-filter: blur(2px);
    margin: 0 auto;
}

/* Completed floors - positioned above viewport */
.tower-floor.floor-completed {
    margin-top: calc(50vh - 200px);
    margin-bottom: calc(50vh - 200px);
}

/* Current floor - centered in viewport */
.tower-floor.floor-current {
    margin-top: calc(50vh - 250px);
    margin-bottom: calc(50vh - 250px);
}

/* Locked floors - positioned below viewport */
.tower-floor.floor-locked {
    margin-top: calc(50vh - 200px);
    margin-bottom: calc(50vh - 200px);
}

@keyframes floorReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tower-floor.locked {
    opacity: 0.6;
    pointer-events: none;
}

.tower-floor::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(135deg, 
        transparent 25%, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 50%, 
        transparent 75%, 
        rgba(255, 255, 255, 0.1) 75%);
    background-size: 8px 8px;
    pointer-events: none;
    z-index: -1;
}

.floor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.floor-number {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.floor-status {
    font-size: 14px;
    padding: 4px 12px;
    border: 2px solid;
    border-radius: 0;
}

.floor-status.completed {
    background: var(--success-color);
    border-color: darkgreen;
    color: white;
}

.floor-status.current {
    background: var(--accent-color);
    border-color: goldenrod;
    color: black;
}

.floor-status.locked {
    background: var(--locked-color);
    border-color: #444;
    color: white;
}

/* Lock icon for locked floors */
.lock-icon {
    width: 48px;
    height: 48px;
    margin: 20px auto;
    position: relative;
    animation: lockPulse 2s ease-in-out infinite;
}

@keyframes lockPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.lock-icon::before {
    content: '🔒';
    font-size: 48px;
    display: block;
}

/* Countdown timer */
.countdown-timer {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--locked-color);
}

.countdown-timer h3 {
    margin-bottom: 10px;
    color: var(--accent-color);
}

.countdown-display {
    font-size: 24px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* Hint styling */
.floor-hint {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--secondary-color);
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere; /* allow breaking long tokens elegantly */
    word-break: break-word; /* legacy fallback */
}

.floor-hint .hint-icon {
    margin-right: 8px;
    color: var(--accent-color);
}

.hint-label {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.floor-hint a {
    color: #8ab4ff;
    text-decoration: underline;
    pointer-events: auto;
}

.floor-hint::before { content: none; }

/* Input field */
.floor-input {
    position: relative;
    margin-bottom: 20px;
}

.floor-input input {
    width: 100%;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-color);
    border: 3px solid var(--secondary-color);
    outline: none;
    transition: all 0.3s ease;
}

.floor-input input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    transform: scale(1.02);
}

.floor-input input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.floor-input input.verifying {
    animation: inputPulse 1.5s ease-in-out infinite;
}

@keyframes inputPulse {
    0%, 100% {
        border-color: var(--accent-color);
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    }
    50% {
        border-color: var(--accent-color);
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
    }
}

/* Button */
.ascend-button {
    width: 100%;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    background: var(--accent-color);
    color: #000;
    border: 4px solid goldenrod;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ascend-button:hover:not(:disabled) {
    background: goldenrod;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.ascend-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ascend-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinner for button */
.button-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0; /* Prevent spinner from collapsing */
}

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

/* Ensure button maintains height during loading */
.ascend-button.loading {
    min-height: 54px; /* 15px padding * 2 + 24px approx text height */
}

/* Feedback message */
.feedback-message {
    margin-top: 15px;
    padding: 15px;
    border: 2px solid;
    font-weight: bold;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback-message.show {
    opacity: 1;
}

.feedback-message.success {
    background: var(--success-color);
    border-color: darkgreen;
    animation: successPulse 0.5s ease;
}

.feedback-message.error {
    background: var(--error-color);
    border-color: darkred;
    animation: errorShake 0.5s ease;
}

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

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

/* Debug buttons */
.debug-button {
    position: fixed;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: white;
    border: 3px solid;
    font-weight: bold;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.debug-unlock-button {
    bottom: 170px;
    background: #ffa500;
    border-color: #cc8400;
}

.debug-unlock-button:hover {
    background: #cc8400;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.debug-unlock-button.active {
    background: #4caf50;
    border-color: #2e7d32;
}

.debug-unlock-button.active:hover {
    background: #2e7d32;
}

.debug-reset-button {
    bottom: 100px;
    background: #ff6b6b;
    border-color: #c92a2a;
}

.debug-reset-button:hover {
    background: #c92a2a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.debug-button svg {
    width: 24px;
    height: 24px;
}

/* Discord button */
.discord-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #5865F2;
    color: white;
    text-decoration: none;
    border: 3px solid #4752C4;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.discord-button:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.discord-button svg {
    width: 24px;
    height: 24px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tower-image-container {
        overflow: hidden;
    }

    .tower-image {
        width: 170%;
        max-width: none;
        margin-left: -35%;
        margin-right: -35%;
    }

    .tower-floor {
        margin: 40px auto;
        padding: 20px;
        max-width: 90%;
    }

    .floor-number {
        font-size: 20px;
    }

    .floor-hint {
        font-size: 14px;
        padding: 15px;
    }

    .floor-input input {
        font-size: 16px;
        padding: 12px;
    }

    .ascend-button {
        font-size: 16px;
        padding: 12px;
    }

    .debug-unlock-button {
        bottom: 150px;
        right: 20px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .debug-unlock-button span {
        display: none;
    }

    .debug-reset-button {
        bottom: 80px;
        right: 20px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .debug-reset-button span {
        display: none;
    }

    .discord-button {
        bottom: 20px;
        right: 20px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .discord-button span {
        display: none;
    }

    .countdown-display {
        font-size: 18px;
    }

    /* Adjust parallax layers for mobile */
    .mountains-back {
        height: 30vh;
    }

    .hills-layer {
        height: 35vh;
    }

    .forest-layer {
        height: 40vh;
    }
}

/* Animations for correct/wrong answers */
@keyframes correctAnswer {
    0% { background: var(--primary-color); opacity: 1; transform: translateY(0); }
    50% { background: var(--success-color); opacity: 1; transform: translateY(0); }
    100% { background: var(--primary-color); opacity: 1; transform: translateY(0); }
}

@keyframes wrongAnswer {
    0% { background: var(--primary-color); opacity: 1; transform: translateY(0); }
    50% { background: var(--error-color); opacity: 1; transform: translateY(0); }
    100% { background: var(--primary-color); opacity: 1; transform: translateY(0); }
}

.tower-floor.correct-flash {
    animation: correctAnswer 0.6s ease forwards !important;
}

.tower-floor.wrong-flash {
    animation: wrongAnswer 0.6s ease forwards !important;
}

/* Completed floor marker */
.completed-marker {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 32px;
    animation: completedBounce 0.6s ease;
}

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

/* Mirror Easter Egg */
.mirror-clickable {
    position: absolute;
    /* Position and size are set dynamically via JavaScript */
    transform: translateX(-50%);
    cursor: pointer;
    z-index: 3;
    transition: transform 0.1s ease;
    /* Uncomment below to see the clickable area during testing */
    /* background: rgba(255, 0, 0, 0.3);
    border: 2px solid red; */
}

.mirror-clickable:hover {
    /* Subtle hint that it's clickable */
    filter: brightness(1.1);
}

.mirror-clickable:active {
    filter: brightness(0.9);
}

/* Nowhere Popup Modal */
.nowhere-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.nowhere-popup-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.nowhere-popup {
    background: var(--primary-color);
    border: 6px solid var(--secondary-color);
    box-shadow: 
        0 8px 0 var(--secondary-color),
        0 16px 40px rgba(0, 0, 0, 0.9);
    padding: 40px 60px;
    position: relative;
    max-width: 90%;
    animation: popupAppear 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popupAppear {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.nowhere-popup::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    background: linear-gradient(135deg, 
        transparent 25%, 
        rgba(255, 255, 255, 0.15) 25%, 
        rgba(255, 255, 255, 0.15) 50%, 
        transparent 50%, 
        transparent 75%, 
        rgba(255, 255, 255, 0.15) 75%);
    background-size: 12px 12px;
    pointer-events: none;
    z-index: -1;
}

.nowhere-text {
    font-size: 72px;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 
        4px 4px 0 rgba(0, 0, 0, 0.5),
        8px 8px 20px rgba(0, 0, 0, 0.7);
    letter-spacing: 8px;
    margin-bottom: 20px;
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 
            4px 4px 0 rgba(0, 0, 0, 0.5),
            8px 8px 20px rgba(0, 0, 0, 0.7);
    }
    50% {
        text-shadow: 
            4px 4px 0 rgba(0, 0, 0, 0.5),
            8px 8px 20px rgba(0, 0, 0, 0.7),
            0 0 30px rgba(212, 175, 55, 0.6);
    }
}

.nowhere-subtitle {
    font-size: 18px;
    color: var(--text-color);
    text-align: center;
    margin-top: 20px;
    opacity: 0.9;
}

.nowhere-close {
    margin-top: 30px;
    padding: 12px 30px;
    background: var(--accent-color);
    color: #000;
    border: 3px solid goldenrod;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.nowhere-close:hover {
    background: goldenrod;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.nowhere-close:active {
    transform: translateY(0);
}

/* Mobile responsive adjustments for popup */
@media (max-width: 768px) {
    .nowhere-popup {
        padding: 30px 40px;
    }
    
    .nowhere-text {
        font-size: 48px;
        letter-spacing: 4px;
    }
    
    .nowhere-subtitle {
        font-size: 14px;
    }
    
    .mirror-clickable {
        width: 60px;
        height: 80px;
    }
}

/* Victory Celebration Popup */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, rgba(0, 0, 0, 0.9) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.celebration-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.celebration-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.celebration-popup {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: 8px solid var(--accent-color);
    box-shadow: 
        0 0 0 4px var(--secondary-color),
        0 16px 60px rgba(212, 175, 55, 0.6),
        inset 0 0 50px rgba(212, 175, 55, 0.3);
    padding: 40px 60px;
    position: relative;
    max-width: 90%;
    text-align: center;
    animation: celebrationAppear 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: visible;
    z-index: 10;
}

@keyframes celebrationAppear {
    0% {
        transform: scale(0.3) rotate(-20deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.celebration-title {
    font-size: 36px;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 
        3px 3px 0 rgba(0, 0, 0, 0.5),
        0 0 20px rgba(212, 175, 55, 0.8);
    letter-spacing: 2px;
    margin-bottom: 30px;
    animation: titlePulse 2s ease-in-out infinite;
}

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

/* Pixelated Treasure Chest */
.treasure-chest {
    width: 180px;
    height: 160px;
    margin: 20px auto;
    position: relative;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.chest-base {
    width: 160px;
    height: 100px;
    background: linear-gradient(135deg, #8B4513 0%, #654321 50%, #8B4513 100%);
    border: 6px solid #5C3317;
    position: absolute;
    bottom: 0;
    left: 10px;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 8px 16px rgba(0, 0, 0, 0.7);
}

.chest-base::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 4px;
    background: var(--accent-color);
    box-shadow: 0 30px 0 var(--accent-color), 0 60px 0 var(--accent-color);
}

.chest-lid {
    width: 160px;
    height: 80px;
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 50%, #A0522D 100%);
    border: 6px solid #5C3317;
    border-radius: 80px 80px 0 0;
    position: absolute;
    top: 0;
    left: 10px;
    transform-origin: bottom center;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 -4px 16px rgba(0, 0, 0, 0.5);
    animation: chestOpen 1.5s ease-out 0.5s forwards;
}

@keyframes chestOpen {
    0% {
        transform: rotateX(0deg);
    }
    100% {
        transform: rotateX(-120deg);
    }
}

.chest-lock {
    width: 30px;
    height: 40px;
    background: var(--accent-color);
    border: 4px solid goldenrod;
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    animation: lockBreak 0.5s ease-out 1s forwards;
}

.chest-lock::after {
    content: '🔓';
    font-size: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes lockBreak {
    0% {
        transform: translateX(-50%) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) rotate(20deg) translateY(-20px);
    }
    100% {
        transform: translateX(-50%) rotate(40deg) translateY(100px);
        opacity: 0;
    }
}


.celebration-message {
    font-size: 24px;
    color: var(--text-color);
    margin: 40px 0 30px;
    line-height: 1.6;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    animation: messageFloat 3s ease-in-out infinite;
}

.celebration-message strong {
    color: var(--accent-color);
    font-size: 28px;
    text-shadow: 
        2px 2px 0 rgba(0, 0, 0, 0.5),
        0 0 10px rgba(212, 175, 55, 0.8);
}

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

.celebration-close {
    margin-top: 20px;
    padding: 15px 40px;
    background: var(--accent-color);
    color: #000;
    border: 4px solid goldenrod;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
    animation: buttonGlow 2s ease-in-out infinite;
}

@keyframes buttonGlow {
    0%, 100% {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0 6px 20px rgba(212, 175, 55, 0.8);
    }
}

.celebration-close:hover {
    background: goldenrod;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 16px rgba(212, 175, 55, 0.6);
}

.celebration-close:active {
    transform: translateY(0) scale(1);
}

/* Mobile responsive for celebration */
@media (max-width: 768px) {
    .celebration-popup {
        padding: 30px 20px;
    }
    
    .celebration-title {
        font-size: 24px;
    }
    
    .treasure-chest {
        transform: scale(0.8);
    }
    
    .celebration-message {
        font-size: 18px;
    }
    
    .celebration-message strong {
        font-size: 22px;
    }
    
    .celebration-close {
        font-size: 16px;
        padding: 12px 30px;
    }
}

