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

body {
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: fixed;
    width: 100%;
    height: 100%;
}

#sky {
    width: 100vw;
    height: 100vh;
    background-image: url('r6g38aXSaQWtd1KxwJbQ-Fs5jtSVDxX3wtLHJEdqixw.jpg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Clouds */
#clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    filter: blur(10px);
    animation: drift linear infinite;
}

@keyframes drift {
    from {
        transform: translateX(-200px);
    }
    to {
        transform: translateX(calc(100vw + 200px));
    }
}

/* Kites container */
#kites-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Individual kite */
.kite-wrapper {
    position: absolute;
    transition: transform 0.15s ease-out;
    opacity: 1;
    transform-origin: center center;
}


.kite {
    position: relative;
    animation: wind-sway 6s ease-in-out infinite;
    transform-origin: center bottom;
    pointer-events: none;
}

@keyframes wind-sway {
    0%, 100% {
        transform: translateX(0) rotate(-3deg);
    }
    15% {
        transform: translateX(12px) rotate(2deg);
    }
    35% {
        transform: translateX(20px) rotate(5deg);
    }
    50% {
        transform: translateX(15px) rotate(3deg);
    }
    70% {
        transform: translateX(8px) rotate(1deg);
    }
    85% {
        transform: translateX(4px) rotate(-2deg);
    }
}

/* Kite tail */
.kite-tail {
    position: absolute;
    left: 50%;
    top: 100%;
    transform-origin: top center;
    animation: tail-wave 2s ease-in-out infinite;
}

@keyframes tail-wave {
    0%, 100% {
        transform: translateX(-50%) rotate(3deg);
    }
    30% {
        transform: translateX(-50%) rotate(8deg);
    }
    70% {
        transform: translateX(-50%) rotate(5deg);
    }
}

.tail-segment {
    width: 4px;
    height: 20px;
    margin: 0 auto;
    border-radius: 2px;
    animation: segment-wave 1.5s ease-in-out infinite;
}

.tail-segment.pixel {
    width: 6px;
    height: 12px;
    border-radius: 0;
    image-rendering: pixelated;
}

.tail-bow {
    width: 20px;
    height: 8px;
    margin: 2px auto;
    border-radius: 50%;
    animation: bow-flutter 1s ease-in-out infinite alternate;
}

.tail-bow.pixel {
    width: 18px;
    height: 6px;
    border-radius: 0;
    image-rendering: pixelated;
}

@keyframes segment-wave {
    0%, 100% {
        transform: rotate(3deg);
    }
    50% {
        transform: rotate(-3deg);
    }
}

@keyframes bow-flutter {
    0% {
        transform: scaleX(1);
    }
    100% {
        transform: scaleX(0.7);
    }
}

/* String */
.kite-string {
    position: absolute;
    left: 50%;
    top: 100%;
    width: 1px;
    height: 500px;
    background: linear-gradient(
        to bottom,
        rgba(139, 119, 101, 0.6) 0%,
        rgba(139, 119, 101, 0.2) 100%
    );
    transform-origin: top center;
    animation: string-sway 3s ease-in-out infinite;
}

@keyframes string-sway {
    0%, 100% {
        transform: rotate(2deg);
    }
    50% {
        transform: rotate(-2deg);
    }
}

