:root {
    --panel: #0b1017;
    --grid: #0f1824;
    --text: #e6f2ff;
    --ship: #22d3ee;
    --ship-rgb: 34, 211, 238;
    --flame: #f59e0b;
    --bullet: #f43f5e;
    --rock-light: #84cc16;
    --rock-med: #15803d;
    --rock-blue: #3b82f6;
    --rock-purple: #a855f7;
    --rock-red: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--panel);
    overflow: hidden;
    touch-action: none;
    font-family: system-ui, -apple-system, sans-serif;
}

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game {
    display: block;
    background: var(--panel);
}

#hud {
    position: fixed;
    top: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 10;
}

#hud.hidden {
    display: none;
}

.hud-item.clickable {
    cursor: pointer;
    pointer-events: auto;
}

#player-info .label {
    font-size: 10px;
    opacity: 0.6;
    letter-spacing: 1px;
}

#player-name-display {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

#player-name-display::after {
    content: '⏸';
    font-size: 16px;
    opacity: 0.6;
}

#player-info.paused #player-name-display::after {
    content: '▶';
}

#player-name-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--ship);
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    width: 200px;
    padding: 10px;
    margin-bottom: 20px;
    outline: none;
}

#start-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

#start-name-display {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    opacity: 0.9;
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--ship);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-btn:hover {
    opacity: 1;
}

.primary-btn {
    border-color: var(--ship);
    background: var(--ship);
    color: var(--panel);
    font-weight: 700;
    font-size: 18px;
    padding: 16px 48px;
    letter-spacing: 3px;
    box-shadow: 0 0 20px rgba(var(--ship-rgb), 0.3);
}

.primary-btn:hover {
    background: #38d9f5;
    border-color: var(--ship);
    box-shadow: 0 0 30px rgba(var(--ship-rgb), 0.5);
    transform: scale(1.05);
    color: var(--panel);
}

.primary-btn:active {
    transform: scale(0.97);
}

.secondary-btn {
    border-color: var(--ship);
    background: transparent;
    color: var(--ship);
    font-weight: 600;
    font-size: 16px;
    padding: 14px 36px;
    letter-spacing: 2px;
    opacity: 0.75;
}

.secondary-btn:hover {
    opacity: 1;
    background: rgba(var(--ship-rgb), 0.1);
    transform: scale(1.05);
    color: var(--ship);
}

.secondary-btn:active {
    transform: scale(0.97);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 18, 12, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

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

.modal-box {
    background: var(--grid);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-box h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

#modal-name-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--ship);
    color: var(--text);
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    width: 100%;
    padding: 10px;
    outline: none;
    transition: border-color 0.2s;
}

#modal-name-input:focus {
    border-bottom-color: var(--flame);
}

.modal-hint {
    font-size: 13px;
    opacity: 0.5;
    margin: 0;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.modal-buttons .menu-btn {
    flex: 1;
    margin-top: 0;
    max-width: none;
    padding: 12px 20px;
    font-size: 14px;
}

.menu-btn {
    margin-top: 16px;
    background: transparent;
    border: 2px solid var(--ship);
    color: var(--text);
    font-size: 16px;
    padding: 14px 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
    width: 100%;
    max-width: 240px;
    box-sizing: border-box;
}

.menu-btn:hover {
    background: var(--ship);
    color: var(--panel);
    transform: scale(1.05);
}

.menu-btn:active {
    transform: scale(0.95);
}

#start-screen > .menu-btn {
    max-width: 240px;
}

#customize-design-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.customize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
    margin-bottom: 8px;
}

.customize-design-item,
.customize-color-item,
.customize-bullet-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    aspect-ratio: 1;
}

.customize-design-item:hover,
.customize-color-item:hover,
.customize-bullet-item:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

.customize-design-item.selected,
.customize-color-item.selected,
.customize-bullet-item.selected {
    border-color: var(--ship);
    background: rgba(var(--ship-rgb), 0.1);
    box-shadow: 0 0 16px rgba(var(--ship-rgb), 0.3);
}

