/* ============================================================
   БАЗОВЫЕ НАСТРОЙКИ И ШРИФТЫ
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* ============================================================
   ЭКРАН «КОМПЬЮТЕРА»
   ============================================================ */
.screen {
    width: 100%;
    max-width: 1000px;
    height: 90vh;
    background: linear-gradient(180deg, #b8dcdc 0%, #ff85ff 70%, #6c91cc 100%);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    border: 2px solid #fff;
}

/* ============================================================
   ВЕРХНЕЕ МЕНЮ
   ============================================================ */
.menubar {
    height: 32px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 16px;
    font-size: 14px;
    font-weight: bold;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.menu-logo {
    font-size: 18px;
}

.menu-title {
    font-family: 'MedievalSharp', 'Cinzel', serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #222;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    margin-left: 4px;
}

.menu-time {
    margin-left: 0;
    color: #333;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    font-weight: bold;
}

.menu-sound {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1;
    padding: 3px 6px;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.menu-sound:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
}

.menu-sound:active {
    background: rgba(0, 0, 0, 0.15);
}

.menu-sound.muted {
    opacity: 0.55;
}

.menu-theme {
    margin-left: auto;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1;
    padding: 3px 6px;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.menu-theme:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
}

.menu-theme:active {
    background: rgba(0, 0, 0, 0.15);
}

/* ============================================================
   РАБОЧИЙ СТОЛ
   ============================================================ */
.desktop {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px;
}

/* ============================================================
   ИКОНКИ РАБОЧЕГО СТОЛА
   ============================================================ */
.icon {
    position: absolute;
    width: 84px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: grab;
    border-radius: 6px;
    user-select: none;
    transition: background 0.15s;
    touch-action: none;
    -webkit-user-drag: none;
}

.icon:active {
    cursor: grabbing;
}

.icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.icon-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.3));
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.icon-label {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    text-align: center;
    font-family: Verdana, Geneva, sans-serif;
    pointer-events: none;
}

#music-icon   { left: 24px; top: 24px; }
#player-icon  { left: 24px; top: 130px; }
#video-icon   { left: 24px; top: 236px; }
#browser-icon { left: 24px; top: 342px; }
#news-icon    { left: 24px; top: 448px; }

/* ============================================================
   ОКНА
   ============================================================ */
.window {
    position: absolute;
    top: 80px;
    left: 140px;
    width: 380px;
    background: #f0f0f0;
    border: 2px solid #000;
    border-radius: 6px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 10;

    transform-origin: top left;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.92) translateY(8px);
    pointer-events: none;
    transition:
        opacity 0.15s ease-in,
        transform 0.15s ease-in,
        visibility 0.15s;
}

.window:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    transition:
        opacity 0.22s ease-out,
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        visibility 0.22s;
}

#video-window {
    top: 140px;
    left: 220px;
}

/* ============================================================
   ЗАГОЛОВОК ОКНА — МЯТНО-БИРЮЗОВАЯ ГАММА
   ============================================================ */
.window-titlebar {
    background: linear-gradient(180deg, #b8dcdc, #7aacac);
    color: #1a3a3a;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 13px;
    font-weight: bold;
    border-bottom: 1px solid #4a7a7a;
    cursor: grab;
    touch-action: none;
    min-height: 24px;
}

.window-titlebar:active {
    cursor: grabbing;
}

.window-title {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 13px;
    font-weight: bold;
}

.window-close {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(26, 58, 58, 0.4);
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    font-family: inherit;
    color: #1a3a3a;
    border-radius: 2px;
    transition: background 0.12s;
}

.window-close:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #0a1a1a;
}

.window-content {
    padding: 16px;
    color: #222;
    background: #fff;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

.window-content ul {
    list-style: none;
    margin-top: 10px;
}

.window-content li {
    padding: 6px 8px;
    border-bottom: 1px dashed #ccc;
    cursor: pointer;
    font-size: 13px;
}

.window-content li:hover {
    background: #d8eaea;
}

/* ============================================================
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ
   ============================================================ */
@media (max-width: 700px) {
    body {
        padding: 0;
    }

    .screen {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
        border: none;
    }

    .menubar {
        gap: 10px;
        padding: 0 10px;
    }

    .menu-time {
        font-size: 11px;
    }

    .desktop {
        padding: 16px;
    }

    .icon {
        width: 76px;
        padding: 6px;
    }

    .icon-img {
        width: 48px;
        height: 48px;
    }

    .icon-label {
        font-size: 11px;
    }

    .menu-title {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .desktop-knight {
        max-width: 140px;
        bottom: -5px;
        right: -5px;
        opacity: 0.85;
    }

    #music-icon   { left: 16px; top: 16px; }
    #player-icon  { left: 16px; top: 112px; }
    #video-icon   { left: 16px; top: 208px; }
    #browser-icon { left: 16px; top: 304px; }
    #news-icon    { left: 16px; top: 400px; }

    .window {
        left: 10px;
        top: 60px;
        width: calc(100% - 20px);
        max-width: 420px;
    }

    #video-window {
        left: 20px;
        top: 100px;
    }

    .window-titlebar {
        padding: 8px 10px;
    }

    .window-title {
        font-size: 10px;
    }

    .window-content {
        font-size: 14px;
        padding: 14px;
    }

    .window-content li {
        font-size: 14px;
    }

    .window-close {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
      /* На мобилке обложка СВЕРХУ, текст СНИЗУ */
    .news-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .news-cover-col {
        width: 100%;
        max-width: 180px;
        align-self: center;
    }

    .news-title {
        font-size: 18px;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .news-description {
        font-size: 13px;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}

/* ============================================================
   🧭 ПРОВОДНИК
   ============================================================ */

.titlebar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(26, 58, 58, 0.4);
    border-radius: 3px;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    color: #1a3a3a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    font-family: inherit;
    flex-shrink: 0;
    transition: background 0.15s;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.7);
    color: #0a1a1a;
}

.nav-btn:active:not(:disabled) {
    background: rgba(0, 0, 0, 0.15);
    color: #1a3a3a;
}

.nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Проводники (Music и Video) — flex-контейнер для ресайза */
#music-window:not(.hidden),
#video-window:not(.hidden) {
    display: flex;
    flex-direction: column;
}

.explorer-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 8px !important;
}

