:root {
    --ink: #101214;
    --muted: #667085;
    --line: #d9e0e7;
    --paper: #f6f8f9;
    --panel: #ffffff;
    --carbon: #171b20;
    --teal: #0d9488;
    --teal-dark: #0f766e;
    --gold: #c9972d;
    --danger: #b42318;
    --shadow: 0 24px 70px rgba(17, 24, 39, 0.14);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px clamp(18px, 5vw, 64px);
    background: rgba(246, 248, 249, 0.9);
    border-bottom: 1px solid rgba(217, 224, 231, 0.8);
    backdrop-filter: blur(18px);
}

.site-header.compact {
    position: relative;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--carbon);
    color: #fff;
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.08);
}

.top-nav,
.server-tabs,
.table-actions,
.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.top-nav a {
    color: #475467;
    font-weight: 700;
}

.stream-page {
    background: #0a0a0a;
    color: #fff;
}

.stream-page.token-player-page {
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.stream-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.stream-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #2c2c2c;
    background: linear-gradient(180deg, #151515, #0a0a0a);
}

.stream-header h1 {
    margin: 0 0 6px;
    font-size: clamp(1.35rem, 5vw, 1.8rem);
    line-height: 1.2;
    letter-spacing: 0;
}

.stream-header p {
    margin: 0;
    color: #a1a1aa;
    font-size: 0.92rem;
}

.stream-page .player-card {
    max-width: none;
    border: 0;
    border-radius: 0;
    background: #000;
    box-shadow: none;
}

.stream-page .player-stage {
    width: 100%;
    position: relative;
    aspect-ratio: 16 / 9 !important;
    background: #000;
    overflow: hidden;
}

.stream-page .player-stage video,
.stream-page .player-stage iframe,
.stream-page .player-stage .plyr,
.stream-page .player-stage .plyr__video-wrapper,
.stream-page .player-stage .plyr__video-embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    padding-bottom: 0 !important;
}

.server-panel {
    padding: 16px;
}

.stream-page .server-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.stream-page .server-tabs button {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid #2c2c2c;
    border-radius: 8px;
    background: #151515;
    color: #fff;
    font-size: 0.94rem;
}

.stream-page .server-tabs button.active {
    border-color: #0d9488;
    background: #0d9488;
    color: #fff;
}

/* Offline & Premium Card Styling */
.offline-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, #1e293b, #020617),
                linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    text-align: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.offline-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(13, 148, 136, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.offline-content {
    position: relative;
    z-index: 1;
}

.offline-content h2 {
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    margin: 20px 0 12px;
    background: linear-gradient(to right, #2dd4bf, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    filter: drop-shadow(0 0 10px rgba(45, 212, 191, 0.3));
}

.offline-content p {
    color: #94a3b8;
    max-width: 440px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.6;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: #f8fafc;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.live-indicator .dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 12px #ef4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 20px #ef4444; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.premium-notice-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.15), rgba(59, 130, 246, 0.1), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.premium-notice-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    to { left: 100%; }
}

.notice-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 15px rgba(201, 151, 45, 0.5));
}

.notice-text {
    display: grid;
    gap: 4px;
}

