/* Общие стили */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #fafcff 50%, #eef2ff 100%);
    color: #1f2937;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.9rem;
}

/* Шапка и прогресс-часы */
.header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2.7rem;
}

.header-row .header-container {
    flex: 1 1 260px;
}

.header-container h1 {
    margin: 0 0 0.35rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #111827;
}

.school-header h2 {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.author-name {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: #6b7280;
}

/* Кликабельные часы */
.clock-link {
    margin-left: auto;
    display: inline-flex;
    border-radius: 22px;
    text-decoration: none;
    transition: transform 0.2s ease, filter 0.2s.ease;
}

.clock-link:hover .progress-clock,
.clock-link:focus-visible .progress-clock {
    transform: translateY(-2px);
    filter: brightness(1.02);
}

.clock-link:focus-visible {
    outline: 2px solid rgba(79, 70, 229, 0.5);
    outline-offset: 6px;
    border-radius: 26px;
}

.progress-clock {
    --progress-angle: 0deg;
    --clock-accent: #4caf50;
    --clock-track: #d9def2;
    display: flex;
    align-items: center;
    gap: 1.45rem;
    padding: 1.1rem 1.45rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 30px -24px rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(79, 70, 229, 0.12);
    cursor: pointer;
}

.progress-clock .clock {
    position: relative;
    width: 160px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(from -90deg, var(--clock-accent) var(--progress-angle), var(--clock-track) 0deg);
    transition: background 0.35s ease;
    box-shadow: 0 10px 24px -16px rgba(76, 175, 80, 0.45);
}

.progress-clock:not(.active) .clock {
    background: conic-gradient(from -90deg, var(--clock-track) 360deg, var(--clock-track) 0deg);
}

.progress-clock .clock::before {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.08);
}

.progress-clock .clock::after {
    content: '';
    position: absolute;
    inset: 24px;
    border-radius: 50%;
    border: 1px dashed rgba(31, 41, 55, 0.12);
}

.progress-clock .clock-hand {
    position: absolute;
    width: 4px;
    height: 42%;
    top: 50%;
    left: 50%;
    transform-origin: 50% 100%;
    transform: translate(-50%, -100%) rotate(calc(var(--progress-angle) - 90deg));
    background: var(--clock-accent);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
    transition: transform 0.35s.ease, opacity 0.35s ease;
}

.progress-clock:not(.active) .clock-hand {
    opacity: 0.3;
    transform: translate(-50%, -100%) rotate(-90deg);
}

.progress-clock .clock-center {
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--clock-accent);
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.45);
}

.clock-text {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 150px;
}

.clock-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--clock-accent);
    font-weight: 600;
}

.clock-event {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1f2937;
}

.clock-eta {
    font-size: 1.05rem;
    color: #16a34a;
    font-weight: 700;
}

/* Управление звуком */
.sound-control {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.2rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.9);
    padding: 1.1rem 1.6rem;
    border-radius: 18px;
    box-shadow: 0 18px 34px -26px rgba(15, 23, 42, 0.5);
}

.sound-btn {
    border: none;
    padding: 0.85rem 1.6rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    transition: transform 0.2s.ease, box-shadow 0.2s.ease;
}

.sound-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -20px rgba(79, 70, 229, 0.5);
}

.sound-btn.active {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.sound-status {
    font-weight: 600;
    color: #475569;
}

.sound-status.enabled {
    color: #4caf50;
}

/* Текущее время */
.current-info,
.current-status {
    background: rgba(255, 255, 255, 0.88);
    border-radius: 18px;
    padding: 1.8rem 2.15rem;
    box-shadow: 0 20px 34px -28px rgba(15, 23, 42, 0.55);
    display: grid;
    gap: 0.9rem;
}

.current-info {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    align-items: stretch;
    text-align: center;
    gap: 1.35rem;
}

.current-info h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 0.9rem 1.2rem;
    border-radius: 16px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.current-info h2 span {
    color: #2563eb;
    font-weight: 700;
    font-size: 1.55rem;
}

/* Текущее состояние */
.status-card h3 {
    margin: 0 0 1.2rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
}

.status-content {
    display: flex;
    flex-direction: column;
    gap: 1.7rem;
}

.status-primary-line {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 1.7rem;
    row-gap: 1rem;
    align-items: stretch;
}

.status-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
    padding: 0.95rem 1.2rem;
    border-radius: 16px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.12);
    width: 100%;
}

.status-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08ем;
    color: #94a3b8;
}

.status-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1f2937;
}

.status-value.lesson-type-lesson {
    color: #2563eb;
}

.status-value.lesson-type-break {
    color: #f97316;
}

.time-left-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.95rem 1.35rem;
    border-radius: 16px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.15);
    margin: 0 auto;
    width: min(260px, 100%);
}

