* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
* {
    -webkit-tap-highlight-color: transparent;
}
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
}
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: #f5f7ff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
.game-shell {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    text-align: center;
    background: transparent;
    padding: 0;
    margin: 0;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}
.game-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 0;
}
#gameCanvas {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    border-radius: 0;
    border: none;
    box-shadow: none;
    touch-action: none;
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
/* Top Game Header */
.game-header {
    position: fixed;
    left: 0;
    right: 0;
    height: clamp(48px, 8vh, 64px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(4px, 1.5vw, 16px);
    gap: clamp(2px, 1vw, 10px);
    backdrop-filter: blur(12px);
    z-index: 100;
    pointer-events: none;
}
.game-header-top {
    top: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.7) 70%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Bottom Stats Bar */
.stats-bar-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: clamp(40px, 6vh, 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 3vw, 24px);
    padding: 0 clamp(8px, 2vw, 20px);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.7) 70%, transparent 100%);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    pointer-events: none;
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* Extra small screens */
@media (max-width: 360px) {
    .game-header {
        height: 46px;
        padding: 0 3px;
        gap: 1px;
    }
    .game-title {
        font-size: 0.55rem;
        letter-spacing: 0.02rem;
    }
    .header-right {
        gap: 2px;
    }
    .stats-bar-bottom {
        height: 38px;
        gap: 6px;
        padding: 0 6px;
    }
    .stat-compact {
        font-size: 0.5rem;
        gap: 1px;
    }
    .stat-icon {
        font-size: 0.55rem;
    }
    .stat-value {
        min-width: 12px;
    }
    .heart {
        font-size: 0.6rem;
    }
    .lives-kills-group {
        gap: 3px;
        padding: 2px 3px;
        border-radius: 8px;
    }
    .header-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    #killsDisplay {
        min-width: 14px;
        padding: 1px 2px;
    }
}
/* Desktop/Tablet responsive scaling */
@media (min-width: 600px) {
    .game-header {
        height: 60px;
        padding: 0 16px;
        gap: 10px;
    }
    .game-title {
        font-size: 1.2rem;
        letter-spacing: 0.1rem;
    }
    .header-right {
        gap: 8px;
    }
    .stats-bar-bottom {
        height: 54px;
        gap: 20px;
        padding: 0 20px;
    }
    .stat-compact {
        font-size: 0.9rem;
        gap: 4px;
    }
    .stat-icon {
        font-size: 1rem;
    }
    .stat-value {
        min-width: 26px;
    }
    .heart {
        font-size: 1.1rem;
    }
    .lives-kills-group {
        gap: 10px;
        padding: 6px 10px;
        border-radius: 18px;
    }
    .header-btn {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
        border-radius: 8px;
    }
    #killsDisplay {
        min-width: 26px;
        padding: 2px 6px;
    }
}
.header-left,
.header-right {
    display: flex;
    align-items: center;
}
.header-left {
    flex: 0 0 auto;
    min-width: 0;
}
.header-right {
    flex: 0 0 auto;
    gap: clamp(2px, 0.8vw, 8px);
    min-width: 0;
}
.game-title {
    font-size: clamp(0.55rem, 2.5vw, 1.2rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: clamp(0.02rem, 0.25vw, 0.1rem);
    margin: 0;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #fff 0%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}
.stat-compact {
    display: flex;
    align-items: center;
    gap: clamp(1px, 0.4vw, 4px);
    font-size: clamp(0.5rem, 1.8vw, 0.9rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    flex-shrink: 1;
}
.stats-bar-bottom .stat-compact {
    font-size: clamp(0.65rem, 2.2vw, 1rem);
    gap: clamp(2px, 0.6vw, 6px);
}
.stat-icon {
    font-size: clamp(0.55rem, 2vw, 1rem);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
    line-height: 1;
    flex-shrink: 0;
}
.stats-bar-bottom .stat-icon {
    font-size: clamp(0.75rem, 2.5vw, 1.2rem);
}
.stat-value {
    color: #ffd700;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    min-width: clamp(12px, 3vw, 26px);
    text-align: center;
    flex-shrink: 0;
}
.stats-bar-bottom .stat-value {
    min-width: clamp(16px, 4vw, 32px);
}
#speedDisplay {
    color: #4fc3f7;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.8);
    font-weight: 900;
}
#distanceDisplay {
    color: #81c784;
    text-shadow: 0 0 8px rgba(129, 199, 132, 0.7);
}
#bestDisplay {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}
.lives-kills-group {
    display: flex;
    align-items: center;
    gap: clamp(3px, 0.8vw, 10px);
    padding: clamp(2px, 0.6vw, 6px) clamp(3px, 0.8vw, 10px);
    background: rgba(0, 0, 0, 0.4);
    border-radius: clamp(8px, 1.5vw, 18px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}
#killsDisplay {
    padding: clamp(1px, 0.25vw, 3px) clamp(2px, 0.6vw, 6px);
    background: rgba(255, 75, 75, 0.15);
    border-radius: clamp(4px, 0.8vw, 8px);
    border: 1px solid rgba(255, 75, 75, 0.3);
    font-weight: 800;
    color: #ff4b4b !important;
    text-shadow: 0 0 8px rgba(255, 75, 75, 0.8) !important;
    transition: all 0.2s ease;
    min-width: clamp(14px, 3.5vw, 26px);
}
.hearts-inline {
    display: flex;
    gap: clamp(0px, 0.15vw, 2px);
}
.heart {
    font-size: clamp(0.6rem, 2vw, 1.1rem);
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    animation: heartbeat 1.5s ease-in-out infinite;
}
.heart.empty {
    opacity: 0.25;
    filter: grayscale(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
@keyframes heartbeat {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}
@keyframes killPulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 75, 75, 0);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 15px rgba(255, 75, 75, 0.8);
    }
}
.header-btn {
    width: clamp(30px, 5.5vw, 42px);
    height: clamp(30px, 5.5vw, 42px);
    border-radius: clamp(6px, 0.8vw, 8px);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    line-height: 1;
    pointer-events: all;
    flex-shrink: 0;
}
.header-btn:active {
    transform: scale(0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.menu-btn:active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
}
.pause-btn {
    display: none;
}
.pause-btn.active {
    display: flex;
}
.pause-btn:active {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.8) 0%, rgba(255, 152, 0, 0.8) 100%);
}
.pause-btn.paused {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.8) 0%, rgba(56, 142, 60, 0.8) 100%);
}
.menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(90vw, 350px);
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    border-left: 2px solid rgba(255, 255, 255, 0.2);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 999;
    backdrop-filter: blur(20px);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.8);
}
.menu-panel.active {
    right: 0;
}
.menu-panel h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.8rem;
    color: #ffffff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 0.75rem;
    text-align: left;
}
.menu-section {
    margin-bottom: 2rem;
    text-align: left;
}
.menu-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    color: #ffd700;
}
.menu-section p {
    margin: 0.75rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}