.notice-text strong {
    color: #fff;
    font-size: 1.1rem;
    background: linear-gradient(90deg, #2dd4bf, #fcd34d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.notice-text span {
    color: #cbd5e1;
    font-size: 0.95rem;
}

.eyebrow {
    display: inline-block;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.button,
.server-tabs button,
.table-actions button,
.table-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button svg,
.logout-button svg,
.field-control svg,
.visibility-toggle svg,
.live-icon svg,
.modal-live-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button:hover,
.server-tabs button:hover,
.table-actions button:hover,
.table-actions a:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: var(--teal);
    color: #fff;
}

.button.primary:hover {
    background: var(--teal-dark);
}

.button.ghost {
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
}

.watch-shell {
    padding: clamp(28px, 6vw, 72px) clamp(18px, 5vw, 64px);
    background: #101214;
}

.watch-shell.single {
    min-height: calc(100vh - 74px);
}

.player-card {
    overflow: hidden;
    max-width: 1180px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #080a0c;
    box-shadow: var(--shadow);
}

.player-stage {
    position: relative;
    aspect-ratio: 16 / 9 !important;
    min-height: unset !important;
    background: #000;
}

.player-stage video,
.player-stage iframe,
.player-stage .plyr,
.player-stage .plyr__video-wrapper,
.player-stage .plyr__video-embed {
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
    background: #000;
    padding-bottom: 0 !important;
}

.player-meta {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    padding: clamp(18px, 4vw, 30px);
    color: #fff;
}

.player-meta h1,
.player-meta h2 {
    margin: 8px 0;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    letter-spacing: 0;
}

.player-meta p {
    max-width: 680px;
    margin: 0;
    color: rgba(255, 255, 255, 0.66);
    line-height: 1.6;
}

.server-tabs {
    justify-content: flex-end;
    min-width: 220px;
}

.server-tabs button {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.server-tabs button.active {
    background: #fff;
    color: var(--ink);
}

.channel-section,
.page-main {
    padding: clamp(30px, 6vw, 72px) clamp(18px, 5vw, 64px);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    max-width: 1180px;
    margin: 0 auto 22px;
}

.section-heading.tight {
    display: block;
    margin: 0 0 18px;
}

.section-heading h2,
.admin-heading h1,
.login-card h1 {
    margin: 6px 0 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0;
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    max-width: 1180px;
    margin: 0 auto;
}

.channel-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 96px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
}

.channel-logo {
    display: grid;
    place-items: center;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 8px;
    background: #e6f5f3;
    color: var(--teal-dark);
    font-weight: 900;
}

.channel-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-card strong,
.channel-card span {
    display: block;
}

.channel-card span {
    margin-top: 4px;
    color: var(--muted);
}

.empty-state {
    max-width: 700px;
    margin: 42px auto;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    text-align: center;
}

.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(rgba(16, 18, 20, 0.72), rgba(16, 18, 20, 0.72)),
        url("https://images.unsplash.com/photo-1495567720989-cebdbdd97913?auto=format&fit=crop&w=1600&q=80") center / cover;
}

.login-card,
.admin-form,
.table-card {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.login-card {
    max-width: 420px;
    padding: 28px;
}

.login-card .brand {
    margin-bottom: 28px;
}

label {
    display: grid;
    gap: 8px;
    color: #344054;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 12px 14px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

.admin-body {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    background: var(--carbon);
    color: #fff;
}

.admin-sidebar nav {
    display: grid;
    gap: 8px;
    margin-top: 34px;
}

.admin-sidebar nav a {
    padding: 12px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 800;
}

.admin-sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.admin-main {
    min-width: 0;
    padding: clamp(22px, 4vw, 44px);
}

.admin-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.flash {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    background: #ecfdf3;
    color: #067647;
    font-weight: 800;
}

.flash.error {
    border-color: #fecdca;
    background: #fef3f2;
    color: var(--danger);
}

.table-card {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: #475467;
    font-size: 0.82rem;
    text-transform: uppercase;
}

td span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.pill {
    display: inline-flex;
    margin: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e6f5f3;
    color: var(--teal-dark);
    font-size: 0.84rem;
}

.table-actions {
    justify-content: flex-end;
}

.table-actions form {
    margin: 0;
}

.table-actions a,
.table-actions button {
    min-height: 36px;
    border-color: var(--line);
    background: #fff;
    color: var(--ink);
}

.table-actions button {
    color: var(--danger);
}

.admin-form {
    padding: clamp(18px, 4vw, 30px);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.wide {
    grid-column: 1 / -1;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check input {
    width: 18px;
    height: 18px;
}

.check span {
    color: var(--ink);
}

.server-builder {
    margin-top: 30px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.server-row {
    display: grid;
    grid-template-columns: minmax(130px, 0.8fr) minmax(120px, 0.7fr) minmax(220px, 1.8fr) 90px 90px 44px;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.4rem;
}

.form-actions {
    justify-content: flex-end;
    margin-top: 24px;
}

.login-body {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.32), transparent 32%),
        linear-gradient(315deg, rgba(201, 151, 45, 0.3), transparent 34%),
        linear-gradient(55deg, rgba(59, 130, 246, 0.22), transparent 42%),
        linear-gradient(160deg, #071316, #10252c 46%, #18313a);
}

.login-body::before {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 22% 18%, rgba(34, 197, 94, 0.28), transparent 26%),
        radial-gradient(circle at 78% 76%, rgba(201, 151, 45, 0.26), transparent 24%),
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: auto, auto, 44px 44px, 44px 44px;
    content: "";
    pointer-events: none;
}

.login-shell {
    width: 100%;
    max-width: 360px;
}

.login-card.refined {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 253, 249, 0.94)),
        #ffffff;
    box-shadow: 0 30px 74px rgba(5, 15, 23, 0.36);
    backdrop-filter: blur(14px);
}

.login-card.refined::before {
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, #0d9488, #22c55e, #c9972d);
    content: "";
}

.server-list-row,
.server-admin-actions,
.server-modal-head,
.server-badges,
.admin-topbar,
.admin-top-actions,
.admin-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.server-modal-head,
.admin-topbar {
    justify-content: space-between;
}

.login-card .login-title {
    margin: 0 0 24px;
    text-align: center;
    font-size: 1.32rem;
    line-height: 1.2;
    color: #0f2f35;
}

.login-fields {
    display: grid;
    gap: 12px;
}

.field-control {
    position: relative;
}

.field-control > svg {
    position: absolute;
    top: 50%;
    left: 13px;
    width: 32px;
    height: 32px;
    padding: 7px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0d9488, #22c55e);
    color: #fff;
    transform: translateY(-50%);
    pointer-events: none;
}

.field-control input {
    height: 46px;
    padding: 0 46px 0 54px;
    border-color: #bddbd5;
    background: linear-gradient(180deg, #ffffff, #f7fcfb);
}

.field-control input:focus {
    background: #fff;
    border-color: var(--teal);
}

.visibility-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--teal-dark);
    cursor: pointer;
    transform: translateY(-50%);
}

