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

html, body {
    margin: 0;
    padding: 0;
    background-color: #000;
    height: 100%;
    width: 100%;
    position: fixed;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Site Logo */
.site-logo {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 900;
    transition: opacity 0.3s ease, pointer-events 0.3s ease;
    opacity: 1;
}

.site-logo h2 {
    color: white;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Upload Section */
.upload-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 800;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.upload-section.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.upload-container {
    background: linear-gradient(145deg, rgba(35, 35, 35, 0.95) 0%, rgba(25, 25, 25, 0.97) 100%);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
    text-align: center;
    margin: 0 auto;
    padding-top: 30px;
}

.upload-container h1 {
    color: white;
    margin-bottom: 20px;
    font-size: 28px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.input-group {
    padding: 25px;
    background: linear-gradient(to bottom, rgba(45, 45, 45, 0.7), rgba(35, 35, 35, 0.7));
    border-radius: 16px;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
}

.input-wrapper {
    display: flex;
    width: 100%;
    position: relative;
    margin-bottom: 15px;
    z-index: 150;
    overflow: visible;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.at-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    font-weight: 500;
    border-radius: 6px 0 0 6px;
}

#handleInput {
    flex: 1;
    padding: 12px 15px;
    padding-right: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    border-radius: 12px 0 0 12px;
    min-width: 0;
    width: 100%;
    text-overflow: ellipsis;
    color: #333;
    transition: all 0.3s ease;
}

/* Style the search button */
.add-handle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 44px;
    background: linear-gradient(to bottom, #1286ff, #0a75e8);
    color: white;
    border: none;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: -1px;
}

.add-handle-btn:hover {
    background: linear-gradient(to bottom, #2a97ff, #1286ff);
    box-shadow: 0 0 10px rgba(18, 134, 255, 0.5);
}

.add-handle-btn .material-icons {
    font-size: 20px;
}

/* Style the handles container */
.handles-container {
    margin-top: 15px;
    text-align: left;
    min-height: 75px;
    max-height: 150px;
    overflow-y: auto;
    background: linear-gradient(to bottom, rgba(30, 30, 30, 0.3), rgba(20, 20, 20, 0.3));
    border-radius: 12px;
    padding: 15px 10px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.no-handles-msg {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    font-style: italic;
    padding: 12px 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
    border-radius: 10px;
    margin: 5px 0;
    border: 1px solid rgba(255, 255, 255, 0.03);
    width: 100%;
}

.handles-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 5px;
}

.handle-item {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    background: transparent;
    border-radius: 10px;
    margin-bottom: 0;
    color: white;
    transition: all 0.2s ease;
    border: none;
}

.handle-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #444;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.handle-item:hover .handle-avatar {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(77, 94, 255, 0.5);
}

.handle-item .handle-text {
    display: none;
}

.handle-item .remove-handle {
    position: absolute;
    top: -5px;
    right: -5px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
}

.handle-item:hover .remove-handle {
    opacity: 1;
}

.handle-item .remove-handle .material-icons {
    font-size: 14px;
}

.handle-item .remove-handle:hover {
    color: #ff5252;
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Style the fetch all button */
.fetch-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(to bottom, #1286ff, #0a75e8);
    color: white;
    padding: 14px 16px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(18, 134, 255, 0.5);
    margin-top: 20px;
    width: 100%;
    text-transform: uppercase;
}

.fetch-all-btn:hover {
    background: linear-gradient(to bottom, #2a97ff, #1286ff);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(18, 134, 255, 0.7);
    border-radius: 18px;
}

.fetch-all-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Add the subtitle style */
.subtitle {
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 25px;
    font-size: 18px;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#fetchAvatarBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #3d5afe;
    color: white;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    white-space: nowrap;
    box-shadow: 0 0 15px rgba(61, 90, 254, 0.5);
    margin-top: 15px;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #3d5afe;
    color: white;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(61, 90, 254, 0.3);
    width: 100%;
}

.action-button:hover {
    background: #536dfe;
    transform: translateY(-2px);
}

.action-button .material-icons {
    font-size: 20px;
}

#continueBtn {
    padding: clamp(12px, 2.5vw, 16px) clamp(20px, 5vw, 30px);
    font-size: clamp(14px, 3vw, 18px);
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 15px;
    width: auto;
    min-width: 240px;
    background-color: #ffeb3b;
    color: #000000;
    border: none;
    border-radius: 0;
    box-shadow: 0 0 15px rgba(255, 235, 59, 0.9);
    cursor: pointer;
    letter-spacing: 1px;
}

.handle-info {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
    text-align: center;
    min-height: 20px;
}

.preview-container {
    margin-top: 15px;
}

#previewImage {
    max-width: 150px;
    max-height: 150px;
    border-radius: 6px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

#previewImage.circle {
    border-radius: 50%;
}

.error-message {
    color: #ff5252;
    padding: 10px;
    border-radius: 6px;
    background: rgba(255, 82, 82, 0.1);
    margin-top: 15px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    transition: opacity 0.3s ease;
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.rotating {
    animation: rotate 1.5s linear infinite;
}

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

#startBouncingBtn {
    background: #f50057;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(245, 0, 87, 0.4);
    letter-spacing: 0.5px;
    margin-top: 20px;
}

#startBouncingBtn:hover:not(.disabled) {
    background: #ff4081;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(245, 0, 87, 0.5);
}

.start-button.disabled {
    background: #444444;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* Control Buttons */
.button-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.button-container.visible {
    opacity: 1;
    pointer-events: auto;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.control-btn.active {
    background: rgba(100, 200, 255, 0.4);
    box-shadow: 0 0 10px rgba(100, 200, 255, 0.7);
    transform: scale(1.05);
}

.control-btn .material-icons {
    color: white;
    font-size: 24px;
}

/* Bouncing Container */
.bounce-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

.bounce-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.bouncing-element {
    position: absolute;
    transition: none;
    user-select: none;
    will-change: transform;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 130px;
    height: 130px;
    object-fit: cover;
}

.bouncing-element.circle {
    border-radius: 50%;
}

/* Info Overlay */
.info-overlay {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.9);
    z-index: 900;
    text-align: left;
    max-width: 400px;
    padding: 20px;
    background: rgba(20, 20, 20, 0.95);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.info-overlay h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: white;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.info-overlay p {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 15px;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.9);
}

.info-overlay ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.info-overlay li {
    margin-bottom: 8px;
    list-style-type: circle;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.4;
}

.info-overlay .controls-info {
    margin-bottom: 15px;
}

.info-overlay .controls-info p {
    margin-bottom: 8px;
    font-weight: 500;
}

.info-overlay .controls-info ul {
    list-style: none;
    padding-left: 5px;
}

.info-overlay .controls-info ul li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.info-overlay .controls-info ul li .material-icons {
    margin-right: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.info-overlay .footer-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 15px;
    margin-bottom: 0;
}

.info-overlay .footer-text a {
    color: white;
    text-decoration: none;
}

.info-overlay .footer-text a:hover {
    text-decoration: underline;
}

/* Fullscreen Mode */
:fullscreen .button-container {
    opacity: 0;
    pointer-events: none;
}

:fullscreen .button-container.active {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .upload-container {
        padding: 20px;
    }
    
    .input-group {
        padding: 15px;
    }
    
    .at-symbol {
        display: none;
    }
    
    #handleInput {
        width: 100%;
        border-radius: 6px;
        padding: 12px;
    }
    
    .action-button {
        width: 100%;
        padding: 12px;
        border-radius: 6px;
    }
    
    #startBouncingBtn {
        padding: 10px 24px;
        font-size: 16px;
    }
    
    .site-logo {
        top: auto;
        bottom: 20px;
    }
    
    #fullscreenBtn {
        display: none;
    }
}

