

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, #0a1929 0%, #0d2238 100%);
    min-height: 100vh;
    color: white;
    
}


.start-screen {
    
    
    
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 1001;
    background: linear-gradient(180deg, #0a1929 0%, #0d2238 100%);
    overflow-y: auto;
    padding: 3rem 2rem;
}

.start-screen.hidden {
    display: none;
}

.start-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 3rem;
    margin-top: 2rem;
    color: white;
}

.difficulty-selector {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.difficulty-btn {
    padding: 1.2rem 3rem;
    background: rgba(13, 34, 56, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s;
    min-width: 140px;
}

.difficulty-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.difficulty-btn.active {
    background: #ff5722;
    border-color: #ff5722;
    color: white;
    box-shadow: 0 6px 24px rgba(255, 87, 34, 0.5);
}

.play-button {
    padding: 1.5rem 6rem;
    background: linear-gradient(135deg, #ff6b3d 0%, #ff5722 100%);
    border: none;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 8px 32px rgba(255, 87, 34, 0.4);
    margin-bottom: 1.5rem;
}

.play-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 87, 34, 0.6);
}

.play-button:active {
    transform: translateY(-1px);
}

.play-button svg {
    margin-left: 0.5rem;
}

.back-btn-start {
    padding: 0.75rem 2rem;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-btn-start:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}


.start-leaderboard {
    width: 100%;
    max-width: 800px;
    margin-top: 4rem;
}

.leaderboard-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    text-align: center;
    margin-bottom: 1.5rem;
}

.leaderboard-tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.leaderboard-tab {
    padding: 0.5rem 1.5rem;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

.leaderboard-tab:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
}

.leaderboard-tab.active {
    background: transparent;
    border-color: #ff5722;
    color: #ff5722;
}

.leaderboard-table {
    background: rgba(13, 34, 56, 0.4);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-table table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: rgba(13, 34, 56, 0.8);
    position: sticky;
    top: 0;
    z-index: 1;
}

.leaderboard-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table th:first-child {
    width: 50px;
    text-align: center;
}

.leaderboard-table td {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-table td:first-child {
    text-align: center;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
}

.leaderboard-table tbody tr:hover {
    background: rgba(33, 150, 243, 0.08);
}


.leaderboard-table::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-table::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.leaderboard-table::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.leaderboard-table::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}


.mode-description {
    width: 100%;
    max-width: 900px;
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(13, 34, 56, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.mode-desc-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    text-align: center;
    margin-bottom: 2rem;
}

.mode-desc-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mode-desc-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(13, 34, 56, 0.3);
    border-radius: 12px;
    transition: all 0.3s;
}

.mode-desc-item:hover {
    background: rgba(13, 34, 56, 0.5);
    transform: translateX(5px);
}

.mode-desc-icon {
    flex-shrink: 0;
}

.mode-desc-icon img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
}

.mode-desc-text {
    flex: 1;
}

.mode-desc-text h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
}

.mode-desc-text p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}


.game-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    background: rgba(10, 25, 41, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.back-button {
    position: absolute;
    left: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #2196f3;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.back-button:hover {
    background: #1976d2;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.6);
}

.back-button svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.game-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
}


.game-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    padding: 1.5rem 4rem;
    background: rgba(10, 25, 41, 0.8);
}

.stat-item {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.stat-label {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.stat-value.round {
    color: #2196f3;
}

.stat-value.current {
    color: #ff9800;
}

.stat-value.average {
    color: #4caf50;
}

.stat-value.best {
    color: #9c27b0;
}


.game-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.5rem;
}

#gameCanvas {
    background: linear-gradient(135deg, #1a3a52 0%, #0f2537 100%);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    cursor: crosshair;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 100%;
    max-height: calc(100vh - 260px);
}

#gameCanvas.waiting {
    cursor: wait;
    background: linear-gradient(135deg, #2a1a1a 0%, #1a0f0f 100%);
}

.game-hint {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.waiting-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: #ff9800;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
    
}

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


.results-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a1929 0%, #0d2238 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 1000;
    padding: 2rem;
    overflow-y: auto;
}

.results-screen.active {
    display: flex;
}


.current-result-container {
    width: 100%;
    max-width: 900px;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.current-result-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: white;
    text-align: center;
}

.current-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    background: rgba(13, 34, 56, 0.6);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.current-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.current-stat-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.current-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ff5722;
}


.history-container {
    width: 100%;
    max-width: 900px;
    margin-bottom: 2rem;
}

.history-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: white;
    text-align: center;
}


.results-table {
    width: 100%;
    margin-bottom: 2rem;
    background: rgba(13, 34, 56, 0.4);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(13, 34, 56, 0.8);
}

th {
    padding: 1rem;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th:first-child {
    width: 60px;
    text-align: center;
}

td {
    padding: 1rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

td:first-child {
    text-align: center;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

tbody tr:hover {
    background: rgba(33, 150, 243, 0.08);
}

tbody tr.highlight-result {
    background: rgba(255, 87, 34, 0.3);
}

tbody tr.highlight-result td {
    color: white;
    font-weight: 500;
}

tbody tr.highlight-result td:first-child {
    background: #ff5722;
    color: white;
}


.results-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #2196f3;
    color: white;
}

.btn-primary:hover {
    background: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}


@media (max-width: 768px) {
    .game-stats {
        padding: 1rem 1.5rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .stat-item {
        font-size: 0.9rem;
    }

    .current-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .current-stat-value {
        font-size: 2rem;
    }

    .history-title {
        font-size: 1.5rem;
    }

    .results-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

