/* =====================================================================
   Часы · Таймер · Секундомер — Библиотеки Екатеринбурга
   Концепция: «читальный зал на закате» — чернильный фон, дышащая
   аврора в цвете состояния, стекло, роллинг-цифры как на одометре.
   ===================================================================== */

/* ----------------------------- Токены ------------------------------ */
:root {
    /* Состояния → акцент. Один цвет ведёт за собой аврору, кольцо,
       кнопки, свечение. */
    --c-idle:     #4f8cff;  --c-idle-soft:     #8fb6ff;
    --c-running:  #3b82f6;  --c-running-soft:  #7cb0ff;
    --c-paused:   #f5a524;  --c-paused-soft:   #ffcf7a;
    --c-finished: #ef4444;  --c-finished-soft: #ff8a8a;
    --c-green:    #10b981;  --c-green-soft:    #6fe3c0;

    --accent:      var(--c-idle);
    --accent-soft: var(--c-idle-soft);

    --font-display: "Space Grotesk", ui-monospace, monospace;
    --font-ui: "Manrope", system-ui, -apple-system, sans-serif;

    --radius: 18px;
    --radius-pill: 999px;
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --ease-soft: cubic-bezier(.4, 0, .2, 1);
    --roll-dur: .55s;
}

/* Тёмная тема (по умолчанию) */
html[data-theme="dark"] {
    --bg-0: #070a12;
    --bg-1: #0b0f1a;
    --surface: rgba(255, 255, 255, .045);
    --surface-strong: rgba(255, 255, 255, .07);
    --border: rgba(255, 255, 255, .10);
    --border-strong: rgba(255, 255, 255, .18);
    --text: #eef2fb;
    --text-dim: #93a0bd;
    --text-faint: #5a6685;
    --shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
    --grain-opacity: .035;
    --aurora-opacity: .55;
    --track: rgba(255, 255, 255, .07);
    color-scheme: dark;
}

/* Светлая тема */
html[data-theme="light"] {
    --bg-0: #eef1f7;
    --bg-1: #f7f9fc;
    --surface: rgba(255, 255, 255, .65);
    --surface-strong: rgba(255, 255, 255, .85);
    --border: rgba(20, 30, 60, .08);
    --border-strong: rgba(20, 30, 60, .14);
    --text: #131a2b;
    --text-dim: #5b677f;
    --text-faint: #9aa3b8;
    --shadow: 0 24px 60px -28px rgba(40, 60, 110, .35);
    --grain-opacity: .025;
    --aurora-opacity: .42;
    --track: rgba(20, 30, 60, .08);
    color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-ui);
    color: var(--text);
    background: var(--bg-1);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background .6s var(--ease-soft), color .6s var(--ease-soft);
}

/* Цвет акцента переключается через data-state на <body> */
body[data-state="default"]  { --accent: var(--c-idle);     --accent-soft: var(--c-idle-soft); }
body[data-state="running"]  { --accent: var(--c-running);  --accent-soft: var(--c-running-soft); }
body[data-state="paused"]   { --accent: var(--c-paused);   --accent-soft: var(--c-paused-soft); }
body[data-state="finished"] { --accent: var(--c-finished); --accent-soft: var(--c-finished-soft); }
body[data-state="green"]    { --accent: var(--c-green);    --accent-soft: var(--c-green-soft); }

/* ---------------------------- Атмосфера ---------------------------- */
.aurora {
    position: fixed; inset: 0; z-index: 0; overflow: hidden;
    opacity: var(--aurora-opacity);
    transition: opacity .6s var(--ease-soft);
    pointer-events: none;
}
.aurora__blob {
    position: absolute; border-radius: 50%;
    filter: blur(70px);
    background: radial-gradient(circle at center, var(--accent) 0%, transparent 68%);
    transition: background .9s var(--ease-soft);
    will-change: transform;
}
.aurora__blob--1 { width: 60vmax; height: 60vmax; top: -22vmax; left: -14vmax;
    animation: drift1 26s ease-in-out infinite; }
.aurora__blob--2 { width: 48vmax; height: 48vmax; bottom: -20vmax; right: -10vmax;
    background: radial-gradient(circle at center, var(--accent-soft) 0%, transparent 66%);
    animation: drift2 32s ease-in-out infinite; }
