/* =============================================================================
   /my-skins — the live studio: a real player preview, the extension's switches
   and the whole catalogue in one place. Built on the ui.css tokens.
   ========================================================================== */

.st-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    margin: 0 0 26px;
}
.st-player { min-width: 0; }
.st-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: #05070d;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-2);
}
.st-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.st-frame__veil {
    position: absolute; inset: 0; background: rgba(3, 5, 10, .72);
    pointer-events: none; transition: opacity .3s var(--ease);
}
.st-live {
    position: absolute; top: 12px; left: 12px; z-index: 3;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(8, 12, 22, .72); backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
}
.st-live i { width: 7px; height: 7px; border-radius: 50%; background: #ff2e4d; box-shadow: 0 0 0 0 rgba(255, 46, 77, .7); animation: stPulse 2s infinite; }
@keyframes stPulse { 70% { box-shadow: 0 0 0 7px rgba(255, 46, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 46, 77, 0); } }

.st-now {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    margin-top: 12px; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.st-now__label { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.st-now__text b { font-size: 18px; color: var(--ink); }
.st-now__acts { display: flex; gap: 9px; }

.st-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 42px; padding: 0 18px !important; min-width: 0 !important;
    border: 1px solid transparent !important; border-radius: 999px !important;
    font-size: 14.5px !important; font-weight: 700 !important; line-height: 1 !important;
    text-decoration: none !important; cursor: pointer;
    transition: transform .15s var(--ease), filter .15s var(--ease), background .15s var(--ease);
}
.st-btn--brand { background: var(--brand) !important; color: #fff !important; box-shadow: 0 8px 18px rgba(255, 0, 64, .26); }
.st-btn--brand:hover { transform: translateY(-1px); filter: brightness(1.06); background: var(--brand) !important; }
.st-btn--ghost { background: var(--surface-2) !important; color: var(--ink) !important; border-color: var(--line-2) !important; }
.st-btn--ghost:hover { background: var(--surface) !important; color: var(--ink) !important; }
.st-btn--wide { width: 100%; height: 46px; }
.st-btn.is-done { background: var(--ok) !important; box-shadow: none; }

.st-panel {
    align-self: start;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 18px 18px 16px; box-shadow: var(--shadow-1);
}
.st-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.st-panel__head h2 { margin: 0 !important; font-size: 18px !important; }
.st-reset { background: none; border: 0; padding: 0; min-width: 0 !important; color: var(--accent); font-size: 13px; font-weight: 700; cursor: pointer; }
.st-panel__hint { margin: 6px 0 14px; font-size: 13px; color: var(--ink-3); line-height: 1.45; }

.st-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.st-opt {
    display: flex; align-items: center; gap: 11px; padding: 8px 8px; border-radius: 10px;
    font-size: 14.5px; color: var(--ink); transition: background .15s var(--ease);
}
.st-opt:hover { background: var(--surface-2); }
.st-sw {
    position: relative; flex: none; width: 38px; height: 22px; padding: 0 !important; min-width: 0 !important;
    border-radius: 999px !important; border: 0 !important; cursor: pointer;
    background: var(--line-2) !important; transition: background .18s var(--ease);
}
.st-sw::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transition: transform .18s var(--ease);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.st-opt[data-on="1"] .st-sw { background: var(--ok) !important; }
.st-opt[data-on="1"] .st-sw::after { transform: translateX(16px); }

.st-cta { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.st-cta span { display: block; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.st-cta--have { text-align: left; }
.st-cta--have b { display: block; color: var(--ok); font-size: 14.5px; }
.st-cta--have span { margin-top: 4px; }

/* ── catalogue ────────────────────────────────────────────────────────── */
.st-lib { margin-bottom: 10px; }
.st-lib__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.st-lib__head h2 { margin: 0 !important; font-size: 21px !important; }
.st-search { position: relative; flex: 0 1 280px; }
.st-search input {
    width: 100%; height: 40px; padding: 0 14px !important; margin: 0 !important;
    border: 1px solid var(--line-2) !important; border-radius: 999px !important;
    background: var(--surface) !important; color: var(--ink) !important; font-size: 14px;
}
.st-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.st-chip {
    height: 34px; padding: 0 14px !important; min-width: 0 !important;
    border-radius: 999px !important; border: 1px solid var(--line) !important;
    background: var(--surface) !important; color: var(--ink-2) !important;
    font-size: 13.5px !important; font-weight: 600 !important; cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.st-chip:hover { background: var(--surface-2) !important; color: var(--ink) !important; }
.st-chip.is-on { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }

.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 14px; }
.st-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    overflow: hidden; box-shadow: var(--shadow-1);
    transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.st-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-2); }
.st-card.is-live { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft), var(--shadow-2); }
.st-card.is-hidden { display: none; }
.st-card__thumb {
    position: relative; display: block; width: 100%; padding: 0 !important; min-width: 0 !important;
    border: 0 !important; background: var(--surface-2) !important; cursor: pointer; aspect-ratio: 10 / 7;
}
.st-card__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.st-card__play {
    position: absolute; inset: auto 0 0 0; padding: 26px 10px 9px;
    background: linear-gradient(transparent, rgba(6, 10, 18, .82));
    color: #fff; font-size: 12.5px; font-weight: 700; text-align: left;
    opacity: 0; transition: opacity .16s var(--ease);
}
.st-card:hover .st-card__play, .st-card.is-live .st-card__play { opacity: 1; }
.st-card.is-live .st-card__play::after { content: ' · on screen'; opacity: .75; }
.st-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 11px; }
.st-card__name { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-card__add {
    flex: none; height: 30px; padding: 0 13px !important; min-width: 0 !important;
    border-radius: 999px !important; border: 1px solid var(--line-2) !important;
    background: var(--surface-2) !important; color: var(--ink) !important;
    font-size: 12.5px !important; font-weight: 700 !important; cursor: pointer;
}
.st-card__add:hover { background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; }
.st-card__add.is-done { background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; }
.st-empty { padding: 26px 0; text-align: center; color: var(--ink-3); }

.st-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 14px);
    z-index: 300; padding: 12px 18px; border-radius: 999px;
    background: var(--nav); color: #fff; font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow-3); opacity: 0; pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.st-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1080px) {
    .st-stage { grid-template-columns: 1fr; }
    .st-panel { order: 2; }
}
@media (max-width: 640px) {
    .st-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .st-card__name { font-size: 13px; }
    .st-now { padding: 12px; }
    .st-now__acts { width: 100%; }
    .st-now__acts .st-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .st-live i { animation: none; }
}