.customize-design-preview {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.customize-design-preview svg {
    width: 100%;
    height: 100%;
}

.customize-color-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.customize-section-separator {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ship);
    opacity: 0.6;
    padding: 16px 0 8px;
    border-bottom: 1px solid rgba(var(--ship-rgb), 0.2);
    margin-bottom: 8px;
}

.customize-bullet-preview {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.customize-bullet-preview svg {
    width: 100%;
    height: 100%;
}

.customize-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    width: 100%;
    justify-content: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.customize-tabs::-webkit-scrollbar {
    display: none;
}

.customize-tab {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    scroll-snap-align: center;
    flex-shrink: 0;
    min-width: 64px;
}

.customize-tab .tab-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.customize-tab.active {
    border-color: var(--ship);
    background: rgba(var(--ship-rgb), 0.15);
    color: var(--ship);
    box-shadow: 0 0 12px rgba(var(--ship-rgb), 0.25);
}

.customize-section {
    display: none;
    width: 100%;
    animation: section-fade 0.2s ease-out;
}

.customize-section.active {
    display: block;
}

@keyframes section-fade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

#player-name-input:focus {
    border-bottom-color: var(--flame);
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text);
}

.hud-item .label {
    font-size: 10px;
    opacity: 0.6;
    letter-spacing: 1px;
}

.hud-item #score,
.hud-item #high {
    font-size: 24px;
    font-weight: 700;
}

#powerup-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    pointer-events: none;
    z-index: 10;
}

.powerup-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    position: relative;
    border: 2px solid transparent;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.powerup-icon-inner {
    position: relative;
    z-index: 1;
}

.powerup-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 18px;
    animation: ring-pulse 2s ease-in-out infinite;
}

@keyframes ring-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.05); }
}

@keyframes powerup-activate {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.powerup-icon.active {
    animation: powerup-activate 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.powerup-icon.expiring {
    animation: pulse-urgent 0.4s ease-in-out infinite;
}

@keyframes pulse-urgent {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}

#start-screen,
#game-over-screen,
#pause-screen,
#instructions-screen,
#customize-screen,
#leaderboard-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(7, 18, 12, 0.95);
    color: var(--text);
    z-index: 100;
    cursor: pointer;
    padding: 20px;
    min-width: 0;
}

#start-screen,
#instructions-screen,
#customize-screen,
#leaderboard-screen {
    background: transparent;
}

#instructions-screen,
#customize-screen,
#leaderboard-screen {
    justify-content: flex-start;
    padding-top: 60px;
    padding-bottom: 100px;
    cursor: default;
}

#start-screen > *,
#game-over-screen > *,
#pause-screen > * {
    max-width: 100%;
    min-width: 0;
    flex-shrink: 1;
}

.screen-content {
    flex: 1;
    width: 100%;
    max-width: min(560px, 100%);
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right));
    touch-action: pan-y;
}

.screen-content::-webkit-scrollbar {
    width: 6px;
}

.screen-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.screen-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--ship), rgba(var(--ship-rgb), 0.4));
    border-radius: 3px;
    box-shadow: 0 0 6px var(--ship);
}

.screen-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--ship), rgba(var(--ship-rgb), 0.8));
}

.screen-content {
    scrollbar-width: thin;
    scrollbar-color: var(--ship) rgba(255, 255, 255, 0.05);
}

.screen-back-btn {
    flex-shrink: 0;
    margin-top: auto;
    background: transparent;
    border: 2px solid var(--ship);
    color: var(--text);
    font-size: 18px;
    padding: 12px 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.screen-back-btn:hover {
    background: var(--ship);
    color: var(--panel);
    transform: scale(1.05);
}

.screen-back-btn:active {
    transform: scale(0.95);
}

#start-screen h1,
#game-over-screen h1,
#pause-screen h1 {
    font-size: clamp(36px, 10vw, 64px);
    letter-spacing: clamp(2px, 1vw, 8px);
    margin-bottom: 20px;
    text-shadow: 0 0 30px var(--ship);
    word-wrap: break-word;
    max-width: 100%;
}

#start-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 260px;
}

