:root {
    --bg: #0f1115;
    --panel: #151923;
    --panel-2: #1b2230;
    --text: #e6eaf2;
    --muted: #9aa3b2;
    --accent: #2a8fef;
    --accent-2: #1e6fc1;
    --danger: #ff5d5d;
    --success: #52d273;
    --radius: 12px;
}

html,
body {
    height: 100vh;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.app {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.title {
    font-weight: 600;
    letter-spacing: 0.2px;
    font-size: 16px;
    background: linear-gradient(135deg, 
        var(--text) 0%, 
        var(--accent) 25%, 
        #4a9eff 50%, 
        #52d273 75%, 
        var(--accent) 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: title-rainbow 4s ease-in-out infinite;
    position: relative;
}

.title::before {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, 
        #ff6b6b 0%, 
        #4ecdc4 25%, 
        #45b7d1 50%, 
        #96ceb4 75%, 
        #feca57 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: title-rainbow-bg 6s ease-in-out infinite;
    opacity: 0.7;
    z-index: -1;
}

@keyframes title-rainbow {
    0% { 
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    25% { 
        background-position: 100% 50%;
        filter: hue-rotate(90deg);
    }
    50% { 
        background-position: 100% 100%;
        filter: hue-rotate(180deg);
    }
    75% { 
        background-position: 0% 100%;
        filter: hue-rotate(270deg);
    }
    100% { 
        background-position: 0% 50%;
        filter: hue-rotate(360deg);
    }
}

@keyframes title-rainbow-bg {
    0% { 
        background-position: 100% 50%;
        filter: hue-rotate(0deg);
    }
    25% { 
        background-position: 0% 50%;
        filter: hue-rotate(90deg);
    }
    50% { 
        background-position: 0% 100%;
        filter: hue-rotate(180deg);
    }
    75% { 
        background-position: 100% 100%;
        filter: hue-rotate(270deg);
    }
    100% { 
        background-position: 100% 50%;
        filter: hue-rotate(360deg);
    }
}

.controls-inline {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.time-range {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    min-width: 300px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    flex-wrap: wrap;
}

.arrow {
    color: var(--muted);
    font-weight: 600;
    font-size: 16px;
}

.field,
.button {
    background: var(--panel);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    max-width: 100%;
}

.field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(42, 143, 239, 0.1);
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.06), 
        rgba(255, 255, 255, 0.04));
}

.field::placeholder {
    color: var(--muted);
    opacity: 0.7;
    font-size: 12px;
}

/* Подсказки для датапикеров */
.field[type="datetime-local"] {
    position: relative;
}

.field[type="datetime-local"]:focus::after {
    content: 'Можно вводить в формате: 15.12.2024 14:30';
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--panel-2);
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    margin-top: 4px;
}

.field:hover {
    border-color: rgba(42, 143, 239, 0.3);
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.06), 
        rgba(255, 255, 255, 0.04));
}

.button {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.button:hover::before {
    left: 100%;
}

.button:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.button.primary {
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border: none;
    box-shadow: 0 2px 8px rgba(42, 143, 239, 0.3);
}

.button.primary:hover {
    background: linear-gradient(180deg, #4a9eff, var(--accent));
    box-shadow: 0 6px 16px rgba(42, 143, 239, 0.4);
}

.button.ghost {
    background: var(--panel-2);
}

.button.ghost:hover {
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.05), 
        rgba(255, 255, 255, 0.02));
    border-color: rgba(42, 143, 239, 0.3);
}

.button:active {
    transform: translateY(1px);
}

