/* =========================================================================
   VATARA — Просмотр клипов твича: стили
   Фон страницы — bgclip.png (см. правило body ниже). Текст/ссылки — в index.php
   ========================================================================= */

:root {
    --cur: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAiCAYAAABFlhkzAAABJUlEQVR4AbSSyw0CMQxEl60EOuBKL5RBGZRBL1zpADoBPYnxwcFknQ/SKNhJ5nkI6/54fqNl0med5Gu2BiAFsp1BXwwwyK+wMcDzfl0QKVBxsrFhgMb71WsFgBSIFKjqUDlQACrn09shgBSIFCjt/L0QAr773UsVQApECpQlVgFZQ39+M4AUiBTIG0X1ZkBkUOunAaRApEDDATVDv59OIANSIFIg9f3aDPBGUd0NIAUiBfKgboA39HUacDhdll+SMSmQ6jRAF7euIUBTRkavx233T7oXAnSgdy0AmlzTqRaIfwzid0bqR2sBiA629g2gSTV5q6G/ZwC/Mao2QDS5+kooMO+AeAekvl8N4DdG1asmHGXofeYn8MSoVlK9hVb1o3vTE3wAAAD//91M9s4AAAAGSURBVAMAVAea8bZWRQQAAAAASUVORK5CYII=') 0 0;
    --cream: #f7eed6;
    --navy: #23315e;
    --muted: #5d6788;
    --denim: #34508f;
    --green: #58b558;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
img { image-rendering: pixelated; }
::selection { background: #58b558; color: #0e2c10; }
body {
    font-family: 'Pixelify Sans', monospace;
    color: var(--navy);
    cursor: var(--cur), auto;
    /* ФОН СТРАНИЦЫ: файл bgclip.png (лежит рядом с index.php) */
    background: url('bgclip.png') center center / cover no-repeat fixed, #161d34;
    line-height: 1.4;
    min-height: 100vh;
}
.bg-overlay {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        linear-gradient(180deg, rgba(8,10,22,.58), rgba(8,10,22,.66)),
        radial-gradient(circle at 50% 40%, rgba(0,0,0,0) 52%, rgba(8,10,22,.55) 100%);
}
.scanlines {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    mix-blend-mode: overlay; opacity: .5;
    background: repeating-linear-gradient(to bottom, rgba(0,0,0,.22) 0 1px, rgba(255,255,255,0) 1px 3px);
    animation: flicker 4s ease-in-out infinite;
}
@keyframes flicker { 0%,100%{opacity:.5} 50%{opacity:.36} }
#fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; }

/* top loading strip */
.top-strip {
    position: fixed; top: 0; left: 0; right: 0; height: 5px; z-index: 45;
    background: rgba(16,18,40,.6); overflow: hidden;
}
.top-strip::after {
    content: ""; position: absolute; top: 0; height: 100%; width: 38%; left: -42%;
    background: linear-gradient(90deg, #58b558, #ffd56b);
    box-shadow: 0 0 12px rgba(255,213,107,.75);
    animation: loadbar 2.6s linear infinite;
}
@keyframes loadbar { 0%{left:-42%} 100%{left:112%} }

/* --- NAV --- */
.topnav {
    position: fixed; top: 12px; left: 0; right: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; padding: 6px clamp(12px, 3vw, 34px);
}
.nav-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-btn {
    text-decoration: none;
    font-family: 'Pixelify Sans'; font-weight: 500;
    font-size: clamp(14px, 1.4vw, 20px); line-height: 1; letter-spacing: .5px;
    color: var(--navy);
    background: rgba(250,243,226,.82);
    padding: 6px 13px;
    border: 2px solid; border-top-color:#fff8ea; border-left-color:#fff8ea;
    border-right-color:#b9a778; border-bottom-color:#b9a778;
    cursor: var(--cur), pointer;
}
.nav-btn:hover {
    color: #faf3e2; background: var(--denim);
    border-top-color:#22376b; border-left-color:#22376b;
    border-right-color:#5e79b8; border-bottom-color:#5e79b8;
}
.nav-btn:active { transform: translate(1px,1px); }
.nav-btn.active {
    color: #faf3e2; background: var(--denim);
    border-top-color:#22376b; border-left-color:#22376b;
    border-right-color:#5e79b8; border-bottom-color:#5e79b8;
}
.nav-sig {
    display: flex; align-items: center; gap: 9px;
    font-family: 'Pixelify Sans'; font-size: clamp(14px,1.4vw,20px); letter-spacing:.5px;
    color: var(--navy); background: rgba(250,243,226,.82); padding: 6px 13px;
    border: 2px solid; border-top-color:#fff8ea; border-left-color:#fff8ea;
    border-right-color:#b9a778; border-bottom-color:#b9a778;
}
.sig-bars { display: flex; align-items: flex-end; gap: 2px; height: 15px; }
.sig-bars i {
    width: 3px; display: block; background: rgba(31,44,84,.28);
    transition: background .25s, box-shadow .25s;
}
.sig-bars i:nth-child(1){height:6px} .sig-bars i:nth-child(2){height:9px}
.sig-bars i:nth-child(3){height:12px} .sig-bars i:nth-child(4){height:15px}
.sig-bars i.on { background: #58b558; box-shadow: 0 0 5px rgba(88,181,88,.7); }

/* --- LAYOUT --- */
.layout {
    position: relative; z-index: 5;
    width: min(940px, calc(100% - 28px));
    margin: 0 auto; padding-top: 78px; padding-bottom: 40px;
    display: grid; gap: 14px;
}

/* --- WINDOW CARD --- */
.card {
    background: rgba(247,238,214,.97);
    border: 2px solid; border-top-color:#fff8ea; border-left-color:#fff8ea;
    border-right-color:#8d7a4e; border-bottom-color:#8d7a4e;
    box-shadow: 5px 5px 0 rgba(10,12,28,.34);
    overflow: hidden;
}
.win-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 6px 9px;
    background: linear-gradient(180deg, #3f5ba0, #2c477f);
    border-bottom: 2px solid #22376b;
    font-family: 'Press Start 2P'; font-size: 9px; letter-spacing: .5px;
    color: #faf3e2; text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.win-bar .label { display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-dots { display: flex; gap: 4px; flex-shrink: 0; }
.win-dots i {
    width: 13px; height: 13px; display: block; background: #d9cba6;
    border: 2px solid; border-top-color:#fff8ea; border-left-color:#fff8ea;
    border-right-color:#8d7a4e; border-bottom-color:#8d7a4e;
}
.win-body { padding: 18px; }

h1 {
    margin: 0; font-family: 'Press Start 2P';
    font-size: clamp(1rem, 2.7vw, 1.55rem); line-height: 1.25; color: var(--navy);
    text-shadow: 0 2px 0 rgba(255,248,234,.6);
}
h2, h3 { margin: 0; font-family: 'Pixelify Sans'; font-weight: 700; }
.subtitle { margin: 10px 0 0; color: var(--muted); font-size: 18px; }

.view-player { display: none; }
.view-player.active { display: grid; gap: 14px; }
.view-input { display: grid; gap: 14px; }
.view-input.hidden { display: none; }

.home-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.home-card-title { min-width: 0; }
.home-card-header .btn { flex-shrink: 0; }
.input-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.player-quick-load .win-body { padding: 14px 18px; }
.player-quick-load .input-row { margin-top: 0; }
.player-quick-load .status { margin-top: 8px; }

.update-card {
    position: fixed; right: 22px; bottom: 22px; z-index: 30;
    width: min(420px, calc(100% - 24px));
}
.update-card .win-body { padding: 14px 16px; }
.update-card h3 { color: var(--navy); font-size: 19px; margin-bottom: 8px; }
.update-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.date-badge {
    display: inline-flex; align-items: center; margin-right: 8px; padding: 3px 8px;
    background: #e86a9c; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap;
    border: 2px solid; border-top-color:#f4afc4; border-left-color:#f4afc4;
    border-right-color:#b03f6a; border-bottom-color:#b03f6a;
}

.clip-input {
    flex: 1; min-width: 200px; padding: 11px 14px;
    background: #fffdf5; color: var(--navy);
    font-size: 17px; font-family: 'Pixelify Sans'; outline: none;
    border: 2px solid; border-top-color:#8d7a4e; border-left-color:#8d7a4e;
    border-right-color:#fff8ea; border-bottom-color:#fff8ea;
    cursor: var(--cur), text;
}
.clip-input::placeholder { color: #9a8f72; }
.clip-input:focus {
    border-top-color:#22376b; border-left-color:#22376b;
    border-right-color:#5e79b8; border-bottom-color:#5e79b8;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 20px;
    font-family: 'Pixelify Sans'; font-weight: 700; font-size: 16px; letter-spacing: .5px;
    text-decoration: none; cursor: var(--cur), pointer; color: #0e2c10;
    background: #58b558;
    border: 3px solid; border-top-color:#9ce89c; border-left-color:#9ce89c;
    border-right-color:#2f7d2f; border-bottom-color:#2f7d2f;
    box-shadow: 3px 3px 0 rgba(10,12,28,.28);
}
.btn:hover { background: #63c163; box-shadow: 3px 3px 0 rgba(10,12,28,.28), 0 0 16px rgba(255,213,107,.55); }
.btn:active {
    transform: translate(2px,2px);
    border-top-color:#2f7d2f; border-left-color:#2f7d2f;
    border-right-color:#9ce89c; border-bottom-color:#9ce89c;
    box-shadow: 1px 1px 0 rgba(10,12,28,.28);
}
.btn-ghost {
    color: var(--navy); background: #ecdfbc;
    border-top-color:#fff8ea; border-left-color:#fff8ea;
    border-right-color:#ad9659; border-bottom-color:#ad9659;
    box-shadow: 3px 3px 0 rgba(10,12,28,.22);
}
.btn-ghost:hover { background: #f6ecca; box-shadow: 3px 3px 0 rgba(10,12,28,.22); }
.btn-ghost:active {
    border-top-color:#ad9659; border-left-color:#ad9659;
    border-right-color:#fff8ea; border-bottom-color:#fff8ea;
}

/* clip header */
.clip-header { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.clip-avatar {
    width: 54px; height: 54px; object-fit: cover; flex-shrink: 0; background: #d9cba6;
    border: 2px solid; border-top-color:#fff8ea; border-left-color:#fff8ea;
    border-right-color:#8d7a4e; border-bottom-color:#8d7a4e;
}
.clip-meta { min-width: 0; flex: 1; }
.clip-title { font-size: clamp(1.05rem, 3vw, 1.4rem); font-family: 'Pixelify Sans'; font-weight: 700; color: var(--navy); margin: 0; word-break: break-word; }
.clip-details { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; font-size: 16px; color: var(--muted); }
.clip-details span { display: inline-flex; align-items: center; gap: 4px; }
.clip-channel-name { color: var(--denim); font-weight: 600; }
.clip-views { color: #2f7d2f; font-weight: 600; }
.clip-game { color: #7a3fd0; }
.clip-date { color: var(--muted); }
.clip-creator { color: #a8791f; }

/* video */
.video-wrap {
    position: relative; width: 100%; overflow: hidden; min-height: 200px;
    display: flex; align-items: center; justify-content: center; background: #0c0f1e;
    border: 2px solid; border-top-color:#22376b; border-left-color:#22376b;
    border-right-color:#5e79b8; border-bottom-color:#5e79b8;
}
.video-wrap video { width: 100%; max-height: 78vh; display: block; background: #000; }
.video-loading {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 14px; background: rgba(10,12,28,.66); z-index: 2;
}
.video-loading.hidden { display: none; }
.video-loading .big-spinner {
    width: 38px; height: 38px; border: 4px solid rgba(255,255,255,.14);
    border-top-color: #58b558; border-radius: 50%; animation: spin .7s steps(8) infinite;
}
.video-loading .load-text { font-size: 17px; color: #d6e2f2; text-align: center; font-family: 'Pixelify Sans'; }

.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.tg-status { padding: 7px 14px; font-size: 15px; font-weight: 600; display: none; border: 2px solid; }
.tg-status.show { display: inline-flex; align-items: center; gap: 6px; }
.tg-status.saving { background: #dbe6fb; border-color: #5e79b8; color: #22376b; }
.tg-status.saved { background: #d6f1de; border-color: #58b558; color: #1f5c2a; }
.tg-status.tg-err { background: #f9d7d7; border-color: #c0392b; color: #7a1f1f; }
.spinner {
    width: 14px; height: 14px; border: 2px solid rgba(34,55,107,.25);
    border-top-color: #22376b; border-radius: 50%; animation: spin .6s steps(8) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status { margin-top: 10px; padding: 10px 14px; font-size: 16px; display: none; border: 2px solid; }
.status.show { display: block; }
.status.err { background: #f9d7d7; border-color: #c0392b; color: #7a1f1f; }

/* history */
.history-card h3 { font-size: 19px; margin-bottom: 12px; color: var(--navy); }
.history-list { display: grid; gap: 6px; }
.history-item {
    display: flex; align-items: center; gap: 10px; padding: 7px 10px;
    background: rgba(255,253,245,.6); cursor: var(--cur), pointer;
    border: 2px solid transparent;
    transition: background .15s;
}
.history-item:hover {
    background: var(--denim); color: #faf3e2;
    border-top-color:#5e79b8; border-left-color:#5e79b8;
    border-right-color:#22376b; border-bottom-color:#22376b;
}
.history-item .thumb {
    width: 80px; height: 45px; object-fit: cover; flex-shrink: 0; background: #d9cba6;
    border: 2px solid; border-top-color:#8d7a4e; border-left-color:#8d7a4e;
    border-right-color:#fff8ea; border-bottom-color:#fff8ea;
}
.history-item .meta { min-width: 0; flex: 1; }
.history-item .meta .h-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item .meta .h-channel { font-size: 14px; color: var(--denim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item:hover .meta .h-channel { color: #bcd0ff; }
.history-item .meta .h-views { font-size: 13px; color: var(--muted); }
.history-item:hover .meta .h-views { color: #d6e2f2; }
.history-clear {
    margin-top: 10px; font-size: 15px; color: var(--muted); font-family: 'Pixelify Sans';
    background: none; border: none; cursor: var(--cur), pointer; text-decoration: underline; padding: 0;
}
.history-clear:hover { color: var(--navy); }

/* skeleton */
.loading-skeleton { display: none; gap: 14px; align-items: center; padding: 6px 0; }
.loading-skeleton.show { display: flex; }
.skel-circle { width: 54px; height: 54px; background: rgba(35,49,94,.14); animation: shimmer 1.2s ease-in-out infinite alternate; flex-shrink: 0; }
.skel-lines { flex: 1; display: grid; gap: 8px; }
.skel-line { height: 14px; background: rgba(35,49,94,.14); animation: shimmer 1.2s ease-in-out infinite alternate; }
.skel-line:nth-child(1) { width: 70%; }
.skel-line:nth-child(2) { width: 50%; animation-delay: .15s; }
.skel-line:nth-child(3) { width: 35%; animation-delay: .3s; }
@keyframes shimmer { to { opacity: .4; } }

@media (max-width: 600px) {
    .layout { width: calc(100% - 18px); padding-top: 70px; }
    .win-body { padding: 14px; }
    .update-card { left: 9px; right: 9px; bottom: 9px; width: auto; }
    .input-row { flex-direction: column; }
    .clip-input { min-width: 0; }
    .clip-avatar { width: 44px; height: 44px; }
    .history-item .thumb { width: 64px; height: 36px; }
    .topnav { gap: 6px; }
    .nav-btn, .nav-sig { font-size: 14px; padding: 5px 10px; }
}
