body, html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
    font-family: 'Courier New', monospace;
    user-select: none;
   -webkit-user-select: none;
   -moz-user-select: none;
   -ms-user-select: none;
    touch-action: pan-x pan-y;
}

* {
    touch-action: manipulation;
}

canvas {
    display: block;
}

/* STATS */
#stats-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 1),
        0 0 2px rgba(0, 0, 0, 1),
        0 0 3px rgba(0, 0, 0, 1),
        0 0 4px rgba(0, 0, 0, 1),
        0 0 8px rgba(0, 0, 0, 1),
        0 0 16px rgba(0, 0, 0, 1);
    pointer-events: none;
    line-height: 1.6;
}

.rate-up {
    color: rgba(100, 255, 100, 0.9);
    transition: color 0.5s ease;
}

.rate-down {
    color: rgba(255, 100, 100, 0.9);
    transition: color 0.5s ease;
}

.rate-same {
    color: rgba(200, 200, 200, 0.8);
    transition: color 0.5s ease;
}

/* ICONS */
#gear-icon,
.score-icon,
#hole-icon {
    position: absolute;
    top: 20px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    z-index: 1000;
}

#gear-icon {
    right: 20px;
}

.score-icon {
    right: 50px;
}

#hole-icon {
    top: 16px;
    right: 80px;
    width: 26px;
    height: 26px;
    opacity: 0.36;
}

#hole-icon.pulse {
    animation: holepulse 3s ease-in-out infinite;
    transition: none;
}

@keyframes holepulse {
    0%, 100% {
        opacity: 0.36;
    }
    50% {
        opacity: 0.8;
    }
}

#gear-icon:hover,
.score-icon:hover,
#hole-icon:hover {
    opacity: 0.69;
}


/* SETTINGS */
#settings-menu {
    display: none;
    position: absolute;
    top: 50px;
    right: 20px;
    background: rgba(20, 20, 30, 0.3);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    width: 280px;
    line-height: 1.5;
    z-index: 999;
    max-height: 80vh;
    overflow-y: auto;
}

#settings-menu.open {
    display: block;
}

.menu-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-text {
    margin-bottom: 12px;
}

.menu-btn {
    background: rgba(60, 60, 80, 0.5);
    border: 1px solid rgba(255, 0, 0, 0.42);
    color: rgba(255, 255, 255, 0.5);
    padding: 6px 12px;
    margin-top: 8px;
    margin-right: 8px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    transition: all 0.2s;
}

.menu-btn.danger:hover {
    background: rgba(255, 0, 0, 0.24);
    border-color: rgba(255, 0, 0, 0.69);
}


/* UPGRADES*/
#upgrade-panel {
    position: absolute;
    top: 50px;
    right: 20px;
    display: none;
    background: rgba(20, 20, 30, 0.3);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    width: 280px;
    z-index: 999;
    max-height: 80vh;
    overflow-y: auto;
}

#upgrade-panel.open {
    display: block;
}

