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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}

.game-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    padding: 20px;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.game-info {
    display: flex;
    gap: 20px;
}

.info-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 20px;
    text-align: center;
    min-width: 80px;
}

.info-box .label {
    font-size: 10px;
    color: #888;
    letter-spacing: 2px;
}

.info-box .value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #00ff88;
}

#game-canvas {
    border: 2px solid #00ff88;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.next-piece-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.side-panel-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    padding-top: 12px;
}

.next-piece-area .label {
    font-size: 12px;
    color: #888;
    letter-spacing: 2px;
}

#next-canvas {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
}

.btn {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    border: none;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: bold;
    color: #0f0f1a;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

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

.leaderboard {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    min-width: 280px;
    max-height: 650px;
    overflow-y: auto;
}

.leaderboard h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #00ff88;
    text-align: center;
    letter-spacing: 2px;
}

#leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 28px 1fr 70px 78px 24px;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 13px;
}

.leaderboard-entry.top-3 {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.leaderboard-entry .rank {
    font-weight: bold;
    color: #888;
}

.leaderboard-entry.top-3 .rank {
    color: #00ff88;
}

.leaderboard-entry .name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-entry .country {
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.leaderboard-entry .flag-img {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.leaderboard-entry .score {
    font-weight: bold;
    color: #00ff88;
    text-align: right;
}

.leaderboard-entry .date {
    font-size: 11px;
    color: #666;
    text-align: right;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1a1a2e;
    border: 2px solid #00ff88;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    min-width: 300px;
}

.modal-content h2 {
    color: #00ff88;
    margin-bottom: 20px;
    font-size: 28px;
}

.modal-content p {
    margin-bottom: 20px;
    font-size: 18px;
}

#player-name {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    margin-bottom: 10px;
}

#player-name:focus {
    outline: none;
    border-color: #00ff88;
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    .leaderboard {
        width: 100%;
        max-width: 340px;
    }
}

@media (max-width: 400px) {
    #game-canvas {
        width: 250px;
        height: 500px;
    }
    
    .game-info {
        gap: 10px;
    }
    
    .info-box {
        padding: 8px 15px;
        min-width: 70px;
    }
}

.visits {
    margin-top: 16px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #8fa3b8;
    letter-spacing: 0.5px;
}

.visits-label { opacity: 0.7; }

.visits-value {
    font-weight: 700;
    color: #00ff88;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
}

.site-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 3px;
    margin: 0 0 14px 0;
    color: #e8edf5;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.site-title-accent {
    color: #00ff88;
    text-shadow: 0 0 14px rgba(0, 255, 136, 0.8), 0 0 4px rgba(0,255,136,0.4);
}

.btn-secondary {
    background: transparent;
    color: #00ff88;
    border: 2px solid #00ff88;
    margin-top: 12px;
}

.btn-secondary:hover {
    background: rgba(0, 255, 136, 0.1);
}