.visibility-toggle:hover {
    background: #e6f5f3;
    color: var(--ink);
}

.login-submit {
    width: 100%;
    margin-top: 14px;
    background: linear-gradient(135deg, #0d9488, #22c55e);
    box-shadow: 0 14px 28px rgba(13, 148, 136, 0.28);
}

.admin-body {
    display: block;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(13, 148, 136, 0.12), transparent 26%),
        linear-gradient(315deg, rgba(201, 151, 45, 0.18), transparent 30%),
        linear-gradient(180deg, #f7faf8, #eef5f2 34%, #f8fafb);
}

.admin-main.single-screen {
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px clamp(16px, 4vw, 34px) 40px;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(13, 148, 136, 0.14);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 251, 247, 0.9)),
        #ffffff;
    box-shadow: 0 18px 42px rgba(13, 64, 72, 0.1);
    backdrop-filter: blur(14px);
}

.admin-title {
    min-width: 0;
    color: var(--ink);
    font-size: 1.22rem;
    font-weight: 900;
}

.live-icon {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0d9488, #22c55e);
    color: #fff;
    box-shadow: 0 12px 24px rgba(13, 148, 136, 0.24);
}

.live-icon svg {
    width: 24px;
    height: 24px;
}

.admin-top-actions {
    justify-content: flex-end;
}

.admin-top-actions .button {
    gap: 8px;
    background: linear-gradient(135deg, #0d9488, #22c55e);
    box-shadow: 0 12px 24px rgba(13, 148, 136, 0.22);
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, #fff7f6);
    color: var(--danger);
    font-weight: 800;
}

.logout-button:hover {
    background: #fff7f6;
}

.admin-panel {
    padding: 18px;
    border: 1px solid rgba(13, 148, 136, 0.12);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 250, 0.9)),
        #ffffff;
    box-shadow: 0 24px 60px rgba(12, 74, 82, 0.1);
}

.admin-heading {
    margin-bottom: 18px;
}

.admin-heading h1 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.server-list {
    display: grid;
    gap: 10px;
}

.server-list-row,
.admin-empty {
    position: relative;
    overflow: hidden;
    padding: 12px;
    border: 1px solid #dde8e5;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 252, 0.96)),
        #ffffff;
    box-shadow: 0 10px 26px rgba(15, 76, 91, 0.06);
}

.server-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    border-left: 4px solid #0d9488;
}

