.player2-live-shell {
    --p2-bg1: #08111c;
    --p2-bg2: #12273b;
    --p2-bg3: #050910;
    --p2-hud: rgba(8, 14, 22, 0.62);
    --p2-panel: rgba(9, 16, 25, 0.84);
    --p2-line: rgba(255, 255, 255, 0.09);
    --p2-text: #f5f8fc;
    --p2-muted: #9eb2c7;
    --p2-accent: #d9f5ff;
    --p2-shell-border: rgba(255, 255, 255, 0.045);
    --p2-card-bg: rgba(255, 255, 255, 0.03);
    --p2-card-active: rgba(160, 234, 255, 0.13);
    --p2-card-active-border: rgba(160, 234, 255, 0.16);
    --p2-control-bg: rgba(255, 255, 255, 0.06);
    --p2-control-border: rgba(255, 255, 255, 0.05);
    --p2-popup-bg: rgba(10, 18, 28, 0.94);
    --p2-overlay-top: rgba(0, 0, 0, 0.42);
    --p2-overlay-bottom: rgba(0, 0, 0, 0.82);
    --p2-hover-bg: rgba(255, 255, 255, 0.1);
    --p2-hover-border: rgba(255, 255, 255, 0.18);
    --p2-elevated-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
    width: 100%;
}

html[data-theme="light"] .player2-live-shell,
html[data-theme="light_japan"] .player2-live-shell {
    --p2-bg1: #eef4fb;
    --p2-bg2: #dce8f4;
    --p2-bg3: #cadced;
    --p2-hud: rgba(255, 255, 255, 0.78);
    --p2-panel: rgba(245, 249, 253, 0.9);
    --p2-line: rgba(21, 43, 66, 0.12);
    --p2-text: #132436;
    --p2-muted: #58708a;
    --p2-accent: #1f6b4e;
    --p2-shell-border: rgba(21, 43, 66, 0.08);
    --p2-card-bg: rgba(255, 255, 255, 0.64);
    --p2-card-active: rgba(31, 107, 78, 0.14);
    --p2-card-active-border: rgba(31, 107, 78, 0.26);
    --p2-control-bg: rgba(255, 255, 255, 0.68);
    --p2-control-border: rgba(21, 43, 66, 0.09);
    --p2-popup-bg: rgba(247, 250, 253, 0.95);
    --p2-hover-bg: rgba(31, 107, 78, 0.08);
    --p2-hover-border: rgba(31, 107, 78, 0.22);
    --p2-elevated-shadow: 0 18px 40px rgba(83, 112, 140, 0.18);
}

.player2-live-shell * {
    box-sizing: border-box;
}

.player2-live-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 32px;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 50% 0%, rgba(210, 246, 255, 0.12), transparent 28%),
        linear-gradient(160deg, rgba(13, 24, 36, 0.96), rgba(5, 9, 15, 0.9));
    box-shadow:
        0 36px 110px rgba(0, 0, 0, 0.44),
        0 12px 34px rgba(0, 0, 0, 0.18),
        0 0 90px rgba(136, 215, 255, 0.04);
    color: var(--p2-text);
}

.player2-live-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, var(--p2-overlay-top), transparent 22%, transparent 66%, var(--p2-overlay-bottom)),
        radial-gradient(circle at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.1) 100%);
}

.player2-live-stage.theater {
    border-radius: 24px;
}

.player2-live-stage.panel-open .player2-live-rail {
    left: 16px;
    right: 340px;
    width: auto;
    transform: none;
}

.player2-live-fallback-media,
.player2-live-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.player2-live-fallback-media {
    z-index: 0;
    background-color: #060a11;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    filter: saturate(0.95) blur(0);
    transform: scale(1.03);
    transition: opacity 0.28s ease;
}

.player2-live-shell.is-ready .player2-live-fallback-media {
    opacity: 0;
}

.player2-live-video {
    z-index: 0;
    object-fit: cover;
    background: #000;
}

.player2-live-shell .glass,
.player2-live-rail,
.player2-live-panel,
.player2-live-settings,
.player2-live-play,
.player2-live-toast,
.player2-live-loading {
    position: absolute;
    z-index: 3;
    transition:
        opacity 0.34s cubic-bezier(0.2, 0.9, 0.22, 1),
        transform 0.34s cubic-bezier(0.2, 0.9, 0.22, 1),
        left 0.34s cubic-bezier(0.2, 0.9, 0.22, 1),
        right 0.34s cubic-bezier(0.2, 0.9, 0.22, 1);
}

.player2-live-shell .glass {
    background: var(--p2-hud);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--p2-elevated-shadow);
}

.player2-live-top {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.player2-live-title {
    max-width: min(34vw, 420px);
    padding: 8px 12px 10px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.035);
}

