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

body {
    font-family: 'Courier New', monospace;
    background: white;
    color: black;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Doodle Jump style background elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Simple platform/plank (Doodle Jump style) */
.platform {
    position: absolute;
    width: 70px;
    height: 15px;
    background: black;
    border-radius: 8px;
    animation: subtleFloat 8s infinite ease-in-out;
    user-select: none;
    opacity: 0.1;
}

/* Slight floating animation - very subtle */
@keyframes subtleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Simple hopping character (ball) */
.hopper {
    position: absolute;
    width: 20px;
    height: 20px;
    background: black;
    border-radius: 50%;
    opacity: 0.15;
    user-select: none;
    z-index: 1;
    transform: translate(-50%, -50%);
}

.container {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* Sections */
.section {
    display: none;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
}

.section.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: normal;
    letter-spacing: 0.2em;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-bottom: 40px;
    letter-spacing: 0.05em;
    text-align: center;
}

/* Handle Input Section */
.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    max-width: 600px;
    z-index: 1;
}

.input-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
}

#handle-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    background: white;
    border: 2px solid black;
    outline: none;
}

#handle-input:focus {
    border-width: 3px;
    padding: 11px 14px;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid black;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.autocomplete-item:hover {
    background: #f0f0f0;
}

.autocomplete-item.selected {
    background: #f0f0f0;
}

.autocomplete-handle {
    font-weight: bold;
    font-size: 0.95rem;
}

.autocomplete-name {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 2px;
}

/* Turnstile Container */
.turnstile-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    background: black;
    color: white;
    border: 2px solid black;
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: all 0.2s ease;
}

.btn:hover:not(:disabled) {
    background: white;
    color: black;
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn.secondary {
    background: white;
    color: black;
}

.btn.secondary:hover {
    background: black;
    color: white;
}

/* Results Section */
.result-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
}

.handle-display {
    font-size: 1rem;
    margin: 10px 0 30px;
    opacity: 0.8;
}

.handle-display span {
    font-weight: bold;
}

/* Hop Stats */
.hop-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: #f9f9f9;
    border: 2px solid black;
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.7;
    letter-spacing: 0.1em;
}

/* Homecoming Badge */
.homecoming-badge {
    background: #e8f5e8;
    border: 2px solid #4caf50;
    padding: 10px 20px;
    margin: 20px 0;
    font-weight: bold;
    display: inline-block;
}

/* Hop History */
.hop-history {
    background: #f9f9f9;
    border: 2px solid #ddd;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
}

.hop-entry {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.hop-entry:last-child {
    border-bottom: none;
}

.hop-from, .hop-to {
    font-weight: bold;
}

.hop-arrow {
    margin: 0 10px;
    opacity: 0.6;
}

.hop-timestamp {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 2px;
}

/* Leaderboard Section */
.leaderboard-content {
    max-width: 1000px;
    width: 100%;
}

/* Filter Buttons */
.filter-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0 30px;
}

.filter-btn {
    padding: 8px 20px;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    background: white;
    color: black;
    border: 2px solid black;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: black;
    color: white;
}

.filter-btn:hover {
    background: black;
    color: white;
}

/* Leaderboard List */
.leaderboard-list {
    margin: 20px 0;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #ddd;
    margin-bottom: 10px;
    background: white;
    transition: all 0.2s ease;
}

.leaderboard-entry:hover {
    border-color: black;
    transform: translateX(5px);
}

.leaderboard-entry.current-user {
    border-color: black;
    background: #f0f0f0;
}

.leaderboard-rank {
    font-size: 1.2rem;
    font-weight: bold;
    margin-right: 20px;
    min-width: 40px;
}

.leaderboard-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid black;
}

.leaderboard-info {
    flex: 1;
    text-align: left;
}

.leaderboard-handle {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 2px;
}

.leaderboard-stats {
    font-size: 0.8rem;
    opacity: 0.7;
}

.leaderboard-badges {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.badge {
    padding: 2px 8px;
    font-size: 0.7rem;
    border: 1px solid black;
    background: white;
}

.badge.homecoming {
    background: #e8f5e8;
    border-color: #4caf50;
}

.share-leaderboard-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    background: black;
    color: white;
    border: 2px solid black;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.share-leaderboard-btn:hover {
    background: white;
    color: black;
}

/* User Links */
.user-links {
    display: none;
    gap: 10px;
    margin-left: auto;
    align-items: center;
}

.user-link {
    padding: 5px 10px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.2s ease;
}

.user-link:hover {
    background: #333;
    color: white;
    border-color: #333;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin: 30px 0;
}

/* Button group for multiple buttons */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Share copied notification */
.share-copied {
    margin-top: 15px;
    font-size: 0.9rem;
    color: black;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-copied.show {
    opacity: 0.7;
}

/* Error Message */
.error-message {
    color: black;
    font-size: 0.9rem;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #ddd;
    border-top-color: black;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.footer a {
    color: black;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.footer a:hover {
    opacity: 0.6;
}

.footer .separator {
    margin: 0 10px;
    opacity: 0.4;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .platform {
        width: 60px;
        height: 12px;
    }
    
    .hopper {
        width: 16px;
        height: 16px;
    }

    h1 {
        font-size: 1.8rem;
        letter-spacing: 0.1em;
    }

    /* Handle input on mobile */
    .input-container {
        max-width: 90%;
        flex-direction: column;
        gap: 15px;
    }

    .input-wrapper {
        width: 100%;
    }

    #handle-input {
        font-size: 1rem;
        padding: 15px;
    }

    .btn {
        width: 100%;
        padding: 15px;
    }

    /* Hop stats on mobile */
    .hop-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Leaderboard on mobile */
    .leaderboard-entry {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .leaderboard-rank {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .leaderboard-avatar {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .leaderboard-info {
        text-align: center;
    }

    .leaderboard-badges {
        margin-left: 0;
        margin-top: 10px;
        justify-content: center;
    }

    /* Button groups on mobile */
    .button-group {
        width: 90%;
        flex-direction: column;
        gap: 10px;
    }

    .button-group .btn {
        width: 100%;
    }

    /* Footer on mobile */
    .footer {
        padding: 15px 10px;
        font-size: 0.75rem;
    }

    .footer .separator {
        display: inline;
        margin: 0 5px;
    }

    .footer-content {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 3px;
    }
}