.explorer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Ограничиваем высоту только когда окно НЕ растянуто */
#music-window:not([style*="height"]) .explorer-list,
#video-window:not([style*="height"]) .explorer-list {
    max-height: 320px;
}

.explorer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 3px;
    user-select: none;
    font-size: 13px;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    color: #222;
}

.explorer-item:hover {
    background: #d8eaea;
}

.explorer-item:active {
    background: #a8cccc;
}

.explorer-item .item-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-icon-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.explorer-item .item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.explorer-item .item-type {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.explorer-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 13px;
    font-style: italic;
}

/* ============================================================
   🎵 MIXTAPES PLAYER
   ============================================================ */

#player-window {
    width: 460px;
    top: 200px;
    left: 300px;
}

.music-player {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.panel-label {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #333;
    padding: 0 2px;
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 6px;
    padding: 8px;
    background: #f5f5f5;
    border: 2px inset #bbb;
    border-radius: 2px;
    min-height: 100px;
    max-height: 220px;
    overflow-y: auto;
}

.playlist-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border: 1px solid transparent;
    user-select: none;
}

.playlist-icon:hover {
    background: rgba(184, 220, 220, 0.4);
}

.playlist-icon-disc {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle,
        #111 12%,
        #444 13%,
        #333 20%,
        #111 21%,
        #444 28%,
        #333 35%,
        #111 36%,
        #444 43%,
        #333 50%,
        #111 51%,
        #444 58%,
        #333 65%,
        #111 66%,
        #444 73%,
        #333 80%,
        #111 81%,
        #333 100%);
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 0 0 1px #666;
    flex-shrink: 0;
}

.playlist-icon-disc::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #7aacac;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 0 2px #fff;
}

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

.playlist-icon.disc-spin .playlist-icon-disc {
    animation: spin 4s linear infinite;
}

.playlist-icon-name {
    font-size: 9px;
    text-align: center;
    line-height: 1.15;
    word-break: break-word;
    font-family: Verdana, Geneva, sans-serif;
    font-weight: bold;
    max-width: 100%;
}

.tracks-list {
    list-style: none;
    max-height: 160px;
    min-height: 90px;
    overflow-y: auto;
    background: #fafafa;
    color: #111;
    border: 2px inset #bbb;
    padding: 4px;
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    border-radius: 2px;
}

.tracks-list li {
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 2px;
    transition: background 0.1s;
}

.tracks-list li .track-index {
    color: #888;
    min-width: 22px;
    font-size: 11px;
    flex-shrink: 0;
}

.tracks-list li .track-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tracks-list li:hover {
    background: #d8eaea;
}

/* Играющий трек — мятно-бирюзовая подсветка */
.tracks-list li.playing {
    background: #7aacac;
    color: #fff;
    font-weight: bold;
}

.tracks-list li.playing .track-index {
    color: rgba(255, 255, 255, 0.85);
}

.tracks-empty {
    color: #888 !important;
    font-style: italic;
    justify-content: center;
    cursor: default !important;
}

.tracks-empty:hover {
    background: transparent !important;
}

.player-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: #e8e8e8;
    border: 2px outset #ddd;
    border-radius: 2px;
}

.player-display {
    background: #fafafa;
    border: 2px inset #bbb;
    border-radius: 3px;
    padding: 6px 10px;
    font-family: 'Courier New', Courier, monospace;
}

