:root {
    --ltv-width: 280px;
    --ltv-osd: #9cf59c;
    --ltv-osd-bg: rgba(6, 12, 8, .9);
    --ltv-ticker: #1d3276;
    --ltv-ticker-edge: #0f1d4d;
    --ltv-ticker-label: #f1c232;
    --ltv-accent: #b3402a;
    --ltv-remote: #2c2722;
    --ltv-remote-edge: #16130f;
    --ltv-key: #efe6d2;
    --ltv-key-low: #d8ccb1;
    --ltv-key-press: #c7b894;
    --ltv-key-edge: #6f5a3c;
    --ltv-ink: #3a3327;
    --ltv-ink-soft: #8a7d66;
    --ltv-font: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}

.ltv, .ltv * {
    box-sizing: border-box;
}

.ltv {
    position: fixed;
    right: 10px;
    bottom: 10px;
    width: var(--ltv-width);
    font-family: var(--ltv-font);
    color: var(--ltv-ink);
    z-index: 9999;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .35s ease, transform .35s ease;
}

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

.ltv button {
    font: inherit;
    cursor: pointer;
}

.ltv-set {
    position: relative;
}

.ltv-set::before {
    content: "";
    position: absolute;
    left: 8%;
    right: 10%;
    top: 90.5%;
    height: 11%;
    background:
        radial-gradient(ellipse 4% 16% at 14.5% 31%, rgba(0, 0, 0, .42) 0%, transparent 100%),
        radial-gradient(ellipse 4% 16% at 85.9% 31%, rgba(0, 0, 0, .42) 0%, transparent 100%),
        radial-gradient(ellipse 5% 18% at 6.7% 84.5%, rgba(0, 0, 0, .48) 0%, transparent 100%),
        radial-gradient(ellipse 5% 18% at 94.9% 84.5%, rgba(0, 0, 0, .48) 0%, transparent 100%),
        radial-gradient(ellipse 52% 60% at 50% 58%, rgba(0, 0, 0, .26) 0%, rgba(0, 0, 0, .12) 55%, transparent 100%);
    filter: blur(1.5px);
    pointer-events: none;
}

.ltv-tv {
    position: relative;
    width: 100%;
    aspect-ratio: 520 / 689;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3));
}

.ltv-frame {
    position: absolute;
    inset: 0;
    background: center / 100% 100% no-repeat;
    pointer-events: none;
    z-index: 2;
}

.ltv-frame-on {
    background-image: url("tv-default.webp");
}

.ltv-frame-off {
    background-image: url("tv-turn.webp");
    transition: opacity .35s ease, visibility 0s;
}

.ltv.playing .ltv-frame-off {
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility 0s linear .35s;
}

.ltv-screen {
    position: absolute;
    left: 14.6%;
    top: 33.4%;
    width: 68.6%;
    height: 37.7%;
    overflow: hidden;
    background: #050706;
    container-type: size;
    z-index: 1;
}

.ltv-screen iframe,
.ltv-screen #youtube-player {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1280px;
    height: 720px;
    transform: translate(-50%, -50%) scale(var(--ltv-video-scale, .195));
    border: 0;
    pointer-events: none;
}

.ltv-static {
    position: absolute;
    inset: -20%;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 120px 120px,
        #1a1a1a;
    transition: opacity .12s ease, visibility 0s linear .12s;
}

.ltv.loading .ltv-static {
    opacity: 1;
    visibility: visible;
    animation: ltv-static .24s steps(4) infinite;
    transition: opacity .08s ease, visibility 0s;
}

.ltv.loading .ltv-frame-off {
    opacity: 0;
    visibility: hidden;
}

@keyframes ltv-static {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-7%, 4%); }
    50% { transform: translate(5%, -6%); }
    75% { transform: translate(-3%, -2%); }
    100% { transform: translate(6%, 5%); }
}

.ltv-scan {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px),
        radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, .5) 100%);
    z-index: 3;
}