.player2-live-title small {
    display: block;
    color: var(--p2-muted);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.player2-live-title strong {
    display: block;
    font-size: 15px;
    line-height: 1.14;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player2-live-title span {
    display: block;
    margin-top: 4px;
    color: var(--p2-muted);
    font-size: 10px;
    line-height: 1.35;
}

.player2-live-pill {
    min-height: 38px;
    margin-left: auto;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: inline-flex;
    align-items: center;
    color: var(--p2-accent);
    font-size: 12px;
    white-space: nowrap;
}

.player2-live-play {
    inset: 0;
    margin: auto;
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--p2-shell-border);
    background: var(--p2-control-bg);
    color: var(--p2-text);
    font-size: 34px;
    cursor: pointer;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
}

.player2-live-play.hidden {
    opacity: 0;
    transform: scale(0.94);
    pointer-events: none;
}

.player2-live-rail {
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: min(980px, calc(100% - 70px));
    padding: 11px 14px 13px;
    border-radius: 26px;
    border: 1px solid var(--p2-shell-border);
    display: grid;
    gap: 10px;
}

.player2-live-time-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}

.player2-live-time,
.player2-live-volume-label {
    font-size: 12px;
    color: var(--p2-muted);
    font-variant-numeric: tabular-nums;
}

.player2-live-progress {
    position: relative;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--p2-line);
    cursor: pointer;
}

.player2-live-progress b,
.player2-live-progress i {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
}

.player2-live-progress b {
    width: 0;
    background: rgba(255, 255, 255, 0.16);
}

.player2-live-progress i {
    width: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), var(--p2-accent));
}

.player2-live-progress span {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.player2-live-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.player2-live-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.player2-live-cluster--center {
    justify-content: center;
}

.player2-live-cluster--right {
    justify-content: flex-end;
}

.player2-live-btn,
.player2-live-capsule {
    min-height: 38px;
    border-radius: 999px;
    border: 1px solid var(--p2-control-border);
    background: var(--p2-control-bg);
    color: var(--p2-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.player2-live-btn {
    min-width: 38px;
    padding: 0 11px;
    font-size: 13px;
}

.player2-live-btn:hover,
.player2-live-capsule:hover,
.player2-live-tab:hover,
.player2-live-card:hover,
.player2-live-season-chip:hover,
.player2-live-menu-item:hover,
.player2-live-menu-back:hover {
    border-color: var(--p2-hover-border);
    background: var(--p2-hover-bg);
}

.player2-live-btn.active,
.player2-live-tab.active,
.player2-live-card.active,
.player2-live-season-chip.active,
.player2-live-menu-item.selected {
    color: var(--p2-accent);
    background: var(--p2-card-active);
    border-color: var(--p2-card-active-border);
}

.player2-live-capsule {
    padding: 0 12px;
    gap: 10px;
    min-width: 0;
}

.player2-live-comp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 380px;
    overflow: hidden;
}

.player2-live-comp strong {
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player2-live-comp span {
    color: var(--p2-muted);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player2-live-comp span:empty {
    display: none;
}

.player2-live-volume {
    width: 88px;
    accent-color: var(--p2-accent);
}

.player2-live-panel {
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: 308px;
    border-radius: 26px;
    background: var(--p2-panel);
    border: 1px solid var(--p2-shell-border);
    display: flex;
    flex-direction: column;
    padding: 16px;
    box-shadow: var(--p2-elevated-shadow);
}

.player2-live-panel.hidden {
    opacity: 0;
    transform: translateX(108%);
    pointer-events: none;
}

.player2-live-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.player2-live-panel-head h2,
.player2-live-timecodes-head h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.15;
}

.player2-live-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.player2-live-tab {
    min-height: 32px;
    padding: 0 11px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--p2-control-border);
    background: var(--p2-control-bg);
    color: var(--p2-muted);
    font-size: 12px;
    cursor: pointer;
}

.player2-live-panel-body,
.player2-live-timecodes-body {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 8px;
    padding-right: 4px;
}

.player2-live-panel-body::-webkit-scrollbar,
.player2-live-timecodes-body::-webkit-scrollbar {
    width: 6px;
}

.player2-live-panel-body::-webkit-scrollbar-thumb,
.player2-live-timecodes-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}

.player2-live-card {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid var(--p2-control-border);
    background: var(--p2-card-bg);
    cursor: pointer;
}

.player2-live-card strong {
    font-size: 13px;
    line-height: 1.3;
}

.player2-live-card span,
.player2-live-card small,
.player2-live-season-label,
.player2-live-menu-title {
    color: var(--p2-muted);
    line-height: 1.35;
    font-size: 11px;
}

.player2-live-season-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.player2-live-season-chip {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--p2-control-border);
    background: var(--p2-card-bg);
    display: inline-flex;
    align-items: center;
    color: var(--p2-muted);
    font-size: 11px;
    cursor: pointer;
}