.player-track-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-track {
    flex: 1;
    color: #111;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.player-download {
    color: #111;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}

.player-download:hover {
    background: rgba(184, 220, 220, 0.5);
    color: #3a6a6a;
}

.player-download.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.player-time-row {
    display: flex;
    justify-content: space-between;
    color: #555;
    font-size: 11px;
    margin-top: 4px;
}

.player-seek {
    height: 8px;
    background: #333;
    border: 1px solid #000;
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.player-seek-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #b8dcdc, #7aacac);
    transition: width 0.1s linear;
    pointer-events: none;
}

.player-controls-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-controls {
    display: flex;
    gap: 6px;
}

.player-btn {
    width: 36px;
    height: 30px;
    background: linear-gradient(180deg, #f5f5f5, #c8c8c8);
    border: 2px outset #ddd;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    color: #222;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    user-select: none;
}

.player-btn:hover {
    background: linear-gradient(180deg, #fff, #d5d5d5);
}

.player-btn:active {
    border-style: inset;
    background: linear-gradient(180deg, #c8c8c8, #f5f5f5);
}

.player-volume-col {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.player-volume-col input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 6px;
    background: #333;
    border: 1px solid #000;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.player-volume-col input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 14px;
    background: linear-gradient(180deg, #f5f5f5, #c8c8c8);
    border: 2px outset #ddd;
    border-radius: 2px;
    cursor: pointer;
}

.player-volume-col input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 14px;
    background: linear-gradient(180deg, #f5f5f5, #c8c8c8);
    border: 2px outset #ddd;
    border-radius: 2px;
    cursor: pointer;
}

.volume-icon {
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

@media (max-width: 700px) {
    #player-window {
        width: calc(100% - 20px);
        max-width: 460px;
        left: 10px;
        top: 60px;
    }
}

/* Обложки плейлистов */
.playlist-icon-disc.has-cover {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ddd;
}

.playlist-icon-disc.has-cover::after {
    background: #111;
    box-shadow: inset 0 0 0 2px #fff;
}

.playlist-icon.active .playlist-icon-disc {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3),
                inset 0 0 0 2px #7aacac;
}

.tracks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.playlist-download-btn {
    background: linear-gradient(180deg, #f5f5f5, #c8c8c8);
    border: 2px outset #ddd;
    border-radius: 3px;
    padding: 3px 10px;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    color: #222;
    transition: background 0.15s;
    white-space: nowrap;
}

.playlist-download-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #fff, #d5d5d5);
}

.playlist-download-btn:active:not(:disabled) {
    border-style: inset;
}

.playlist-download-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ============================================================
   🌐 БРАУЗЕР
   ============================================================ */

#browser-window {
    width: 520px;
    top: 60px;
    left: 200px;
}

.browser-content {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    gap: 0;
    background: #e8e8e8;
}

.browser-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: #e8e8e8;
    border-bottom: 1px solid #aaa;
}

.browser-nav-btn {
    width: 24px;
    height: 22px;
    background: linear-gradient(180deg, #f5f5f5, #c8c8c8);
    border: 1px solid #888;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    color: #222;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: inherit;
    flex-shrink: 0;
    line-height: 1;
}

.browser-nav-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #fff, #d5d5d5);
}

.browser-nav-btn:active:not(:disabled) {
    border-style: inset;
}

.browser-nav-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.browser-url {
    flex: 1;
    height: 22px;
    padding: 0 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    color: #111;
    background: #fff;
    border: 2px inset #bbb;
    border-radius: 2px;
    outline: none;
    min-width: 0;
}

.browser-bookmarks {
    display: flex;
    gap: 4px;
    padding: 5px 8px;
    background: #f0f0f0;
    border-bottom: 1px solid #aaa;
    flex-wrap: wrap;
}

.bookmark-btn {
    background: linear-gradient(180deg, #f5f5f5, #d8d8d8);
    border: 1px solid #888;
    border-radius: 3px;
    padding: 3px 10px;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10px;
    font-weight: bold;
    color: #222;
    cursor: pointer;
    transition: background 0.1s;
    white-space: nowrap;
}

.bookmark-btn:hover {
    background: linear-gradient(180deg, #fff, #e0e0e0);
}

.bookmark-btn:active {
    border-style: inset;
}

.browser-viewport {
    flex: 1;
    min-height: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.browser-home {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    text-align: center;
    width: 100%;
}

.browser-home-title {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #444;
}

.browser-home-grid {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.browser-home-card {
    width: 130px;
    padding: 14px 10px;
    background: linear-gradient(180deg, #f9f9f9, #e8e8e8);
    border: 2px outset #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.12s, border-color 0.12s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.browser-home-card:hover {
    transform: translateY(-2px);
    border-color: #7aacac;
}

.browser-home-card-icon {
    font-size: 32px;
    line-height: 1;
}

.browser-home-card-name {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: #222;
}

.browser-external-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 30px 20px;
    max-width: 380px;
}

.browser-external-icon {
    font-size: 44px;
    line-height: 1;
}

.browser-external-title {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #111;
}

.browser-external-url {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #666;
    word-break: break-all;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.browser-external-note {
    font-size: 11px;
    color: #999;
    font-style: italic;
    line-height: 1.4;
}

.browser-external-btn {
    margin-top: 6px;
    background: linear-gradient(180deg, #b8dcdc, #7aacac);
    color: #1a3a3a;
    text-decoration: none;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    font-weight: bold;
    padding: 8px 18px;
    border: 2px outset #b8dcdc;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.1s;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
}

.browser-external-btn:hover {
    background: linear-gradient(180deg, #d8eaea, #8ababa);
}

.browser-external-btn:active {
    border-style: inset;
}

.browser-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 40px 20px;
}

.browser-placeholder-icon {
    font-size: 56px;
    line-height: 1;
    animation: hammerPulse 2s ease-in-out infinite;
}

@keyframes hammerPulse {
    0%, 100% { transform: rotate(-8deg); }
    50%      { transform: rotate(8deg); }
}

.browser-placeholder-title {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    letter-spacing: 1px;
}

.browser-placeholder-text {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

@media (max-width: 700px) {
    #browser-window {
        width: calc(100% - 20px);
        max-width: 520px;
        left: 10px;
        top: 60px;
    }

    .browser-viewport {
        min-height: 220px;
    }

    .browser-home-card {
        width: 110px;
        padding: 10px 6px;
    }

    .browser-home-card-icon {
        font-size: 26px;
    }
}

/* ============================================================
   🖼️ IMAGE VIEWER
   ============================================================ */

#image-viewer-window {
    width: 580px;
    top: 60px;
    left: 160px;
}

.image-viewer-content {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    background: #1a1a1a;
}

.image-viewer-stage {
    min-height: 300px;
    max-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #1a1a1a;
    overflow: hidden;
}

.image-viewer-stage img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
    border: 1px solid #444;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    background: #000;
    transition: opacity 0.15s;
}

.image-viewer-stage img:not([src]),
.image-viewer-stage img[src=""] {
    visibility: hidden;
}

.image-viewer-thumbs {
    display: flex;
    gap: 6px;
    padding: 8px;
    background: #111;
    border-top: 1px solid #444;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 70px;
    align-items: center;
}

.image-viewer-thumbs::-webkit-scrollbar {
    height: 6px;
}

.image-viewer-thumbs::-webkit-scrollbar-track {
    background: #222;
}

.image-viewer-thumbs::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.image-viewer-thumbs::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.viewer-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border: 2px solid #444;
    border-radius: 3px;
    background: #000;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
    opacity: 0.65;
}

.viewer-thumb:hover {
    border-color: #888;
    opacity: 1;
    transform: scale(1.05);
}

.viewer-thumb.active {
    border-color: #7aacac;
    opacity: 1;
    box-shadow: 0 0 8px rgba(122, 172, 172, 0.7);
}

.image-viewer-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 10px;
    background: #e8e8e8;
    border-top: 1px solid #aaa;
}

#image-viewer-counter {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    min-width: 60px;
    text-align: center;
    user-select: none;
}

.viewer-btn {
    width: 32px;
    height: 28px;
    background: linear-gradient(180deg, #f5f5f5, #c8c8c8);
    border: 2px outset #ddd;
    border-radius: 3px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    color: #222;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    user-select: none;
    text-decoration: none;
    transition: background 0.1s;
}

.viewer-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #fff, #d5d5d5);
}

.viewer-btn:active:not(:disabled) {
    border-style: inset;
    background: linear-gradient(180deg, #c8c8c8, #f5f5f5);
}

.viewer-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

@media (max-width: 700px) {
    #image-viewer-window {
        width: calc(100% - 20px);
        max-width: 580px;
        left: 10px;
        top: 60px;
    }

    .image-viewer-stage {
        min-height: 200px;
        max-height: 280px;
    }

    .image-viewer-stage img {
        max-height: 260px;
    }

    .viewer-thumb {
        width: 46px;
        height: 46px;
    }
}

/* ============================================================
   📄 TEXT VIEWER
   ============================================================ */

#text-viewer-window {
    width: 480px;
    max-width: calc(100% - 40px);
    top: 100px;
    left: min(220px, 5%);
}

/* Окно — flex-контейнер, чтобы содержимое тянулось при ресайзе */
#text-viewer-window:not(.hidden) {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

#text-viewer-window:not([style*="height"]) {
    max-height: 80vh;
}

#text-viewer-window .window-titlebar {
    flex-shrink: 0;
}

