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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(180deg, #1a4d6d 0%, #2d7a9f 50%, #e8f4f8 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.logo-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.game-logo {
    max-width: 300px;
    height: auto;
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    background: linear-gradient(180deg, #87ceeb 0%, #e0f6ff 100%);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    max-width: 100%;
    max-height: 100vh;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.popup.hidden {
    display: none;
}

.popup-content {
    background: linear-gradient(135deg, #0a1628 0%, #1a3a5c 50%, #0a1628 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    min-width: 400px;
    animation: scaleIn 0.3s ease, lightningPulse 2s infinite;
    position: relative;
    border: 4px solid transparent;
    background-clip: padding-box;
}

.popup-content::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, 
        #00d4ff, #0099ff, #6600ff, #ff00ff, 
        #ff0066, #ffff00, #00ff66, #00d4ff);
    background-size: 400% 400%;
    border-radius: 24px;
    z-index: -1;
    animation: lightningBorder 3s ease infinite;
    filter: blur(3px);
}

.popup-content::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: linear-gradient(45deg, 
        transparent, rgba(0, 212, 255, 0.5), transparent,
        rgba(255, 255, 0, 0.5), transparent, rgba(138, 43, 226, 0.5));
    background-size: 200% 200%;
    border-radius: 28px;
    z-index: -2;
    animation: lightningGlow 1.5s ease infinite;
    filter: blur(15px);
}

.popup-content h2 {
    color: #fff;
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 
        0 0 10px rgba(0, 212, 255, 0.8),
        0 0 20px rgba(0, 212, 255, 0.6),
        0 0 30px rgba(0, 212, 255, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% { 
        text-shadow: 
            0 0 10px rgba(0, 212, 255, 0.8),
            0 0 20px rgba(0, 212, 255, 0.6),
            0 0 30px rgba(0, 212, 255, 0.4);
    }
    50% { 
        text-shadow: 
            0 0 15px rgba(255, 255, 0, 0.9),
            0 0 30px rgba(255, 255, 0, 0.7),
            0 0 45px rgba(255, 255, 0, 0.5);
    }
}

.popup-content p {
    color: #e0f6ff;
    font-size: 24px;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.popup-btn {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 50%, #6600ff 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 212, 255, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.popup-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transform: rotate(45deg);
    animation: buttonShine 3s infinite;
}

@keyframes buttonShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 7px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 212, 255, 0.8),
        0 0 50px rgba(0, 212, 255, 0.5);
}

.popup-btn:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

@keyframes lightningGlow {
    0%, 100% { 
        opacity: 0.5;
        background-position: 0% 50%;
    }
    25% {
        opacity: 1;
        background-position: 50% 0%;
    }
    50% { 
        opacity: 0.7;
        background-position: 100% 50%;
    }
    75% {
        opacity: 1;
        background-position: 50% 100%;
    }
}

@keyframes lightningPulse {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(0, 212, 255, 0.5),
            0 0 40px rgba(0, 212, 255, 0.3),
            0 0 60px rgba(0, 212, 255, 0.2),
            inset 0 0 20px rgba(0, 212, 255, 0.1);
    }
    25% {
        box-shadow: 
            0 0 30px rgba(255, 255, 0, 0.6),
            0 0 50px rgba(255, 255, 0, 0.4),
            0 0 70px rgba(255, 255, 0, 0.2),
            inset 0 0 25px rgba(255, 255, 0, 0.15);
    }
    50% { 
        box-shadow: 
            0 0 25px rgba(138, 43, 226, 0.5),
            0 0 45px rgba(138, 43, 226, 0.3),
            0 0 65px rgba(138, 43, 226, 0.2),
            inset 0 0 22px rgba(138, 43, 226, 0.1);
    }
    75% {
        box-shadow: 
            0 0 35px rgba(0, 255, 255, 0.7),
            0 0 55px rgba(0, 255, 255, 0.4),
            0 0 75px rgba(0, 255, 255, 0.2),
            inset 0 0 28px rgba(0, 255, 255, 0.15);
    }
}

@keyframes lightningFlash {
    0%, 90%, 100% { opacity: 0; }
    92%, 94%, 96% { opacity: 1; }
    93%, 95% { opacity: 0; }
}

@media (max-width: 768px) {
    .popup-content {
        min-width: 300px;
        padding: 30px;
    }
    
    .popup-content h2 {
        font-size: 28px;
    }
    
    .popup-content p {
        font-size: 18px;
    }
}

/* Chat Panel Styles */
.chat-panel {
    position: absolute;
    left: 10px; /* Position inside game canvas where TV was */
    bottom: 210px; /* Moved up a little bit */
    width: 180px;
    background: linear-gradient(135deg, #0a1628 0%, #1a3a5c 100%);
    border-radius: 12px;
    box-shadow: 
        0 5px 25px rgba(0, 0, 0, 0.5),
left: 10px; /* Position inside game canvas where TV was */    z-index: 500;
    overflow: hidden;
    border: 2px solid rgba(0, 212, 255, 0.5);
    animation: chatGlow 3s ease-in-out infinite;
}

@keyframes chatGlow {
    0%, 100% { box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 255, 0, 0.4); }
}

.chat-header {
    background: linear-gradient(90deg, #00d4ff 0%, #6600ff 100%);
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.chat-header:hover {
    background: linear-gradient(90deg, #00e5ff 0%, #7700ff 100%);
}

.chat-title {
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.chat-toggle {
    color: white;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.chat-body {
    display: flex;
    flex-direction: column;
    height: 220px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.5);
    border-radius: 3px;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.4;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.kelly-message {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(102, 0, 255, 0.2) 100%);
    border-left: 3px solid #00d4ff;
}

.user-message {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid #32CD32;
}

.chat-name {
    font-weight: bold;
    display: block;
    margin-bottom: 3px;
}

.chat-name.kelly {
    color: #00d4ff;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

.chat-name.user {
    color: #32CD32;
}

.chat-text {
    color: #e0f6ff;
    word-wrap: break-word;
}

.chat-input-container {
    display: flex;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(0, 212, 255, 0.3);
}

.chat-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 12px;
    outline: none;
    transition: background 0.3s ease;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-input:focus {
    background: rgba(255, 255, 255, 0.2);
}

.chat-send {
    margin-left: 8px;
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(90deg, #00d4ff 0%, #6600ff 100%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.chat-send:active {
    transform: scale(0.95);
}

/* Mobile styles - hide chat on mobile */
@media (max-width: 768px) {
    .chat-panel {
        display: none !important;
    }
}