.ltv-ticker {
    position: absolute;
    left: 12%;
    right: 14%;
    top: 63.6%;
    display: flex;
    height: 20px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, var(--ltv-ticker) 0%, var(--ltv-ticker-edge) 100%);
    border-top: 1px solid rgba(255, 255, 255, .35);
    border-bottom: 1px solid rgba(0, 0, 0, .4);
}

.ltv-ticker-label {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0 8px 0 7.4%;
    background: var(--ltv-ticker-label);
    color: #1a1a1a;
    font-size: 10px;
    font-weight: 900;
}

.ltv-ticker-window {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.ltv-ticker-text {
    display: block;
    max-width: 100%;
    padding-left: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 19px;
}

.ltv.playing .ltv-ticker-text {
    display: inline-block;
    max-width: none;
    padding-left: 100%;
    overflow: visible;
    animation: ltv-ticker 14s linear infinite;
}

@keyframes ltv-ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

.ltv-screen-hit {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
}

.ltv-screen-hit button {
    padding: 0;
    border: 0;
    background: transparent;
}

.ltv-hit-prev,
.ltv-hit-next {
    flex: 0 0 25%;
}

.ltv-hit-play {
    flex: 1;
}

.ltv-knob {
    position: absolute;
    z-index: 3;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 50%;
    transition: box-shadow .12s ease, background-color .12s ease;
}

.ltv-knob:active {
    background: rgba(0, 0, 0, .18);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .45);
}

@media (hover: hover) and (pointer: fine) {
    .ltv-knob:hover {
        box-shadow: 0 0 0 2px rgba(255, 244, 214, .75);
    }
}

.ltv-knob-prev {
    left: 86.7%;
    top: 33.3%;
    width: 8%;
    height: 5%;
}

.ltv-knob-next {
    left: 86.7%;
    top: 38.3%;
    width: 8%;
    height: 5%;
}

.ltv-knob-play {
    left: 86.6%;
    top: 44.9%;
    width: 8.8%;
    height: 6.1%;
}

.ltv-knob-grille {
    left: 86.5%;
    top: 51.8%;
    width: 8.8%;
    height: 21.2%;
    border-radius: 3px;
}

.ltv-knob-power {
    left: 86.4%;
    top: 73%;
    width: 7.6%;
    height: 2.9%;
    border-radius: 3px;
}

.ltv-dial-mark {
    position: absolute;
    left: 91.01%;
    top: 47.93%;
    width: 2px;
    height: 2%;
    margin-left: -1px;
    background: rgba(40, 32, 22, .75);
    border-radius: 1px;
    transform-origin: 50% 100%;
    transform: translateY(-100%) rotate(-40deg);
    transition: transform .3s ease;
    z-index: 3;
    pointer-events: none;
}

.ltv.playing .ltv-dial-mark {
    transform: translateY(-100%) rotate(40deg);
}

.ltv-talk {
    position: absolute;
    inset: 0 0 auto 0;
    height: 30%;
    z-index: 6;
    pointer-events: none;
}