.text-viewer-content {
    flex: 1;
    min-height: 0;
    padding: 0 !important;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.text-viewer-body {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 16px 18px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.55;
    color: #222;
    background: #fafafa;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Ограничиваем высоту только пока окно не растянуто */
#text-viewer-window:not([style*="height"]) .text-viewer-body {
    max-height: 400px;
}

/* Скроллбар */
.text-viewer-body::-webkit-scrollbar {
    width: 10px;
}

.text-viewer-body::-webkit-scrollbar-track {
    background: #eee;
}

.text-viewer-body::-webkit-scrollbar-thumb {
    background: #bbb;
    border: 2px solid #eee;
    border-radius: 5px;
}

.text-viewer-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Мобильная адаптация */
@media (max-width: 700px) {
    #text-viewer-window {
        width: calc(100% - 20px);
        max-width: 480px;
        left: 10px;
        top: 60px;
    }

    .text-viewer-body {
        font-size: 12px;
        padding: 12px;
    }

    #text-viewer-window:not([style*="height"]) .text-viewer-body {
        max-height: 320px;
    }
}

/* Тёмная тема */
.screen.dark .text-viewer-content,
.screen.dark .text-viewer-body {
    background: #1a1428;
    color: #e0d8e8;
}

/* ============================================================
   🎬 VIDEO PLAYER
   ============================================================ */

#video-player-window {
    width: 620px;
    top: 60px;
    left: 160px;
}

.video-player-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px !important;
    background: #e8e8e8;
}

.video-stage {
    background: #000;
    border: 2px inset #888;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 260px;
}

.video-stage video {
    max-width: 100%;
    max-height: 520px;   /* ← было 420, подняли до 520 */
    width: auto;
    height: auto;
    display: block;
    background: #000;
}

#video-seek {
    height: 10px;
}

.video-controls-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-time-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    flex: 1;
    justify-content: center;
    user-select: none;
}