#company-name,
#game-version {
    font-size: 12px;
    opacity: 0.45;
    letter-spacing: 1px;
    cursor: default;
}

#start-screen p,
#game-over-screen p,
#pause-screen p {
    font-size: clamp(14px, 4vw, 18px);
    opacity: 0.8;
}

#instructions-screen {
    cursor: default;
}

#start-screen h1,
#start-screen p {
    cursor: default;
}

#instructions-screen h1,
#customize-screen h1,
#leaderboard-screen h1 {
    font-size: clamp(24px, 7vw, 36px);
    letter-spacing: clamp(2px, 0.5vw, 4px);
    margin-bottom: 0;
    margin-top: 0;
    text-shadow: 0 0 30px var(--ship);
    flex-shrink: 0;
}

.instructions-controls {
    text-align: center;
    margin-bottom: 50px;
    padding: 0 20px;
}

.instructions-controls p {
    font-size: 20px;
    opacity: 0.85;
    margin: 12px 0;
    font-weight: 500;
}

.instructions-powerups {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 50px;
    padding: 0 20px;
    max-width: 400px;
    width: 100%;
}

.powerup-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.powerup-item:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 120px;
}

.powerup-icon-only {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.powerup-label {
    font-size: 11px;
    opacity: 0.9;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#game-over-screen h1 {
    color: var(--bullet);
    text-shadow: 0 0 30px var(--bullet);
    text-align: center;
    width: 100%;
}

#gameover-name-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--ship);
    color: var(--text);
    font-size: 20px;
    text-align: center;
    padding: 8px 16px;
    outline: none;
    transition: border-color 0.2s;
    max-width: 200px;
}

#gameover-name-input:focus {
    border-bottom-color: var(--flame);
}

#pause-screen h1 {
    color: var(--flame);
    text-shadow: 0 0 30px var(--flame);
}

#pause-screen .screen-back-btn + .screen-back-btn {
    margin-top: 8px;
}

#final-score {
    font-size: 24px;
    margin-bottom: 30px;
}

.hidden {
    display: none !important;
}

.menu-btn {
    margin-top: 16px;
    background: transparent;
    border: 2px solid var(--ship);
    color: var(--text);
    font-size: 16px;
    padding: 14px 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
    width: 100%;
    max-width: 240px;
    box-sizing: border-box;
}

#design-list {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 180px;
}

#design-list.open {
    display: flex;
}

.design-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.03);
}

.design-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.design-option.selected {
    border-color: var(--ship);
    background: rgba(var(--ship-rgb), 0.1);
}

.design-option .design-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.design-option .design-name {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lb-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.lb-tab {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.lb-tab.active {
    border-color: var(--ship);
    background: rgba(var(--ship-rgb), 0.15);
    color: var(--ship);
}

.lb-tab-content {
    width: 100%;
    max-width: 360px;
}

.lb-list {
    width: 100%;
}

.lb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.lb-row.current {
    border-color: var(--flame);
    background: rgba(245, 158, 11, 0.12);
}

.lb-row.rank-1 .lb-rank,
.lb-row.rank-1 .lb-score {
    font-size: 22px;
    font-weight: 800;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 40px rgba(255, 215, 0, 0.5), 0 0 80px rgba(255, 215, 0, 0.3);
}
.lb-row.rank-1 .lb-name {
    font-size: 15px;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}
.lb-row.rank-1 {
    padding: 12px 16px;
    border: 2px solid rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.18) 0%, rgba(255, 215, 0, 0.04) 100%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.25), inset 0 0 12px rgba(255, 215, 0, 0.08);
    border-radius: 10px;
    transform: scale(1.03);
    animation: rankPulse 2s ease-in-out infinite;
    margin-bottom: 10px;
}

