/* ==========================================================================
   base.css — reset, typography, stage, shared atoms
   --------------------------------------------------------------------------
   Target: Chrome 53 / WebKit 537.36 (LG webOS 4+, Tizen 3+)
   Rules : no var(), no grid, no gap, no clamp(); -webkit- prefixes kept.
   Canvas: everything is laid out on a 1280×720 #stage scaled by app.js.

   Palette
     background      #000
     surface         #141414 / #0d0d0d
     accent (active) #e50914
     rating          #46d369
     text            #fff · secondary rgba(255,255,255,.6)
     hover surface   rgba(255,255,255,.06) · hairline rgba(255,255,255,.12)
   ========================================================================== */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

*, *:before, *:after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    font-family: 'Barlow', 'Arial', sans-serif;
    font-weight: 400;
    color: #fff;
    -webkit-font-smoothing: antialiased;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, p, dl, dt, dd { margin: 0; font-weight: inherit; }
img, svg { display: block; }
b { font-weight: 700; }

/* ---- stage ------------------------------------------------------------- */
#stage {
    position: absolute;
    left: 0;
    top: 0;
    width: 1280px;
    height: 720px;
    overflow: hidden;
    background: #000;
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
}

.view {
    position: absolute;
    left: 0;
    top: 0;
    width: 1280px;
    height: 720px;
    overflow: hidden;
}

/* ---- layers (stacking order) ------------------------------------------- */
#sidebar        { z-index: 20; }
#scrim          { z-index: 15; }
#layer-details  { z-index: 40; }
#layer-player   { z-index: 60; }
#layer-dialog   { z-index: 70; }
#layer-login    { z-index: 80; }
#splash         { z-index: 90; }
#toast          { z-index: 95; }

.layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 1280px;
    height: 720px;
    display: none;
}
.layer.is-open { display: block; }

/* ---- text helpers ------------------------------------------------------ */
.ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ic { -webkit-flex-shrink: 0; flex-shrink: 0; }

/* ---- spinner ----------------------------------------------------------- */
.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
}
.spinner i {
    display: block;
    width: 100%;
    height: 100%;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.14);
    border-top-color: #e50914;
    -webkit-animation: spin 0.8s linear infinite;
    animation: spin 0.8s linear infinite;
}
.spinner--sm { width: 18px; height: 18px; margin: 0 10px 0 0; }
.spinner--sm i { border-width: 2px; border-top-color: #fff; }
.spinner--lg { width: 64px; height: 64px; }
.spinner--lg i { border-width: 4px; }

/* ---- splash ------------------------------------------------------------ */
#splash {
    position: absolute;
    left: 0;
    top: 0;
    width: 1280px;
    height: 720px;
    background: #000;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-transition: opacity 0.4s ease;
    transition: opacity 0.4s ease;
}
#splash.is-hidden { opacity: 0; pointer-events: none; visibility: hidden; -webkit-transition: opacity 0.4s ease, visibility 0s linear 0.4s; transition: opacity 0.4s ease, visibility 0s linear 0.4s; }

/* Unicode glyph fallback from UI.icon when inline SVG is unsupported */
.ic-txt { display: inline-block; text-align: center; font-style: normal; font-weight: 700; overflow: hidden; }
.splash-brand {
    font-size: 44px;
    font-weight: 700;
    letter-spacing: 6px;
    margin-bottom: 36px;
}
.splash-brand b, .brand-accent { color: #e50914; }
.splash-brand img { max-height: 90px; max-width: 420px; }

/* ---- toast ------------------------------------------------------------- */
#toast {
    position: absolute;
    left: 640px;
    bottom: 44px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 12px 24px 12px 18px;
    -webkit-border-radius: 26px;
    border-radius: 26px;
    background: rgba(28, 28, 28, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    -webkit-transform: translate(-50%, 16px);
    transform: translate(-50%, 16px);
    -webkit-transition: opacity 0.25s ease, -webkit-transform 0.25s ease;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
#toast.is-visible {
    opacity: 1;
    -webkit-transform: translate(-50%, 0);
    transform: translate(-50%, 0);
}
#toast .ic { color: #46d369; margin-right: 10px; }
