/* ===== Глобальные стили (ПК-версия) ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background: #0a0a0a;
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #fff;
}

#app {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

/* ===== Страницы ===== */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}
.page.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== Главная страница ===== */
.home-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    padding: 40px 20px;
    border-radius: 24px;
    border: 2px solid #444;
    box-shadow: 0 0 60px rgba(255, 200, 0, 0.15);
    overflow: hidden;
    background-image: url('/assets/images/bg-main.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1a1a1a;
}
.home-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 24px;
    z-index: 0;
}
.home-content > * {
    position: relative;
    z-index: 1;
}
.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    width: 100%;
    margin-top: 30px;
}
.home-footer {
    margin-top: 40px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 20px;
    width: 100%;
    text-align: center;
}

/* ===== Кнопки ===== */
.btn {
    display: inline-block;
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
    min-width: 200px;
}
.btn.primary {
    background: #ffcc44;
    color: #1a1a1a;
    box-shadow: 0 0 20px rgba(255, 200, 0, 0.3);
}
.btn.primary:hover {
    background: #ffdd66;
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(255, 200, 0, 0.5);
}
.btn.secondary {
    background: rgba(42, 42, 42, 0.85);
    color: #ddd;
    border: 1px solid #555;
    backdrop-filter: blur(2px);
}
.btn.secondary:hover {
    background: rgba(58, 58, 58, 0.9);
    border-color: #888;
}
.btn.danger {
    background: #661111;
    color: #ff8888;
    border: 1px solid #aa3333;
}
.btn.danger:hover {
    background: #881122;
}
.btn.small {
    padding: 8px 16px;
    font-size: 14px;
    min-width: auto;
    background: #2a2a2a;
    color: #ccc;
    border: 1px solid #555;
    margin-top: 12px;
}
.btn.small:hover {
    background: #3a3a3a;
}

/* ===== Игровой контейнер ===== */
.game-container {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(255, 200, 0, 0.2);
    border: 2px solid #444;
}
.canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}
#gameCanvas {
    display: block;
    width: 600px;
    height: 600px;
    image-rendering: pixelated;
    background: #222;
    border: 3px solid #555;
    border-radius: 8px;
    touch-action: none;
    cursor: none;
}
.info-panel {
    display: flex;
    justify-content: space-between;
    color: #ffcc44;
    margin-top: 12px;
    font-size: 18px;
    padding: 0 8px;
    text-shadow: 0 0 8px #ff8800;
    letter-spacing: 1px;
}
.info-panel span {
    color: #fff;
    font-weight: bold;
}
.controls {
    color: #888;
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    border-top: 1px solid #333;
    padding-top: 10px;
}
.controls kbd {
    background: #2a2a2a;
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid #666;
    color: #ffcc66;
}

/* ===== Рекорды ===== */
.records-container {
    background: #1a1a1a;
    border-radius: 24px;
    padding: 30px;
    border: 2px solid #444;
    box-shadow: 0 0 40px rgba(255, 200, 0, 0.1);
}
.records-container h2 {
    text-align: center;
    color: #ffcc44;
    margin-bottom: 24px;
    font-size: 32px;
}
#records-list {
    background: #111;
    border-radius: 12px;
    padding: 10px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}
#records-list table {
    width: 100%;
    border-collapse: collapse;
    color: #ddd;
    font-size: 14px;
}
#records-list th {
    background: #2a2a2a;
    color: #ffcc44;
    padding: 10px 8px;
    text-align: left;
    border-bottom: 2px solid #444;
}
#records-list td {
    padding: 8px 8px;
    border-bottom: 1px solid #333;
}
#records-list tr:hover td {
    background: #222;
}
.placeholder {
    text-align: center;
    color: #666;
    padding: 40px 0;
}
.records-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* ===== Контакты ===== */
.contacts-container {
    background: #1a1a1a;
    border-radius: 24px;
    padding: 40px 30px;
    border: 2px solid #444;
    box-shadow: 0 0 40px rgba(255, 200, 0, 0.1);
    text-align: center;
}
.contacts-container h2 {
    color: #ffcc44;
    font-size: 32px;
    margin-bottom: 20px;
}
.contacts-container p {
    font-size: 18px;
    margin: 12px 0;
    color: #ccc;
}
.contacts-container a {
    color: #ffcc44;
    text-decoration: none;
    border-bottom: 1px dashed #ffcc44;
}
.contacts-container a:hover {
    color: #ffdd66;
}

/* ===== Мобильная адаптация ===== */
@media (max-width: 768px) {
    body {
        align-items: stretch;
        min-height: 100vh;
        overflow: hidden;
    }
    #app {
        padding: 10px;
        height: 100vh;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .game-container {
        padding: 12px;
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .canvas-wrapper {
        flex: 1;
        min-height: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    #gameCanvas {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-width: 2px;
    }
    .info-panel {
        font-size: 14px;
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 8px;
    }
    .controls {
        font-size: 12px;
        padding-top: 6px;
        margin-top: 6px;
    }
    .controls kbd {
        font-size: 12px;
        padding: 1px 8px;
    }
    .home-content {
        min-height: 400px;
        background-image: url('/assets/images/bg-main-mobile.jpg');
    }
    .home-buttons {
        margin-top: 20px;
    }
    .btn {
        min-width: 140px;
        font-size: 16px;
        padding: 10px 20px;
    }
    .records-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 400px) {
    .info-panel {
        font-size: 12px;
    }
    .controls {
        font-size: 10px;
    }
    .controls kbd {
        font-size: 10px;
        padding: 0 6px;
    }
}