.menu-section strong {
    color: #ffffff;
    font-weight: 700;
}
/* Menu Tabs */
.menu-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}
.menu-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.menu-tab:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}
.menu-tab.active {
    color: #ffd700;
    border-bottom-color: #ffd700;
}
.menu-tab-content {
    display: none;
}
.menu-tab-content.active {
    display: block;
}
/* Leaderboard */
.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}
.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid rgba(255, 215, 0, 0.5);
    transition: all 0.2s ease;
}
.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
}
.leaderboard-item.top-1 {
    border-left-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}
.leaderboard-item.top-2 {
    border-left-color: #c0c0c0;
}
.leaderboard-item.top-3 {
    border-left-color: #cd7f32;
}
.leaderboard-rank {
    font-size: 1.2rem;
    font-weight: 900;
    color: #ffd700;
    min-width: 40px;
}
.leaderboard-info {
    flex: 1;
    margin: 0 1rem;
}
.leaderboard-name {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
}
.leaderboard-stats {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}
.leaderboard-score {
    font-size: 1.1rem;
    font-weight: 800;
    color: #4fc3f7;
    min-width: 60px;
    text-align: right;
}
/* Global Stats Display */
.stats-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}
.stat-card {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}
.stat-card-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: #ffd700;
    margin-bottom: 0.5rem;
}
.stat-card-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}
.loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 2rem;
}
.volume-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.volume-group label {
    font-size: 1rem;
    min-width: 80px;
    color: #ffffff;
}
.volume-group span {
    min-width: 45px;
    text-align: right;
    color: #ffd700;
    font-weight: 600;
}
.volume-group input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.volume-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.volume-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 9, 18, 0.85);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    padding: 1.5rem;
    z-index: 10;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}
.overlay.active {
    opacity: 1;
    visibility: visible;
}
.overlay.active .overlay-card {
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.overlay-card {
    width: min(88vw, 460px);
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.92) 0%, rgba(20, 20, 40, 0.9) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    margin: auto;
}
.overlay-card h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.8rem, 5vw, 2.3rem);
    letter-spacing: 0.08rem;
    font-weight: 900;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.3);
    animation: titlePulse 2s ease-in-out infinite;
}
@keyframes titlePulse {
    0%,
    100% {
        transform: scale(1);
        text-shadow: 0 3px 10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 215, 0, 0.5);
    }
}
.overlay-card p {
    margin: 0.7rem 0;
    line-height: 1.6;
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
    padding: 1rem 0;
}
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, background 0.3s ease;
}
.stat-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}
.stat-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.stat-value {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
.stat-label {
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}
.secondary-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin-top: 1.5rem;
}
.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 3rem;
    border-radius: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid rgba(255, 255, 255, 0.25);
    font-weight: 800;
    font-size: clamp(1rem, 3vw, 1.15rem);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 1rem;
    animation: buttonGlow 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}
.primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.primary:active::after {
    width: 300px;
    height: 300px;
}
@keyframes buttonGlow {
    0%,
    100% {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 8px 28px rgba(102, 126, 234, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}
.primary:hover,
.primary:focus-visible {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 28px rgba(102, 126, 234, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    outline: none;
    animation: none;
}
.primary:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.6);
}
.hint {
    font-size: 0.85rem;
    color: rgba(226, 233, 255, 0.6);
}
/* Name Input Screen */
.name-input-group {
    margin: 2rem 0;
    width: 100%;
}
.name-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
}
.name-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.name-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}
.input-helper {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}
.intro-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 1rem 0;
}
/* Start Screen Enhancements */
.game-tips {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.tip-item {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    text-align: left;
}
/* Game Over Screen Enhancements */
.game-over-card {
    max-height: 85vh;
    overflow-y: auto;
}
.player-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.player-name-display {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}
.rank-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.rank-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.rank-value {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}
.game-over-leaderboard {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.leaderboard-title {
    font-size: 1.2rem;
    margin: 0 0 1rem 0;
    color: #ffd700;
    text-align: center;
}
.leaderboard-list.compact {
    max-height: 250px;
}
.leaderboard-list.compact .leaderboard-item {
    padding: 0.5rem;
    margin-bottom: 0.4rem;
}
.leaderboard-list.compact .leaderboard-rank {
    font-size: 1rem;
    min-width: 30px;
}
.leaderboard-list.compact .leaderboard-name {
    font-size: 0.9rem;
}
.leaderboard-list.compact .leaderboard-stats {
    font-size: 0.75rem;
}
.leaderboard-list.compact .leaderboard-score {
    font-size: 0.95rem;
    min-width: 50px;
}
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.action-buttons .primary,
.action-buttons .secondary {
    flex: 1;
    min-width: 150px;
}
.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 2rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}
.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}
.secondary:active {
    transform: translateY(0);
}
.btn-icon {
    font-size: 1.2em;
}
.primary:disabled,
.secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}
.touch-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(94vw, 600px);
    z-index: 100;
}
.touch-btn {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    padding: 1.1rem 0.9rem;
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: rgba(20, 20, 40, 0.75);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
}
.touch-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}
.touch-btn:active::before {
    left: 100%;
}
.touch-btn--boost {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.85), rgba(58, 123, 213, 0.85));
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    border-color: rgba(0, 210, 255, 0.5);
}
.touch-btn--brake {
    background: linear-gradient(135deg, rgba(248, 80, 50, 0.85), rgba(231, 56, 39, 0.85));
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    border-color: rgba(248, 80, 50, 0.5);
}
.touch-btn.pressed {
    transform: translateY(3px) scale(0.96);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.7),
        inset 0 2px 8px rgba(0, 0, 0, 0.4);
    filter: brightness(0.85);
}
.touch-btn--boost.pressed {
    box-shadow: 0 3px 12px rgba(0, 210, 255, 0.5),
        inset 0 2px 8px rgba(0, 0, 0, 0.4);
}
.touch-btn--brake.pressed {
    box-shadow: 0 3px 12px rgba(248, 80, 50, 0.5),
        inset 0 2px 8px rgba(0, 0, 0, 0.4);
}
@media (max-width: 540px) {
    .hud-group {
        padding: 0.5rem 0.7rem;
        min-width: 80px;
        gap: 0.3rem;
    }
    .hud-item {
        font-size: clamp(0.7rem, 1.8vw, 0.85rem);
        gap: 0.25rem;
    }
    .hud-item .icon {
        font-size: clamp(0.85rem, 2.2vw, 1rem);
    }
    .heart {
        font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    }
    .overlay-card {
        padding: 2rem 1.5rem;
    }
    .game-header {
        height: 56px;
        padding: 0 8px;
        gap: 6px;
    }
    .game-title {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
        letter-spacing: 0.08rem;
    }
    .header-center {
        gap: 8px;
    }
    .stat-compact {
        font-size: clamp(0.7rem, 2vw, 0.85rem);
        gap: 3px;
    }
    .lives-kills-group {
        padding: 4px 8px;
        gap: 8px;
    }
    .header-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .stat-item {
        padding: 0.75rem;
    }
    .stat-icon {
        font-size: 1.5rem;
    }
    .stat-value {
        font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    }
}
@media (hover: none) and (pointer: coarse) {
    .touch-controls {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.7rem;
    }
    .touch-btn {
        font-size: clamp(0.95rem, 3.8vw, 1.1rem);
        padding: clamp(0.75rem, 3vw, 1rem) 0.5rem;
    }
}
 /* Highlight current player in leaderboard */
.leaderboard-item.current-player {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}
