* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #050505;
    color: #e5e5e5;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    touch-action: pan-x pan-y;
    overscroll-behavior: none;
}

.bg-glow-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.glow-1 {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, rgba(5, 5, 5, 0) 70%);
    top: -20vw;
    right: -10vw;
}

.glow-2 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, rgba(5, 5, 5, 0) 70%);
    bottom: -10vw;
    left: -5vw;
}

#root {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background: #0a0a0a;
    border-right: 1px solid rgba(255, 255, 255, .04);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.sidebar-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.sidebar-brand span {
    font-size: 14px;
    font-weight: 700;
    color: #fafafa;
    letter-spacing: 0.05em;
}

.sidebar-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 12px 0;
    flex-wrap: wrap;
}

.sidebar-tab {
    flex: 1;
    min-width: 70px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #888;
    border-radius: 8px;
    padding: 8px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.sidebar-tab.is-active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.sidebar-nav {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

.storage-view,
#logs-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tx-log-action {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.06);
    color: #ccc;
}

.tx-log-action.is-login { color: #93c5fd; background: rgba(59, 130, 246, 0.12); }
.tx-log-action.is-watch { color: #86efac; background: rgba(34, 197, 94, 0.12); }
.tx-log-action.is-screenshot { color: #fcd34d; background: rgba(234, 179, 8, 0.12); }
.tx-log-action.is-record { color: #fca5a5; background: rgba(239, 68, 68, 0.12); }

.logs-view .tx-table-wrap {
    margin-top: 4px;
}

.storage-view.hidden,
.hidden {
    display: none !important;
}

.tx-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.tx-stat {
    background: #121212;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.tx-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.tx-stat-icon svg {
    width: 18px;
    height: 18px;
}

.tx-stat-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 2px;
}

.tx-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #fafafa;
    letter-spacing: -0.03em;
}

.tx-toolbar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tx-search-wrap {
    flex: 1;
    min-width: 220px;
}

.tx-search-field {
    position: relative;
}

.tx-search {
    width: 100%;
    background: #121212;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 72px 10px 12px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.tx-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-family: inherit;
    color: #777;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 2px 6px;
    pointer-events: none;
}

.tx-search:focus {
    border-color: rgba(255, 255, 255, 0.2);
}

.tx-search-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #666;
}

.tx-select {
    background: #121212;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #ddd;
    padding: 10px 12px;
    font-size: 12px;
    min-width: 160px;
}

.tx-table-wrap {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
    background: #0d0d0d;
}

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

.tx-table th,
.tx-table td {
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
}

.tx-table th {
    color: #888;
    font-weight: 600;
    font-size: 11px;
    text-transform: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    user-select: none;
}

.tx-table th.is-sort::after {
    content: " ↓";
    color: #aaa;
}

.tx-table th.is-sort-asc::after {
    content: " ↑";
}

.tx-table tbody tr {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.tx-table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.015);
}

.tx-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tx-name {
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tx-name-icons {
    display: inline-flex;
    gap: 4px;
    color: #555;
}

.tx-name-icons span,
.tx-ico {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tx-ico svg {
    width: 12px;
    height: 12px;
}

.tx-muted {
    color: #888;
}

.tx-table-captures td {
    vertical-align: middle;
}

.tx-row-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    white-space: nowrap;
}

.tx-row-actions .btn {
    padding: 6px 10px;
    font-size: 11px;
}

.tx-thumb {
    position: relative;
    width: 108px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #111;
    flex-shrink: 0;
}

.tx-thumb img,
.tx-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #111;
}

.tx-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.28);
    pointer-events: none;
    text-shadow: 0 1px 4px #000;
}

.tx-player-head {
    margin: 12px 0 16px;
    color: #aaa;
    font-size: 13px;
    line-height: 1.5;
}

.storage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.storage-card {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.storage-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.storage-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: #111;
    object-fit: cover;
    display: block;
}

.storage-thumb-video {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 12px;
    font-weight: 600;
    background: #111;
    position: relative;
}

.storage-thumb-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.storage-play-mark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    background: rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.storage-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.storage-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.storage-card-meta {
    font-size: 11px;
    color: #777;
    line-height: 1.45;
}

.storage-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.storage-filter-hint {
    font-size: 11px;
    color: #888;
    padding: 0 12px 10px;
    line-height: 1.4;
}

.storage-clear-filter {
    margin: 0 12px 12px;
    width: calc(100% - 24px);
}

.toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 200000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    min-width: 260px;
    max-width: 400px;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f5f5f5;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid #666;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
}

.toast-success {
    border-left-color: #22c55e;
}

.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.shot-flash {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
}

.shot-flash.go {
    animation: shotFlash 0.38s ease-out;
}