.server-list-row::after {
    position: absolute;
    inset: 0 auto 0 0;
    width: 88px;
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.1), transparent);
    content: "";
    pointer-events: none;
}

.server-list-row.type-iframe {
    border-left-color: #3b82f6;
}

.server-list-row.type-iframe::after {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), transparent);
}

.server-list-row.type-video {
    border-left-color: #c9972d;
}

.server-list-row.type-video::after {
    background: linear-gradient(90deg, rgba(201, 151, 45, 0.12), transparent);
}

.server-main {
    min-width: 0;
}

.server-main h2,
.admin-empty h2,
.server-modal-head h2 {
    margin: 0;
    font-size: 1rem;
}

.server-main p {
    overflow: hidden;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-main .access-link {
    color: var(--teal-dark);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.78rem;
}

.server-main .access-link a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.empty-state.dark {
    border-color: #27272a;
    background: #111;
    color: #fff;
}

.invalid-link-screen {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at top, rgba(13, 148, 136, 0.18), transparent 34%),
        #050505;
}

.invalid-link-card {
    width: min(520px, 100%);
    padding: 30px;
    border: 1px solid #27272a;
    border-radius: 8px;
    background: #111;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.invalid-link-card h1 {
    margin: 0 0 10px;
    font-size: clamp(1.6rem, 6vw, 2.3rem);
    letter-spacing: 0;
}

.invalid-link-card p {
    margin: 0;
    color: #a1a1aa;
    line-height: 1.6;
}

.premium-landing {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px 18px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 50% 0%, rgba(13, 148, 136, 0.22), transparent 32%),
        linear-gradient(145deg, #030606, #0b1412 48%, #050505);
    background-size: 42px 42px, 42px 42px, auto, auto;
}

.premium-shell {
    width: min(560px, 100%);
}

.premium-landing-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: clamp(24px, 7vw, 38px) clamp(16px, 5vw, 34px);
    border: 1px solid rgba(94, 234, 212, 0.2);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
        linear-gradient(180deg, rgba(13, 148, 136, 0.1), rgba(0, 0, 0, 0)),
        #090d0d;
    text-align: center;
    box-shadow:
        0 34px 90px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.premium-landing-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #0d9488, #5eead4, #c9972d);
    content: "";
}

.premium-landing-card::after {
    display: none;
}

.premium-landing-card h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(1.45rem, 7vw, 2.45rem);
    line-height: 1.12;
    letter-spacing: 0;
    white-space: nowrap;
}

.premium-lock-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border: 1px solid rgba(94, 234, 212, 0.25);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(94, 234, 212, 0.2), rgba(201, 151, 45, 0.12)),
        #101817;
    color: #5eead4;
    box-shadow:
        0 18px 38px rgba(13, 148, 136, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.premium-lock-icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.premium-landing-card p {
    position: relative;
    z-index: 1;
    margin: 16px auto 0;
    color: #cbd5e1;
    font-size: clamp(1rem, 4.2vw, 1.12rem);
    line-height: 1.65;
}

.token-player-page,
.token-player,
.token-player .player-card {
    height: 100%;
    min-height: 100%;
}

.token-player .player-card,
.token-player .player-stage {
    height: 100%;
}

.token-player .player-stage {
    aspect-ratio: auto !important;
}

.server-badges {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.server-admin-actions {
    justify-content: flex-end;
}

.button.compact {
    min-height: 38px;
    padding: 0 14px;
}

.button.danger {
    background: #fff;
    border-color: #f0c5c0;
    color: var(--danger);
}

.button.danger:hover {
    background: #fff7f6;
}

.single-screen .button.ghost {
    border-color: #d0d5dd;
    background: #fff;
    color: var(--ink);
}

.pill.neutral {
    background: #e8f3ff;
    color: #1d4ed8;
}

.pill.accent {
    background: #dcfce7;
    color: #067647;
}

.pill.muted {
    background: #f4f4f5;
    color: #52525b;
}

.server-modal {
    width: min(590px, calc(100vw - 24px));
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
}

.server-modal::backdrop {
    background: rgba(10, 16, 22, 0.56);
    backdrop-filter: blur(8px);
}

.server-modal-card {
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(13, 148, 136, 0.16);
    border-radius: 8px;
    background:
        linear-gradient(160deg, rgba(13, 148, 136, 0.1), transparent 34%),
        linear-gradient(180deg, #ffffff, #f8fcfa),
        #ffffff;
    box-shadow: 0 34px 86px rgba(9, 38, 45, 0.26);
}

.server-modal-head {
    position: relative;
    overflow: hidden;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(13, 148, 136, 0.95), rgba(17, 24, 39, 0.96)),
        #101214;
    border-bottom: 1px solid rgba(13, 148, 136, 0.12);
    color: #fff;
}

.server-modal-head::after {
    position: absolute;
    right: 18px;
    bottom: 14px;
    width: 150px;
    height: 46px;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    content: "";
    transform: skewX(-18deg);
    pointer-events: none;
}

.server-modal-title {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #99f6e4;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.modal-live-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 20px;
    margin-top: 0;
}

.modal-options-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.85fr);
    gap: 14px;
    align-items: end;
}