.hidden {
    display: none !important;
}

/* Winner Overlay */
.winner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
    padding: 15px;
    overflow: hidden;
}

/* Background grid pattern */
.winner-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#333 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.2;
}

/* Floating elements in background */
.winner-overlay::after {
    content: "";
    position: absolute;
    top: 20%;
    left: 20%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: rgba(168, 85, 247, 0.1);
    filter: blur(40px);
    z-index: -1;
}

.floating-light {
    position: absolute;
    bottom: 20%;
    right: 15%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: rgba(234, 179, 8, 0.1);
    filter: blur(40px);
    z-index: -1;
}

.winner-content {
    background-color: #18181b; /* zinc-900 */
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    max-width: 90%;
    width: min(450px, 92vw);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(255, 255, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleIn 0.5s cubic-bezier(0.18, 1.25, 0.4, 1);
}

@keyframes scaleIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Corner accents */
.corner-accent {
    position: absolute;
    width: 64px;
    height: 64px;
    border-width: 2px;
    border-color: rgba(253, 224, 71, 0.6); /* yellow-300 with opacity */
}

.corner-accent-tl {
    top: 0;
    left: 0;
    border-top-style: solid;
    border-left-style: solid;
    border-top-left-radius: 24px;
}

.corner-accent-tr {
    top: 0;
    right: 0;
    border-top-style: solid;
    border-right-style: solid;
    border-top-right-radius: 24px;
}

.corner-accent-bl {
    bottom: 0;
    left: 0;
    border-bottom-style: solid;
    border-left-style: solid;
    border-bottom-left-radius: 24px;
}

.corner-accent-br {
    bottom: 0;
    right: 0;
    border-bottom-style: solid;
    border-right-style: solid;
    border-bottom-right-radius: 24px;
}

.winner-content h2 {
    color: #facc15; /* Will be overridden by JS */
    font-size: clamp(24px, 6vw, 36px);
    margin-bottom: 24px;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.7); /* Will be overridden by JS */
    animation: none; /* Remove default animation */
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes glowPulse {
    0% { text-shadow: 0 0 7px currentColor; }
    50% { text-shadow: 0 0 15px currentColor; }
    100% { text-shadow: 0 0 7px currentColor; }
}

.winner-image-container {
    width: min(250px, 60vw);
    height: min(250px, 60vw);
    margin: 0 auto 24px;
    position: relative;
    border-radius: 16px;
    overflow: visible;
}

.winner-image-glow {
    position: absolute;
    inset: -3px;
    border-radius: 16px;
    background: #facc15; /* Will be overridden by JS */
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.7); /* Will be overridden by JS */
}

