/* MoontubeWeb: a familiar theater-mode watch page, with a real remote player. */
:root {
    color-scheme: dark;
    --surface-0: #0f0f0f; --surface-1: #181818; --surface-2: #272727;
    --surface-3: #303030; --surface-4: #444; --surface-glass: #0f0f0f;
    --text-1: #f1f1f1; --text-2: #aaa; --text-3: #888;
    --accent-1: #ff0033; --accent-strong: #ff3355; --accent-deep: #c90026;
    --accent-soft: #ff00331a; --accent-ring: transparent; --on-accent: white;
    --border-1: #ffffff1f; --border-2: #ffffff38;
    --font-ui: Arial, Helvetica, sans-serif; --font-mono: monospace;
    --radius-sm: 6px; --radius-md: 12px; --radius-lg: 12px; --radius-pill: 24px;
    --bg-grid: none; --app-bg: #0f0f0f; --glow-accent: none; --glow-cyan: none;
    --app-card-w: 250px; --app-card-gap: 18px;
}
html, body { background: #0f0f0f; font-family: Arial, Helvetica, sans-serif; }
body::before, body::after { display: none !important; }
body.streaming-active { overflow-y: auto !important; }
#app { min-height: 100vh; max-width: none; margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.app-header, body.streaming-active .app-header {
    display: flex !important; height: 64px; padding: 0 28px; gap: 18px;
    background: #0f0f0f; border: 0; backdrop-filter: none; box-shadow: none;
    position: relative; z-index: 1100;
}
.app-header h1 { display: flex; align-items: center; gap: 5px; white-space: nowrap;
    font: 700 22px/1 Arial, sans-serif; letter-spacing: -1.1px; text-transform: none;
    text-shadow: none; margin: 0; }