.server-modal-card .form-actions {
    justify-content: space-between;
    margin-top: 0;
    padding: 18px 20px 20px;
    border-top: 1px solid rgba(13, 148, 136, 0.1);
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.4), rgba(255, 255, 255, 0.92));
}

.server-modal-card input,
.server-modal-card select {
    min-height: 48px;
    border-color: #bddbd5;
    background:
        linear-gradient(180deg, #ffffff, #f8fffd),
        #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.server-modal-card input:focus,
.server-modal-card select:focus {
    background: #fff;
}

.icon-button.muted {
    position: relative;
    z-index: 1;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.icon-button.muted:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.default-toggle {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    height: 50px;
    padding: 0 12px;
    border: 1px solid #bddbd5;
    border-radius: 8px;
    background:
        linear-gradient(180deg, #ffffff, #f6fffc),
        #ffffff;
    cursor: pointer;
    box-sizing: border-box;
}

.default-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.toggle-copy {
    display: grid;
    gap: 2px;
}

.toggle-copy strong {
    color: var(--ink);
    font-size: 0.9rem;
}

.toggle-copy small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: #d0d5dd;
    transition: background 160ms ease;
}

.toggle-switch::after {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(16, 24, 40, 0.22);
    content: "";
    transition: transform 160ms ease;
}

.default-toggle input:checked ~ .toggle-switch {
    background: linear-gradient(135deg, #0d9488, #22c55e);
}

.default-toggle input:checked ~ .toggle-switch::after {
    transform: translateX(18px);
}

.modal-cancel {
    border-color: #d0d5dd;
    background: #fff;
    color: var(--ink);
}

.modal-save {
    border-color: transparent;
    background: linear-gradient(135deg, #0d9488, #22c55e);
    color: #fff;
    box-shadow: 0 14px 26px rgba(13, 148, 136, 0.22);
}

.type-selection-group {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    height: 50px;
    box-sizing: border-box;
}

.type-btn {
    flex: 1;
    height: 100%;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 160ms ease;
}

.type-btn:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.5);
}

.type-btn.active {
    background: #fff;
    color: var(--teal-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (max-width: 980px) {
    .admin-body {
        grid-template-columns: 1fr;
    }

    .admin-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .server-tabs {
        justify-content: flex-start;
    }

    .server-row {
        grid-template-columns: 1fr 1fr;
    }

    .server-row .url-field,
    .server-row .small {
        grid-column: 1 / -1;
    }

    .server-admin-actions,
    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .server-list-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .server-badges,
    .admin-top-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .site-header,
    .top-nav,
    .form-grid,
    .server-row,
    .modal-grid,
    .modal-options-row {
        grid-template-columns: 1fr;
    }

    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-nav {
        width: 100%;
        justify-content: space-between;
    }

    .player-stage {
        min-height: auto;
    }

    .button,
    .server-tabs,
    .server-tabs button,
    .table-actions,
    .table-actions a,
    .table-actions button {
        width: 100%;
    }

    th,
    td {
        padding: 12px;
    }

    .login-card.refined,
    .admin-panel,
    .server-modal-card {
        padding: 16px;
    }

    .server-modal-card {
        padding: 0;
    }

    .admin-top-actions,
    .admin-top-actions .button {
        width: 100%;
    }

    .logout-button {
        width: 100%;
    }

    .server-list-row {
        gap: 10px;
    }

    .server-admin-actions .button,
    .server-admin-actions form,
    .server-admin-actions button {
        width: 100%;
    }
}

/* =========================================================================
   StreamPlayer — Modern Video Player Controls (.sp- prefix)
   ========================================================================= */

/* ---- Global hidden fix ---- */
[hidden] {
    display: none !important;
}

/* ---- Player stage ---- */
.player-stage {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    -webkit-user-select: none;
    user-select: none;
}

.player-stage video {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    background: #000;
}

/* Hide native controls */
.player-stage video::-webkit-media-controls,
.player-stage video::-webkit-media-controls-enclosure,
.player-stage video::-webkit-media-controls-panel {
    display: none !important;
    -webkit-appearance: none;
}

/* ---- Overlay base ---- */
.sp-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}

.sp-overlay > * {
    pointer-events: auto;
}

/* ---- Top bar (title + gradient) ---- */
.sp-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 14px 18px 24px;
    opacity: 1;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.sp-top-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        transparent 100%);
    pointer-events: none;
}

.sp-title {
    position: relative;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

/* ---- Center play button ---- */
.sp-center-play {
    z-index: 3;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sp-play-lg {
    width: 68px !important;
    height: 68px !important;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    backdrop-filter: blur(16px) saturate(1.2);
    border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
    color: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.2s ease,
                box-shadow 0.2s ease;
}

.sp-play-lg svg {
    width: 30px;
    height: 30px;
    margin-left: 3px;
}

.sp-play-lg:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.08);
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.45);
    color: #fff;
}

.sp-play-lg:active {
    transform: scale(0.95);
}

/* Hide center play when playing */
.sp-playing .sp-center-play {
    opacity: 0;
    pointer-events: none;
}

/* ---- Bottom gradient ---- */
.sp-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.5) 35%,
        rgba(0, 0, 0, 0.15) 65%,
        transparent 100%);
    pointer-events: none;
    z-index: 4;
    opacity: 1;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Mini progress bar (visible when controls hidden) ---- */