/* Специальные стили для кнопок с эмодзи */
.button[id="playpause"],
.button[id="back10"],
.button[id="fwd10"] {
    font-size: 16px;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.button[id="playpause"] {
    font-size: 18px;
    min-width: 48px;
    min-height: 48px;
}

/* Исправление отображения эмодзи */
.button[id="back10"]::before,
.button[id="fwd10"]::before {
    display: none;
}

.button[id="back10"],
.button[id="fwd10"] {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-weight: 500;
    vertical-align: middle;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Дополнительные стили для правильного отображения эмодзи */
.button[id="playpause"] {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-weight: 500;
    vertical-align: middle;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.player-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    width: 100%;
    box-sizing: border-box;
}

.player-card:hover {
    border-color: rgba(42, 143, 239, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.video-wrap {
    position: relative;
    background: #000;
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-height: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.video-wrap:hover {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
    min-height: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.controls-panel {
    display: grid;
    gap: 10px;
    padding: 10px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.transport {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.time {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    font-size: 12px;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.time:hover {
    color: var(--accent);
    background: rgba(42, 143, 239, 0.1);
    border-color: rgba(42, 143, 239, 0.2);
}

.rangebar {
    width: 100%;
    height: 60px;
    position: relative;
    touch-action: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Убрано скачки при наведении */

.rangebar:hover #timeline {
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(42, 143, 239, 0.3);
}

#timeline {
    width: 100%;
    height: 18px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(255, 255, 255, 0.12) 50%, 
        rgba(255, 255, 255, 0.08) 100%);
    position: relative;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.1);
    transition: background 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    max-width: 100%;
    box-sizing: border-box;
}

#timeline:hover {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.12) 0%, 
        rgba(255, 255, 255, 0.18) 50%, 
        rgba(255, 255, 255, 0.12) 100%);
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(42, 143, 239, 0.2);
}

.buffered,
.played,
.range,
.thumb {
    position: absolute;
    height: 100%;
    pointer-events: none;
    transition: width 0.1s ease, left 0.1s ease;
}

.buffered {
    background: linear-gradient(90deg, 
        rgba(42, 143, 239, 0.4) 0%, 
        rgba(42, 143, 239, 0.6) 50%, 
        rgba(42, 143, 239, 0.4) 100%);
    left: 0;
    width: 0;
    pointer-events: none;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(42, 143, 239, 0.3);
}

@keyframes pulse-buffer {
    0%, 100% { 
        box-shadow: 0 0 8px rgba(42, 143, 239, 0.3);
        opacity: 0.8;
    }
    50% { 
        box-shadow: 0 0 12px rgba(42, 143, 239, 0.5);
        opacity: 1;
    }
}

.played {
    background: linear-gradient(90deg, 
        var(--accent) 0%, 
        #4a9eff 50%, 
        var(--accent) 100%);
    left: 0;
    width: 0;
    pointer-events: none;
    border-radius: 999px;
    box-shadow: 
        0 0 10px rgba(42, 143, 239, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

@keyframes shimmer {
    0% { 
        background: linear-gradient(90deg, 
            var(--accent) 0%, 
            #4a9eff 50%, 
            var(--accent) 100%);
    }
    50% { 
        background: linear-gradient(90deg, 
            #4a9eff 0%, 
            var(--accent) 50%, 
            #4a9eff 100%);
    }
    100% { 
        background: linear-gradient(90deg, 
            var(--accent) 0%, 
            #4a9eff 50%, 
            var(--accent) 100%);
    }
}

.range {
    background: linear-gradient(90deg, 
        rgba(82, 210, 115, 0.4) 0%, 
        rgba(82, 210, 115, 0.7) 50%, 
        rgba(82, 210, 115, 0.4) 100%);
    cursor: pointer;
    pointer-events: auto;
    border-radius: 999px;
    box-shadow: 
        0 0 6px rgba(82, 210, 115, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.range::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    animation: sweep 3s ease-in-out infinite;
}

.range:hover {
    background: linear-gradient(90deg, 
        rgba(82, 210, 115, 0.6) 0%, 
        rgba(82, 210, 115, 0.9) 50%, 
        rgba(82, 210, 115, 0.6) 100%);
    box-shadow: 
        0 0 12px rgba(82, 210, 115, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

@keyframes sweep {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.thumb {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    border-radius: 50%;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    pointer-events: none;
    border: 2px solid var(--accent);
    transition: left 0.1s ease;
}

.thumb:hover {
    box-shadow: 
        0 6px 16px rgba(42, 143, 239, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

@keyframes thumb-pulse {
    0%, 100% { 
        box-shadow: 
            0 4px 12px rgba(0, 0, 0, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    50% { 
        box-shadow: 
            0 6px 16px rgba(42, 143, 239, 0.3),
            0 2px 8px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
}

.ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: var(--muted);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.ticks div {
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.ticks div:hover {
    background: rgba(42, 143, 239, 0.1);
    color: var(--accent);
}

.ticks div::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 6px;
    background: var(--muted);
    opacity: 0.6;
    transition: all 0.2s ease;
}

.ticks div:hover::before {
    background: var(--accent);
    opacity: 1;
    height: 8px;
}

.footer {
    padding: 10px 16px;
    color: var(--muted);
    font-size: 12px;
}

.spacer {
    flex: 1 1 auto;
}

input[type="datetime-local"] {
    color-scheme: dark;
}

/* Скрытие AM/PM для всех устройств (российская аудитория) */
input[type="datetime-local"]::-webkit-datetime-edit-text {
    display: none;
}

input[type="datetime-local"]::-webkit-datetime-edit-month-field,
input[type="datetime-local"]::-webkit-datetime-edit-day-field,
input[type="datetime-local"]::-webkit-datetime-edit-year-field {
    color: var(--text);
}

input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field {
    color: var(--text);
}

/* Дополнительные стили для скрытия AM/PM */
input[type="datetime-local"]::-webkit-datetime-edit-ampm-field {
    display: none !important;
}

input[type="datetime-local"]::-webkit-datetime-edit-ampm-field:before {
    content: '';
    display: none;
}

/* Скрытие AM/PM в Firefox */
input[type="datetime-local"]::-moz-datetime-edit-ampm-field {
    display: none !important;
}

/* Скрытие AM/PM в Edge */
input[type="datetime-local"]::-ms-datetime-edit-ampm-field {
    display: none !important;
}

/* Принудительное использование 24-часового формата */
input[type="datetime-local"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Дополнительные стили для скрытия AM/PM */
input[type="datetime-local"]::-webkit-datetime-edit-ampm-field {
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Скрытие AM/PM в Safari */
input[type="datetime-local"]::-webkit-datetime-edit-ampm-field:before {
    content: '' !important;
    display: none !important;
}

/* Принудительное использование 24-часового формата через CSS */
input[type="datetime-local"] {
    direction: ltr;
    text-align: left;
}

/* Мобильные стили для датапикеров */
@media (max-width: 600px) {
    input[type="datetime-local"] {
        font-size: 14px;
        padding: 8px 10px;
    }
}

@media (min-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .title {
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    .header {
        padding: 8px 12px;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        box-sizing: border-box;
    }

    .title {
        text-align: center;
        margin-bottom: 4px;
        font-size: 16px;
        word-wrap: break-word;
    }

    .controls-inline {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        width: 100%;
        box-sizing: border-box;
    }

    .time-range {
        min-width: auto;
        flex-direction: column;
        gap: 6px;
        order: 1;
        align-items: stretch;
        width: 100%;
    }

    .time-range .arrow {
        display: none;
    }

    .actions {
        justify-content: space-between;
        order: 2;
        gap: 8px;
        width: 100%;
        flex-wrap: wrap;
    }

    .field,
    .button {
        padding: 10px 12px;
        font-size: 14px;
        min-height: 40px;
        border-radius: 8px;
        touch-action: manipulation;
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }

    .button {
        flex: 1;
        font-weight: 600;
        min-width: 0;
    }

    .button.primary {
        background: linear-gradient(135deg, var(--accent), #4a9eff);
        box-shadow: 0 2px 8px rgba(42, 143, 239, 0.3);
    }

    /* Мобильные стили для кнопок перемотки */
    .button[id="playpause"],
    .button[id="back10"],
    .button[id="fwd10"] {
        min-width: 40px;
        min-height: 40px;
        font-size: 14px;
        padding: 6px 8px;
    }

    .button[id="playpause"] {
        min-width: 44px;
        min-height: 44px;
        font-size: 16px;
    }

    #timeline {
        height: 20px;
        border-radius: 10px;
    }

    .thumb {
        width: 18px;
        height: 18px;
        border-width: 2px;
    }

    .transport {
        gap: 8px;
        padding: 12px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .time {
        font-size: 12px;
        padding: 6px 10px;
        background: rgba(42, 143, 239, 0.1);
        border-radius: 6px;
        border: 1px solid rgba(42, 143, 239, 0.2);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .layout {
        grid-template-columns: 1fr;
        padding: 8px;
        gap: 12px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .player-card {
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .video-wrap {
        aspect-ratio: 16 / 9;
        border-radius: 8px;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
    }

    .controls-panel {
        padding: 12px;
        gap: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        width: 100%;
        box-sizing: border-box;
    }

    .rangebar {
        height: 60px;
        padding: 6px 0;
        width: 100%;
        box-sizing: border-box;
    }

    #timeline {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .ticks {
        margin-top: 8px;
        font-size: 11px;
    }

    .ticks div {
        padding: 3px 6px;
        border-radius: 4px;
        font-size: 10px;
    }

    /* Мобильные анимации */
    .player-card {
        animation: slide-in-right 0.6s ease;
    }

    /* Боковая панель скрыта */

    .header {
        animation: slide-in-right 0.4s ease;
    }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
    .header {
        padding: 6px 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .title {
        font-size: 14px;
        margin-bottom: 2px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .controls-inline {
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }

    .time-range {
        gap: 4px;
        width: 100%;
    }

    .time-range .arrow {
        display: none;
    }

    .field,
    .button {
        padding: 8px 10px;
        font-size: 13px;
        min-height: 36px;
        border-radius: 6px;
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }

    .actions {
        gap: 6px;
        width: 100%;
        flex-wrap: wrap;
    }

    .transport {
        gap: 6px;
        padding: 8px;
        width: 100%;
        box-sizing: border-box;
        flex-wrap: wrap;
    }

    .time {
        font-size: 11px;
        padding: 4px 8px;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .controls-panel {
        padding: 8px;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .rangebar {
        height: 50px;
        padding: 4px 0;
        width: 100%;
        box-sizing: border-box;
    }

    #timeline {
        height: 18px;
        border-radius: 9px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .thumb {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }

    .ticks {
        margin-top: 6px;
        font-size: 10px;
        width: 100%;
        overflow: hidden;
    }

    .ticks div {
        padding: 2px 4px;
        font-size: 9px;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .layout {
        padding: 6px;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .player-card {
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .video-wrap {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Стили для кнопок перемотки на очень маленьких экранах */
    .button[id="playpause"],
    .button[id="back10"],
    .button[id="fwd10"] {
        min-width: 36px;
        min-height: 36px;
        font-size: 12px;
        padding: 4px 6px;
    }

    .button[id="playpause"] {
        min-width: 40px;
        min-height: 40px;
        font-size: 14px;
    }
}

/* Специальные стили для iOS WebView */
@supports (-webkit-touch-callout: none) {
    .video-wrap {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    video {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    #timeline {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .button {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .field {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
}

/* Toast banner styles */
.banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 20;
    display: grid;
    gap: 8px;
}

.toast {
    background: var(--panel-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(20px);
    opacity: 0;
    animation: toast-enter 0.4s ease forwards;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@keyframes toast-enter {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast.error {
    border-color: rgba(255, 93, 93, 0.6);
}

.toast.info {
    border-color: rgba(42, 143, 239, 0.6);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: -3px;
    box-shadow: 0 0 8px rgba(42, 143, 239, 0.3);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Дополнительные анимации для улучшения UX */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes scale-in {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Анимации для элементов интерфейса */
.controls-panel {
    animation: fade-in 0.5s ease;
}

.transport {
    animation: slide-in-right 0.6s ease;
}

.rangebar {
    animation: scale-in 0.4s ease;
}

/* Стили для элементов списка диапазонов убраны */

.btn-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.muted {
    color: var(--muted);
}

.progress {
    width: 160px;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.progress:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress>span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, 
        var(--accent) 0%, 
        #4a9eff 50%, 
        var(--accent) 100%);
    width: 0%;
    border-radius: 999px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(42, 143, 239, 0.4);
    animation: progress-shimmer 2s ease-in-out infinite;
}

@keyframes progress-shimmer {
    0% { 
        background: linear-gradient(90deg, 
            var(--accent) 0%, 
            #4a9eff 50%, 
            var(--accent) 100%);
    }
    50% { 
        background: linear-gradient(90deg, 
            #4a9eff 0%, 
            var(--accent) 50%, 
            #4a9eff 100%);
    }
    100% { 
        background: linear-gradient(90deg, 
            var(--accent) 0%, 
            #4a9eff 50%, 
            var(--accent) 100%);
    }
}