@keyframes shotFlash {
    0% { opacity: 0.85; }
    100% { opacity: 0; }
}

.stream-tile.tile-shutter {
    box-shadow: 0 0 0 2px #fff inset;
}

.player-shell {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    width: min(980px, calc(100vw - 32px));
}

.player-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.player-stage {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.player-stage:fullscreen,
.player-stage:-webkit-full-screen {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    border-radius: 0;
    background: #000;
}

.player-stage video,
.player-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: none;
}

.player-stage video.is-on,
.player-stage img.is-on {
    display: block;
}

.player-big-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: none;
    z-index: 3;
}

.player-big-play.is-on {
    display: block;
}

.player-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    font-size: 11px;
    z-index: 4;
}

.player-stage.has-video:hover .player-bar,
.player-stage.has-video .player-bar.is-on {
    display: flex;
}

.player-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 28px;
    height: 28px;
}

.player-bar input[type="range"] {
    accent-color: #fff;
}

#player-seek {
    flex: 1;
}

#player-vol {
    width: 70px;
}

.player-clip-label {
    color: #bbb;
    white-space: nowrap;
}

.record-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 12px;
    color: #aaa;
}

.record-field input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #fff;
    padding: 8px 10px;
    font-size: 13px;
}

.btn-library.is-recording,
.btn-record.is-recording {
    background: rgba(237, 66, 69, 0.25);
    border-color: #ED4245;
    color: #fff;
}

@media (max-width: 900px) {
    .tx-stats {
        grid-template-columns: 1fr 1fr;
    }
}

.nav-label {
    font-size: 10px;
    color: #444;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: 12px 12px 8px;
    font-weight: 700;
}

.search-container {
    padding: 0 12px 16px;
}

.search {
    width: 100%;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #fafafa;
    outline: none;
    transition: all .2s;
}

.search:focus {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, .05);
}

.player-list {
    list-style: none;
}

.player-item {
    padding: 12px 16px;
    margin: 4px 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    background: transparent;
}

.player-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.player-item.is-watching {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
}

.player-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.player-name-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.player-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.record-badge-status {
    color: #ef4444;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.record-badge-spinner {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulseRed 1s infinite;
}

.record-badge-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}

.record-badge-bar {
    width: 0%;
    height: 100%;
    background: #ef4444;
    transition: width linear;
}

@keyframes pulseRed {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

#pip-overlay {
    background: #0a0a0a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8) !important;
    transition: box-shadow 0.2s;
}

#pip-overlay:hover {
    box-shadow: 0 12px 48px rgba(255, 255, 255, 0.05) !important;
}

.pip-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pip-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.pip-close:hover {
    background: #ef4444;
}

.pip-resize {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.2) 50%);
}

.player-id {
    font-size: 10px;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.player-item-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-watch-toggle {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #444;
    transition: all 0.2s;
}

.player-item.is-watching .btn-watch-toggle {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.btn-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, .04);
}

.quality-select {
    width: 100%;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #ccc;
    outline: none;
    cursor: pointer;
}

.quality-select option {
    background: #0a0a0a;
    color: #ccc;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    animation: fadeUp 0.4s ease-out;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #fafafa;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.page-sub {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.status-indicator {
    font-size: 11px;
    color: #888;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: none;
}

.status-indicator.active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.2s ease-out;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-danger {
    background: rgba(237, 66, 69, 0.1);
    color: #ED4245;
    border: 1px solid rgba(237, 66, 69, 0.2);
}

.btn-danger:hover {
    background: #ED4245;
    color: #fff;
}

.streams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    flex: 1;
}

.streams-grid.single-stream {
    grid-template-columns: 1fr;
}

.stream-tile {
    position: relative;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeUp 0.5s ease-out both;
}

.stream-tile-header {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.stream-tile-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    max-height: calc(100vh - 220px);
    overflow: hidden;
    touch-action: none;
}

.stream-tile video {
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 220px);
    aspect-ratio: 16/9;
    background: #000;
    object-fit: contain;
    display: block;
}

.stream-waiting-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: radial-gradient(ellipse at center, #141418 0%, #050506 100%);
    color: #c8c8c8;
    text-align: center;
    padding: 24px;
    pointer-events: none;
}

.stream-waiting-overlay.hidden {
    display: none;
}

.stream-waiting-spinner {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: #7dd3fc;
    border-radius: 50%;
    animation: stream-spin 0.8s linear infinite;
}

.stream-waiting-text {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    color: #d4d4d8;
    max-width: 280px;
}

.stream-waiting-sub {
    font-size: 11px;
    color: #71717a;
    letter-spacing: 0.02em;
}

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