#video-volume-icon {
    font-size: 14px;
    cursor: pointer;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

#video-player-window .player-volume-col input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 6px;
    background: #333;
    border: 1px solid #000;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#video-player-window .player-volume-col input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 14px;
    background: linear-gradient(180deg, #f5f5f5, #c8c8c8);
    border: 2px outset #ddd;
    border-radius: 2px;
    cursor: pointer;
}

#video-player-window .player-volume-col input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 14px;
    background: linear-gradient(180deg, #f5f5f5, #c8c8c8);
    border: 2px outset #ddd;
    border-radius: 2px;
    cursor: pointer;
}

@media (max-width: 700px) {
    #video-player-window {
        width: calc(100% - 20px);
        max-width: 620px;
        left: 10px;
        top: 60px;
    }

    .video-stage {
        min-height: 180px;
    }

.video-stage video {
    max-height: 380px;   /* ← было 320 */
}

    .video-controls-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .video-time-row {
        order: 3;
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   РЫЦАРЬ В ПРАВОМ НИЖНЕМ УГЛУ
   ============================================================ */
.desktop-knight {
    position: absolute;
    bottom: -20px;
    right: -10px;
    max-width: 320px;
    height: auto;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.9;
    z-index: 1;
    user-select: none;
    -webkit-user-drag: none;
}

/* ============================================================
   📰 NEWS WINDOW — компактная компоновка
   ============================================================ */

#news-window {
    width: 400px;
    max-width: calc(100% - 40px);
    top: 60px;
    left: 50%;
    margin-left: -200px;   /* = половина ширины 400px */
    display: flex;
    flex-direction: column;
}

/* Ограничиваем высоту только пока окно не растянуто */
#news-window:not([style*="height"]) {
    max-height: 80vh;
}

#news-window .window-titlebar {
    flex-shrink: 0;
}

.news-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 !important;
    background: #fff;
}

/* Скроллбар в News */
.news-content::-webkit-scrollbar {
    width: 8px;
}

.news-content::-webkit-scrollbar-track {
    background: transparent;
}

.news-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.news-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* === ОТДЕЛЬНАЯ НОВОСТЬ === */
.news-item {
    position: relative;
    padding: 12px 16px 16px;
    border-bottom: 2px dashed #a8cccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #fff;
}

.news-item:last-child {
    border-bottom: none;
}

/* У каждой новости — свой фон (из обложки) */
.news-item {
    --news-bg-image: none;
}

.news-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--news-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: multiply;
}
.news-item > * {
    position: relative;
    z-index: 1;
}

/* Дата — слева, компактнее */
.news-date {
    align-self: flex-start;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #777;
    text-transform: uppercase;
    padding-bottom: 4px;
    border-bottom: 1px solid #e0e0e0;
    width: 100%;
}

/* Обложка — компактная, по центру */
.news-cover-wrapper {
    width: 100%;
    max-width: 140px;
    align-self: center;
}

.news-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.08);
    background: #f0f0f0;
}