/* Windows XP Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 38px;
    background: linear-gradient(to bottom,
        #3168d5 0%,
        #4e8fea 3%,
        #2f61ce 6%,
        #2455bf 50%,
        #1941a5 100%
    );
    display: flex;
    align-items: center;
    padding: 0;
    z-index: 100;
    font-family: Tahoma, "Segoe UI", sans-serif;
    border-top: 1px solid #5c9eff;
}

#start-btn {
    background: linear-gradient(to bottom,
        #5db343 0%,
        #40a828 8%,
        #3c9d24 45%,
        #349620 50%,
        #2c8a1a 55%,
        #267d16 100%
    );
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 0 16px 0 8px;
    margin-left: 0;
    color: white;
    font-size: 14px;
    font-weight: bold;
    font-style: italic;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    text-shadow: 1px 1px 1px rgba(0, 60, 0, 0.7);
    letter-spacing: 0.3px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        1px 0 1px rgba(0, 0, 0, 0.1);
}

#start-btn:hover {
    background: linear-gradient(to bottom,
        #6ec95a 0%,
        #52be38 8%,
        #4ab530 45%,
        #42ad28 50%,
        #3aa022 55%,
        #32921c 100%
    );
}

#start-btn:active {
    background: linear-gradient(to bottom,
        #2c8a1a 0%,
        #349620 50%,
        #3c9d24 100%
    );
}

.start-icon {
    font-size: 20px;
    filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.3));
}

.start-text {
    letter-spacing: 0.3px;
}

#taskbar-content {
    display: flex;
    align-items: center;
    margin-left: 10px;
    flex: 1;
    gap: 12px;
    height: 100%;
}

#presence-indicator {
    color: white;
    font-size: 11px;
    padding: 4px 10px;
    text-shadow: 1px 1px 0 rgba(0, 0, 80, 0.5);
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

#kite-count {
    font-weight: bold;
    font-size: 12px;
}

.separator {
    width: 1px;
    height: 22px;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.1);
}

#share-prompt {
    color: white;
    font-size: 11px;
    text-shadow: 1px 1px 0 rgba(0, 0, 80, 0.5);
    opacity: 0.9;
}

#camera-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 18px;
    cursor: pointer;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.6));
    transition: filter 0.2s;
}

#camera-btn:hover {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
}

#sound-btn {
    background: none;
    border: none;
    font-size: 18px;
    padding: 4px 8px;
    cursor: pointer;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.6));
    transition: filter 0.2s;
}

#sound-btn:hover {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
}

#chat-btn {
    background: none;
    border: none;
    font-size: 16px;
    padding: 4px 8px;
    cursor: pointer;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.6));
    transition: filter 0.2s;
}

#chat-btn:hover {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
}

/* Chat window - Windows XP style */
#chat-window {
    position: fixed;
    bottom: 48px;
    right: 10px;
    width: 280px;
    background: #ece9d8;
    border-radius: 8px 8px 0 0;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.4),
        0 0 0 1px #0855c5,
        2px 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 99;
    font-family: Tahoma, "Segoe UI", sans-serif;
    overflow: hidden;
}

#chat-window.hidden {
    display: none;
}

#chat-window .window-title {
    padding: 4px 6px;
    font-size: 12px;
}

#chat-window .window-title span {
    font-size: 12px;
}


.chat-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(to bottom, #f5f4ef 0%, #ece9d8 100%);
}

.chat-blurb {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

.chat-input-row {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #7f9db9;
    padding: 2px 6px 2px 8px;
}

.chat-input-row:focus-within {
    border-color: #3168d5;
}

#chat-text {
    border: none;
    outline: none;
    font-family: Tahoma, sans-serif;
    font-size: 12px;
    flex: 1;
    padding: 4px 0;
    background: transparent;
    color: #333;
}

#chat-text::placeholder {
    color: #999;
}

#chat-send {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#chat-send:hover {
    opacity: 1;
}

/* Floating messages */
#floating-messages {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 15;
    overflow: hidden;
}

.floating-message {
    position: absolute;
    font-family: 'VT323', monospace;
    font-size: 22px;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    animation: float-up 12s ease-out forwards;
    white-space: nowrap;
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh);
    }
}

/* Countdown overlay */
#countdown {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

#countdown.hidden {
    display: none;
}

#countdown-number {
    font-family: Tahoma, sans-serif;
    font-size: 150px;
    font-weight: bold;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: countdown-pop 1s ease-out;
}