.sp-mini-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sp-mini-progress-buffers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sp-mini-progress-buffer-segment {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.38);
    pointer-events: none;
}

.sp-mini-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--teal, #14b8a6);
    transition: width 0.3s linear;
}

/* Show mini progress only when controls are hidden */
.sp-controls-hidden .sp-mini-progress {
    opacity: 1;
}

.sp-controls-visible .sp-mini-progress {
    opacity: 0;
}

/* ---- Controls bar (two-row layout) ---- */
.sp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 14px 10px;
    z-index: 5;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Controls visibility ---- */
.sp-controls-hidden .sp-controls,
.sp-controls-hidden .sp-gradient,
.sp-controls-hidden .sp-top-bar {
    opacity: 0;
    pointer-events: none;
}

.sp-controls-hidden .sp-controls {
    transform: translateY(8px);
}

.sp-controls-visible .sp-controls,
.sp-controls-visible .sp-gradient,
.sp-controls-visible .sp-top-bar {
    opacity: 1;
    pointer-events: auto;
}

.sp-controls-visible .sp-controls {
    transform: translateY(0);
}

/* ---- Buttons row ---- */
.sp-buttons-row {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.sp-spacer {
    flex: 1;
}

/* ---- Buttons ---- */
.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 6px;
    transition: color 0.18s ease, background 0.18s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.sp-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sp-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sp-btn:active {
    transform: scale(0.92);
}

/* Skip buttons (back/forward 10s) */
.sp-skip-btn svg {
    width: 20px;
    height: 20px;
}

.sp-skip-btn[hidden] {
    display: none;
}

/* ---- Seek bar row (left/right labels + track) ---- */
.sp-seek-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.sp-seek-time-left,
.sp-seek-time-right {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.75);
    font-variant-numeric: tabular-nums;
    font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
    user-select: none;
    flex-shrink: 0;
}