.ltv-bubble {
    position: absolute;
    padding: 6px 10px 7px;
    background: #fffdf6;
    border: 2px solid #2a241c;
    border-radius: 14px;
    color: #2a241c;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -.02em;
    white-space: nowrap;
    box-shadow: 2px 3px 0 rgba(42, 36, 28, .25);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.ltv-bubble::before {
    content: "";
    position: absolute;
    background: center / 100% 100% no-repeat;
}

.ltv-bubble-shout {
    left: 12%;
    top: 3%;
    font-size: 14px;
    transform-origin: 0 0;
    transform: rotate(-5deg) scale(.6);
}

.ltv-bubble-shout::before {
    left: -21px;
    top: 5px;
    width: 25px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='16' viewBox='0 0 25 16'%3E%3Cpath d='M25 3.5 L21 3.5 Q13 5.5 3 2 Q11 9.5 21 12.5 L25 12.5 Z' fill='%23fffdf6'/%3E%3Cpath d='M21 3.5 Q13 5.5 3 2 Q11 9.5 21 12.5' fill='none' stroke='%232a241c' stroke-width='2' stroke-linejoin='miter' stroke-miterlimit='20' stroke-linecap='butt'/%3E%3C/svg%3E");
}

.ltv-bubble-reply {
    right: 6%;
    top: 34%;
    padding: 5px 9px 6px;
    font-size: 12px;
    font-weight: 700;
    transform-origin: 30% 100%;
    transform: scale(.6);
}

.ltv-bubble-reply::before {
    left: 10px;
    bottom: -18px;
    width: 16px;
    height: 21px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='21' viewBox='0 0 16 21'%3E%3Cpath d='M3.5 0 L3.5 3 Q5.5 11 3 18.5 Q9.5 11 12.5 3 L12.5 0 Z' fill='%23fffdf6'/%3E%3Cpath d='M3.5 3 Q5.5 11 3 18.5 Q9.5 11 12.5 3' fill='none' stroke='%232a241c' stroke-width='2' stroke-linejoin='miter' stroke-miterlimit='20' stroke-linecap='butt'/%3E%3C/svg%3E");
}

.ltv.talk-shout .ltv-bubble-shout {
    opacity: 1;
    visibility: visible;
    transform: rotate(-5deg) scale(1);
    transition: opacity .15s ease, transform .22s cubic-bezier(.3, 1.6, .5, 1), visibility 0s;
}

.ltv.talk-reply .ltv-bubble-reply {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity .15s ease, transform .22s cubic-bezier(.3, 1.6, .5, 1), visibility 0s;
}

.ltv-antenna {
    position: absolute;
    z-index: 3;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 4px;
}

.ltv-antenna-left {
    left: 30%;
    top: 0;
    width: 6.5%;
    height: 27%;
}

.ltv-antenna-right {
    left: 46%;
    top: 6%;
    width: 23%;
    height: 21%;
}

.ltv-antenna:focus-visible {
    outline: 2px solid var(--ltv-ticker-label);
    outline-offset: 1px;
}

.ltv-credit {
    position: absolute;
    left: 36%;
    top: 1%;
    z-index: 7;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 5px 8px 6px;
    background: #fffdf6;
    border: 1.5px solid #2a241c;
    border-radius: 6px;
    box-shadow: 2px 3px 0 rgba(42, 36, 28, .2);
    color: #2a241c;
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}

.ltv.credit-open .ltv-credit {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .15s ease, transform .15s ease, visibility 0s;
}

.ltv-credit-label {
    font-size: 9px;
    font-weight: 700;
    color: #6d6250;
}

.ltv-credit a {
    color: #1d3276;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ltv-remote {
    position: absolute;
    right: calc(100% + 6px);
    bottom: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: 38px 38px;
    grid-template-areas:
        "play play"
        "prev next"
        "vol power"
        "shuffle repeat"
        "list list";
    gap: 5px;
    padding: 9px 7px 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
    background: linear-gradient(90deg, #3a342d 0%, var(--ltv-remote) 100%);
    border: 1px solid var(--ltv-remote-edge);
    border-radius: 14px 14px 12px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 6px 14px rgba(0, 0, 0, .35);
}

.ltv.remote-open .ltv-remote {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: opacity .2s ease, transform .2s ease, visibility 0s;
}

.ltv-remote-row {
    display: contents;
}

.ltv-remote .ltv-power-toggle { grid-area: play; height: 34px; font-size: 15px; }
.ltv-remote #prev-btn { grid-area: prev; }
.ltv-remote #next-btn { grid-area: next; }
.ltv-remote #volume-btn { grid-area: vol; }
.ltv-remote .ltv-stow { grid-area: power; }
.ltv-remote #shuffle-btn { grid-area: shuffle; }
.ltv-remote #repeat-btn { grid-area: repeat; }
.ltv-remote #list-toggle-btn { grid-area: list; }

.ltv-remote-tab {
    position: absolute;
    left: 3%;
    bottom: 0;
    z-index: 3;
    width: 13%;
    aspect-ratio: 120 / 206;
    padding: 0;
    border: 0;
    background: url("clicker.webp") center bottom / 100% 100% no-repeat;
    filter: drop-shadow(1px 3px 3px rgba(0, 0, 0, .35));
    transform-origin: 50% 100%;
    transform: rotate(-4deg);
    transition: transform .15s ease, opacity .15s ease;
}

.ltv-remote-tab:active {
    transform: rotate(-4deg) translateY(2px);
}

@media (hover: hover) and (pointer: fine) {
    .ltv-remote-tab:hover {
        transform: rotate(-1deg) translateY(-3px);
    }
}

.ltv-remote-tab:focus-visible {
    outline: 2px solid var(--ltv-ticker-label);
    outline-offset: 2px;
}

.ltv.remote-open .ltv-remote-tab {
    transform: rotate(-1deg) translateY(-3px);
}


.ltv-remote .control-btn,
.ltv-remote .list-toggle-btn {
    position: relative;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    height: 30px;
    padding: 0 6px;
    background: linear-gradient(180deg, var(--ltv-key) 0%, var(--ltv-key-low) 100%);
    border: 1px solid var(--ltv-key-edge);
    border-radius: 5px;
    color: var(--ltv-ink);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 2px 0 var(--ltv-remote-edge);
    transition: transform .08s ease, box-shadow .08s ease, background .12s ease;
}

.ltv-remote .control-btn {
    padding: 0;
}

.ltv-remote .list-toggle-btn {
    font-size: 12px;
}

.ltv-remote .ltv-power-toggle {
    color: var(--ltv-ink-soft);
    transition: color .15s ease, text-shadow .15s ease;
}

.ltv.playing .ltv-remote .ltv-power-toggle {
    color: var(--ltv-accent);
    text-shadow: 0 0 6px rgba(179, 64, 42, .45);
}

.ltv-remote .control-btn:disabled {
    color: var(--ltv-ink-soft);
    opacity: .55;
    cursor: default;
}

.ltv-remote .control-btn.mode-btn {
    color: var(--ltv-ink-soft);
}

.ltv-remote .control-btn.mode-btn.active,
.ltv-remote .list-toggle-btn.active {
    background: var(--ltv-key-press);
    color: var(--ltv-ink);
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, .3), 0 1px 0 var(--ltv-remote-edge);
    transform: translateY(1px);
}

.ltv-remote .control-btn:active:not(:disabled),
.ltv-remote .list-toggle-btn:active {
    background: var(--ltv-key-press);
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, .3);
    transform: translateY(2px);
}