.time-left-container .status-label {
    color: #1d4ed8;
    letter-spacing: 0.16em;
    font-weight: 600;
}

.time-left {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1d4ed8;
}

.full-width {
    width: 100%;
}

.progress-bar {
    height: 16px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    width: 100%;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
    transition: width 0.35s ease;
}

/* Следующее событие */
.next-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.35rem;
}

.next-content .status-field {
    padding: 0.95rem 1.2rem;
    border-radius: 16px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.12);
}

/* Расписание */
.schedule-container {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2.1rem 1.9rem 2.4rem;
    box-shadow: 0 24px 40px -30px rgba(15, 23, 42, 0.55);
}

.day-selector h3,
.schedule h3 {
    margin: 0 0 1.1rem;
    font-size: 1.2rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

.day-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    justify-content: center;
}

.day-btn {
    border: none;
    padding: 0.75rem 1.3rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    background: #e2e8f0;
    color: #1f2937;
    transition: transform 0.15s ease, background 0.15s.ease, color 0.15s ease;
}

.day-btn:hover {
    background: #cbd5f5;
}

.day-btn.active {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    color: #ffffff;
    box-shadow: 0 12px 24px -22px rgba(59, 130, 246, 0.7);
}

.schedule table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.schedule thead th {
    background: #f8fafc;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    padding: 1rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    text-align: center;
}

.schedule tbody td {
    padding: 1.05rem 0.85rem;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.17);
    text-align: center;
}

.schedule tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.7);
}

.schedule tbody td[colspan] {
    text-align: center;
}

.schedule tbody tr.schedule-current {
    background: rgba(37, 99, 235, 0.16) !important;
    position: relative;
}

.schedule tbody tr.schedule-current::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: linear-gradient(180deg, #2563eb 0%, #3b82f6 100%);
}

.break-time {
    color: #f97316;
    font-weight: 600;
}

.current-lesson {
    background: rgba(59, 130, 246, 0.12);
}

.current-break {
    background: rgba(249, 115, 22, 0.14);
}

.empty-schedule {
    text-align: center;
    padding: 1.4rem;
    color: #94a3b8;
}

/* Страница с большими часами */
/* --- только для страницы больших часов --- */
body.clock-only {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: clamp(2rem, 5vw, 3.5rem);
    background: radial-gradient(circle at top, #f8fafc 0%, #e2e8f0 40%, #cbd5f5 100%);
}

body.clock-only .clock-only-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.6rem, 4vw, 3rem);
    width: 100%;
}