.sp-seek-time-right {
    color: var(--teal, #14b8a6);
    font-weight: 500;
}

.sp-seek {
    flex: 1;
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0;
    min-width: 0;
}

.sp-seek[hidden] {
    display: none;
}

.sp-seek-track {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: visible;
    transition: height 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.sp-seek:hover .sp-seek-track {
    height: 5px;
}

.sp-seek-buffers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sp-seek-buffer-segment {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.38);
    border-radius: 3px;
    pointer-events: none;
}

.sp-seek-target-buffer {
    position: absolute;
    top: 0;
    height: 100%;
    background: transparent;
    border-right: 1px dashed rgba(255, 255, 255, 0.4);
    pointer-events: none;
    transition: left 0.1s linear, width 0.3s ease;
}

.sp-seek-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: #06b6d4;
    border-radius: 3px;
    pointer-events: none;
    transition: width 0.08s linear;
}

/* Seek thumb — appears on hover */
.sp-seek-progress::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 13px;
    height: 13px;
    background: #06b6d4;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sp-seek:hover .sp-seek-progress::after {
    transform: translateY(-50%) scale(1);
}

.sp-seek-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    background: transparent;
    z-index: 1;
}
.sp-seek-input:focus,
.sp-volume-slider:focus {
    outline: none !important;
    box-shadow: none !important;
}
/* ---- Time display ---- */
.sp-time {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
    flex-shrink: 0;
    user-select: none;
    letter-spacing: 0.01em;
    padding: 0 2px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.sp-time:hover {
    color: rgba(255, 255, 255, 0.95);
}

.sp-sep {
    color: rgba(255, 255, 255, 0.32);
    margin: 0 1px;
}

.sp-buffer-ahead {
    font-size: 0.72rem;
    color: var(--teal, #14b8a6);
    opacity: 0.85;
    margin-left: 4px;
    font-weight: 500;
}

/* ---- Volume ---- */
.sp-volume {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.sp-volume-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    background: transparent;
    outline: none;
    margin: 0;
    padding: 0;
    border: 0;
    cursor: pointer;
    opacity: 0;
}

.sp-volume:hover .sp-volume-slider,
.sp-volume-slider:focus {
    width: 72px;
    opacity: 1;
}

.sp-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transition: transform 0.12s ease;
    margin-top: -5px;
}

.sp-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.sp-volume-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.sp-volume-slider::-webkit-slider-runnable-track {
    height: 3px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
}

.sp-volume-slider::-moz-range-track {
    height: 3px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    border: 0;
}

/* ---- Speed menu ---- */
.sp-speed-wrap {
    position: relative;
    flex-shrink: 0;
}

.sp-speed-btn {
    font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    min-width: 40px;
}

.sp-speed-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    right: -8px;
    min-width: 140px;
    background: rgba(18, 18, 18, 0.94);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    z-index: 10;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55),
                0 2px 8px rgba(0, 0, 0, 0.2);
    animation: sp-menu-in 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 4px 0;
}

.sp-speed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    user-select: none;
    font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
}

.sp-speed-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.sp-speed-item.sp-active {
    color: var(--teal, #14b8a6);
    font-weight: 600;
}

.sp-speed-item.sp-active::before {
    content: '\2713';
    font-size: 0.7rem;
    font-weight: 800;
    margin-right: -4px;
}

/* ---- Quality menu ---- */
.sp-quality-wrap {
    position: relative;
    flex-shrink: 0;
}

.sp-quality-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    right: -8px;
    min-width: 160px;
    background: rgba(18, 18, 18, 0.94);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    z-index: 10;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55),
                0 2px 8px rgba(0, 0, 0, 0.2);
    animation: sp-menu-in 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 4px 0;
}