.ltv-remote .control-btn:focus-visible,
.ltv-remote .list-toggle-btn:focus-visible {
    outline: 2px solid var(--ltv-ticker-label);
    outline-offset: 1px;
}

.ltv .repeat-one-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 8px;
    font-weight: 900;
    color: var(--ltv-accent);
}

.ltv-vol-wrap {
    display: contents;
}

.ltv .volume-popup {
    display: none;
    position: absolute;
    left: 19%;
    top: calc(var(--ltv-width) * 689 / 520 * .55);
    width: 60%;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--ltv-osd-bg);
    border: 1px solid var(--ltv-osd);
    z-index: 10;
}

.ltv .volume-popup.show {
    display: flex;
}

.ltv-vol-label {
    color: var(--ltv-osd);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
}

.ltv .volume-slider {
    flex: 1;
    min-width: 0;
    height: 6px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: repeating-linear-gradient(90deg, var(--ltv-osd) 0 3px, transparent 3px 5px);
    outline: none;
    cursor: pointer;
}

.ltv .volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 9px;
    height: 16px;
    background: #fff;
    border: 1px solid #0b1a0b;
    cursor: pointer;
}

.ltv .volume-slider::-moz-range-thumb {
    width: 9px;
    height: 16px;
    background: #fff;
    border: 1px solid #0b1a0b;
    border-radius: 0;
    cursor: pointer;
}