.upgrade-row {
    margin-bottom: 8px;
}
.upgrade-btn {
    background: rgba(60, 60, 80, 0.5);
    border: 1px solid rgba(0, 255, 0, 0.42);
    color: rgba(255, 255, 255, 0.5);
    padding: 4px 8px;
    margin-top: 4px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.upgrade-btn:hover {
    background: rgba(80, 80, 100, 0.6);
}

.upgrade-btn:disabled {
    cursor: not-allowed;
    border: 1px solid rgba(0, 0, 0, 0.69);
    opacity: 0.3;
}

/* SCORES */
.modal {
    position: absolute;
    top: 50px;
    right: 20px;
    display: none;
    z-index: 999;
    background: transparent;
}

.modal.show {
    display: block;
}

.modal-content {
    background: rgba(20, 20, 30, 0.3);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    max-height: 80vh;
    overflow-y: auto;
}

.leaderboard-title,
.leaderboard-entry {
    display: grid;
    grid-template-columns: 1fr 90px 60px 90px 60px;
    column-gap: 8px;
    align-items: center;
    padding: 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.5;
}

.leaderboard-entry {
    background: rgba(255, 255, 255, 0.03);
}

.leaderboard-entry .rank {
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.leaderboard-entry .name {
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.leaderboard-entry .value {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}

.leaderboard-entry .value.mass {
    color: rgba(255, 255, 255, 0.7);
}

.leaderboard-entry .value.age {
    color: rgba(255, 255, 255, 0.7);
}

.value.mass.sorted {
    font-weight: bold;
}

.value.age.sorted {
    font-weight: bold;
}

.leaderboard-entry.local-player {
    border: 1px solid rgba(255, 100, 150, 0.3);
}

.menu-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-text {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    line-height: 1.5;
}

.online-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #00ff00;
    border-radius: 50%;
    margin-left: 6px;
    margin-right: 6px;
    box-shadow: 0 0 1px #00ff00, 0 0 3px #00ff00;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 6px #00ff00, 0 0 6px #00ff00;
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 4px #00ff00, 0 0 6px #00ff00;
    }
}

/* Base notification styles */
.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 30px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 10000;
    text-align: center;
    line-height: 1.6;
    animation: notificationFadeIn 0.3s ease-out;
}

/* Notification types */
.notification.unlock {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.8);
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    font-size: 12px;
    padding: 20px 40px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.42);
}

.notification.offline {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 0, 0.8);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.42);
}

.notification.error {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 0, 0, 0.8);
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.42);
}

.notification.success {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(0, 255, 0, 0.8);
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.42);
}

.notification.info {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(180, 180, 200, 0.8);
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

/* Animation */
@keyframes notificationFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* SESSION TRANSFER */
.menu-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 14px 0;
}

.menu-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.transfer-warning {
    color: rgba(255, 200, 100, 0.9);
    font-size: 10px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.transfer-code-box {
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    text-align: center;
    margin: 8px 0 4px;
}

.transfer-code {
    font-size: 26px;
    letter-spacing: 7px;
    color: rgba(0, 255, 255, 0.69);
}

.transfer-expiry {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    margin-bottom: 4px;
}

.transfer-input-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.menu-btn-export {
    background: rgba(60, 60, 80, 0.5);
    border: 1px solid rgba(255, 192, 0, 0.42);
    color: rgba(255, 255, 255, 0.5);
    padding: 6px 12px;
    margin-top: 8px;
    margin-right: 8px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    transition: all 0.2s;
}

.menu-btn-export:hover {
    background: rgba(255, 192, 0, 0.24);
    border-color: rgba(255, 192, 0, 0.69);
}

.menu-btn-export-active {
    background: rgba(255, 192, 0, 0.13);
    border-color: rgba(255, 192, 0, 0.42);
}

.menu-btn-import {
    background: rgba(60, 60, 80, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.42);
    color: rgba(255, 255, 255, 0.5);
    padding: 6px 12px;
    margin-top: 8px;
    margin-right: 8px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.menu-btn-import:hover {
    background: rgba(0, 255, 255, 0.24);
    border-color: rgba(0, 255, 255, 0.69);
}

.menu-btn-import.active {
    background: rgba(0, 255, 255, 0.13);
    border-color: rgba(0, 255, 255, 0.42);
}

.transfer-input {
    flex: 1;
    background: rgba(30, 30, 50, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 6px 8px;
    font-size: 15px;
    letter-spacing: 3px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.transfer-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.transfer-input:focus {
    outline: none;
    border-color: rgba(0, 255, 255, 0.42);
}

.tooltip-trigger {
    cursor: help;
    pointer-events: auto;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.3);
    position: relative;
}

#global-tooltip {
    position: fixed;
    z-index: 9999;
    background: rgba(20, 20, 30, 0.69);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(5px);
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    font-family: 'Courier New', monospace;
    padding: 8px 10px;
    border-radius: 4px;
    max-width: 256px;
    pointer-events: none;
    display: none;
    line-height: 1.5;
}