.aurora__blob--3 { width: 40vmax; height: 40vmax; top: 30%; left: 40%;
    opacity: .6; animation: drift3 22s ease-in-out infinite; }

@keyframes drift1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(8vmax,6vmax) scale(1.12)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0) scale(1.05)} 50%{transform:translate(-7vmax,-5vmax) scale(.92)} }
@keyframes drift3 { 0%,100%{transform:translate(-50%,-50%) scale(1)} 50%{transform:translate(-42%,-58%) scale(1.18)} }

.grain {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(120% 90% at 50% 40%, transparent 55%, var(--bg-0) 100%);
}

/* ---------------------------- Верхняя панель ----------------------- */
.topbar {
    position: relative; z-index: 5;
    display: flex; align-items: center; gap: 16px;
    padding: 18px clamp(16px, 4vw, 40px);
    transition: opacity .4s var(--ease-soft);
}
.brand {
    display: inline-flex; align-items: center; gap: 12px;
    color: var(--text); text-decoration: none; flex: 0 0 auto;
}
.brand__mark {
    width: 34px; height: 34px; display: grid; place-items: center;
    color: var(--accent);
    border-radius: 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: color .6s var(--ease-soft);
}
.brand__mark svg { width: 22px; height: 22px; }
.brand__word {
    font-weight: 800; font-size: .82rem; line-height: 1.08;
    letter-spacing: .01em; color: var(--text);
    text-transform: uppercase;
    transition: color .6s var(--ease-soft);
}