/* ── filters row: chips and search on one line ────────────────────────── */
.st-filters { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.st-filters .st-chips { margin-bottom: 0; flex: 1 1 auto; }
.st-filters .st-search { flex: 0 0 260px; }
@media (max-width: 720px) { .st-filters .st-search { flex: 1 1 100%; } }

/* ── the frame tilts towards the pointer ──────────────────────────────── */
.st-frame { transform-style: preserve-3d; transition: transform .35s var(--ease), box-shadow .35s var(--ease); will-change: transform; }
.st-frame.is-tilting { transition: transform .08s linear, box-shadow .3s var(--ease); box-shadow: var(--shadow-3); }
.st-frame::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
    background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .16), transparent 62%);
    transition: opacity .25s var(--ease);
}
.st-frame.is-tilting::after { opacity: 1; }

/* ── my skins ─────────────────────────────────────────────────────────── */
.st-mine { margin-bottom: 26px; }
.st-mine__count { font-size: 13.5px; color: var(--ink-3); }
.st-card.is-applied { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(18, 183, 106, .18), var(--shadow-1); }
.st-card.is-applied .st-card__add { background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; }

/* Visible at rest: a CSS-only fade, so nothing depends on an observer that a
   content script or Rocket Loader might never let run. */
.st-fade { animation: stFade .45s var(--ease) both; }
.st-fade:nth-of-type(2) { animation-delay: .05s; }
@keyframes stFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .st-fade { animation: none; } }
