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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    text-align: center;
}

h1 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-wrapper {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.info-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 200px;
}

.info-panel h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.score-board, .lines-board, .level-board {
    margin-bottom: 20px;
}

#score, #lines, #level {
    font-size: 2em;
    font-weight: bold;
    color: #764ba2;
}

.controls {
    margin-top: 20px;
}

.controls p {
    margin: 5px 0;
    color: #333;
    font-size: 0.9em;
}

#gameCanvas {
    border: 3px solid white;
    border-radius: 5px;
    background: #1a1a2e;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.next-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.next-panel h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

#nextCanvas {
    border: 2px solid #667eea;
    border-radius: 5px;
    background: #1a1a2e;
}

/* Экранные кнопки для мобильных устройств */
.touch-controls {
    position: fixed;
    bottom: 16px;
    left: 0;
    right: 0;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    z-index: 200;
    pointer-events: none; /* включаем только кнопки */
}

.touch-controls button {
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    touch-action: manipulation;
}

.touch-center {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

@media (max-width: 1024px) {
    .touch-controls {
        display: flex;
    }
    .game-wrapper {
        padding-bottom: 120px;
    }
}

.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
}

.game-over.hidden {
    display: none;
}

.game-over h2 {
    color: #764ba2;
    margin-bottom: 15px;
}

.game-over button {
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 1em;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.game-over button:hover {
    background: #764ba2;
}

/* Tip & Tournament panel */
.actions-panel {
    margin: 18px auto 0;
    max-width: 860px;
    background: rgba(255, 255, 255, 0.95);
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.actions-panel h2 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.actions-row button {
    padding: 12px 18px;
    border-radius: 999px;
    border: none;
    background: #667eea;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.actions-row button:hover {
    background: #764ba2;
}

.tournament-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    font-size: 0.9rem;
    color: #333;
    text-align: left;
}

.tournament-stats strong {
    color: #667eea;
}

.tx-status {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #333;
    word-break: break-all;
}

.actions-note {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #555;
    text-align: left;
}

@media (max-width: 560px) {
    .tournament-stats {
        grid-template-columns: 1fr;
    }
    .actions-row button {
        width: 100%;
    }
}