.lb-row.rank-2 .lb-rank,
.lb-row.rank-2 .lb-score {
    font-size: 19px;
    font-weight: 700;
    color: #E8E8E8;
    text-shadow: 0 0 14px rgba(192, 192, 192, 1), 0 0 30px rgba(192, 192, 192, 0.5), 0 0 50px rgba(192, 192, 192, 0.2);
}
.lb-row.rank-2 .lb-name {
    font-size: 15px;
    font-weight: 700;
    color: #C0C0C0;
    text-shadow: 0 0 8px rgba(192, 192, 192, 0.4);
}
.lb-row.rank-2 {
    padding: 10px 14px;
    border: 2px solid rgba(192, 192, 192, 0.5);
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.12) 0%, rgba(192, 192, 192, 0.03) 100%);
    box-shadow: 0 0 14px rgba(192, 192, 192, 0.18), inset 0 0 8px rgba(192, 192, 192, 0.05);
    border-radius: 10px;
    transform: scale(1.02);
    animation: rankPulse 2.5s ease-in-out infinite;
    margin-bottom: 8px;
}

.lb-row.rank-3 .lb-rank,
.lb-row.rank-3 .lb-score {
    font-size: 17px;
    font-weight: 700;
    color: #CD7F32;
    text-shadow: 0 0 12px rgba(205, 127, 50, 0.9), 0 0 24px rgba(205, 127, 50, 0.4);
}
.lb-row.rank-3 .lb-name {
    font-size: 14px;
    font-weight: 700;
    color: #CD7F32;
    text-shadow: 0 0 6px rgba(205, 127, 50, 0.3);
}
.lb-row.rank-3 {
    padding: 9px 13px;
    border: 2px solid rgba(205, 127, 50, 0.45);
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1) 0%, rgba(205, 127, 50, 0.02) 100%);
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.15), inset 0 0 6px rgba(205, 127, 50, 0.04);
    border-radius: 10px;
    transform: scale(1.01);
    animation: rankPulse 3s ease-in-out infinite;
    margin-bottom: 6px;
}

@keyframes rankPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.lb-row.rank-top5 {
    border: 1px solid rgba(var(--ship-rgb), 0.4);
    background: rgba(var(--ship-rgb), 0.08);
    border-radius: 8px;
    padding: 7px 12px;
    margin-bottom: 3px;
}

.lb-row.rank-top5 .lb-rank,
.lb-row.rank-top5 .lb-score {
    font-size: 15px;
    font-weight: 700;
    color: var(--ship);
}

.lb-row.rank-top10 {
    border: 1px solid rgba(45, 212, 191, 0.28);
    background: rgba(45, 212, 191, 0.05);
    border-radius: 6px;
    padding: 6px 12px;
}

.lb-row.rank-top10 .lb-rank {
    color: #2dd4bf;
    font-weight: 700;
    opacity: 0.7;
}

.lb-row.rank-top10 .lb-score {
    font-size: 14px;
    font-weight: 600;
}

.lb-row.rank-top20 {
    border: 1px solid rgba(34, 197, 94, 0.15);
    background: rgba(34, 197, 94, 0.025);
    border-radius: 4px;
}

.lb-row.rank-top20 .lb-rank {
    color: #22c55e;
    font-weight: 600;
    opacity: 0.45;
}

.lb-row.rank-top20 .lb-score {
    font-weight: 600;
}

.lb-row.rank-top50 {
    border: 1px solid rgba(234, 179, 8, 0.18);
    background: rgba(234, 179, 8, 0.025);
    border-radius: 4px;
}

.lb-row.rank-top50 .lb-rank {
    color: #eab308;
    font-weight: 600;
    opacity: 0.5;
}

.lb-row.rank-top50 .lb-score {
    font-weight: 600;
}

.lb-row.rank-top100 {
    background: rgba(100, 116, 139, 0.04);
}

.lb-row.rank-top100 .lb-rank {
    color: #64748b;
    font-weight: 600;
    opacity: 0.35;
}