@keyframes countdown-pop {
    0% {
        transform: scale(1.5);
        opacity: 0;
    }
    20% {
        transform: scale(1);
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Photo preview */
#photo-preview {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

#photo-preview.hidden {
    display: none;
}

.photo-frame {
    background: white;
    padding: 20px 20px 24px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
}

.photo-frame img {
    max-width: 100%;
    max-height: 62vh;
    display: block;
    object-fit: contain;
}

.caption-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

#regenerate-caption {
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#regenerate-caption:hover {
    border-color: #888;
    color: #333;
}

.photo-caption {
    text-align: center;
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: #333;
    white-space: nowrap;
}

.photo-credit {
    text-align: center;
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: #aaa;
    margin-top: 8px;
}

.photo-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

#regenerate-caption-mobile {
    display: none;
}

.photo-actions button {
    background: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    font-family: Tahoma, sans-serif;
}

.photo-actions button:hover {
    background: #f0f0f0;
}

#clock {
    background: linear-gradient(to bottom,
        #0c59cd 0%,
        #0c59cd 50%,
        #0a4ebf 100%
    );
    color: white;
    font-size: 11px;
    padding: 0 12px;
    text-shadow: 1px 1px 0 rgba(0, 0, 80, 0.5);
    height: 100%;
    display: flex;
    align-items: center;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.2);
}

/* About Panel - Windows XP Window Style */
#about-panel {
    position: fixed;
    bottom: 48px;
    left: 10px;
    width: 360px;
    background: #ece9d8;
    border-radius: 10px 10px 0 0;
    box-shadow:
        0 0 0 1px #0855c5,
        0 0 0 2px #4a9aff,
        3px 5px 15px rgba(0, 0, 0, 0.35);
    z-index: 99;
    font-family: Tahoma, "Segoe UI", sans-serif;
    overflow: hidden;
}

#about-panel.hidden {
    display: none;
}

.window-title {
    background: linear-gradient(to bottom,
        #0a58d8 0%,
        #3c94f7 3%,
        #2080f0 6%,
        #0a58d8 50%,
        #0a50c8 51%,
        #0845b0 95%,
        #063a98 100%
    );
    color: white;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #0040a0;
}