.ltv .playlist-container {
    position: absolute;
    left: 6px;
    right: 6px;
    top: 6px;
    bottom: 6px;
    z-index: 9;
    flex-direction: column;
    background: var(--ltv-osd-bg);
    border: 1px solid var(--ltv-osd);
    border-radius: 4px;
    color: var(--ltv-osd);
    font-size: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
}

.ltv .playlist-container[style*="block"] {
    display: flex !important;
}

.ltv-schedule-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 5px 5px 9px;
    border-bottom: 1px solid var(--ltv-osd);
    font-weight: 800;
    letter-spacing: .04em;
}

.ltv-schedule-close {
    width: 24px;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 13px;
    line-height: 1;
}

.ltv .playlist {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    list-style: none;
    margin: 0;
    padding: 2px 0;
    counter-reset: ltv-slot;
    scrollbar-width: thin;
    scrollbar-color: var(--ltv-osd) transparent;
}

.ltv .playlist::-webkit-scrollbar { width: 5px; }
.ltv .playlist::-webkit-scrollbar-thumb { background: var(--ltv-osd); border-radius: 3px; }

.ltv .playlist li {
    counter-increment: ltv-slot;
    padding: 6px 9px;
    line-height: 1.35;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ltv .playlist li::before {
    content: counter(ltv-slot, decimal-leading-zero);
    margin-right: 7px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    opacity: .7;
}

.ltv .playlist li.current {
    background: var(--ltv-osd);
    color: #0b1a0b;
    font-weight: 800;
}

.ltv .playlist li.current::before {
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    .ltv .playlist li:not(.current):hover {
        background: rgba(156, 245, 156, .14);
    }
}

.ltv-mini {
    display: none;
    width: 46px;
    aspect-ratio: 120 / 206;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: url("clicker.webp") center bottom / 100% 100% no-repeat;
    filter: drop-shadow(1px 4px 4px rgba(0, 0, 0, .35));
    transform-origin: 50% 100%;
    transform: rotate(-4deg);
    transition: transform .15s ease;
}

.ltv-mini:active {
    transform: rotate(-4deg) translateY(2px);
}

@media (hover: hover) and (pointer: fine) {
    .ltv-mini:hover {
        transform: rotate(-1deg) translateY(-3px);
    }
}

.ltv-mini:focus-visible {
    outline: 2px solid var(--ltv-ticker-label);
    outline-offset: 2px;
}

.ltv.minimized,
.ltv.ltv-mobile {
    width: auto;
}

.ltv.minimized .ltv-mini,
.ltv.ltv-mobile .ltv-mini {
    display: block;
}

.ltv.ltv-mobile .ltv-mini {
    width: 34px;
}

.ltv.ltv-mobile {
    visibility: hidden;
    pointer-events: none;
}

.ltv.ltv-mobile .ltv-screen iframe,
.ltv.ltv-mobile .ltv-screen #youtube-player {
    width: 0 !important;
    height: 0 !important;
}

.ltv.ltv-mobile:not(.playing) .ltv-mini {
    filter: drop-shadow(1px 4px 4px rgba(0, 0, 0, .35)) grayscale(.7) brightness(.9);
}

.ltv.minimized .ltv-set,
.ltv.ltv-mobile .ltv-set {
    position: absolute;
    right: 0;
    bottom: 0;
    width: var(--ltv-width);
    opacity: 0;
    pointer-events: none;
    clip-path: inset(100% 0 0 100%);
}

@media (prefers-reduced-motion: reduce) {
    .ltv,
    .ltv-frame-off,
    .ltv-dial-mark,
    .ltv-bubble {
        transition: none !important;
    }
    .ltv.loading .ltv-static {
        animation: none;
    }
    .ltv.playing .ltv-ticker-text {
        display: block;
        max-width: 100%;
        padding-left: 6px;
        overflow: hidden;
        animation: none;
    }
}