/* Заголовок — слева */
.news-title {
    font-family: 'MedievalSharp', 'Cinzel', serif;
    font-size: 19px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
    letter-spacing: 0.3px;
    text-align: left;
    margin: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Описание — слева */
.news-description {
    font-family: 'Trebuchet MS', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    text-align: left;
    margin: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Ссылки — компактные, текст по центру */
.news-links {
    list-style: none;
    padding: 0;
    margin: 2px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.news-links li {
    padding: 0;
    border: none;
    cursor: default;
    width: 100%;
}

.news-links li:hover {
    background: transparent;
}

.news-links a {
    display: block;
    padding: 5px 10px;
    background: linear-gradient(180deg, #f9f9f9, #ececec);
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: #222;
    text-decoration: none;
    text-align: center;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.news-links a:hover {
    background: linear-gradient(180deg, #d8eaea, #b8dcdc);
    border-color: #7aacac;
    color: #111;
}

.news-links a:active {
    border-style: inset;
}



/* ============================================================
   АДАПТИВ NEWS
   ============================================================ */
@media (max-width: 700px) {
    #news-window {
        width: calc(100% - 20px);
        max-width: 400px;
        left: 10px;
        top: 60px;
        margin-left: 0;   /* ← вот эта строка */
    }

    .news-item {
        padding: 10px 12px 14px;
        gap: 7px;
    }

    .news-cover-wrapper {
        max-width: 120px;
    }

    .news-title {
        font-size: 14px;
    }

    .news-description {
        font-size: 11px;
    }

    .news-links a {
        font-size: 10px;
        padding: 4px 8px;
    }
}
/* ============================================================
   🌙 ТЁМНАЯ ТЕМА
   ============================================================ */

.screen.dark {
    background: linear-gradient(180deg, #1a1030 0%, #2a1a3e 40%, #0f1628 100%);
    border-color: #3a2a4a;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), inset 0 0 40px rgba(100, 60, 140, 0.15);
}

.screen.dark .menubar {
    background: rgba(30, 20, 45, 0.85);
    border-bottom-color: rgba(184, 220, 220, 0.2);
}

.screen.dark .menu-title,
.screen.dark .menu-time,
.screen.dark .menu-item {
    color: #e8d8f0;
}

.screen.dark .menu-item:hover {
    color: #b8dcdc;
}

.screen.dark .menu-sound:hover,
.screen.dark .menu-theme:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.screen.dark .window {
    background: #1e1830;
    border-color: #4a3a5a;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.7);
}

.screen.dark .window-titlebar {
    background: linear-gradient(180deg, #8ababa, #4a7a7a);
    border-bottom-color: #2a4a4a;
    color: #f0f8f8;
}

.screen.dark .window-titlebar .window-close {
    color: #f0f8f8;
    border-color: rgba(255, 255, 255, 0.4);
}

.screen.dark .window-content {
    background: #252038;
    color: #e0d8e8;
}

.screen.dark .window-close {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    color: #e0d8e8;
}

.screen.dark .window-close:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #1a3a3a;
}

.screen.dark .explorer-item {
    color: #e0d8e8;
}

.screen.dark .explorer-item:hover {
    background: rgba(184, 220, 220, 0.25);
}

.screen.dark .explorer-item:active {
    background: rgba(184, 220, 220, 0.4);
}

.screen.dark .explorer-item .item-type {
    color: #8878a0;
}

.screen.dark .explorer-empty {
    color: #8878a0;
}

.screen.dark .playlists-grid {
    background: #1a1428;
    border-color: #3a2a4a;
}

.screen.dark .panel-label {
    color: #b8a8c8;
}

.screen.dark .tracks-list {
    background: #1a1428;
    color: #d8c8e8;
    border-color: #3a2a4a;
}

.screen.dark .tracks-list li .track-index {
    color: #8878a0;
}

.screen.dark .tracks-list li:hover {
    background: rgba(184, 220, 220, 0.25);
}

.screen.dark .tracks-list li.playing {
    background: #7aacac;
    color: #fff;
}

.screen.dark .tracks-empty {
    color: #8878a0 !important;
}

.screen.dark .player-bar {
    background: #1e1830;
    border-color: #4a3a5a;
}

.screen.dark .player-display {
    background: #0a0812;
    border-color: #3a2a4a;
}

.screen.dark .player-track {
    color: #a8e0e0;
}

.screen.dark .player-time-row {
    color: #6a8a8a;
}

.screen.dark .player-btn,
.screen.dark .playlist-download-btn {
    background: linear-gradient(180deg, #3a2a4a, #2a1a3a);
    border-color: #5a4a6a;
    color: #e0d8e8;
}

.screen.dark .player-btn:hover,
.screen.dark .playlist-download-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #4a3a5a, #3a2a4a);
}

.screen.dark .player-seek,
.screen.dark .player-volume-col input[type="range"] {
    background: #2a1a3a;
    border-color: #4a3a5a;
}

.screen.dark .browser-content,
.screen.dark .browser-toolbar {
    background: #1e1830;
    border-bottom-color: #3a2a4a;
}

.screen.dark .browser-nav-btn,
.screen.dark .bookmark-btn {
    background: linear-gradient(180deg, #3a2a4a, #2a1a3a);
    border-color: #5a4a6a;
    color: #e0d8e8;
}

.screen.dark .browser-nav-btn:hover:not(:disabled),
.screen.dark .bookmark-btn:hover {
    background: linear-gradient(180deg, #4a3a5a, #3a2a4a);
}

.screen.dark .browser-url {
    background: #0a0812;
    border-color: #4a3a5a;
    color: #a8e0e0;
}

.screen.dark .browser-bookmarks {
    background: #1a1428;
    border-bottom-color: #3a2a4a;
}

.screen.dark .browser-viewport {
    background: #14101f;
}

.screen.dark .browser-home-title {
    color: #b8a8c8;
}

.screen.dark .browser-home-card {
    background: linear-gradient(180deg, #2a1a3a, #1e1830);
    border-color: #4a3a5a;
}

.screen.dark .browser-home-card-name,
.screen.dark .browser-external-title,
.screen.dark .browser-placeholder-title {
    color: #e0d8e8;
}

.screen.dark .browser-external-url {
    background: #1a1428;
    color: #a8b8c8;
    border-color: #3a2a4a;
}

.screen.dark .browser-external-note,
.screen.dark .browser-placeholder-text {
    color: #8878a0;
}

/* === News — тёмная тема === */
.screen.dark .news-content {
    background: #14101f;
}

/* Фон новости — тёмный */
.screen.dark .news-item {
    background: #1a1428;
    border-bottom-color: #4a7a7a;
}

/* Dithering-фон в тёмной теме — осветляем вместо затемнения */
.screen.dark .news-item::before {
    opacity: 0.18;
    mix-blend-mode: screen;
    filter: brightness(0.7) saturate(0.8);
}

/* Дата */
.screen.dark .news-date {
    color: #b8a8c8;
    border-bottom-color: #3a2a4a;
}

/* Заголовок */
.screen.dark .news-title {
    color: #f0e8f8;
    text-shadow: 0 0 6px rgba(122, 172, 172, 0.25);
}

/* Описание */
.screen.dark .news-description {
    color: #c8bdd8;
}

/* Обложка — лёгкое свечение, чтобы не «тонула» в тёмном фоне */
.screen.dark .news-cover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(184, 220, 220, 0.15);
    background: #2a1a3a;
}

/* Кнопки ссылок */
.screen.dark .news-links a {
    background: linear-gradient(180deg, #2a1a3a, #1e1830);
    border-color: #4a3a5a;
    color: #e0d8e8;
}

.screen.dark .news-links a:hover {
    background: linear-gradient(180deg, #4a7a7a, #3a6a6a);
    border-color: #8ababa;
    color: #fff;
}

.screen.dark .image-viewer-footer {
    background: #1e1830;
    border-top-color: #3a2a4a;
}

.screen.dark #image-viewer-counter {
    color: #e0d8e8;
}

.screen.dark .viewer-btn {
    background: linear-gradient(180deg, #3a2a4a, #2a1a3a);
    border-color: #5a4a6a;
    color: #e0d8e8;
}

.screen.dark .viewer-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #4a3a5a, #3a2a4a);
}

.screen.dark .image-viewer-thumbs {
    background: #0a0812;
    border-top-color: #3a2a4a;
}

.screen.dark .viewer-thumb {
    border-color: #4a3a5a;
}

.screen.dark .text-viewer-content,
.screen.dark .text-viewer-body {
    background: #1a1428;
    color: #e0d8e8;
}
/* ============================================================
   🎛️ РЕСАЙЗ ОКОН — уголок в правом нижнем углу
   ============================================================ */

.window-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 20;
    touch-action: none;
    opacity: 0.55;
    transition: opacity 0.15s;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M15 1 L15 15 L1 15' fill='none' stroke='%234a7a7a' stroke-width='1.5'/><path d='M15 6 L15 15 L6 15' fill='none' stroke='%234a7a7a' stroke-width='1.5'/><path d='M15 11 L15 15 L11 15' fill='none' stroke='%234a7a7a' stroke-width='1.5'/></svg>") no-repeat center / contain;
}

.window-resize-handle:hover {
    opacity: 1;
}

/* На мобилке — уменьшаем, чтобы не мешала */
@media (max-width: 700px) {
    .window-resize-handle {
        width: 22px;
        height: 22px;
        opacity: 0.7;
    }
}

/* ============================================================
   🖥️ ЭКРАН ЗАГРУЗКИ (SPLASH SCREEN)
   ============================================================ */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-gif {
    max-width: 80%;
    max-height: 55%;
    margin-bottom: 40px;
    filter: drop-shadow(0 0 20px rgba(122, 172, 172, 0.5));
}

/* === Сегментная шкала загрузки === */
.splash-loader {
    width: 320px;
    max-width: 75%;
    height: 22px;
    background: #0a0a0a;
    border: 2px solid #4a7a7a;
    border-radius: 3px;
    padding: 3px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 0 14px rgba(122, 172, 172, 0.35);
    display: flex;
}

.splash-loader-segments {
    display: flex;
    gap: 2px;
    flex: 1;
    align-items: stretch;
}

.splash-segment {
    flex: 1;
    background: #1a1a1a;
    border-radius: 1px;
    border: 1px solid #2a2a2a;
    transition: background 0.12s ease, box-shadow 0.12s ease;
}

/* Зажжённый сегмент */
.splash-segment.on {
    background: linear-gradient(180deg, #d8eaea, #7aacac);
    border-color: #b8dcdc;
    box-shadow:
        0 0 6px rgba(184, 220, 220, 0.9),
        inset 0 0 3px rgba(255, 255, 255, 0.4);
}

/* Текст под шкалой — средневековый шрифт */
.splash-loader-text {
    margin-top: 16px;
    font-family: 'MedievalSharp', 'Cinzel', serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #b8dcdc;
    text-transform: uppercase;
    text-shadow:
        0 0 10px rgba(122, 172, 172, 0.7),
        0 0 20px rgba(122, 172, 172, 0.35);
    animation: loaderTextPulse 1.8s ease-in-out infinite;
}

@keyframes loaderTextPulse {
    0%, 100% {
        opacity: 0.65;
        text-shadow:
            0 0 10px rgba(122, 172, 172, 0.7),
            0 0 20px rgba(122, 172, 172, 0.35);
    }
    50% {
        opacity: 1;
        text-shadow:
            0 0 14px rgba(184, 220, 220, 1),
            0 0 28px rgba(122, 172, 172, 0.6);
    }
}

/* ============================================================
   ⚔️ ЛОГОТИП — кликабельный, с анимацией
   ============================================================ */
.menu-logo {
    cursor: pointer;
    transition: transform 0.15s;
    user-select: none;
}

.menu-logo:hover {
    transform: scale(1.15);
}

@keyframes swordShake {
    0%   { transform: rotate(0deg)   scale(1.15); }
    15%  { transform: rotate(-18deg) scale(1.2);  }
    30%  { transform: rotate(18deg)  scale(1.2);  }
    45%  { transform: rotate(-14deg) scale(1.15); }
    60%  { transform: rotate(14deg)  scale(1.15); }
    80%  { transform: rotate(-6deg)  scale(1.1);  }
    100% { transform: rotate(0deg)   scale(1.15); }
}

.menu-logo.sword-shake {
    animation: swordShake 0.5s ease-in-out;
    display: inline-block;
}

/* ============================================================
   🎬 VIDEO PLAYER — Fullscreen + вертикальные видео
   ============================================================ */

/* Кнопка fullscreen */
.video-fullscreen-btn {
    margin-left: 8px;
    flex-shrink: 0;
}

/* Сцена видео */
.video-stage {
    position: relative;
    background: #000;
    border: 2px inset #888;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 260px;
}

/* Видео в обычном режиме */
.video-stage video {
    max-width: 100%;
    max-height: 420px;
    width: auto;
    height: auto;
    display: block;
    background: #000;
}

/* ============================================================
   FULLSCREEN РЕЖИМ — с !important, чтобы перебить базовые правила
   ============================================================ */

/* Контейнер .video-stage в полноэкранном режиме */
.video-stage:fullscreen,
.video-stage:-webkit-full-screen,
.video-stage:-moz-full-screen,
.video-stage:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Само видео в полноэкранном режиме — растягиваем принудительно */
.video-stage:fullscreen video,
.video-stage:-webkit-full-screen video,
.video-stage:-moz-full-screen video,
.video-stage:-ms-fullscreen video {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: contain !important;
    display: block !important;
    background: #000 !important;
}

/* Скрываем встроенные контролы Chrome — оставляем только наши */
.video-stage video::-webkit-media-controls {
    display: none !important;
}

/* Мобильная адаптация */
@media (max-width: 700px) {
    .video-controls-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .video-time-row {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .video-fullscreen-btn {
        margin-left: auto;
    }

    .video-stage {
        min-height: 220px;
    }

    .video-stage video {
        max-height: 380px;
    }
}

/* ============================================================
   ⏱️ ТАЙМЕР В НОВОСТИ
   ============================================================ */

.news-countdown {
    width: 100%;
    padding: 10px 8px 8px;
    margin: 2px 0 4px;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.04), rgba(10, 10, 10, 0.08));
    border: 1px solid #a8cccc;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.news-countdown-label {
    font-family: 'MedievalSharp', 'Cinzel', serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #4a7a7a;
    text-transform: uppercase;
}

.news-countdown-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.news-countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 34px;
}

.news-countdown-value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    font-weight: bold;
    color: #1a3a3a; /* Тёмный цвет для цифр */
    background: #f0f8f8; /* Светлый фон */
    padding: 3px 5px;
    border-radius: 3px;
    border: 1px solid #a8cccc; /* Светлая граница */
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); /* Лёгкое свечение для объёма */
    letter-spacing: 1px;
    line-height: 1;
    min-width: 30px;
    text-align: center;
}


.news-countdown-sep {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #4a7a7a; /* Более тёмный цвет для разделителей */
    margin-bottom: 12px;
    animation: countdownBlink 1s ease-in-out infinite;
}

.news-countdown-caption {
    font-size: 7px;
    font-weight: bold;
    color: #4a7a7a; /* Более тёмный цвет для подписей */
    letter-spacing: 1px;
    margin-top: 3px;
    text-transform: uppercase;
}

@keyframes countdownBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* Когда релиз наступил */
.news-countdown.released .news-countdown-display {
    display: none;
}

.news-countdown.released .news-countdown-label::after {
    content: ' — ВЫШЕЛ!';
    color: #7aacac;
    animation: countdownBlink 1.5s ease-in-out infinite;
}

/* === Тёмная тема === */
.screen.dark .news-countdown {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.4));
    border-color: #3a5a5a;
}

.screen.dark .news-countdown-label {
    color: #8ababa;
}

.screen.dark .news-countdown-value {
    background: #0a0812;
    color: #b8dcdc;
    border-color: #3a5a5a;
}

.screen.dark .news-countdown-caption {
    color: #8ababa;
}

.screen.dark .news-countdown-sep {
    color: #7aacac;
}

/* === Мобильная адаптация === */
@media (max-width: 700px) {
    .news-countdown {
        padding: 8px 6px 6px;
    }

    .news-countdown-value {
        font-size: 15px;
        padding: 2px 4px;
        min-width: 24px;
    }

    .news-countdown-unit {
        min-width: 28px;
    }

    .news-countdown-sep {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .news-countdown-label {
        font-size: 9px;
        letter-spacing: 1.5px;
    }

    .news-countdown-caption {
        font-size: 6px;
    }
}

/* ============================================================
   💾 КНОПКА ПРЕСЕЙВ
   ============================================================ */

.news-presave-btn {
    display: block;
    padding: 8px 12px;
    margin-top: 4px;
    background: linear-gradient(180deg, #d8eaea, #b8dcdc);
    border: 1px solid #7aacac;
    border-radius: 3px;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: #1a3a3a;
    text-decoration: none;
    text-align: center;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.05);
}

.news-presave-btn:hover {
    background: linear-gradient(180deg, #e8f4f4, #c8e4e4);
    border-color: #5a8a8a;
    color: #0a1a1a;
}

.news-presave-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* Тёмная тема для кнопки ПРЕСЕЙВ */
.screen.dark .news-presave-btn {
    background: linear-gradient(180deg, #3a5a5a, #2a4a4a);
    border-color: #4a7a7a;
    color: #e0f0f0;
}

.screen.dark .news-presave-btn:hover {
    background: linear-gradient(180deg, #4a6a6a, #3a5a5a);
    border-color: #8ababa;
    color: #ffffff;
}

/* Мобильная адаптация */
@media (max-width: 700px) {
    .news-presave-btn {
        font-size: 10px;
        padding: 7px 10px;
    }
}