/* Переключатель режимов с «летящей» подложкой */
.modes {
    position: relative; margin: 0 auto;
    display: flex; gap: 4px; padding: 5px;
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.modes__pill {
    position: absolute; z-index: 0; top: 5px; bottom: 5px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    box-shadow: 0 6px 22px -6px var(--accent);
    transition: transform .45s var(--ease-spring), width .45s var(--ease-spring),
                background .6s var(--ease-soft), box-shadow .6s var(--ease-soft);
}
.mode {
    position: relative; z-index: 1;
    border: 0; background: transparent; cursor: pointer;
    font-family: var(--font-ui); font-weight: 600; font-size: .92rem;
    color: var(--text-dim);
    padding: 9px clamp(12px, 2.4vw, 22px); border-radius: var(--radius-pill);
    transition: color .35s var(--ease-soft);
    white-space: nowrap;
}
.mode:hover { color: var(--text); }
.mode.is-active { color: #fff; }
html[data-theme="light"] .mode.is-active { color: #fff; }

.topbar__actions { display: flex; gap: 8px; flex: 0 0 auto; }
.icon-btn {
    width: 42px; height: 42px; display: grid; place-items: center;
    border-radius: 13px; cursor: pointer;
    color: var(--text-dim);
    background: var(--surface); border: 1px solid var(--border);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    transition: color .25s, background .25s, transform .25s var(--ease-spring), border-color .25s;
}
.icon-btn:hover { color: var(--text); transform: translateY(-2px); border-color: var(--border-strong); }
.icon-btn:active { transform: translateY(0) scale(.94); }
.icon-btn svg { width: 21px; height: 21px; }
.ic-compress { display: none; }
body.is-fullscreen .ic-expand { display: none; }
body.is-fullscreen .ic-compress { display: block; }

/* ------------------------------ Сцена ------------------------------ */
.stage {
    position: relative; z-index: 4; flex: 1;
    display: grid; place-items: center;
    padding: 12px clamp(16px, 4vw, 40px) 8px;
    min-height: 0;
}
.panel {
    display: none; flex-direction: column; align-items: center;
    gap: clamp(18px, 3vh, 30px); width: 100%;
    animation: panelIn .5s var(--ease-soft) both;
}
.panel.is-active { display: flex; }
@keyframes panelIn {
    from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(6px); }
    to   { opacity: 1; transform: none; filter: none; }
}

/* ------------------------- Роллинг-дисплей ------------------------- */
.display {
    font-family: var(--font-display); font-weight: 600;
    line-height: 1; letter-spacing: .01em;
    display: inline-flex; align-items: center;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    filter: drop-shadow(0 0 26px color-mix(in srgb, var(--accent) 34%, transparent));
    transition: filter .6s var(--ease-soft);
}
.display--xl { font-size: clamp(3.6rem, 17vw, 12rem); }
.display--lg { font-size: clamp(3rem, 13vw, 9rem); }
#timer-roll { font-size: 14cqw; }

.roll__digit {
    display: inline-flex; height: 1em; overflow: hidden;
    position: relative; vertical-align: top;
}
.roll__strip {
    display: flex; flex-direction: column;
    transition: transform var(--roll-dur) var(--ease-spring);
    will-change: transform;
}
.roll__num { height: 1em; display: flex; align-items: center; justify-content: center; }
.roll__sep {
    display: inline-flex; align-items: center; justify-content: center;
    width: .42em; opacity: .55;
}
#sw-roll .roll__digit.is-fast { color: var(--accent); transition: color .6s var(--ease-soft); }

.subline {
    margin: 0; font-size: clamp(.95rem, 2.4vw, 1.3rem);
    font-weight: 500; color: var(--text-dim);
    text-transform: capitalize; letter-spacing: .02em;
}

/* Чип расписания */
.schedule-chip {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 8px 16px; border-radius: var(--radius-pill);
    background: var(--surface); border: 1px solid var(--border);
    font-weight: 600; font-size: .9rem; color: var(--text);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    animation: panelIn .4s var(--ease-soft) both;
}
.schedule-chip__dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent);
    animation: pulse 1.8s var(--ease-soft) infinite;
}
.schedule-chip__time { color: var(--text-dim); font-weight: 500; }
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
    70%  { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* ----------------------------- Таймер ------------------------------ */
.ring-stage {
    position: relative; width: clamp(260px, 64vmin, 460px); aspect-ratio: 1;
    display: grid; place-items: center;
    container-type: inline-size;
}
.ring { width: 100%; height: 100%; transform: rotate(-90deg); color: var(--accent); }
.ring__track { fill: none; stroke: var(--track); stroke-width: 6; transition: stroke .6s; }
.ring__progress {
    fill: none; stroke: url(#ringGrad); stroke-width: 8; stroke-linecap: round;
    stroke-dasharray: 1000; stroke-dashoffset: 0;
    filter: url(#ringGlow);
    transition: stroke-dashoffset .3s linear;
}
body[data-state="running"] .ring__progress { animation: ringBreath 3.4s var(--ease-soft) infinite; }
@keyframes ringBreath { 0%,100%{opacity:1} 50%{opacity:.78} }

.ring-stage__center {
    position: absolute; inset: 0; display: grid; place-items: center;
}
.ring-stage__center .display { position: absolute; }

/* Поля ввода времени поверх центра кольца */
.time-inputs {
    position: absolute; display: inline-flex; align-items: center; gap: 2px;
    font-family: var(--font-display); font-weight: 600;
    font-size: 14cqw; color: var(--text);
    transition: opacity .3s var(--ease-soft);
}
.time-inputs span { opacity: .5; }
.time-inputs input {
    width: 1.5em; text-align: center; border: 0; padding: 0; margin: 0;
    background: transparent; color: inherit;
    font: inherit; border-radius: 10px;
    outline: none; caret-color: var(--accent);
    transition: background .25s, box-shadow .25s;
    font-variant-numeric: tabular-nums;
}
.time-inputs input:hover { background: var(--surface); }
.time-inputs input:focus { background: var(--surface-strong); box-shadow: inset 0 -3px 0 var(--accent); }

/* переключение видимости дисплей ⇄ инпуты делает JS через .is-editing */
body.is-editing #timer-roll { opacity: 0; pointer-events: none; }
body:not(.is-editing) .time-inputs { opacity: 0; pointer-events: none; }

/* Пресеты */
.presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 540px; }
.preset {
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-dim); cursor: pointer;
    padding: 8px 15px; border-radius: var(--radius-pill);
    font-family: var(--font-ui); font-weight: 600; font-size: .85rem;
    transition: all .22s var(--ease-soft);
}
.preset:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }
.preset:active { transform: translateY(0) scale(.96); }
.preset.is-active {
    color: #fff; background: var(--accent); border-color: transparent;
    box-shadow: 0 8px 24px -8px var(--accent);
}