.player2-live-season-label {
    padding: 2px 2px 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.player2-live-settings {
    bottom: 106px;
    right: 128px;
    width: 252px;
    border-radius: 20px;
    background: var(--p2-popup-bg);
    border: 1px solid var(--p2-shell-border);
    display: none;
    padding: 10px;
    gap: 7px;
    transform: translateY(8px);
    color: var(--p2-text);
    box-shadow: var(--p2-elevated-shadow);
}

.player2-live-settings.open {
    display: grid;
    transform: translateY(0);
}

.player2-live-menu-title {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 6px 8px;
}

.player2-live-menu-back,
.player2-live-menu-item {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
    border-radius: 13px;
    border: 1px solid var(--p2-control-border);
    background: var(--p2-card-bg);
    cursor: pointer;
    font-size: 13px;
}

.player2-live-menu-item small,
.player2-live-menu-back small {
    color: var(--p2-muted);
    font-size: 11px;
}

.player2-live-timecodes-popup {
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    width: min(500px, calc(100% - 160px));
    max-height: min(68%, 520px);
    padding: 12px;
    border-radius: 22px;
    background: var(--p2-popup-bg);
    border: 1px solid var(--p2-shell-border);
    z-index: 4;
    display: none;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
    box-shadow: var(--p2-elevated-shadow);
}

.player2-live-timecodes-popup.open {
    display: grid;
}

.player2-live-timecodes-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.player2-live-toast {
    left: 18px;
    bottom: 18px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(8, 14, 22, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--p2-muted);
    font-size: 13px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

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

.player2-live-loading {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(8, 14, 22, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--p2-muted);
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
}

.player2-live-loading.show {
    opacity: 1;
}

html[data-theme="light"] .player2-live-shell .player2-live-btn,
html[data-theme="light"] .player2-live-shell .player2-live-capsule,
html[data-theme="light"] .player2-live-shell .player2-live-tab,
html[data-theme="light"] .player2-live-shell .player2-live-card,
html[data-theme="light"] .player2-live-shell .player2-live-season-chip,
html[data-theme="light"] .player2-live-shell .player2-live-menu-item,
html[data-theme="light"] .player2-live-shell .player2-live-menu-back,
html[data-theme="light_japan"] .player2-live-shell .player2-live-btn,
html[data-theme="light_japan"] .player2-live-shell .player2-live-capsule,
html[data-theme="light_japan"] .player2-live-shell .player2-live-tab,
html[data-theme="light_japan"] .player2-live-shell .player2-live-card,
html[data-theme="light_japan"] .player2-live-shell .player2-live-season-chip,
html[data-theme="light_japan"] .player2-live-shell .player2-live-menu-item,
html[data-theme="light_japan"] .player2-live-shell .player2-live-menu-back {
    color: var(--p2-text);
    background: rgba(255, 255, 255, 0.84);
}

html[data-theme="light"] .player2-live-shell .player2-live-toast,
html[data-theme="light"] .player2-live-shell .player2-live-loading,
html[data-theme="light_japan"] .player2-live-shell .player2-live-toast,
html[data-theme="light_japan"] .player2-live-shell .player2-live-loading {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(21, 43, 66, 0.12);
    color: var(--p2-text);
}

html[data-theme="light"] .player2-live-shell .player2-live-progress span,
html[data-theme="light_japan"] .player2-live-shell .player2-live-progress span {
    background: #1f6b4e;
    box-shadow: 0 0 0 4px rgba(31, 107, 78, 0.12);
}

.player2-live-stage.idle .player2-live-top,
.player2-live-stage.idle .player2-live-rail {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

@media (max-width: 980px) {
    .player2-live-stage,
    .player2-live-stage.theater {
        border-radius: 26px;
    }

    .player2-live-top {
        top: 12px;
        left: 12px;
        right: 12px;
    }

    .player2-live-title {
        max-width: calc(100% - 118px);
    }

    .player2-live-rail {
        width: calc(100% - 24px);
        left: 12px;
        right: 12px;
        transform: none;
        bottom: 12px;
    }

    .player2-live-stage.panel-open .player2-live-rail {
        right: 12px;
    }

    .player2-live-panel {
        top: 12px;
        right: 12px;
        bottom: 12px;
        width: min(84vw, 320px);
        border-radius: 24px;
    }

    .player2-live-controls {
        grid-template-columns: 1fr;
    }

    .player2-live-cluster--center,
    .player2-live-cluster--right {
        justify-content: flex-start;
    }

    .player2-live-settings {
        left: 12px !important;
        right: 12px !important;
        width: auto;
        bottom: 92px;
    }

    .player2-live-timecodes-popup {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        top: auto !important;
        bottom: 92px !important;
        transform: none !important;
    }
}

@media (max-width: 640px) {
    .player2-live-stage {
        border-radius: 22px;
    }

    .player2-live-title {
        padding: 8px 12px 10px;
    }

    .player2-live-title strong {
        font-size: 14px;
    }

    .player2-live-pill {
        min-height: 36px;
        padding: 0 12px;
        font-size: 11px;
    }

    .player2-live-play {
        width: 80px;
        height: 80px;
        font-size: 28px;
    }

    .player2-live-rail {
        padding: 10px 12px 12px;
        border-radius: 22px;
    }

    .player2-live-comp {
        max-width: 100%;
    }
}