@keyframes sp-menu-in {
    from {
        opacity: 0;
        transform: translateY(4px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sp-quality-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    user-select: none;
    font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
}

.sp-quality-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.sp-quality-item.sp-active {
    color: var(--teal, #14b8a6);
    font-weight: 600;
}

.sp-quality-item.sp-active::before {
    content: '\2713';
    font-size: 0.7rem;
    font-weight: 800;
    margin-right: -4px;
}

/* ---- Buffer health indicator ---- */
.sp-buffer-health {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    flex-shrink: 0;
}

.sp-health-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    transition: background 0.5s ease;
}



/* ---- Spinner overlay ---- */
.sp-spinner-overlay {
    z-index: 6;
    background: rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease;
}

.sp-spinner {
    width: 44px;
    height: 44px;
    border: 2.5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--teal, #14b8a6);
    border-radius: 50%;
    animation: sp-spin 0.7s linear infinite;
}

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

/* ---- Error overlay ---- */
.sp-error-overlay {
    z-index: 7;
    background: rgba(0, 0, 0, 0.88);
    pointer-events: auto;
}

.sp-error-content {
    text-align: center;
    max-width: 300px;
    padding: 20px;
}

.sp-error-icon {
    color: #f87171;
    margin-bottom: 12px;
    opacity: 0.9;
}

.sp-error-icon svg {
    width: 44px;
    height: 44px;
}

.sp-error-msg {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    margin: 0 0 18px;
    line-height: 1.5;
    font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
}

.sp-retry-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: auto !important;
    height: auto !important;
    padding: 10px 28px !important;
    background: var(--teal, #14b8a6) !important;
    color: #fff;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    transition: background 0.18s ease, transform 0.12s ease,
                box-shadow 0.18s ease;
    box-shadow: 0 2px 12px rgba(20, 184, 166, 0.3);
}

.sp-retry-btn svg {
    width: 16px;
    height: 16px;
}

.sp-retry-btn:hover {
    background: var(--teal-dark, #0d9488) !important;
    color: #fff;
    box-shadow: 0 4px 18px rgba(20, 184, 166, 0.4);
    transform: translateY(-1px);
}

.sp-retry-btn:active {
    transform: translateY(0) scale(0.97);
}

/* ---- Live badge ---- */
.sp-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ef4444;
    color: #fff;
    padding: 3px 10px 3px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
    user-select: none;
    box-shadow: 0 1px 6px rgba(239, 68, 68, 0.35);
}

.sp-live-badge[hidden] {
    display: none;
}

.sp-live-dot {
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
    animation: sp-pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes sp-pulse {
    0%, 100% { opacity: 0.5; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* ---- PiP button ---- */
.sp-pip-btn[hidden] {
    display: none;
}

/* ---- Iframe container ---- */
.sp-iframe-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.sp-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---- Token player page ---- */
.token-player .player-stage {
    position: relative;
    overflow: hidden;
}

.token-player .sp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* ---- Fullscreen ---- */
.player-card:fullscreen .player-stage,
.player-card:-webkit-full-screen .player-stage {
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto !important;
}

.player-card:fullscreen .player-stage video,
.player-card:-webkit-full-screen .player-stage video {
    object-fit: contain;
}

/* ---- Responsive — Mobile ---- */
@media (max-width: 640px) {
    .sp-volume-slider {
        display: none;
    }

    .sp-btn {
        width: 36px;
        height: 36px;
    }

    .sp-btn svg {
        width: 20px;
        height: 20px;
    }

    .sp-controls {
        padding: 0 10px 8px;
        gap: 1px;
    }

    .sp-buttons-row {
        gap: 1px;
    }

    .sp-time {
        font-size: 0.72rem;
    }

    .sp-play-lg {
        width: 56px !important;
        height: 56px !important;
    }

    .sp-play-lg svg {
        width: 26px;
        height: 26px;
    }

    .sp-quality-menu,
    .sp-speed-menu {
        min-width: 130px;
        right: -4px;
    }

    .sp-quality-item,
    .sp-speed-item {
        padding: 10px 14px;
    }

    .sp-seek-progress::after {
        width: 14px;
        height: 14px;
        right: -7px;
        transform: translateY(-50%) scale(1);
    }

    .sp-skip-btn {
        display: none;
    }

    .sp-top-bar {
        padding: 10px 14px 20px;
    }

    .sp-title {
        font-size: 0.82rem;
    }
}

@media (max-width: 400px) {
    .sp-time {
        display: none;
    }

    .sp-speed-btn {
        display: none;
    }
}

/* Disable mobile tap highlight */
.player-card,
.player-stage,
.player-stage *,
.sp-mini-progress,
.sp-controls,
.sp-btn {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

/* ---- Mini live badge (visible when controls hidden) ---- */
.sp-mini-live-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 6;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ef4444;
    color: #fff;
    padding: 3px 10px 3px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
    user-select: none;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sp-controls-hidden .sp-mini-live-badge {
    opacity: 1;
}

.sp-controls-visible .sp-mini-live-badge {
    opacity: 0;
}