/* --------------------------- Кнопки -------------------------------- */
.controls { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn {
    position: relative; overflow: hidden;
    font-family: var(--font-ui); font-weight: 700; font-size: 1rem;
    padding: 14px 34px; border-radius: 15px; cursor: pointer;
    border: 1px solid transparent;
    transition: transform .2s var(--ease-spring), box-shadow .3s, background .3s, color .3s, opacity .3s;
}
.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--primary {
    color: #fff; background: var(--accent);
    box-shadow: 0 14px 34px -12px var(--accent);
}
.btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 20px 42px -12px var(--accent); }
.btn--ghost {
    color: var(--text); background: var(--surface);
    border-color: var(--border);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.btn--ghost:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-strong); }
/* рябь */
.ripple {
    position: absolute; border-radius: 50%; transform: scale(0);
    background: rgba(255, 255, 255, .45); pointer-events: none;
    animation: ripple .6s var(--ease-soft);
}
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* --------------------------- Секундомер ---------------------------- */
.laps {
    list-style: none; margin: 0; padding: 0; width: min(440px, 90vw);
    max-height: 28vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 6px;
    -webkit-mask: linear-gradient(transparent, #000 12px, #000 calc(100% - 12px), transparent);
            mask: linear-gradient(transparent, #000 12px, #000 calc(100% - 12px), transparent);
}
.lap {
    display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline;
    padding: 11px 16px; border-radius: 13px;
    background: var(--surface); border: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
    animation: lapIn .4s var(--ease-spring) both;
}
@keyframes lapIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.lap__n { color: var(--text-dim); font-weight: 700; font-size: .85rem; }
.lap__split { color: var(--text-faint); font-size: .82rem; text-align: right; }
.lap__total { font-family: var(--font-display); font-weight: 500; }
.lap.is-best  { border-color: color-mix(in srgb, var(--c-green) 50%, var(--border)); }
.lap.is-best  .lap__n { color: var(--c-green); }
.lap.is-worst { border-color: color-mix(in srgb, var(--c-finished) 45%, var(--border)); }
.lap.is-worst .lap__n { color: var(--c-finished); }

/* ----------------------------- Подсказка --------------------------- */
.hint {
    position: relative; z-index: 4; margin: 0 auto 10px;
    text-align: center; color: var(--text-faint); font-size: .8rem;
    transition: opacity .4s;
}
.hint kbd {
    font-family: var(--font-ui); font-weight: 700; font-size: .72rem;
    padding: 2px 7px; border-radius: 7px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-dim);
}

/* Логотип внизу (для полноэкранного режима) */
#logo {
    position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
    z-index: 5; opacity: 0; pointer-events: none;
    padding: 8px 16px; border-radius: 14px;
    background: color-mix(in srgb, var(--glass) 70%, transparent);
    border: 1px solid var(--glass-brd);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: opacity .4s var(--ease-soft);
}
#logo img {
    display: block; height: 26px; width: auto;
    filter: brightness(0) invert(1) drop-shadow(0 1px 6px rgba(0,0,0,.4));
    opacity: .92;
}
html[data-theme="light"] #logo img { filter: none; opacity: .85; }

/* --------------------------- Будильник ----------------------------- */
.alarm {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
    z-index: 60; display: flex; align-items: center; gap: 14px;
    padding: 12px 12px 12px 22px; border-radius: var(--radius-pill);
    background: var(--surface-strong); border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    animation: alarmIn .5s var(--ease-spring) both;
}
@keyframes alarmIn { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translateX(-50%); } }
.alarm__icon { font-size: 1.3rem; animation: shake 1s ease-in-out infinite; }
@keyframes shake { 0%,100%{transform:rotate(0)} 20%{transform:rotate(14deg)} 40%{transform:rotate(-12deg)} 60%{transform:rotate(8deg)} 80%{transform:rotate(-5deg)} }
.alarm__text { font-weight: 700; }
.alarm .btn { padding: 10px 22px; }

/* Тревожная пульсация всего экрана */
body.is-flashing::after {
    content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none;
    background: radial-gradient(120% 90% at 50% 50%, transparent 40%, color-mix(in srgb, var(--c-finished) 30%, transparent) 100%);
    animation: flash 1.1s var(--ease-soft) infinite;
}
@keyframes flash { 0%,100%{opacity:0} 50%{opacity:1} }

/* Конфетти */
#confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; }

