/* pilot_viewer.css — Pilot 2026 ver.2.02 — Viewer */

body {
    margin: 0;
    padding: 0;
    background-color: #111;
    color: white;
    font-family: Arial, sans-serif;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    text-align: center;
    padding: 4px 0 2px 0;
    box-sizing: border-box;
}

.game-title {
    margin: 0 0 1px 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

#game-header {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #88ccff;
}

/*
.header-links {
    font-weight: 400;
    font-size: 0.9rem;
}

.header-links a {
    color: #88ccff;
    text-decoration: none;
}

.header-links a:hover {
    text-decoration: underline;
}
*/

.game-version {
    margin: 0 0 2px 0;
    font-size: 0.8rem;
    color: #888;
}

#stats-bar {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    justify-content: center;
    line-height: 1.1;
}

#stats-bar > * {
    margin: 0;
    padding: 0;
}

#stats-bar b {
    color: #4caf50;
}

/* --- Игровое поле --- */
#game-container {
    position: relative;
    width: 100%;
    max-width: min(400px, 90vmin);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    background-color: #000;
    box-sizing: border-box;
    overflow: hidden;
    touch-action: none;
    box-shadow: 0 0 0 3px #333;
}

.game-object, .enemy-object {
    position: absolute;
    width: 12.5%;
    height: 12.5%;
    top: 0;
    left: 0;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: none;
}

.pilot-idle {
    background: #1a3a1a;
    border: 2px solid #2a4a2a;
}
.pilot-playing {
    background: #4caf50;
    border: 2px solid #388e3c;
}
.pilot-gameover {
    background: #333;
    border: 2px solid #388e3c;
}

.enemy-object {
    background: red;
    border: 1px solid #500;
}

.enemy-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- Управление --- */
#viewer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 2px;
    align-items: center;
}

.control-btn {
    padding: 8px 14px;
    font-size: 0.9rem;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.control-btn:active {
    transform: scale(0.98);
}

.control-btn:hover:not(:disabled) {
    background: #555;
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.btn-info { background: #2980b9; }
.btn-info:hover:not(:disabled) { background: #3498db; }

.btn-start { background: #2e7d32; }
.btn-start:hover:not(:disabled) { background: #388e3c; }

.danger { background: #a00; }
.danger:hover:not(:disabled) { background: #c00; }

#speed-select {
    padding: 8px 10px;
    font-size: 0.9rem;
    background: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
}

/* --- Прогресс-бар --- */
#progress-container {
    width: 100%;
    max-width: min(400px, 90vmin);
    height: 12px;
    background: #333;
    border-radius: 3px;
    margin: 2px auto 0;
    overflow: hidden;
    cursor: pointer;
}

#progress-bar {
    height: 100%;
    width: 0;
    background: #4caf50;
    border-radius: 3px;
    pointer-events: none;
    transition: width 0.05s linear;
}

/* --- Сообщение о конце игры --- */
#end-message {
    margin-top: 2px;
    font-size: 0.9rem;
    color: #88ccff;
    text-align: center;
    min-height: 0;
}

/* --- Диалоги --- */
dialog {
    background: #222;
    color: white;
    border: 2px solid #444;
    padding: 20px;
    border-radius: 8px;
    max-width: 90vw;
    margin: 5vh auto auto auto;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.9);
}

dialog h2 {
    margin: 0 0 16px 0;
    font-size: 1.2rem;
    color: #88ccff;
}

.dialog-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.dialog-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.dialog-form input[type="text"],
.dialog-form input[type="number"] {
    padding: 6px 10px;
    background: #111;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 0.9rem;
}

#games-list-container {
    max-height: 320px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid #444;
    padding-top: 10px;
}

.game-list-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.game-list-table th {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #444;
    color: #88ccff;
}

.game-list-table td {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #333;
}

.game-list-table tr {
    cursor: pointer;
}

.game-list-table tr:hover {
    background: #2a2a2a;
}

.game-list-table tr.selected {
    background: #1a3a1a;
}

.dialog-close-row {
    margin-top: 16px;
    text-align: right;
}

#dialog-no-game p {
    margin: 0 0 16px 0;
    line-height: 1.5;
}

/* --- Мобильные фиксы --- */

@media (max-width: 480px) {
    #stats-bar {
        gap: 2px 6px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .game-list-table button {
        padding: 6px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .game-list-table .col-date {
        display: none;
    }
}