body.clock-only .clock-only-control {
    width: clamp(360px, 72vw, 760px);
    justify-content: center;
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

body.clock-only .progress-clock {
    --clock-size: min(520px, 80vw); /* круг уменьшен ~ в 1.5 раза */
    --frame-offset: 1cm;            /* рамка на 1 см шире круга */
    width: calc(var(--clock-size) + 2 * var(--frame-offset));
    flex-direction: column;
    align-items: center;
    gap: clamp(1.4rem, 4vw, 2.4rem);
    padding: calc(var(--frame-offset) + clamp(1.2rem, 3vw, 2rem));
    border-radius: clamp(20px, 5vw, 32px);
    position: relative;
}

body.clock-only .progress-clock .clock {
    width: var(--clock-size);
    max-width: 640px;
    position: relative;
}

body.clock-only .clock-text {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

body.clock-only .clock-event,
body.clock-only .clock-eta,
body.clock-only .clock-meta {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-weight: 700;
    max-width: 80%;
}

/* название события — на 1 см выше центра */
body.clock-only .clock-event {
    top: calc(38% - 1cm);
    transform: translate(-50%, -50%);
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    color: #1f2937;
}

/* сколько осталось — на 1 см ниже центра */
body.clock-only .clock-eta {
    top: calc(45% + 1cm);
    transform: translate(-50%, -50%);
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: #ef4444;
}

/* школа — на 2 см ниже времени, автор — строкой ниже */
body.clock-only .clock-meta {
    top: calc(50% + 3cm);
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-weight: 600;
    color: #1f2937;
}

body.clock-only .clock-meta-school {
    font-size: clamp(1rem, 1,5vw, 1.45rem);
}

body.clock-only .clock-meta-author {
    font-size: clamp(0.95rem, 1vw, 1.3rem);
    color: #4b5563;
}

body.clock-only .clock-only-progress {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    align-items: stretch;
    margin-top: clamp(0,8rem, calc(4vw-0,5cm), 1.6rem);
}

body.clock-only .clock-only-progress .status-label {
    text-align: center;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6b7280;
}

body.clock-only .clock-only-progress .progress-bar {
    width: 100%;
    height: 18px;
}

/* Адаптация */
@media (max-width: 1024px) {
    .status-primary-line {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2.1rem 1.1rem 2.6rem;
    }
.header-row {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: clamp(0.25rem, 2vw, 0.6rem); /* меньше расстояние между заголовком и часами */
}

.clock-link {
    margin: 0;                   /* убираем возможный внешний отступ сверху */
    align-self: center;
}

.progress-clock {
    margin-top: 0;               /* на всякий случай обнуляем, если был */
}

.header-row .header-container {
    width: 100%;
    text-align: center;
}

.header-container h1,
.school-header h2,
.author-name {
    text-align: center;
}
.header-row .header-container,
    .header-row .clock-link {
        flex: 0 0 auto;
    }

.clock-link {
    margin: 0;
    align-self: center;
}

    .progress-clock {
        align-self: center;
margin-top: 0;
    }

    .progress-clock .clock {
        width: 140px;
    }

    .current-info {
        grid-template-columns: 1fr;
    }

    .status-primary-line,
    .next-content {
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
        gap: 1.1rem;
    }

    body.clock-only .progress-clock {
        width: min(520px, 92vw);
    }

    body.clock-only .progress-clock .clock {
        width: min(520px, 92vw);
    }
    .schedule {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* плавный скролл на iOS */
    }

    .schedule table {
        min-width: 640px; /* чтобы колонкам было где размещаться */
    }

    .schedule table th,
    .schedule table td {
        padding: 0.75rem 0.6rem;
        font-size: 0.92rem;
        white-space: nowrap; /* отключаем перенос, вся колонка скроллится целиком */
    }
@media (max-width: 600px) {
    /* немного уменьшаем круг */
    body.clock-only .progress-clock {
        --clock-size: min(400px, 88vw);
    }

    /* название события — чуть выше центра (45%) */
    body.clock-only .clock-event {
        top: 45%;
        transform: translate(-50%, -50%);
        font-size: clamp(1.4rem, 6vw, 2.2rem);
    }

    /* оставшееся время — чуть ниже центра (55%) */
    body.clock-only .clock-eta {
        top: 55%;
        transform: translate(-50%, -50%);
        font-size: clamp(1.8rem, 7vw, 2.6rem);
    }

    /* блок “школа + автор” — ближе к центру, но всё ещё ниже времени */
    body.clock-only .clock-meta {
        top: 68%;
        transform: translate(-50%, -50%);
        gap: 0.35rem;
    }

    body.clock-only .clock-meta-school {
        font-size: clamp(0.9rem, 4.5vw, 1.2rem);
    }

    body.clock-only .clock-meta-author {
        font-size: clamp(0.8rem, 4vw, 1.1rem);
    }

    /* прогресс-бар чуть ближе к кругу */
    body.clock-only .clock-only-progress {
        margin-top: clamp(0.9rem, 5vw, 1.6rem);
    }
@media (max-width: 600px) {
    body.clock-only .progress-clock {
        --clock-size: min(380px, 88vw);  /* сам круг */
        --mobile-offset: clamp(28px, 9vw, 38px);       /* “≈ 1 см” от центра */
        --mobile-meta-gap: clamp(40px, 12vw, 56px);    /* расстояние до блока со школой */
        width: calc(var(--clock-size) + 2 * var(--frame-offset));
    }

    /* название события – на 1 см выше центра */
    body.clock-only .clock-event {
        top: calc(50% - var(--mobile-offset));
        transform: translate(-50%, -50%);
        font-size: clamp(1.3rem, 5.5vw, 2.1rem);
    }

    /* сколько осталось – на 1 см ниже центра */
    body.clock-only .clock-eta {
        top: calc(50% + var(--mobile-offset));
        transform: translate(-50%, -50%);
        font-size: clamp(1.7rem, 6.5vw, 2.6rem);
    }

    /* школа и автор – держим внутри круга */
    body.clock-only .clock-meta {
        top: calc(50% + var(--mobile-offset) + var(--mobile-meta-gap));
        transform: translate(-50%, -50%);
        gap: 0.35rem;
    }

    body.clock-only .clock-meta-school {
        font-size: clamp(0.9rem, 4.2vw, 1.3rem);
    }

    body.clock-only .clock-meta-author {
        font-size: clamp(0.8rem, 3.8vw, 1.1rem);
    }

    body.clock-only .clock-only-progress {
        margin-top: clamp(1rem, 6vw, 1.7rem);
    }
}
@media (max-width: 900px) {
   .header-row {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: clamp(0.25rem, 2vw, 0.6rem);
    }

    .header-row .header-container {
        flex: 1 1 auto;
        text-align: center;
    }

    .header-container h1,
    .school-header h2,
    .author-name {
        text-align: center;
    }
.header-row .header-container,
    .header-row .clock-link {
        flex: 0 0 auto;
    }
    .clock-link {
        margin: 0;
        align-self: center;
    }
}
}

