/* ═══════════ АТМОСФЕРЫ РАУНДА (2026-07-27) ═══════════
   Фоновые сцены под таймер: подбираются по тегу/направлению раунда.
   Только transform/opacity — чтобы старый webview не захлёбывался. */
.amb {
    position: absolute; inset: 0;
    overflow: hidden; pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}
@media (prefers-reduced-motion: reduce) {
    .amb * { animation: none !important; }
}

/* ─── ЗВЁЗДЫ · рефлексия, дневник, вечер ─── */
.amb-sky { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 110%, rgba(147, 130, 220, 0.16), transparent 60%); }
.amb-star {
    position: absolute; width: 2px; height: 2px; border-radius: 50%;
    background: #cfe3ea; opacity: 0.25;
    animation: ambTwinkle 4.5s ease-in-out infinite;
}
@keyframes ambTwinkle { 0%, 100% { opacity: 0.16; } 50% { opacity: 0.85; } }
.amb-moon {
    position: absolute; right: 14%; top: 14%;
    width: 34px; height: 34px; border-radius: 50%;
    background: #e8dcc0; opacity: 0.5;
    box-shadow: 0 0 26px rgba(232, 220, 192, 0.35);
    /* серп — вырезаем тенью вместо второго круга */
    mask-image: radial-gradient(circle at 72% 30%, transparent 52%, #000 53%);
    -webkit-mask-image: radial-gradient(circle at 72% 30%, transparent 52%, #000 53%);
    animation: ambMoon 26s ease-in-out infinite;
}
@keyframes ambMoon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.amb-shoot {
    position: absolute; left: 8%; top: 22%;
    width: 74px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(207, 227, 234, 0.9));
    opacity: 0;
    animation: ambShoot 11s linear infinite;
}
@keyframes ambShoot {
    0%, 88% { opacity: 0; transform: translate(0, 0) rotate(18deg); }
    90% { opacity: 0.9; }
    97% { opacity: 0; transform: translate(190px, 68px) rotate(18deg); }
    100% { opacity: 0; }
}

/* ─── ПОТОК · работа, код, дела ─── */
.amb-flow { position: absolute; inset: 0; }
.amb-col {
    position: absolute; top: -30%; width: 1px; height: 60%;
    background: linear-gradient(180deg, transparent, rgba(95, 180, 201, 0.5), transparent);
    animation: ambFall 9s linear infinite;
}
@keyframes ambFall { 0% { transform: translateY(-40%); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translateY(240%); opacity: 0; } }
.amb-scan {
    position: absolute; left: 0; right: 0; height: 42px;
    background: linear-gradient(180deg, transparent, rgba(95, 180, 201, 0.08), transparent);
    animation: ambScan 6.5s linear infinite;
}
@keyframes ambScan { 0% { top: -12%; } 100% { top: 108%; } }

/* ─── ПУЛЬС · тело, спорт ─── */
.amb-pulse { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #e0725a; }
.amb-ecg {
    position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
    width: 100%; height: 74px; opacity: 0.55;
    stroke-dasharray: 300; stroke-dashoffset: 300;
    animation: ambEcg 3.4s linear infinite;
}
@keyframes ambEcg { 0% { stroke-dashoffset: 300; } 70% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -60; } }
.amb-ring {
    position: absolute; width: 90px; height: 90px; border-radius: 50%;
    border: 1px solid rgba(224, 114, 90, 0.5);
    animation: ambRing 3.4s ease-out infinite;
}
.amb-ring.r2 { animation-delay: 1.7s; }
@keyframes ambRing { 0% { transform: scale(0.5); opacity: 0.6; } 100% { transform: scale(2.1); opacity: 0; } }

/* ─── НЕЙРО · учёба, чтение ─── */
.amb-neuro { position: absolute; inset: 0; }
.amb-node {
    position: absolute; width: 5px; height: 5px; border-radius: 50%;
    background: #7CCDDF; box-shadow: 0 0 8px rgba(124, 205, 223, 0.6);
    opacity: 0.35;
    animation: ambNode 3.6s ease-in-out infinite;
}
@keyframes ambNode { 0%, 100% { opacity: 0.25; transform: scale(1); } 50% { opacity: 0.95; transform: scale(1.5); } }
.amb-link {
    position: absolute; height: 1px; transform-origin: 0 50%;
    background: linear-gradient(90deg, rgba(124, 205, 223, 0.45), rgba(124, 205, 223, 0.1));
    opacity: 0.25;
    animation: ambLink 3.6s ease-in-out infinite;
}
@keyframes ambLink { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.5; } }

/* ─── ЗАКАТ · вечер, завершение ─── */
.amb-sunset { position: absolute; inset: 0; overflow: hidden; }
.amb-sun {
    position: absolute; left: 50%; margin-left: -46px; bottom: 26%;
    width: 92px; height: 92px; border-radius: 50%;
    background: radial-gradient(circle, #f0b45a, #e0725a 70%);
    opacity: 0.5; filter: blur(0.5px);
    box-shadow: 0 0 60px rgba(240, 160, 60, 0.4);
    animation: ambSun 30s ease-in-out infinite;
}
@keyframes ambSun { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(30px); opacity: 0.34; } }
.amb-horizon {
    position: absolute; left: 0; right: 0; bottom: 26%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240, 160, 60, 0.5), transparent);
}
.amb-glow {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(224, 114, 90, 0.14) 74%, rgba(147, 130, 220, 0.12));
}

/* ─── ДОЖДЬ · пауза, восстановление ─── */
.amb-rain { position: absolute; inset: 0; }
.amb-drop {
    position: absolute; top: -10%; width: 1px; height: 16px;
    background: linear-gradient(180deg, transparent, rgba(124, 205, 223, 0.55));
    animation: ambDrop 1.8s linear infinite;
}
@keyframes ambDrop { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(560px); opacity: 0; } }