.winner-image-frame {
    position: absolute;
    inset: 3px;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1;
}

#winnerImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.winner-handle {
    font-size: clamp(16px, 4vw, 20px);
    color: rgba(255, 255, 255, 0.9);
    margin: 0 auto 32px;
    text-align: center;
    max-width: 90%;
    font-weight: 500;
    animation: floatAnimation 4s infinite ease-in-out;
}

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

#continueBtn {
    width: 100%;
    padding: 16px;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    background: linear-gradient(to right, #facc15, #fef08a); /* yellow-400 to yellow-200 */
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.5);
}

#continueBtn:hover {
    box-shadow: 0 0 25px rgba(255, 255, 0, 0.7);
    transform: scale(1.03);
}

#continueBtn:active {
    transform: scale(0.97);
}

.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

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

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

/* Game Mode */
.game-mode .bouncing-element {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.game-mode-info {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    color: white;
    padding: clamp(15px, 3vw, 20px) clamp(20px, 5vw, 40px);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    font-size: clamp(18px, 5vw, 32px);
    font-weight: bold;
    text-align: center;
    width: auto;
    max-width: 90%;
    z-index: 700;
    opacity: 1;
    transition: all 0.5s ease;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
    text-transform: uppercase;
    letter-spacing: clamp(1px, 0.5vw, 2px);
    animation: gameModeAnnounce 0.5s ease-out;
    border: min(2px, 0.5vw) solid rgba(255, 215, 0, 0.7);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

@keyframes gameModeAnnounce {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    70% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.corner-indicator {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: transparent;
    border-width: 2px;
    border-style: solid;
    z-index: 50;
    pointer-events: none;
}

.corner-indicator.top-left {
    top: 0;
    left: 0;
    border-color: #ff0000; /* Red */
    box-shadow: 0 0 5px #ff0000;
}

.corner-indicator.top-right {
    top: 0;
    right: 0;
    border-color: #0000ff; /* Blue */
    box-shadow: 0 0 5px #0000ff;
}

.corner-indicator.bottom-left {
    bottom: 0;
    left: 0;
    border-color: #ffff00; /* Yellow */
    box-shadow: 0 0 5px #ffff00;
}

.corner-indicator.bottom-right {
    bottom: 0;
    right: 0;
    border-color: #00ff00; /* Green */
    box-shadow: 0 0 5px #00ff00;
}

/* Confetti */
.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    /* Background color will be set dynamically by JavaScript */
    top: 0;
    opacity: 0;
}

.confetti-piece:nth-child(1) {
    left: 7%;
    transform: rotate(-40deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 182ms;
    animation-duration: 1116ms;
}

.confetti-piece:nth-child(2) {
    left: 14%;
    transform: rotate(4deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 161ms;
    animation-duration: 1076ms;
    background: #00d4ff;
}

.confetti-piece:nth-child(3) {
    left: 21%;
    transform: rotate(-51deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 481ms;
    animation-duration: 1103ms;
    background: #ff0000;
}

.confetti-piece:nth-child(4) {
    left: 28%;
    transform: rotate(61deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 334ms;
    animation-duration: 708ms;
    background: #0f0;
}

.confetti-piece:nth-child(5) {
    left: 35%;
    transform: rotate(-52deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 302ms;
    animation-duration: 756ms;
    background: #ff00f7;
}

.confetti-piece:nth-child(6) {
    left: 42%;
    transform: rotate(38deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 180ms;
    animation-duration: 1168ms;
    background: #46bdff;
}

.confetti-piece:nth-child(7) {
    left: 49%;
    transform: rotate(11deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 395ms;
    animation-duration: 829ms;
    background: #ffb300;
}

.confetti-piece:nth-child(8) {
    left: 56%;
    transform: rotate(49deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 14ms;
    animation-duration: 1099ms;
    background: #ff004c;
}

.confetti-piece:nth-child(9) {
    left: 63%;
    transform: rotate(-72deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 149ms;
    animation-duration: 1200ms;
    background: #00ffc8;
}

.confetti-piece:nth-child(10) {
    left: 70%;
    transform: rotate(10deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 351ms;
    animation-duration: 1106ms;
    background: #ff8300;
}

.confetti-piece:nth-child(11) {
    left: 77%;
    transform: rotate(4deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 307ms;
    animation-duration: 1169ms;
    background: #5e00ff;
}

.confetti-piece:nth-child(12) {
    left: 84%;
    transform: rotate(42deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 464ms;
    animation-duration: 1094ms;
    background: #ff006e;
}

.confetti-piece:nth-child(13) {
    left: 91%;
    transform: rotate(-72deg);
    animation: makeItRain 1000ms infinite ease-out;
    animation-delay: 429ms;
    animation-duration: 1113ms;
    background: #00ff9d;
}

@keyframes makeItRain {
    from {
        opacity: 0;
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        opacity: 1;
    }
    to {
        transform: translateY(180px) rotate(90deg);
        opacity: 0;
    }
}

.speed-indicator-popup {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    z-index: 1500;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
    border: 1px solid rgba(100, 200, 255, 0.3);
}

.speed-indicator-popup.active {
    opacity: 1;
    transform: translateY(0);
}

/* Small screen adjustments */
@media (max-height: 600px), (max-width: 500px) {
    .winner-content {
        padding: 15px;
    }
    
    .winner-content h2 {
        margin-bottom: 10px;
    }
    
    .winner-image-container {
        width: min(140px, 40vw);
        height: min(140px, 40vw);
        margin-bottom: 8px;
        border-width: 3px;
    }
    
    .winner-handle {
        margin-bottom: 10px;
    }
    
    #continueBtn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
    transition: opacity 0.5s ease;
}

.background-logo {
    position: absolute;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    opacity: 0.7;
    filter: grayscale(50%);
    transition: transform 0.05s linear;
}

.background-logo.circle {
    border-radius: 50%;
}

/* Flash animation for duplicate handles */
@keyframes flash {
    0%, 100% { background: rgba(255, 255, 255, 0.1); }
    50% { background: rgba(235, 87, 87, 0.3); }
}

.handle-item.flash {
    animation: flash 0.5s ease-in-out;
}

/* Style the profile suggestions dropdown */
.profile-suggestions {
    max-height: 200px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #2f2f2f, #252525);
    border-radius: 12px;
    margin-top: 5px;
    width: 100%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 200;
    position: absolute;
    top: 100%;
    left: 0;
    border: 1px solid rgba(77, 94, 255, 0.3);
}

.profile-suggestions.active {
    display: block !important;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.suggestion-item:hover {
    background-color: rgba(77, 94, 255, 0.3);
    transform: translateX(2px);
}

.suggestion-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    background-color: #444;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.suggestion-info {
    flex: 1;
    text-align: left;
    overflow: hidden;
}

.suggestion-display-name {
    color: white;
    font-weight: 500;
    margin-bottom: 4px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    font-size: 14px;
}

.suggestion-handle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Add subtle animation for inputs */
#handleInput:focus {
    box-shadow: 0 0 0 2px rgba(77, 94, 255, 0.3);
    outline: none;
    transition: all 0.2s ease;
}

/* Game Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.settings-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.settings-overlay.hidden {
    display: none;
}

.settings-content {
    background-color: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.settings-content h2 {
    text-align: center;
    color: #0f0;
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.setting-item {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.setting-item label {
    flex: 1;
    max-width: 100%;
    color: #fff;
    font-size: 16px;
}

/* Toggle Switch Styles */
.toggle-wrapper {
    position: relative;
    width: 60px;
    height: 30px;
    flex-shrink: 0;
    display: inline-block;
}

.toggle-wrapper input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    z-index: -1;
}

.toggle-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.4s;
    z-index: 1;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

input:checked + .toggle-label {
    background-color: #0f0;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

input:checked + .toggle-label:before {
    transform: translateX(30px);
}

/* Range slider styles */
#autoContinueDelayWrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

#autoContinueDelayWrapper label {
    width: 100%;
    margin-bottom: 5px;
}

#autoContinueDelayWrapper .slider-container {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 15px;
}

#autoContinueDelay {
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: #444;
    outline: none;
    flex-grow: 1;
}

#autoContinueDelay::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0f0;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

#autoContinueDelay::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0f0;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

#autoContinueDelayValue {
    color: #0f0;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

#closeSettingsBtn {
    display: block;
    width: 100%;
    padding: 10px;
    background: linear-gradient(to right, #0f0, #0c0);
    color: black;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s;
}

#closeSettingsBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

#gameSettingsBtn {
    position: relative;
}

#gameSettingsBtn:after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #0f0;
    border-radius: 50%;
    top: 5px;
    right: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

#gameSettingsBtn.has-settings:after {
    opacity: 1;
}

/* Auto-continue countdown */
.auto-countdown {
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    animation: pulseFade 1s infinite;
    transition: opacity 0.3s ease;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px);
}

.auto-countdown.hidden {
    display: none;
}

#countdownValue {
    font-weight: bold;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(to right, #0f0, #6f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 2px;
}

@keyframes pulseFade {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Handles header */
.handles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.no-handles-msg {
    margin: 0;
}

/* Clear all button */
.clear-all-btn {
    background-color: rgba(255, 0, 0, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.clear-all-btn:hover {
    background-color: rgba(255, 0, 0, 0.3);
    color: white;
}

.clear-all-btn.hidden {
    display: none;
}

/* List Notification */
.list-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(18, 134, 255, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    max-width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
}

.list-notification.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Animation for loading spinner */
.animate-spin {
    animation: spin 1s linear infinite;
}

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

/* Help icon and tooltip */
.help-icon {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    z-index: 15;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.help-icon .material-icons {
    font-size: 16px;
}

.help-icon:hover {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(255, 255, 255, 0.6);
}

/* Help overlay */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 20px 0;
}

.help-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.help-content {
    background-color: #1a1a1a;
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    color: white;
    box-shadow: 0 0 20px rgba(18, 134, 255, 0.5);
    border: 1px solid rgba(18, 134, 255, 0.3);
    position: relative;
    margin: auto;
}

.help-content h2 {
    text-align: center;
    color: white;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
}

.help-content ul {
    padding-left: 20px;
    margin-bottom: 20px;
    list-style-type: circle;
}

.help-content li {
    padding: 10px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.help-content li strong {
    color: white;
    display: block;
    margin-bottom: 4px;
    font-size: 17px;
}

.help-content li br {
    display: block;
    content: "";
    margin-top: 4px;
}

.help-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    word-break: break-all;
    display: inline-block;
    margin-top: 3px;
}

.close-help-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(to right, #1286ff, #0a75e8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-help-btn:hover {
    background: linear-gradient(to right, #2a97ff, #1286ff);
    box-shadow: 0 0 10px rgba(18, 134, 255, 0.5);
}

/* Add media queries for mobile adjustments */
@media (max-height: 700px) {
    .help-content {
        padding: 15px;
        font-size: 14px;
    }
    
    .help-content h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .help-content li {
        padding: 5px 0;
        margin-bottom: 5px;
        font-size: 14px;
    }
    
    .help-content li strong {
        font-size: 15px;
    }
    
    .help-content code {
        font-size: 12px;
        padding: 1px 3px;
    }
    
    .close-help-btn {
        padding: 10px 15px;
        font-size: 14px;
        margin-top: 10px;
    }
} 