/* --------------------------- Настройки ----------------------------- */
.drawer-backdrop {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(4, 7, 14, .5); backdrop-filter: blur(3px);
    animation: fade .3s var(--ease-soft) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
    position: fixed; top: 0; right: 0; z-index: 85; height: 100svh;
    width: min(380px, 92vw); padding: 26px;
    display: flex; flex-direction: column; gap: 18px;
    background: var(--bg-1); border-left: 1px solid var(--border);
    box-shadow: var(--shadow);
    animation: slideIn .4s var(--ease-spring) both;
    overflow-y: auto;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; }
.drawer__head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.drawer__foot { margin-top: auto; color: var(--text-faint); font-size: .8rem; text-align: center; }

.field { display: flex; flex-direction: column; gap: 10px; }
.field__label { font-weight: 700; font-size: .92rem; }
.field__hint { margin: 0; font-size: .78rem; color: var(--text-faint); line-height: 1.5; }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); }
.seg button {
    flex: 1; border: 0; cursor: pointer; padding: 9px; border-radius: 10px;
    font-family: var(--font-ui); font-weight: 600; color: var(--text-dim);
    background: transparent; transition: all .25s var(--ease-soft);
}
.seg button.is-active { color: #fff; background: var(--accent); box-shadow: 0 6px 18px -8px var(--accent); }

.switch {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    cursor: pointer; padding: 14px 16px; border-radius: 14px;
    background: var(--surface); border: 1px solid var(--border);
}
.switch--inline { background: transparent; border: 0; padding: 0; }
.switch > span:first-child { display: flex; flex-direction: column; font-weight: 600; font-size: .92rem; }
.switch small { font-weight: 500; font-size: .76rem; color: var(--text-faint); margin-top: 2px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
    flex: 0 0 auto; width: 46px; height: 27px; border-radius: 999px;
    background: var(--track); border: 1px solid var(--border);
    position: relative; transition: background .3s;
}
.switch__thumb {
    position: absolute; top: 2px; left: 2px; width: 21px; height: 21px;
    border-radius: 50%; background: var(--text-dim);
    transition: transform .3s var(--ease-spring), background .3s;
}
.switch input:checked ~ .switch__track { background: color-mix(in srgb, var(--accent) 75%, transparent); border-color: transparent; }
.switch input:checked ~ .switch__track .switch__thumb { transform: translateX(19px); background: #fff; }

.schedule-times { display: flex; gap: 12px; }
.schedule-times label { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: .8rem; color: var(--text-dim); font-weight: 600; }
.schedule-times input {
    font-family: var(--font-ui); font-size: .95rem; color: var(--text);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 11px; padding: 9px 11px; transition: border-color .2s;
}
.schedule-times input:focus { outline: none; border-color: var(--accent); }
.schedule-times.is-disabled { opacity: .4; pointer-events: none; }

/* --------------------- Полноэкранный режим ------------------------- */
body.is-fullscreen .topbar,
body.is-fullscreen .hint { opacity: 0; pointer-events: none; }
body.is-fullscreen #logo {
    opacity: .85; left: auto; right: 24px; bottom: 22px; transform: none;
}
body.is-fullscreen .presets { opacity: 0; pointer-events: none; height: 0; overflow: hidden; }
body.is-fullscreen .display--xl { font-size: clamp(5rem, 20vw, 22rem); }
body.is-fullscreen .display--lg { font-size: clamp(4rem, 16vw, 16rem); }
body.is-fullscreen #timer-roll,
body.is-fullscreen .time-inputs { font-size: 14cqw; }
body.is-fullscreen .ring-stage { width: clamp(320px, 78vmin, 820px); }
body.is-fullscreen .controls { transform: scale(1.25); margin-top: 1.5rem; }
body.is-fullscreen .laps { max-height: 36vh; }

/* ------------------------- Адаптив, доступность -------------------- */
@media (max-width: 720px) {
    .topbar { flex-wrap: wrap; justify-content: center; }
    .brand { order: 1; }
    .topbar__actions { order: 2; margin-left: auto; }
    .modes { order: 3; width: 100%; justify-content: center; }
    .hint { display: none; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important; animation-iteration-count: 1 !important;
        transition-duration: .12s !important;
    }
    .roll__strip { transition: none !important; }
}