/* ─── выбор атмосферы в меню фокуса ─── */
.fs-amb-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.fs-amb-chip {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 5px 2px; background: var(--glass-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--glass-border); border-radius: 8px;
    color: var(--text-secondary); font-family: inherit; cursor: pointer;
}
.fs-amb-chip b { font-size: 13px; line-height: 1.1; font-weight: 400; }
.fs-amb-chip span { font-size: 8px; letter-spacing: 0.2px; color: var(--text-muted); }
.fs-amb-chip.sel { border-color: var(--ds-amber, #f0a03c); background: rgba(240, 160, 60, 0.12); color: var(--text-primary); }
.fs-amb-chip.sel span { color: var(--ds-amber, #f0a03c); }

/* ─── слои: атмосфера всегда позади содержимого ─── */
.fs-zone .fs-visual { z-index: 1; }
.focus-overlay > *:not(.amb) { position: relative; z-index: 1; }

/* ─── бортовой журнал во весь экран (27.07) ─── */
.sheet.sheet-full { align-items: stretch; }
.sheet.sheet-full .sheet-content {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    background: rgba(8, 11, 17, 0.96);
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    animation: none;
}
.sheet.sheet-full .sheet-content > *:not(#sheet-amb) { position: relative; z-index: 1; }
.sheet.sheet-full .sheet-handle { display: none; }
.sheet.sheet-full #sheet-amb { opacity: 0.5; }

/* ═══════════ МЕНЮ РАУНДА — единая концепция «пульт» (27.07) ═══════════ */
/* атмосфера на весь оверлей + затемнение книзу, чтобы контент читался.
   ВАЖНО: не трогаем position самого .fs-overlay — у .mp-overlay он fixed,
   и переопределение роняло оверлей в поток страницы (уезжал в самый низ). */
.fs-overlay > .amb { position: fixed; inset: 0; z-index: 0; }
.fs-overlay > .amb::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(6, 8, 15, 0.15) 0%, rgba(6, 8, 15, 0.55) 45%, rgba(6, 8, 15, 0.93) 100%);
}
.fs-overlay > .mp-head, .fs-overlay > .mp-screen { position: relative; z-index: 1; }
/* шапка — без сцены за спиной, чтобы показатели читались */
.fs-overlay > .mp-head {
    background: rgba(6, 8, 15, 0.92);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--glass-border);
}
/* зона таймера больше не коробка — сцена идёт фоном всего экрана */
.fs-overlay .fs-zone { background: transparent; }

/* --- кнопки-пульт: срезанный угол, моно, состояния --- */
.fs-overlay .mp-btn-ghost,
.fs-overlay .mp-start {
    position: relative;
    font-family: inherit; letter-spacing: 1.6px; text-transform: uppercase;
    clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.fs-overlay .mp-btn-ghost {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 12px; padding: 11px 14px;
}
.fs-overlay .mp-btn-ghost:active { background: rgba(255, 255, 255, 0.09); color: var(--text-primary); }
.fs-overlay .mp-btn-danger { border-color: rgba(224, 114, 90, 0.45); color: #e0725a; background: rgba(224, 114, 90, 0.07); }
.fs-overlay .mp-start {
    border: 1px solid rgba(240, 160, 60, 0.7);
    box-shadow: 0 0 22px rgba(240, 160, 60, 0.22), inset 0 0 22px rgba(240, 160, 60, 0.08);
}
/* направление/теги активного раунда — в том же языке */
.fs-overlay .fs-run-dir, .fs-overlay .fs-run-tag {
    clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
    border-radius: 0;
}

/* --- панель управления: вид / фон / развернуть, одной строкой --- */
.fs-panel {
    margin-top: 10px; padding: 9px 10px;
    border: 1px solid var(--glass-border); border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    display: flex; flex-direction: column; gap: 7px;
}
.fs-panel-row { display: flex; align-items: center; gap: 8px; }
.fs-panel-lbl {
    flex: 0 0 26px; font-size: 8.5px; letter-spacing: 1.4px;
    text-transform: uppercase; color: var(--text-muted);
}
/* сегменты заменены на квадратные иконочные кнопки .fs-ib (см. ui.css) */

/* --- распределение времени: одна полоса-стопка --- */
.fs-stack {
    display: flex; height: 8px; margin: 10px 0 8px;
    border-radius: 4px; overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}
.fs-stack > i { display: block; height: 100%; }
.fs-stack > i + i { box-shadow: inset 1px 0 0 rgba(6, 8, 15, 0.5); }

/* --- таймлайн дня: план vs факт, линия «сейчас» --- */
.fs-tl-legend { margin-left: auto; font-size: 9px; color: var(--text-muted); letter-spacing: 0.4px; }
.fs-tl-block.plan {
    background: transparent;
    border: 1px dashed var(--glass-border);
    border-left: 2px dashed var(--text-muted);
    color: var(--text-muted);
}
.fs-tl-block.live {
    border-left-color: var(--ds-amber, #f0a03c);
    box-shadow: 0 0 12px rgba(240, 160, 60, 0.25);
    animation: fsLivePulse 2.2s ease-in-out infinite;
}
/* «сейчас» — красная линия во всю ширину, метка времени влезает целиком */
.fs-tl-now {
    position: absolute; left: 44px; right: 0; height: 0;
    border-top: 1.5px solid #e0483c;
    box-shadow: 0 0 10px rgba(224, 72, 60, 0.55);
    z-index: 3; pointer-events: none;
}
.fs-tl-now > span {
    position: absolute; left: -44px; top: -8px;
    width: 40px; text-align: center; padding: 2px 0;
    background: #e0483c; color: #fff;
    font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.3px;
    clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px));
}
