:root {
    --accent: #005bff;
    --lift-w: clamp(176px, 22.4vw, 272px);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f6f8;
    color: #1a1a1a;
}

main {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 16px;
}

/* баннер недоступности сервера: во всю ширину вверху страницы */
.server-banner {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px 16px;
    text-align: center;
    font-weight: 600;
    color: #fff;
    background: #d93025;
}

h1 { margin-bottom: 4px; }

h2 { margin-top: 32px; }

/* --- Схематичные шахты лифтов (пропорция 3:5) --- */

.lifts-row {
    display: flex;
    gap: 48px;
    justify-content: center;
    align-items: flex-end;
    margin: 28px 0 36px;
}

/* колонка: название прибито к шахте, под ней время/статистика */
.lift-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lift {
    width: var(--lift-w);
    height: calc(var(--lift-w) * 5 / 3);
    background: #dfe2e7;
    border: 3px solid #3a3f47;
    border-radius: 10px;
    box-shadow: inset 0 0 0 6px #e8eaee;
    position: relative;
    overflow: hidden;
}

/* вертикальная линия по центру шахты, на всю высоту */
.lift::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    transform: translateX(-50%);
    background: #9aa0a8;
}

/* пассажирский уже на 10%, высота одинаковая */
.lift-passenger { width: calc(var(--lift-w) * 0.9); }

.lift-name {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;   /* прибита к шахте */
}

/* «дисплей кабины»: тёмная панель, вписанная в верхнюю часть шахты,
   внутри неё — внутренняя рамка с цифрой этажа и стрелкой. Ширина одна
   на оба лифта (50% ширины правой, более узкой шахты) */
.cab-display {
    position: absolute;
    top: 9%;
    left: 50%;
    transform: translateX(-50%);
    width: calc(var(--lift-w) * 0.45);
    background: #17191d;
    border: 3px solid #3a3f47;
    border-radius: 8px;
    padding: 5px;
    box-shadow: inset 0 0 0 3px #2c3038;
    z-index: 2;
}

.floor-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #000;
    border-radius: 5px;
    padding: 1px 12px;
    line-height: 1.25;
}

.floor-arrow {
    font-size: calc(var(--lift-w) * 0.13);
    color: #ff3222;
    min-width: calc(var(--lift-w) * 0.13);
    text-align: center;
}

.floor-value {
    font-size: calc(var(--lift-w) * 0.19);
    font-weight: 700;
    color: #ff3222;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.floor-time {
    font-size: 11px;
    color: #999;
}

.lift-stats {
    font-size: 13px;
    color: #666;
}

/* --- Фото дисплеев и обучение --- */

.displays-row {
    display: flex;
    gap: 32px;
    justify-content: center;
    align-items: flex-start;
}

.display-block {
    width: var(--lift-w);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player {
    display: block;
    width: 100%;
    aspect-ratio: 65 / 44;
    object-fit: contain;
    background: #000;
    border-radius: 8px;
}

.player-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 13px;
    pointer-events: none;
}

.teach-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.teach-row input {
    width: 88px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 26px;
}

.teach-row button {
    padding: 12px 20px;
    font-size: 24px;
}

.teach-msg {
    margin-top: 6px;
    font-size: 22px;
    color: #999;
}

@media (max-width: 900px) {
    :root { --lift-w: clamp(120px, 38vw, 200px); }
    /* табло: лифты слева направо, без скролла */
    .lifts-row { flex-direction: row; flex-wrap: nowrap; gap: 16px; margin: 20px 0 28px; }
    .displays-row { flex-direction: column; align-items: center; }
    .lift-name { font-size: 12px; }
}

button {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

button:hover { opacity: 0.9; }

/* --- Подвал и модалка «Как добавить на телефон» --- */

.page-footer {
    text-align: center;
    padding: 8px 16px 32px;
}

.page-footer a {
    color: #666;
    font-size: 14px;
    text-decoration: underline;
}

/* страница открыта как установленное приложение — ссылка не нужна */
@media (display-mode: standalone) {
    .page-footer { display: none; }
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* display: flex выше перебивает скрытие атрибутом hidden — восстанавливаем */
.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-card {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    max-width: 420px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal-card h2 { margin-top: 0; }

.modal-card h3 { margin-bottom: 6px; }

.modal-card ol { margin-top: 0; padding-left: 20px; }

.modal-card li { margin-bottom: 6px; }

.modal-note {
    color: #666;
    font-size: 14px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eee;
    color: #333;
    font-size: 20px;
    line-height: 1;
    padding: 0;
}

/* --- /daily: суточный пробег по дням --- */
.daily-table {
    margin: 16px auto 0;
    border-collapse: collapse;
}

.daily-table th, .daily-table td {
    border: 1px solid #d8dbe0;
    padding: 6px 14px;
    text-align: center;
}

.daily-table th { background: #eef0f3; }

.daily-table td:first-child { text-align: left; }

.weekend { color: #c22; }

.daily-empty, .daily-back { text-align: center; }
