/*
 * BRITEON web player screens.
 *   Non-content screens (idle / download / offline / registered / corner) = 09-24 approved common frame, Tizen 1.4.4 PU.
 *   Maintenance panel, confirm, toast, close button = Android dialog_management / AlertDialog / Toast / btnClose
 *   (already common with Tizen - light mnt_* tokens). Comparison table: players/web/docs/UI_PARITY.md
 */
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #000; color: #fff; }
body { font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
#stage { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; }

/* ---- content frames (activity_main fcv + fragment_html WebView, double buffer like Tizen) ---- */
.layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; opacity: 0; z-index: 1; background: #000; }
.layer.active { opacity: 1; z-index: 2; }
/* graphic renderMode A / standby: separate sandboxed frame above the engine (HtmlFragment overlay WebView) */
.ovl { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 3; overflow: hidden; pointer-events: none; }
.ovf { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; background: transparent; pointer-events: none; }

/* ---- 09-24 approved common frame (dark, Q1 A) - same values as Tizen 1.4.4 js/playerui.js (PU) ----
 * Boards: idle (편성 없음) / first download / offline (NET-001) / registered. Corner: offline · back · download.
 * A 1920x1080 (or 1080x1920) board is scaled to the window by Screens.fit(); below scale .45 the compact board. */
.pu-layer { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; background: #0a1430; color: #f4f6fa;
            font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif; word-break: keep-all;
            -webkit-font-smoothing: antialiased; }
.pu-layer.idle { z-index: 4; } .pu-layer.offline { z-index: 5; } .pu-layer.regfail { z-index: 5; } .pu-layer.dl { z-index: 6; }
.pu-layer.done { z-index: 8; opacity: 0; -webkit-transition: opacity .35s ease; transition: opacity .35s ease; }
.pu-layer.done.on { opacity: 1; }
.pu-layer *, .pu-corner * { margin: 0; padding: 0; box-sizing: border-box; }
.pu-board { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; -webkit-transform-origin: 0 0; transform-origin: 0 0; }
.pu-board.portrait { width: 1080px; height: 1920px; }
.pu-num { font-variant-numeric: tabular-nums; }
.pu-top { position: absolute; left: 96px; top: 72px; height: 56px; }
.pu-top img { display: block; height: 56px; width: auto; }
.pu-board.portrait .pu-top { left: 80px; top: 88px; }
.pu-state { position: absolute; right: 96px; top: 84px; font-size: 26px; font-weight: 600; line-height: 32px; color: #b4bfd6; white-space: nowrap; }
.pu-board.portrait .pu-state { right: 80px; top: 100px; }
.pu-state i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 12px; vertical-align: 2px; background: #7d8aa8; }
.pu-state.ok i { background: #3ecf8e; } .pu-state.warn i { background: #f5a524; } .pu-state.bad i { background: #ff6b85; }
.pu-state.live i { background: #3ecf8e; -webkit-animation: pu-blink 2s ease-in-out infinite; animation: pu-blink 2s ease-in-out infinite; }
@-webkit-keyframes pu-blink { 50% { opacity: .3; } } @keyframes pu-blink { 50% { opacity: .3; } }
.pu-main { position: absolute; left: 160px; top: 200px; bottom: 200px; width: 1240px; display: -webkit-box; display: -webkit-flex; display: flex;
           -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column; -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center; }
.pu-board.portrait .pu-main { left: 80px; right: 80px; width: auto; top: 240px; bottom: 240px; }
.pu-label { font-size: 28px; font-weight: 700; line-height: 36px; color: #6ea2ff; margin-bottom: 24px; }
.pu-label.ok { color: #3ecf8e; } .pu-label.warn { color: #f5a524; } .pu-label.bad { color: #ff6b85; }
.pu-h { font-size: 72px; font-weight: 800; line-height: 1.2; letter-spacing: -1.5px; }
.pu-board.portrait .pu-h { font-size: 64px; }
.pu-p { margin-top: 28px; font-size: 36px; font-weight: 500; line-height: 1.5; color: #b4bfd6; }
.pu-facts { margin-top: 56px; width: 880px; border-top: 2px solid #22356b; padding-top: 12px; }
.pu-board.portrait .pu-facts { width: 100%; }
.pu-facts .row { display: -webkit-box; display: -webkit-flex; display: flex; padding: 14px 0; font-size: 28px; line-height: 40px; }
.pu-facts .k { width: 240px; -webkit-flex-shrink: 0; flex-shrink: 0; color: #7d8aa8; font-weight: 500; }
.pu-facts .v { color: #f4f6fa; font-weight: 600; }
.pu-bar { margin-top: 64px; width: 880px; height: 12px; border-radius: 6px; background: #1a2a57; overflow: hidden; }
.pu-board.portrait .pu-bar { width: 100%; }
.pu-bar i { display: block; height: 100%; width: 100%; background: #2979ff; -webkit-transform: scaleX(0); transform: scaleX(0); -webkit-transform-origin: 0 50%; transform-origin: 0 50%; -webkit-transition: -webkit-transform .25s ease; transition: transform .25s ease; }
.pu-bar-meta { position: relative; width: 880px; height: 40px; margin-top: 20px; font-size: 28px; font-weight: 600; color: #b4bfd6; }
.pu-board.portrait .pu-bar-meta { width: 100%; }
.pu-bar-meta .r { position: absolute; right: 0; top: 0; color: #f4f6fa; }
.pu-clock { font-size: 220px; font-weight: 700; line-height: 1; letter-spacing: -6px; }
.pu-board.portrait .pu-clock { font-size: 200px; }
.pu-date { margin-top: 24px; font-size: 40px; font-weight: 600; color: #b4bfd6; }
.pu-note { margin-top: 72px; padding-top: 32px; border-top: 2px solid #22356b; width: 880px; font-size: 30px; line-height: 1.5; color: #7d8aa8; }
.pu-board.portrait .pu-note { width: 100%; }
.pu-note b { color: #b4bfd6; font-weight: 600; }
.pu-drift { -webkit-animation: pu-drift 600s ease-in-out infinite alternate; animation: pu-drift 600s ease-in-out infinite alternate; }
@-webkit-keyframes pu-drift { from { -webkit-transform: translate(0, 0); } to { -webkit-transform: translate(40px, -24px); } }
@keyframes pu-drift { from { transform: translate(0, 0); } to { transform: translate(40px, -24px); } }
.pu-foot { position: absolute; left: 96px; right: 96px; bottom: 64px; padding-top: 24px; padding-right: 320px; border-top: 2px solid #22356b;
           font-size: 24px; font-weight: 600; line-height: 32px; color: #7d8aa8; white-space: nowrap; overflow: hidden; }
.pu-board.portrait .pu-foot { left: 80px; right: 80px; bottom: 80px; }
.pu-foot b { color: #b4bfd6; font-weight: 600; margin-right: 28px; }
.pu-foot .r { position: absolute; right: 0; top: 24px; }
.pu-foot .key { display: inline-block; margin-right: 12px; padding: 0 12px; border: 2px solid #22356b; border-radius: 8px; line-height: 28px; color: #b4bfd6; font-weight: 700; }
/* in-play corner (never covers content): bottom-right, scaled */
.pu-corner { position: absolute; right: 0; bottom: 0; z-index: 7; -webkit-transform-origin: 100% 100%; transform-origin: 100% 100%;
             font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif; }
.pu-corner .in { margin: 0 48px 48px 0; height: 72px; line-height: 68px; padding: 0 32px 0 28px; border-radius: 12px; background: #0a1430;
                 border: 2px solid #22356b; color: #f4f6fa; font-size: 26px; font-weight: 600; white-space: nowrap; }
.pu-corner.dl .in { margin-bottom: 136px; }   /* one row above the connection corner (Tizen dl-circle) */
.pu-corner i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 14px; vertical-align: 2px; background: #f5a524; }
.pu-corner.ok i { background: #3ecf8e; }
.pu-corner b { font-weight: 600; }
.pu-corner span { color: #b4bfd6; font-weight: 500; margin-left: 16px; }
/* low-res minimal board (Q5): scale < .45 -> small canvas, logo + one sentence */
.pu-board.compact .pu-top { left: 24px; top: 20px; height: 28px; } .pu-board.compact .pu-top img { height: 28px; }
.pu-board.compact .pu-state, .pu-board.compact .pu-label, .pu-board.compact .pu-p, .pu-board.compact .pu-facts,
.pu-board.compact .pu-foot, .pu-board.compact .pu-date, .pu-board.compact .pu-bar-meta { display: none; }
.pu-board.compact .pu-main { left: 24px; right: 24px; width: auto; top: 64px; bottom: 24px; }
.pu-board.compact .pu-h { font-size: 28px; letter-spacing: -0.5px; }
.pu-board.compact .pu-clock { font-size: 96px; letter-spacing: -2px; }
.pu-board.compact .pu-note { margin-top: 16px; padding-top: 12px; width: auto; font-size: 22px; }
.pu-board.compact .pu-bar { margin-top: 20px; width: auto; }
.pu-corner.compact .in { margin: 0 12px 12px 0; height: 40px; line-height: 36px; padding: 0 14px; font-size: 18px; }
.pu-corner.compact.dl .in { margin-bottom: 60px; }
.pu-corner.compact span { display: none; }
.pu-board.compact .pu-drift { -webkit-animation-name: pu-drift-c; animation-name: pu-drift-c; }
@-webkit-keyframes pu-drift-c { from { -webkit-transform: translate(0, 0); } to { -webkit-transform: translate(8px, -6px); } }
@keyframes pu-drift-c { from { transform: translate(0, 0); } to { transform: translate(8px, -6px); } }
@media (prefers-reduced-motion: reduce) { .pu-drift, .pu-state.live i { -webkit-animation: none; animation: none; } }

/* ---- close button: activity_main btnClose (64dp, top-right, long-press arms, click exits) ---- */
.btn-close { position: absolute; top: 0; right: 0; width: 64px; height: 64px; padding: 16px; border: 0; margin: 0;
             background: transparent; z-index: 9; outline: none; -webkit-tap-highlight-color: transparent; }
.btn-close svg { width: 24px; height: 24px; display: none; }
.btn-close.armed svg { display: block; }

/* ---- Toast (Android system toast) ---- */
.toast { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 20; max-width: 80%;
         padding: 10px 18px; border-radius: 24px; background: rgba(60, 60, 60, .94); color: #fff; font-size: 14px;
         line-height: 20px; text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }

/* ---- maintenance: dialog_management.xml + values/colors.xml mnt_* + styles.xml Mnt* ---- */
.mnt-dim { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 30; background: rgba(2, 4, 10, .62); }
.mnt { position: absolute; top: 0; right: 0; bottom: 0; width: 640px; max-width: 92%; box-sizing: border-box;
       background: #fff; padding: 30px 28px 24px; display: flex; flex-direction: column; color: #111827;
       animation: mnt-in .22s ease-out; }
@keyframes mnt-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.mnt h1 { margin: 0 0 22px; font-size: 24px; font-weight: bold; letter-spacing: -.02em; color: #111827; }
.mnt-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.mnt-box { border: 1px solid #e0e5f0; border-radius: 16px; background: #fff; margin-bottom: 22px; }
.mnt-row { display: flex; align-items: center; padding: 14px 18px; }
.mnt-row + .mnt-row { border-top: 1px solid #eceff5; }
.mnt-key { font-size: 14px; color: #6b7898; white-space: nowrap; }
.mnt-val { flex: 1 1 auto; margin-left: 16px; text-align: right; font-size: 14px; font-weight: bold; color: #111827;
           word-break: break-all; }
.mnt-label { margin: 0 0 8px; font-size: 13px; font-weight: bold; letter-spacing: .03em; color: #9aa3b8; }
.mnt-list { background: #f7f8fb; border: 1px solid #eceff5; border-radius: 12px; padding: 16px; font-size: 13px;
            line-height: 1.5; color: #374151; white-space: pre-wrap; word-break: break-all; }
.mnt-btn { display: block; width: 100%; box-sizing: border-box; margin: 10px 0 0; padding: 16px 0; border: 1px solid #d8dde8;
           border-radius: 12px; background: #fff; color: #374151; font: inherit; font-size: 16px; font-weight: bold;
           text-align: center; cursor: pointer; outline: none; }
.mnt-btn.first { margin-top: 20px; }
.mnt-btn.danger { border-color: rgba(232, 0, 58, .3); color: #e8003a; }
.mnt-btn:focus, .mnt-btn:hover { background: #e7f1ff; }                 /* ripple @color/second */
.mnt-btn.danger:focus, .mnt-btn.danger:hover { background: rgba(232, 0, 58, .2); }
.mnt-foot { margin-top: 16px; font-size: 12px; color: #9aa3b8; text-align: center; }

/* ---- confirm: AlertDialog on Theme.Material3.Dark (colorPrimary #1367F4) ---- */
.confirm-dim { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 40; background: rgba(0, 0, 0, .32);
               display: flex; align-items: center; justify-content: center; }
.confirm { min-width: 280px; max-width: 560px; box-sizing: border-box; padding: 24px 24px 18px; border-radius: 28px;
           background: #2b2930; color: #e6e0e9; }
.confirm h2 { margin: 0 0 16px; font-size: 24px; font-weight: normal; line-height: 32px; }
.confirm p { margin: 0 0 24px; font-size: 14px; line-height: 20px; color: #cac4d0; white-space: pre-line; }
.confirm-actions { text-align: right; }
.confirm-actions button { margin-left: 8px; padding: 10px 12px; border: 0; border-radius: 20px; background: transparent;
                          color: #1367f4; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; outline: none; }
.confirm-actions button:focus, .confirm-actions button:hover { background: rgba(19, 103, 244, .14); }

/* ---- debug log (blue key) ---- */
.debug { position: absolute; right: 0; top: 0; z-index: 50; max-width: 50%; max-height: 100%; overflow: hidden; margin: 0;
         padding: 12px; font: 14px/1.4 monospace; background: rgba(0, 0, 0, .75); color: #9fe; white-space: pre-wrap; }