.close-btn {
    background: linear-gradient(to bottom,
        #e88a7c 0%,
        #d85548 3%,
        #c94436 50%,
        #be3527 51%,
        #c94436 97%,
        #d85548 100%
    );
    border: 1px solid #8b1a10;
    border-radius: 4px;
    color: white;
    width: 23px;
    height: 23px;
    font-size: 18px;
    font-weight: bold;
    line-height: 21px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

.close-btn:hover {
    background: linear-gradient(to bottom,
        #f5a090 0%,
        #e86858 3%,
        #d95545 50%,
        #ce4535 51%,
        #d95545 97%,
        #e86858 100%
    );
}

.close-btn:active {
    background: linear-gradient(to bottom,
        #be3527 0%,
        #c94436 50%,
        #d85548 100%
    );
}

.window-content {
    padding: 18px;
    font-size: 12px;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(to bottom, #f5f4ef 0%, #ece9d8 100%);
}

.window-content p {
    margin: 0 0 12px 0;
}

.window-content p:last-child {
    margin-bottom: 0;
}

.weather-box {
    background: linear-gradient(to bottom, #e8f4fc 0%, #d4ebf7 100%);
    border: 1px solid #b8d4e8;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.weather-title {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.weather-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.weather-icon {
    font-size: 24px;
}

.weather-temp {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.weather-desc {
    font-size: 11px;
    color: #666;
    font-style: italic;
}

.wind-info {
    font-size: 11px;
    color: #555;
}

#wind-speed {
    font-weight: bold;
}

.tribute {
    color: #444;
    font-size: 11px;
    line-height: 1.6;
}

.tribute a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.tribute a:hover {
    text-decoration: underline;
}

.dedication {
    font-style: italic;
    color: #555;
    border-left: 2px solid #7eb4ea;
    padding-left: 12px;
    margin-left: 0;
    font-size: 11px;
    line-height: 1.6;
}

.stats {
    background: #f5f4ef;
    border: 1px solid #d4d0c8;
    padding: 8px 10px;
    font-size: 11px;
    color: #444;
    text-align: center;
    border-radius: 2px;
}

.stats #total-kites {
    font-weight: bold;
    color: #2460d4;
}

.credit {
    font-size: 10px;
    color: #777;
    text-align: right;
    margin-top: 14px !important;
    padding-top: 10px;
    border-top: 1px solid #d4d0c8;
}

.credit a {
    color: #0066cc;
    text-decoration: none;
}

.credit a:hover {
    text-decoration: underline;
}

.inspired {
    font-style: italic;
    font-size: 9px;
    color: #999;
}


/* Mobile share prompt at top of screen */
#mobile-share {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    padding: 10px 20px;
    font-family: Tahoma, "Segoe UI", sans-serif;
    font-size: 14px;
    color: white;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    z-index: 50;
    max-width: 90%;
}

/* Mobile styles */
@media (max-width: 768px) {
    #taskbar {
        height: 36px;
    }

    #start-btn {
        font-size: 12px;
        padding: 0 12px 0 6px;
        border-radius: 0 6px 6px 0;
    }

    .start-icon {
        font-size: 16px;
    }

    #taskbar-content {
        gap: 6px;
        margin-left: 6px;
    }

    #presence-indicator {
        font-size: 10px;
        padding: 3px 8px;
    }

    #kite-count {
        font-size: 11px;
    }

    /* Hide share prompt in taskbar on mobile */
    #share-prompt {
        display: none;
    }

    .separator {
        display: none;
    }

    #camera-btn {
        padding: 3px 8px;
        font-size: 14px;
        filter: none;
    }

    #camera-btn:hover {
        filter: none;
    }

    #sound-btn {
        font-size: 14px;
        filter: none;
    }

    #sound-btn:hover {
        filter: none;
    }

    #chat-btn {
        font-size: 14px;
        filter: none;
    }

    #chat-btn:hover {
        filter: none;
    }

    #chat-window {
        bottom: auto;
        top: 50%;
        right: 10%;
        left: 10%;
        transform: translateY(-50%);
        width: auto;
        max-width: 280px;
        margin: 0 auto;
        border-radius: 8px;
    }

    #chat-window .window-title {
        border-radius: 8px 8px 0 0;
        cursor: grab;
    }

    #chat-window .window-title:active {
        cursor: grabbing;
    }

    .chat-blurb {
        font-size: 10px;
    }

    .chat-input-row {
        padding: 4px 8px 4px 10px;
    }

    #chat-text {
        font-size: 16px; /* Prevents iOS zoom */
    }

    .floating-message {
        font-size: 18px;
        max-width: 80vw;
        white-space: normal;
        text-align: center;
        line-height: 1.3;
    }

    #sound-btn {
        font-size: 16px;
        padding: 4px 8px;
    }

    #clock {
        font-size: 11px;
        padding: 0 12px;
    }

    /* Show mobile share prompt at top */
    #mobile-share {
        display: block;
    }

    #about-panel {
        bottom: 54px;
        left: 5px;
        right: 5px;
        width: auto;
    }

    /* Mobile polaroid adjustments */
    .photo-frame {
        padding: 16px;
        max-width: 92vw;
    }

    .photo-frame img {
        max-width: 100%;
        max-height: 58vh;
        object-fit: contain;
    }

    .caption-row {
        margin-top: 16px;
    }

    .photo-caption {
        white-space: normal;
        font-size: 15px;
        line-height: 1.4;
        max-width: 90%;
        margin: 0 auto;
    }

    .photo-credit {
        font-size: 12px;
        margin-top: 6px;
    }

    #regenerate-caption {
        display: none;
    }

    #regenerate-caption-mobile {
        display: block;
        background: white;
        border: none;
        padding: 10px 15px;
        font-size: 16px;
        cursor: pointer;
        border-radius: 4px;
    }
}
