/**
 * Tetris Game - Styles
 * Modern, clean interface with dark theme
 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #eee;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3em;
    color: #00d9ff;
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
    margin-bottom: 10px;
}

.player-info {
    font-size: 1.2em;
    color: #b8b8d0;
}

/* Game Wrapper */
.game-wrapper {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

/* Left Panel - Stats */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stats-box {
    background: #16213e;
    border: 2px solid #0f3460;
    border-radius: 10px;
    padding: 15px 25px;
    min-width: 180px;
    text-align: center;
}

.stats-box h3 {
    color: #b8b8d0;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #00d9ff;
}

.stats-box.high-score {
    border-color: #f0a000;
}

.stats-box.high-score .stat-value {
    color: #f0a000;
}

/* Game Board */
.game-board {
    position: relative;
    background: #0f1419;
    border: 4px solid #0f3460;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    display: block;
    background: #1a1a2e;
}

/* Name Prompt Overlay */
.name-prompt {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 6px;
    z-index: 10;
}

.name-prompt h2 {
    color: #00d9ff;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.name-prompt input {
    width: 100%;
    max-width: 300px;
    padding: 12px 20px;
    font-size: 1.1em;
    border: 2px solid #0f3460;
    border-radius: 6px;
    background: #16213e;
    color: #eee;
    text-align: center;
    margin-bottom: 15px;
}

.name-prompt input:focus {
    outline: none;
    border-color: #00d9ff;
}

.name-prompt button {
    padding: 12px 40px;
    font-size: 1.1em;
    background: #0f3460;
    color: #00d9ff;
    border: 2px solid #00d9ff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.name-prompt button:hover {
    background: #00d9ff;
    color: #1a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.4);
}

.name-prompt .hint {
    margin-top: 15px;
    color: #b8b8d0;
    font-size: 0.9em;
}

/* Right Panel */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.next-piece-box {
    background: #16213e;
    border: 2px solid #0f3460;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.next-piece-box h3 {
    color: #b8b8d0;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

#nextCanvas {
    display: block;
    margin: 0 auto;
    background: #1a1a2e;
}

/* Controls Box */
.controls-box {
    background: #16213e;
    border: 2px solid #0f3460;
    border-radius: 10px;
    padding: 15px;
}

.controls-box h3 {
    color: #b8b8d0;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-align: center;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 8px;
    background: #0f1419;
    border-radius: 5px;
}

.control-item .key {
    background: #0f3460;
    color: #00d9ff;
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    font-size: 0.9em;
}

.control-item span:last-child {
    color: #b8b8d0;
    font-size: 0.9em;
}

/* Button Group */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: #0f3460;
    color: #00d9ff;
    border: 2px solid #00d9ff;
}

.btn-primary:hover {
    background: #00d9ff;
    color: #1a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.4);
}

.btn-secondary {
    background: #16213e;
    color: #b8b8d0;
    border: 2px solid #0f3460;
}

.btn-secondary:hover {
    background: #0f3460;
    color: #00d9ff;
    border-color: #00d9ff;
}

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

/* Leaderboard Section */
.leaderboard-section {
    background: #16213e;
    border: 2px solid #0f3460;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.leaderboard-section h2 {
    color: #00d9ff;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2em;
}

.leaderboard {
    max-width: 900px;
    margin: 0 auto 20px;
    overflow-x: auto;
}

.leaderboard table {
    width: 100%;
    border-collapse: collapse;
    background: #0f1419;
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard thead {
    background: #0f3460;
}

.leaderboard th {
    padding: 15px;
    text-align: left;
    color: #00d9ff;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 1px;
}

.leaderboard td {
    padding: 12px 15px;
    border-bottom: 1px solid #16213e;
}

.leaderboard tr:last-child td {
    border-bottom: none;
}

.leaderboard tr:hover {
    background: #16213e;
}

.leaderboard tr.highlight {
    background: rgba(0, 217, 255, 0.1);
    border-left: 3px solid #00d9ff;
}

.leaderboard .rank {
    font-weight: bold;
    color: #f0a000;
    text-align: center;
    width: 60px;
}

.leaderboard .name {
    color: #eee;
    font-weight: 500;
}

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

.leaderboard .loading,
.leaderboard .no-data,
.leaderboard .error {
    text-align: center;
    padding: 30px;
    color: #b8b8d0;
}

.leaderboard .error {
    color: #ff6b6b;
}

.btn-small {
    padding: 10px 25px;
    font-size: 0.9em;
    background: #0f3460;
    color: #00d9ff;
    border: 2px solid #00d9ff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    display: block;
    margin: 0 auto;
}

.btn-small:hover {
    background: #00d9ff;
    color: #1a1a2e;
    transform: translateY(-2px);
}

/* Player Stats Section */
.player-stats-section {
    background: #16213e;
    border: 2px solid #0f3460;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.player-stats-section h2 {
    color: #00d9ff;
    text-align: center;
    margin-bottom: 25px;
    font-size: 2em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.stat-card {
    background: #0f1419;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #0f3460;
}

.stat-label {
    color: #b8b8d0;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #00d9ff;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #b8b8d0;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .left-panel,
    .right-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .stats-box {
        min-width: 140px;
    }

    .stat-value {
        font-size: 2em;
    }

    .controls-box {
        width: 100%;
    }

    .leaderboard {
        font-size: 0.9em;
    }

    .leaderboard th,
    .leaderboard td {
        padding: 10px 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .game-board {
        padding: 5px;
    }

    #gameCanvas {
        max-width: 100%;
        height: auto;
    }

    .name-prompt h2 {
        font-size: 1.4em;
    }

    .btn {
        padding: 12px 20px;
        font-size: 1em;
    }
}
/* Center alignment for games and lines columns */
.leaderboard .center {
    text-align: center;
}

/* Share Section */
.share-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #0f3460;
    text-align: center;
}

.share-section h3 {
    color: #00d9ff;
    font-size: 1.3em;
    margin-bottom: 20px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    min-width: 140px;
    justify-content: center;
}

.share-btn i {
    font-size: 1.2em;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.share-btn.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0d5dbf 100%);
}

.share-btn.facebook:hover {
    background: linear-gradient(135deg, #2988ff 0%, #1877f2 100%);
}

.share-btn.twitter {
    background: linear-gradient(135deg, #1da1f2 0%, #0c85d0 100%);
}

.share-btn.twitter:hover {
    background: linear-gradient(135deg, #3db3ff 0%, #1da1f2 100%);
}

.share-btn.whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #1ea952 100%);
}

.share-btn.whatsapp:hover {
    background: linear-gradient(135deg, #38e074 0%, #25d366 100%);
}

.share-btn.telegram {
    background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
}

.share-btn.telegram:hover {
    background: linear-gradient(135deg, #009ee0 0%, #0088cc 100%);
}

@media (max-width: 768px) {
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .share-btn {
        width: 100%;
        max-width: 250px;
    }
}