.lb-row .lb-rank {
    width: 28px;
    text-align: center;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.lb-row .lb-ship {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-row .lb-ship svg {
    width: 100%;
    height: 100%;
}

.lb-row .lb-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lb-row .lb-name {
    flex: 1;
    text-align: left;
    margin-left: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-row .lb-score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-left: 12px;
    flex-shrink: 0;
}

.lb-empty {
    text-align: center;
    padding: 24px;
    opacity: 0.5;
    font-size: 14px;
}

.lb-loading {
    text-align: center;
    padding: 24px;
    opacity: 0.6;
    font-size: 14px;
}

#gameover-leaderboard {
    width: 100%;
    max-width: 360px;
    margin: 12px 0;
    max-height: 40vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#gameover-leaderboard h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 12px 0 8px;
    opacity: 0.7;
    color: var(--ship);
}

#gameover-leaderboard .lb-row {
    padding: 6px 10px;
    font-size: 13px;
}

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel);
    z-index: 9999;
    transition: opacity 0.4s ease-out;
}

#splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#splash-screen .splash-logo {
    animation: splash-glow 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes splash-glow {
    0%   { transform: scale(0.85); filter: drop-shadow(0 0 0 transparent); opacity: 0; }
    60%  { transform: scale(1.05); filter: drop-shadow(0 0 30px rgba(34, 255, 158, 0.6)); opacity: 1; }
    100% { transform: scale(1);    filter: drop-shadow(0 0 20px rgba(34, 255, 158, 0.4)) drop-shadow(0 0 40px rgba(168, 85, 247, 0.3)); opacity: 1; }
}

.logo-wordmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    user-select: none;
}

.logo-wordmark-row {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    gap: 0;
}

.logo-letter {
    font-family: 'Tektur', 'Orbitron', 'Bank Gothic', system-ui, sans-serif;
    font-weight: 900;
    font-size: clamp(44px, 13vw, 78px);
    letter-spacing: 0.02em;
    line-height: 1;
    background: linear-gradient(180deg, #e6f8ff 0%, #22d3ee 45%, #0891b2 80%, #155e75 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter:
        drop-shadow(0 0 10px rgba(var(--ship-rgb), 0.45))
        drop-shadow(0 0 28px rgba(var(--ship-rgb), 0.18))
        drop-shadow(0 2px 0 rgba(0, 0, 0, 0.55));
    padding: 0 0.025em;
    transform: skewX(-2deg);
}

.logo-a-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.03em;
    transform: translateY(0.06em) skewX(-2deg);
    animation: logo-pulse 4.5s ease-in-out infinite;
}

.logo-a-mark svg {
    height: clamp(42px, 12.4vw, 74px);
    width: auto;
    display: block;
}

@keyframes logo-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 6px rgba(var(--ship-rgb), 0.35))
                drop-shadow(0 0 14px rgba(var(--ship-rgb), 0.12));
    }
    50% {
        filter: drop-shadow(0 0 14px rgba(var(--ship-rgb), 0.65))
                drop-shadow(0 0 34px rgba(var(--ship-rgb), 0.3));
    }
}

.logo-caption {
    font-family: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
    font-size: clamp(9px, 1.7vw, 11px);
    letter-spacing: clamp(2.5px, 0.5vw, 4.5px);
    text-transform: uppercase;
    color: rgba(var(--ship-rgb), 0.55);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 2px;
}

.logo-caption .logo-tri-mark {
    font-size: 0.78em;
    color: var(--ship);
    text-shadow: 0 0 6px rgba(var(--ship-rgb), 0.6);
    line-height: 1;
    transform: translateY(-1px);
}

.logo-caption .logo-tri-mark:nth-child(2) {
    color: #a5f3fc;
    opacity: 0.85;
}

.logo-caption .logo-tri-mark:nth-child(3) {
    color: #0e7490;
    text-shadow: 0 0 6px rgba(var(--ship-rgb), 0.55);
}

.logo-caption .logo-caption-sep {
    color: rgba(var(--ship-rgb), 0.4);
    margin: 0 1px;
}

.logo-caption .logo-caption-num {
    color: var(--ship);
    font-weight: 500;
    text-shadow: 0 0 8px rgba(var(--ship-rgb), 0.4);
}

.logo-caption .logo-caption-tag {
    color: rgba(var(--ship-rgb), 0.45);
    margin-left: 2px;
}

.screen-enter {
    animation: screen-enter 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes screen-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
