/* Общие стили */
:root {
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent-primary: #8A2BE2;
    --accent-secondary: #36D1DC;
    --accent-success: #4CAF50;
    --accent-warning: #FF9800;
    --accent-danger: #FF5252;
    
    --page-bg: #fafafa;
    --page-text: #333333;
    --page-primary: #2c3e50;
    --page-secondary: #7f8c8d;
    --page-border: #e0e0e0;
    --page-card: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--page-bg);
    color: var(--page-text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    padding: 0;
}

/* Контейнер приложения */
.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

@keyframes shooting-star {
    0% {
        transform: translateX(-100px) translateY(-100px);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    15% {
        transform: translateX(300px) translateY(300px);
        opacity: 0;
    }
    100% {
        transform: translateX(300px) translateY(300px);
        opacity: 0;
    }
}

/* Блок с часами */
.clock-section {
    width: 100%;
    max-width: 380px;
    min-width: 320px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 1.5rem;
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: background 3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    gap: 1.2rem;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #0F2027 0%, #203A43 100%);
}

/* Улучшенное звездное небо */
.clock-section::before,
.mobile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(1px 1px at 5% 10%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(1px 1px at 15% 25%, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        radial-gradient(1px 1px at 25% 60%, rgba(255, 255, 255, 0.9) 1px, transparent 1px),
        radial-gradient(1px 1px at 35% 85%, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        radial-gradient(1px 1px at 45% 15%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(1px 1px at 55% 70%, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        radial-gradient(1px 1px at 65% 40%, rgba(255, 255, 255, 0.9) 1px, transparent 1px),
        radial-gradient(1px 1px at 75% 90%, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        radial-gradient(1px 1px at 85% 30%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(1px 1px at 95% 55%, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        radial-gradient(2px 2px at 8% 75%, rgba(255, 255, 255, 0.9) 2px, transparent 2px),
        radial-gradient(2px 2px at 22% 18%, rgba(255, 255, 255, 0.8) 2px, transparent 2px),
        radial-gradient(2px 2px at 42% 88%, rgba(255, 255, 255, 0.7) 2px, transparent 2px),
        radial-gradient(2px 2px at 58% 32%, rgba(255, 255, 255, 0.9) 2px, transparent 2px),
        radial-gradient(2px 2px at 78% 68%, rgba(255, 255, 255, 0.6) 2px, transparent 2px),
        radial-gradient(2px 2px at 92% 12%, rgba(255, 255, 255, 0.8) 2px, transparent 2px),
        radial-gradient(3px 3px at 12% 48%, rgba(255, 255, 255, 0.9) 3px, transparent 3px),
        radial-gradient(3px 3px at 38% 82%, rgba(255, 255, 255, 0.7) 3px, transparent 3px),
        radial-gradient(3px 3px at 62% 22%, rgba(255, 255, 255, 0.9) 3px, transparent 3px),
        radial-gradient(3px 3px at 88% 58%, rgba(255, 255, 255, 0.6) 3px, transparent 3px);
    background-size: 100% 100%;
    opacity: 0;
    transition: opacity 2s ease;
    pointer-events: none;
    z-index: -1;
}

.clock-section::after,
.mobile-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(1px 1px at 2% 20%, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        radial-gradient(1px 1px at 18% 45%, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        radial-gradient(1px 1px at 28% 80%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(1px 1px at 48% 5%, rgba(255, 255, 255, 0.5) 1px, transparent 1px),
        radial-gradient(1px 1px at 68% 65%, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        radial-gradient(1px 1px at 82% 35%, rgba(255, 255, 255, 0.9) 1px, transparent 1px),
        radial-gradient(1px 1px at 98% 85%, rgba(255, 255, 255, 0.6) 1px, transparent 1px);
    background-size: 100% 100%;
    opacity: 0;
    transition: opacity 2s ease;
    pointer-events: none;
    z-index: -1;
}

/* Падающие звезды (только ночью) */
.star-shooting {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%);
    opacity: 0;
    z-index: -1;
}

.clock-section.night .star-shooting:nth-child(1),
.mobile-header.night .star-shooting:nth-child(1) {
    top: 15%;
    left: 5%;
    animation: shooting-star 8s 3s infinite;
}

.clock-section.night .star-shooting:nth-child(2),
.mobile-header.night .star-shooting:nth-child(2) {
    top: 40%;
    left: 15%;
    animation: shooting-star 10s 8s infinite;
}

.clock-section.night .star-shooting:nth-child(3),
.mobile-header.night .star-shooting:nth-child(3) {
    top: 70%;
    left: 25%;
    animation: shooting-star 12s 15s infinite;
}

.clock-section.night::before,
.clock-section.night::after,
.mobile-header.night::before,
.mobile-header.night::after {
    opacity: 0.8;
    animation: twinkle 3s infinite alternate;
}

.clock-section.night::after {
    animation-delay: 1.5s;
}

.clock-section::-webkit-scrollbar {
    width: 6px;
}

.clock-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.clock-section::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.desktop-menu-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 110;
    background: rgba(138, 43, 226, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.desktop-menu-btn:hover {
    background: rgba(138, 43, 226, 0.5);
    transform: scale(1.05);
}

.desktop-menu-btn i {
    font-size: 1.2rem;
    color: var(--text-main);
}

.clock-wrapper {
    position: relative;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1 / 1;
    z-index: 20;
    margin: 0.5rem auto;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    flex-grow: 0;
}

.clock-face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: 
        inset 0 0 40px rgba(0, 0, 0, 0.3),
        0 12px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.marker {
    position: absolute;
    transform-origin: center center;
    border-radius: 50%;
}

.hour-marker {
    width: 0;
    height: 0;
    background: transparent;
    opacity: 0.9;
    transform: translate(-50%, -50%);
}

.minute-marker {
    width: 2px;
    height: 2px;
    background: var(--text-secondary);
    opacity: 0.6;
    transform: translate(-50%, -50%);
}

.hour-number {
    position: absolute;
    text-align: center;
    font-weight: 500;
    color: var(--text-main);
    transform: translate(-50%, -50%);
    user-select: none;
    z-index: 5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-family: 'Inter', sans-serif;
}

.clock-logo {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.time-period-indicator {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translate(-50%, 50%);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 80px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    white-space: nowrap;
}

.period-emoji {
    font-size: 0.8rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.period-text {
    font-size: 0.65rem;
    font-weight: 600;
}

.time-period-window {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translate(-50%, 50%);
    width: 80px;
    height: 24px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9;
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: 50% 100%;
    border-radius: 4px 4px 2px 2px;
    cursor: grab;
    z-index: 30;
    transition: transform 0.05s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    touch-action: none;
    will-change: transform;
    transform: translateX(-50%) rotate(0deg);
    transform-origin: 50% 100%;
}

.hand:active {
    cursor: grabbing;
}

.hour-hand {
    width: 6px;
    height: 30%;
    background: linear-gradient(to top, #ffffff, #e0e0e0);
    z-index: 31;
}

.minute-hand {
    width: 4px;
    height: 42%;
    background: linear-gradient(to top, var(--accent-primary), #9b6bff);
    z-index: 32;
}

.second-hand {
    width: 2px;
    height: 45%;
    background: linear-gradient(to top, var(--accent-danger), #ff7b7b);
    z-index: 33;
    pointer-events: none;
    transition: transform 0.05s linear !important;
}

.center-nut {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--text-main);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

.digital-display {
    margin: 0.3rem 0;
    text-align: center;
    z-index: 10;
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.digital-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.digital-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
    width: 100%;
    max-width: 280px;
}

.digital-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    text-align: center;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    flex: 1;
}

.digital-time:hover {
    background: rgba(255, 255, 255, 0.05);
}

.digital-time.disabled {
    opacity: 0.3;
    cursor: default;
}

.format-controls-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 280px;
}

.format-control-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 36px;
}

.format-control-btn:hover {
    background: rgba(138, 43, 226, 0.2);
    transform: translateY(-2px);
}

.format-control-btn i {
    font-size: 0.9rem;
}

.format-control-btn.active {
    background: rgba(138, 43, 226, 0.3);
    border-color: var(--accent-primary);
}

.time-control-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
    transition: all 0.3s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    position: relative;
    font-weight: 600;
    flex-shrink: 0;
}

.time-control-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.time-control-btn.active {
    color: var(--accent-primary);
    background: rgba(138, 43, 226, 0.15);
}

.score-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem;
    margin: 0.5rem 0;
    width: 100%;
    max-width: 280px;
    text-align: center;
}

.score-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.score-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-warning);
    text-shadow: 0 0 10px rgba(255, 152, 0, 0.3);
}

.clock-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
    z-index: 10;
    justify-content: center;
    width: 100%;
    max-width: 280px;
}

.control-btn {
    padding: 0.7rem 0.5rem;
    border-radius: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    min-height: 42px;
    white-space: nowrap;
}

.control-btn:hover {
    background: rgba(138, 43, 226, 0.25);
    transform: translateY(-2px);
}

.control-btn i {
    font-size: 0.9rem;
}

.real-time-btn {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.3);
}

.random-time-btn {
    background: rgba(138, 43, 226, 0.2);
    border-color: rgba(138, 43, 226, 0.3);
}

.real-time-btn:hover {
    background: rgba(76, 175, 80, 0.3);
}

.random-time-btn:hover {
    background: rgba(138, 43, 226, 0.3);
}

/* Блок с контентом и упражнениями */
.content-section {
    flex: 1;
    margin-left: 380px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.table-of-contents {
    position: fixed;
    top: 0;
    left: 380px;
    width: 320px;
    height: 100%;
    background: rgba(15, 15, 25, 0.98);
    backdrop-filter: blur(25px);
    border-right: 1px solid var(--glass-border);
    z-index: 90;
    padding: 2rem;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
}

.table-of-contents::-webkit-scrollbar {
    width: 6px;
}

.table-of-contents::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.table-of-contents::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.table-of-contents.active {
    transform: translateX(0);
}

.toc-header {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.toc-item {
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.toc-item:hover {
    background: rgba(138, 43, 226, 0.1);
    color: var(--text-main);
    transform: translateX(5px);
}

.toc-item.active {
    background: rgba(138, 43, 226, 0.2);
    color: var(--text-main);
    font-weight: 600;
}

.toc-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.pages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 3rem;
    scroll-behavior: smooth;
    position: relative;
    z-index: 10;
    background: transparent;
}

.pages-container::-webkit-scrollbar {
    width: 8px;
}

.pages-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.pages-container::-webkit-scrollbar-thumb {
    background: var(--page-secondary);
    border-radius: 4px;
}

.page {
    display: none;
    animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 0;
    position: relative;
    overflow: hidden;
}

.page.active {
    display: block;
}

.page-header {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: var(--page-primary);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 1rem;
}

.page-subheader {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--page-secondary);
    padding-bottom: 0.5rem;
}

.page-text {
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--page-text);
    position: relative;
}

.character-name {
    color: var(--page-primary);
    font-weight: 600;
    background: rgba(44, 62, 80, 0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.page-list {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--page-text);
}

.page-list li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    position: relative;
    padding-left: 0.5rem;
}

.quote {
    border-left: 3px solid var(--page-primary);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-style: italic;
    background: rgba(44, 62, 80, 0.02);
    color: var(--page-text);
    position: relative;
    font-size: 1.1rem;
}

.quote-author {
    text-align: right;
    font-weight: 600;
    margin-top: 1rem;
    color: var(--page-secondary);
}

.card {
    background: var(--page-card);
    border: 1px solid var(--page-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--page-primary);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.card-icon {
    font-size: 1.3rem;
}

.exercise {
    background: var(--page-card);
    border: 1px solid var(--page-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.exercise-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--page-primary);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.exercise-instruction {
    margin-bottom: 1.5rem;
    color: var(--page-text);
    font-size: 1.1rem;
    line-height: 1.7;
}

.exercise-points {
    display: inline-block;
    background: var(--accent-warning);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.exercise-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.exercise-btn {
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    background: rgba(44, 62, 80, 0.05);
    border: 1px solid var(--page-border);
    color: var(--page-text);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.exercise-btn:hover {
    background: rgba(44, 62, 80, 0.1);
    transform: translateY(-2px);
}

.exercise-btn.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.exercise-btn.primary:hover {
    background: #7a1fd1;
}

.time-input {
    padding: 0.7rem 1rem;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--page-border);
    color: var(--page-text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    width: 120px;
}

.time-check-btn {
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    background: var(--accent-success);
    border: 1px solid var(--accent-success);
    color: white;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-check-btn:hover {
    background: #3d8b40;
}

.page-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--page-border);
}

.nav-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    background: rgba(44, 62, 80, 0.05);
    border: 1px solid var(--page-border);
    color: var(--page-text);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    background: rgba(44, 62, 80, 0.1);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn:disabled:hover {
    background: rgba(44, 62, 80, 0.05);
    transform: none;
}

.page-indicator {
    display: flex;
    align-items: center;
    color: var(--page-secondary);
    font-size: 0.9rem;
}

.game-mode {
    background: var(--page-card);
    border: 1px solid var(--page-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.game-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--accent-warning);
}

.game-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.03);
    padding: 1.2rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
}

.game-time-target {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
}

.game-btn {
    padding: 0.9rem 2rem;
    border-radius: 10px;
    background: var(--accent-warning);
    border: none;
    color: white;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
    width: 100%;
}

.game-btn:hover {
    background: #e68900;
    transform: translateY(-3px);
}

.leaderboard {
    background: var(--page-card);
    border: 1px solid var(--page-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.leaderboard-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
    text-align: center;
}

.leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid var(--page-border);
}

.leaderboard-rank {
    font-weight: 700;
    color: var(--accent-warning);
    width: 30px;
    text-align: center;
}

.leaderboard-name {
    flex: 1;
    margin: 0 1rem;
}

.leaderboard-score {
    font-weight: 700;
    color: var(--accent-success);
    font-family: 'JetBrains Mono', monospace;
}

.leaderboard-form {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-input {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--page-border);
    color: var(--page-text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.form-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

/* Мобильная версия - УЛУЧШЕННАЯ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 25vh !important;
    min-height: 25vh !important;
    max-height: 25vh !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    padding: 0.7rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    overflow: hidden;
    transition: background 3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    background: linear-gradient(135deg, #0F2027 0%, #203A43 100%);
}

.mobile-clock-side {
    flex: 0 0 auto;
    width: 22vh !important;
    height: 22vh !important;
    min-width: 22vh !important;
    min-height: 22vh !important;
    max-width: 22vh !important;
    max-height: 22vh !important;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.3rem;
    box-sizing: border-box;
    margin-right: 0.5rem;
}

.mobile-clock-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-clock-face {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.3),
        0 12px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
}

.mobile-controls-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding-left: 0;
    padding-block: 0.75rem;
    padding-right: 0.1rem;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    gap: 0.5rem;
}

.mobile-controls-row {
    display: flex;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
}

.mobile-row-1 {
    margin-bottom: 0.1rem;
    justify-content: space-between;
    height: 30px;
    min-height: 30px;
    flex-shrink: 0;
}

.mobile-row-2 {
    margin-bottom: 0.1rem;
    justify-content: center;
    height: 40px;
    min-height: 40px;
    flex-shrink: 0;
}

.mobile-row-3 {
    margin-bottom: 0;
    justify-content: space-between;
    height: 36px;
    min-height: 36px;
    flex-shrink: 0;
}

.mobile-score-panel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    height: 100%;
}

.mobile-score-value {
    font-weight: 700;
    color: var(--accent-warning);
    font-size: 1.3rem;
    min-width: 40px;
    text-align: right;
}

.mobile-menu-toggle {
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    background: var(--accent-primary);
    border: none;
    color: white;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    min-width: 70px;
    justify-content: center;
    flex-shrink: 0;
    height: 30px;
    min-height: 30px;
}

.mobile-menu-toggle:hover {
    background: #7a1fd1;
    transform: translateY(-2px);
}

.mobile-time-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.3rem 0.5rem;
    height: 100%;
    min-width: 0;
}

.mobile-digital-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 0;
    flex: 1;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-digital-time:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-digital-time.disabled {
    opacity: 0.3;
    cursor: default;
}

.mobile-time-control-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-weight: 600;
}

.mobile-time-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.mobile-time-control-btn.active {
    color: var(--accent-primary);
    background: rgba(138, 43, 226, 0.15);
}

.mobile-buttons-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    height: 100%;
}

.mobile-control-btn {
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    justify-content: center;
    flex: 1;
    white-space: nowrap;
    height: 100%;
    min-height: 36px;
}

.mobile-control-btn:hover {
    background: rgba(138, 43, 226, 0.2);
    transform: translateY(-2px);
}

.mobile-control-btn i {
    font-size: 0.75rem;
}

.mobile-real-time-btn {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.3);
}

.mobile-random-time-btn {
    background: rgba(138, 43, 226, 0.2);
    border-color: rgba(138, 43, 226, 0.3);
}

.mobile-real-time-btn:hover {
    background: rgba(76, 175, 80, 0.3);
}

.mobile-random-time-btn:hover {
    background: rgba(138, 43, 226, 0.3);
}

.mobile-menu {
    position: fixed;
    top: 25vh;
    left: 0;
    width: 100%;
    height: 0;
    background: rgba(15, 15, 25, 0.98);
    backdrop-filter: blur(25px);
    z-index: 999;
    overflow: hidden;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mobile-menu.active {
    height: 75vh;
    min-height: 300px;
    max-height: 75vh;
    overflow-y: auto;
}

.mobile-menu-content {
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
}

.mobile-toc-header {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-align: center;
}

.mobile-toc-item {
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.mobile-toc-item:hover {
    background: rgba(138, 43, 226, 0.1);
    color: var(--text-main);
}

.mobile-toc-item.active {
    background: rgba(138, 43, 226, 0.2);
    color: var(--text-main);
    font-weight: 600;
}

.mobile-toc-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .clock-section {
        max-width: 350px;
    }
    
    .content-section {
        margin-left: 350px;
    }
    
    .table-of-contents {
        left: 350px;
    }
}

@media (max-width: 992px) {
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .clock-section {
        display: none;
    }
    
    .mobile-header {
        display: flex !important;
        height: 25vh !important;
        min-height: 25vh !important;
        max-height: 25vh !important;
        padding: 0.6rem;
        gap: 0.6rem;
    }
    
    .mobile-clock-side {
        width: 22vh !important;
        height: 22vh !important;
        min-width: 22vh !important;
        min-height: 22vh !important;
        max-width: 22vh !important;
        max-height: 22vh !important;
    }
    
    .content-section {
        width: 100%;
        height: auto;
        min-height: calc(100vh - 25vh);
        margin-left: 0;
        margin-top: 25vh;
    }
    
    .pages-container {
        padding: 1.5rem;
        height: auto;
    }
    
    .page-header {
        font-size: 1.8rem;
    }
    
    .page-subheader {
        font-size: 1.4rem;
    }
    
    .page-text {
        font-size: 1.05rem;
        line-height: 1.7;
    }
    
    .exercise-controls {
        flex-direction: column;
    }
    
    .exercise-btn, .time-input {
        width: 100%;
    }
    
    .table-of-contents {
        display: none;
    }
    
    .quote {
        padding: 1rem 1.5rem;
        margin: 1.5rem 0;
    }
    
    .card, .exercise, .game-mode, .leaderboard {
        padding: 1.2rem;
        margin: 1.5rem 0;
    }
    
    .mobile-digital-time {
        font-size: 1.2rem;
    }
    
    .mobile-control-btn {
        font-size: 0.65rem;
        padding: 0.35rem 0.4rem;
    }
}

@media (max-width: 768px) {
    .mobile-header {
        height: 25vh !important;
        min-height: 25vh !important;
        max-height: 25vh !important;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .mobile-clock-side {
        width: 20vh !important;
        height: 20vh !important;
        min-width: 20vh !important;
        min-height: 20vh !important;
        max-width: 20vh !important;
        max-height: 20vh !important;
    }
    
    .mobile-digital-time {
        font-size: 1.1rem;
    }
    
    .mobile-time-control-btn {
        min-width: 34px;
        height: 34px;
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .mobile-control-btn {
        font-size: 0.65rem;
        padding: 0.35rem 0.4rem;
        min-height: 34px;
    }
    
    .mobile-menu-toggle {
        font-size: 0.7rem;
        padding: 0.35rem 0.6rem;
        min-width: 65px;
        height: 30px;
    }
    
    .content-section {
        min-height: calc(100vh - 25vh);
        margin-top: 25vh;
    }
    
    .page-header {
        font-size: 1.6rem;
    }
    
    .page-subheader {
        font-size: 1.3rem;
    }
    
    .pages-container {
        padding: 1.2rem;
    }
    
    .page-text {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .page-list {
        margin-left: 1rem;
    }
    
    .page-navigation {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    .nav-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .mobile-row-1 {
        height: 28px;
        min-height: 28px;
    }
    
    .mobile-row-2 {
        height: 38px;
        min-height: 38px;
    }
    
    .mobile-row-3 {
        height: 34px;
        min-height: 34px;
    }
}

@media (max-width: 480px) {
    .mobile-header {
        height: 25vh !important;
        min-height: 25vh !important;
        max-height: 25vh !important;
        padding: 0.4rem;
        gap: 0.4rem;
    }
    
    .mobile-clock-side {
        width: 23vh !important;
        height: 23vh !important;
        min-width: 23vh !important;
        min-height: 23vh !important;
        max-width: 23vh !important;
        max-height: 23vh !important;
        margin-right: 0.1rem;
    }
    
    .mobile-digital-time {
        font-size: 1rem;
        padding: 0.1rem 0.2rem;
    }
    
    .mobile-time-control-btn {
        min-width: 20px;
        height: 32px;
        font-size: 0.75rem;
        padding: 0.1rem 0.3rem;
    }
    
    .mobile-control-btn {
        font-size: 0.6rem;
        padding: 0.3rem 0.35rem;
        min-height: 32px;
    }
    
    .mobile-menu-toggle {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
        min-width: 60px;
        height: 28px;
    }
    
    .content-section {
        min-height: calc(100vh - 25vh);
        margin-top: 25vh;
    }
    
    .page-header {
        font-size: 1.4rem;
    }
    
    .page-subheader {
        font-size: 1.2rem;
    }
    
    .page-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .pages-container {
        padding: 1rem;
    }
    
    .exercise, .card {
        padding: 1rem;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.8rem;
    }
    
    .mobile-row-2 .mobile-time-wrapper {
        padding: 0.2rem 0.4rem;
    }
    
    .mobile-row-1 {
        height: 26px;
        min-height: 26px;
    }
    
    .mobile-row-2 {
        height: 36px;
        min-height: 36px;
    }
    
    .mobile-row-3 {
        height: 32px;
        min-height: 32px;
    }
}

@media (max-height: 700px) and (max-width: 992px) {
    .mobile-header {
        height: 25vh !important;
        min-height: 25vh !important;
        max-height: 25vh !important;
    }
    
    .mobile-control-btn {
        padding: 0.2rem 0.3rem;
        font-size: 0.6rem;
        min-height: 30px;
    }
    
    .mobile-menu.active {
        height: 75vh;
    }
    
    .content-section {
        min-height: calc(100vh - 25vh);
        margin-top: 25vh;
    }
    
    .mobile-row-1 {
        height: 26px;
        min-height: 26px;
    }
    
    .mobile-row-2 {
        height: 34px;
        min-height: 34px;
    }
    
    .mobile-row-3 {
        height: 30px;
        min-height: 30px;
    }
}

@media (min-width: 1600px) {
    .clock-section {
        max-width: 420px;
    }
    
    .content-section {
        margin-left: 420px;
    }
    
    .table-of-contents {
        left: 420px;
    }
    
    .pages-container {
        padding: 2.5rem 4rem;
    }
    
    .page {
        max-width: 900px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .mobile-header {
        height: 30vh !important;
        min-height: 30vh !important;
        max-height: 30vh !important;
    }
    
    .mobile-clock-side {
        width: 25vh !important;
        height: 25vh !important;
        min-width: 25vh !important;
        min-height: 25vh !important;
        max-width: 25vh !important;
        max-height: 25vh !important;
    }
    
    .mobile-menu.active {
        height: 70vh;
    }
    
    .content-section {
        min-height: calc(100vh - 30vh);
        margin-top: 30vh;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .mobile-header {
        padding: 0.3rem;
        gap: 0.3rem;
    }
    
    .mobile-clock-side {
        width: 20vh !important;
        height: 20vh !important;
        min-width: 20vh !important;
        min-height: 20vh !important;
        max-width: 20vh !important;
        max-height: 20vh !important;
        margin-right: 0.2rem;
    }
    
    .mobile-digital-time {
        font-size: 0.9rem;
    }
    
    .mobile-time-control-btn {
        min-width: 30px;
        height: 30px;
        font-size: 0.7rem;
        padding: 0.1rem 0.2rem;
    }
    
    .mobile-control-btn {
        font-size: 0.55rem;
        padding: 0.25rem 0.3rem;
        min-height: 30px;
    }
    
    .mobile-menu-toggle {
        font-size: 0.6rem;
        padding: 0.25rem 0.4rem;
        min-width: 55px;
        height: 26px;
    }
    
    .mobile-score-panel {
        font-size: 0.75rem;
    }
    
    .mobile-score-value {
        font-size: 1.1rem;
    }
}