.app-header h1 sup { align-self: flex-start; font: 10px/1.5 Arial; letter-spacing: .3px; color: #aaa; margin-left: 2px; }
.mt-brand-icon { display: flex; width: 34px; height: 24px; background: #ff0033; border-radius: 7px; align-items: center; justify-content: center; margin-right: 2px; }
.mt-brand-icon svg { width: 22px; height: 22px; color: white; }
.mt-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%; color: #f1f1f1; background: transparent; padding: 8px; flex-shrink: 0; }
.mt-icon-button:hover { background: #ffffff22; }
.mt-icon-button:focus-visible, .mt-pill:focus-visible { outline: 2px solid #3ea6ff; outline-offset: 2px; }
.mt-search { display: flex; width: min(42vw, 640px); margin: 0 auto; height: 40px; }
.mt-search input { min-width: 0; flex: 1; background: #121212; border: 1px solid #303030; border-radius: 24px 0 0 24px; padding: 0 20px; color: white; outline: none; font-size: 16px; }
.mt-search input:focus { border-color: #1c62b9; }
.mt-search button { width: 64px; border: 1px solid #303030; background: #222; border-radius: 0 24px 24px 0; color: white; }
.header-actions { gap: 10px; margin: 0; }
.header-actions .btn-icon { border: 0; background: transparent; border-radius: 50%; }
.header-btn-label, #btn-bmc, .app-header .version { display: none !important; }
.app-header #instance-menu { max-width: 130px; font-size: 14px; }
#mt-navigation { position: absolute; top: 64px; left: 12px; z-index: 1200; width: 220px; background: #212121; border-radius: 12px; padding: 12px; box-shadow: 0 8px 30px #0008; }
#mt-navigation a { display: block; padding: 14px; color: #f1f1f1; text-decoration: none; border-radius: 8px; }
#mt-navigation a:hover { background: #333; }
#mt-idle-stage { height: min(68vh, 720px); min-height: 320px; background: #000; position: relative; display: grid; place-items: center; }
.mt-idle-center { text-align: center; padding: 32px; }
.mt-large-play { margin: 0 auto 24px; width: 72px; height: 50px; border-radius: 14px; background: #252525; color: #aaa; display: grid; place-items: center; }
.mt-large-play svg { width: 40px; height: 40px; }
.mt-idle-center h2 { font: 500 24px/1.3 Arial; text-transform: none; letter-spacing: 0; }
.mt-idle-center p { font-size: 15px; color: #aaa; margin: 12px 0 24px; }
.mt-connect { border: 0; border-radius: 22px; background: #f1f1f1; color: #0f0f0f; padding: 12px 20px; font-weight: 600; font-size: 14px; }
.mt-idle-controls { position: absolute; bottom: 0; left: 20px; right: 20px; height: 48px; border-top: 3px solid #454545; display: flex; gap: 22px; align-items: center; color: #aaa; }
.mt-idle-controls > span:first-child { display: flex; gap: 24px; }
.mt-idle-live { font-size: 13px; font-weight: 700; }
.mt-control-spacer { flex: 1; }
#mt-watch-meta { max-width: 1500px; width: calc(100% - 96px); margin: 22px auto 28px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; }
#mt-watch-title { font: 700 21px/1.4 Arial, sans-serif; text-transform: none; letter-spacing: 0; margin: 0 0 14px; color: #f1f1f1; }
.mt-channel-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.mt-avatar { border-radius: 50%; width: 42px; height: 42px; display: grid; place-items: center; background: #5e35b1; font-size: 22px; flex-shrink: 0; }
.mt-channel-copy { display: grid; gap: 4px; min-width: 90px; }
.mt-channel-copy strong { font-size: 16px; }
.mt-channel-copy span { font-size: 12px; color: #aaa; }
.mt-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 24px; color: #f1f1f1; background: #272727; font-size: 14px; font-weight: 600; white-space: nowrap; }
.mt-subscribe { background: #f1f1f1; color: #0f0f0f; margin-left: 12px; }
.mt-description { background: #272727; border-radius: 12px; padding: 14px; color: #f1f1f1; font-size: 14px; line-height: 1.55; }
.mt-description p { margin: 4px 0 10px; }
.mt-description summary { cursor: pointer; font-weight: 600; }
.mt-up-next { display: flex; align-self: start; gap: 12px; padding-top: 4px; }
.mt-mini-art { width: 130px; height: 78px; border-radius: 10px; background: linear-gradient(135deg, #292929, #424242); display: grid; place-items: center; flex-shrink: 0; color: #ddd; }
.mt-up-next strong { font-size: 15px; }
.mt-up-next p { font-size: 13px; color: #aaa; line-height: 1.4; margin: 5px 0; }
.mt-browse { padding: 0; border: 0; background: transparent; color: #3ea6ff; font-size: 14px; }
#main-content { max-width: 1500px; width: calc(100% - 96px); margin: 0 auto; padding: 0 0 32px; }
.app-footer { font-size: 12px; border: 0; background: transparent; color: #717171; }
.btn, .host-box, .host-card, .app-card, .app-card-image { clip-path: none !important; filter: none !important; box-shadow: none; }
.host-box { background: transparent; border: 0; }
.app-card { border: 0 !important; background: transparent !important; }
.app-card-image { aspect-ratio: 16/9; height: auto !important; border-radius: 12px; background: #272727; overflow: hidden; }
.app-card-image img { object-fit: cover; }
.app-card-name { font-size: 16px; text-transform: none; font-weight: 600; letter-spacing: 0; padding: 10px 0; }
body.streaming-active #mt-idle-stage { display: none; }
body.streaming-active #main-content { display: none !important; }
body.streaming-active .stream-overlay {
    position: relative; inset: auto; height: min(72vh, 800px) !important; min-height: 300px;
    width: 100%; z-index: 1000; background: black; background-image: none;
    flex-direction: column; margin: 0;
}
.stream-overlay .stream-canvas-area { order: 0; min-height: 0; background: black; }
.stream-overlay .stream-header { order: 1; padding: 0 18px; height: 48px; background: #080808; border: 0; }
.stream-brand { display: none !important; }
.mt-player-controls { display: flex; align-items: center; gap: 12px; position: relative; width: 100%; height: 48px; }
.mt-live-line { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: #ff0033; }
.mt-live-line span { position: absolute; right: 0; width: 10px; height: 10px; border-radius: 50%; background: #ff0033; transform: translateY(-3px); }
.mt-live-label { font-size: 13px; font-weight: 600; }
.mt-live-label::before { content: ''; display: inline-block; width: 8px; height: 8px; background: #ff0033; border-radius: 50%; margin-right: 7px; }
.stream-quit-btn { border: 0 !important; background: #272727 !important; color: white !important; text-transform: none; border-radius: 20px; padding: 7px 14px; font: 600 13px Arial; }
.stream-overlay:fullscreen, :fullscreen .stream-overlay, body.streaming-active .stream-overlay.stream-css-fs { position: fixed; inset: 0; height: 100vh !important; min-height: 0; z-index: 3000; }
:fullscreen .app-header, :fullscreen #mt-watch-meta { display: none !important; }
@media (max-width: 1000px) {
    #mt-watch-meta { grid-template-columns: 1fr; width: calc(100% - 48px); }
    .mt-up-next { display: none; }
    #main-content { width: calc(100% - 48px); }
    .app-header #instance-menu { display: none; }
    .mt-search { width: auto; flex: 1; }
}
@media (max-width: 600px) {
    .app-header, body.streaming-active .app-header { padding: 0 12px; gap: 8px; height: 56px; }
    .app-header h1 { font-size: 18px; }
    .app-header h1 sup, .mt-search, .app-header > .mt-icon-button { display: none; }
    .header-actions { margin-left: auto; }
    #mt-idle-stage { min-height: 240px; height: 48vh; }
    body.streaming-active .stream-overlay { height: 55vh !important; min-height: 240px; }
    #mt-watch-meta, #main-content { width: calc(100% - 28px); }
    #mt-watch-title { font-size: 19px; }
    .mt-channel-row { flex-wrap: wrap; gap: 10px; }
    .mt-subscribe { margin-left: auto; }
    .mt-share { display: none; }
    .mt-player-controls { gap: 4px; }
}