.stream-tile-actions {
    padding: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.02));
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.stream-tile-actions button {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #a0a0a0;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.stream-tile-actions button svg {
    width: 18px;
    height: 18px;
}

.stream-tile-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stream-tile-actions button.btn-stop {
    margin-left: auto;
    width: auto;
    padding: 0 16px;
    background: rgba(237, 66, 69, 0.1);
    border-color: rgba(237, 66, 69, 0.2);
    color: #ED4245;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 8px;
}

.stream-tile-actions button.btn-stop:hover {
    background: #ED4245;
    border-color: #ED4245;
    color: #fff;
}

/* Volume Control Styles */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 36px;
}

.volume-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    flex-shrink: 0;
}

.volume-icon svg {
    width: 14px;
    height: 14px;
}

.volume-control-proximity {
    border-color: rgba(125, 211, 252, 0.15);
}

.volume-control-proximity .volume-icon {
    color: #7dd3fc;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.volume-slider:hover {
    background: rgba(255, 255, 255, 0.2);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* PiP Volume Styles */
.pip-controls {
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

#pip-overlay:hover .pip-controls {
    opacity: 1;
}

.pip-vol {
    flex: 1;
    height: 3px;
}

.pip-close {
    position: static;
    width: 20px;
    height: 20px;
    font-size: 14px;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #333;
    text-align: center;
    gap: 16px;
}

.placeholder-icon {
    width: 64px;
    height: 64px;
    color: #1a1a1a;
}

.placeholder h3 {
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

.placeholder p {
    font-size: 14px;
    max-width: 300px;
    line-height: 1.5;
}

.placeholder.hidden {
    display: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 12px 64px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 255, 255, 0.02);
    animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #fafafa;
    margin-bottom: 12px;
}

.modal-content-text {
    font-size: 14px;
    color: #888;
    line-height: 1.6;
    margin-bottom: 32px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}


.freeze-alert {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    z-index: 15;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Vrai plein écran : la vidéo occupe tout l'écran, barres en overlay */
.stream-tile:fullscreen,
.stream-tile.is-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    border: none;
    background: #000;
}

.stream-tile:fullscreen .stream-tile-header,
.stream-tile.is-fullscreen .stream-tile-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
    border: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.stream-tile:fullscreen .stream-tile-actions,
.stream-tile.is-fullscreen .stream-tile-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    border: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.stream-tile:fullscreen:hover .stream-tile-header,
.stream-tile:fullscreen:hover .stream-tile-actions,
.stream-tile:fullscreen.fs-controls-visible .stream-tile-header,
.stream-tile:fullscreen.fs-controls-visible .stream-tile-actions,
.stream-tile.is-fullscreen:hover .stream-tile-header,
.stream-tile.is-fullscreen:hover .stream-tile-actions,
.stream-tile.is-fullscreen.fs-controls-visible .stream-tile-header,
.stream-tile.is-fullscreen.fs-controls-visible .stream-tile-actions {
    opacity: 1;
    pointer-events: auto;
}

.stream-tile:fullscreen .stream-tile-video-wrap,
.stream-tile.is-fullscreen .stream-tile-video-wrap {
    flex: 1;
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
}

.stream-tile:fullscreen video,
.stream-tile.is-fullscreen video {
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
}

.stream-tile:fullscreen .stream-waiting-overlay,
.stream-tile.is-fullscreen .stream-waiting-overlay {
    inset: 0;
}

.stream-tile:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    border: none;
    background: #000;
}

.stream-tile:-webkit-full-screen .stream-tile-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
    border: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.stream-tile:-webkit-full-screen .stream-tile-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    border: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.stream-tile:-webkit-full-screen:hover .stream-tile-header,
.stream-tile:-webkit-full-screen:hover .stream-tile-actions,
.stream-tile:-webkit-full-screen.fs-controls-visible .stream-tile-header,
.stream-tile:-webkit-full-screen.fs-controls-visible .stream-tile-actions {
    opacity: 1;
    pointer-events: auto;
}

.stream-tile:-webkit-full-screen .stream-tile-video-wrap {
    flex: 1;
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
}

.stream-tile:-webkit-full-screen video {
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
}

@media (hover: none) {
    .stream-tile:fullscreen .stream-tile-header,
    .stream-tile:fullscreen .stream-tile-actions,
    .stream-tile.is-fullscreen .stream-tile-header,
    .stream-tile.is-fullscreen .stream-tile-actions {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 800px) {
    .bg-glow {
        display: none;
    }

    .volume-slider {
        width: 64px;
    }

    .streams-grid {
        grid-template-columns: 1fr;
    }

    .stream-tile-video-wrap,
    .stream-tile video {
        max-height: calc(100vh - 180px);
    }
}
