/* Sized in rem; js/app.js sets the root font size so 1rem = 1/120 of the screen width
   (16px on a 1920px screen). No CSS grid, custom properties or flex gap, so older
   Tizen browsers (Chromium 47+) render it correctly. */
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #0f1115; color: #e8e8e8; }
body { font-family: "Samsung One", "SamsungOne", Roboto, "Segoe UI", Arial, sans-serif; font-size: 1.5rem; -webkit-user-select: none; user-select: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
* { box-sizing: border-box; }

#header { position: absolute; left: 0; top: 0; right: 0; height: 6rem; padding: 0 4rem; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; z-index: 5; background: -webkit-linear-gradient(top, rgba(15,17,21,.95), rgba(15,17,21,0)); background: linear-gradient(to bottom, rgba(15,17,21,.95), rgba(15,17,21,0)); }
.brand { font-size: 2rem; font-weight: bold; color: #52b54b; margin-right: 3rem; }
.menu { -webkit-flex: 1; flex: 1; white-space: nowrap; }
.menu-item { display: inline-block; padding: .6rem 1.6rem; margin-right: .6rem; border-radius: 2rem; font-size: 1.5rem; color: #bbb; }
.menu-item.active { color: #fff; }
.clock { font-size: 1.6rem; color: #bbb; }

#view { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; }
.page { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; }
.scroller { position: absolute; left: 0; right: 0; top: 6rem; bottom: 0; overflow: hidden; }
.scroll-inner { padding: 1rem 0 6rem 0; }

/* focus */
.focusable { outline: none; }
.focused { outline: none; }
.menu-item.focused, .btn.focused, .chip.focused, .dlg-item.focused, .input.focused, .ep.focused { background: #fff; color: #111; }
.card.focused .card-img { box-shadow: 0 0 0 .35rem #fff, 0 .8rem 2rem rgba(0,0,0,.6); -webkit-transform: scale(1.06); transform: scale(1.06); }
.card.focused .card-title { color: #fff; }

/* rows */
.section { margin: 0 0 2.4rem 0; }
.section-title { font-size: 1.9rem; margin: 0 4rem .8rem 4rem; color: #fff; }
.row { overflow: hidden; white-space: nowrap; padding: 1rem 4rem; }
.row-inner { white-space: nowrap; }

.card { display: inline-block; vertical-align: top; margin-right: 1.6rem; white-space: normal; }
.card-img { position: relative; background: #22262e center/cover no-repeat; border-radius: .5rem; overflow: hidden; -webkit-transition: -webkit-transform .12s; transition: transform .12s; }
.card.portrait .card-img { width: 14rem; height: 21rem; }
.card.landscape .card-img { width: 24rem; height: 13.5rem; }
.card.square .card-img { width: 16rem; height: 16rem; }
.card.portrait .card-title { width: 14rem; }
.card.landscape .card-title { width: 24rem; }
.card.square .card-title { width: 16rem; }
.card-title { font-size: 1.3rem; color: #bbb; margin-top: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 1.1rem; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-fallback { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-size: 1.4rem; color: #888; padding: 0 1rem; }
.card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: .45rem; background: rgba(0,0,0,.6); }
.card-progress div { height: 100%; background: #52b54b; }
.card-badge { position: absolute; right: .6rem; top: .6rem; background: #52b54b; color: #fff; font-size: 1.1rem; border-radius: 1rem; padding: .1rem .7rem; }

/* grid (library) – inline-block wrapping */
.grid { padding: 1rem 3.5rem; font-size: 0; }
.grid .card { margin: 0 .5rem 2rem .5rem; font-size: 1.5rem; }
.grid-status { font-size: 1.4rem; color: #888; padding: 0 4rem; }

/* detail */
.backdrop { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: #0f1115 center/cover no-repeat; }
.backdrop-shade { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: -webkit-linear-gradient(left, rgba(15,17,21,.97) 30%, rgba(15,17,21,.55)); background: linear-gradient(to right, rgba(15,17,21,.97) 30%, rgba(15,17,21,.55)); }
.detail { position: relative; padding: 2rem 4rem 0 4rem; }
.detail-title { font-size: 3.6rem; font-weight: bold; color: #fff; max-width: 80rem; }
.detail-meta { font-size: 1.5rem; color: #bbb; margin: 1rem 0; }
.detail-meta span { margin-right: 2rem; }
.detail-overview { font-size: 1.5rem; line-height: 1.5; color: #ccc; max-width: 70rem; max-height: 9.2rem; overflow: hidden; }
.detail-buttons { margin: 2rem 0; }
.btn { display: inline-block; line-height: 1.3; padding: .9rem 2.2rem; margin-right: 1rem; border-radius: .5rem; background: rgba(255,255,255,.12); font-size: 1.5rem; color: #eee; }
.btn.primary { background: #52b54b; color: #fff; }
.btn.primary.focused { background: #fff; color: #111; }

.chips { padding: 0 4rem; margin-bottom: 1.5rem; white-space: nowrap; overflow: hidden; }
.chip { display: inline-block; padding: .6rem 1.6rem; margin-right: .8rem; border-radius: 2rem; background: rgba(255,255,255,.1); font-size: 1.4rem; }
.chip.selected { background: #52b54b; color: #fff; }

.episodes { padding: 0 4rem; }
.ep { display: -webkit-flex; display: flex; padding: 1rem; border-radius: .6rem; margin-bottom: .6rem; }
.ep-img { width: 20rem; height: 11.25rem; -webkit-flex-shrink: 0; flex-shrink: 0; background: #22262e center/cover no-repeat; border-radius: .4rem; position: relative; overflow: hidden; }
.ep-body { padding-left: 2rem; overflow: hidden; }
.ep-title { font-size: 1.6rem; font-weight: bold; }
.ep-meta { font-size: 1.2rem; color: #999; margin: .4rem 0; }
.ep.focused .ep-meta, .ep.focused .ep-ov { color: #333; }
.ep-ov { font-size: 1.3rem; color: #aaa; line-height: 1.4; max-height: 5.5rem; overflow: hidden; }

/* forms */
.form { width: 60rem; margin: 4rem auto 0 auto; }
.form h1 { font-size: 3rem; margin: 0 0 2rem 0; }
.label { font-size: 1.3rem; color: #999; margin: 1.4rem 0 .4rem 0; }
.input { display: block; width: 100%; font-size: 1.8rem; padding: 1rem 1.4rem; border: .2rem solid #333; border-radius: .5rem; background: #1b1e25; color: #fff; font-family: inherit; }
.input.focused { border-color: #fff; background: #fff; color: #111; }
.form .btn { margin-top: 2rem; }
.error { color: #ff6b6b; font-size: 1.4rem; margin-top: 1.2rem; min-height: 2rem; }
.note { color: #888; font-size: 1.2rem; line-height: 1.5; margin-top: 2rem; }
.opt-row { margin: .6rem 0; }

.search-box { padding: 0 4rem 1rem 4rem; }
.search-box .input { width: 60rem; }

/* player */
#player { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: #000; z-index: 20; }
#video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: #000; }
#subs { position: absolute; left: 10%; right: 10%; bottom: 8%; text-align: center; font-size: 2.6rem; line-height: 1.3; color: #fff; text-shadow: 0 0 .3rem #000, 0 0 .3rem #000, .15rem .15rem .2rem #000; pointer-events: none; }
#subs.osd-up { bottom: 24%; }
#spinner { position: absolute; left: 50%; top: 50%; margin: -3rem 0 0 -3rem; }
.spin { width: 6rem; height: 6rem; border: .5rem solid rgba(255,255,255,.2); border-top-color: #52b54b; border-radius: 50%; -webkit-animation: spin 1s linear infinite; animation: spin 1s linear infinite; }
@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
#osd { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.osd-top { position: absolute; left: 0; right: 0; top: 0; padding: 3rem 4rem 6rem 4rem; background: -webkit-linear-gradient(top, rgba(0,0,0,.85), rgba(0,0,0,0)); background: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,0)); }
#osd-title { font-size: 2.6rem; font-weight: bold; }
#osd-sub { font-size: 1.5rem; color: #bbb; margin-top: .4rem; }
.osd-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 6rem 4rem 3rem 4rem; background: -webkit-linear-gradient(bottom, rgba(0,0,0,.9), rgba(0,0,0,0)); background: linear-gradient(to top, rgba(0,0,0,.9), rgba(0,0,0,0)); }
.progress { position: relative; height: .6rem; background: rgba(255,255,255,.2); border-radius: .3rem; overflow: hidden; }
.progress.focused { height: 1.2rem; box-shadow: 0 0 0 .2rem #fff; }
#osd-buffer { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.3); width: 0; }
#osd-played { position: absolute; left: 0; top: 0; bottom: 0; background: #52b54b; width: 0; }
.osd-times { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; font-size: 1.4rem; color: #ccc; margin: .8rem 0 1.6rem 0; }
#osd-info { color: #888; }
.osd-buttons { text-align: center; white-space: nowrap; }

/* dialog */
#dialog { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); z-index: 40; }
.dialog-box { position: absolute; right: 0; top: 0; bottom: 0; width: 46rem; background: #1b1e25; padding: 3rem 2rem; }
.dialog-title { font-size: 2rem; margin: 0 1rem 1.5rem 1rem; }
.dialog-list { position: absolute; left: 2rem; right: 2rem; top: 7rem; bottom: 2rem; overflow: hidden; }
.dlg-item { display: block; padding: 1rem 1.4rem; border-radius: .5rem; font-size: 1.5rem; margin-bottom: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlg-item.checked:before { content: "\2713  "; color: #52b54b; }
.dlg-item.focused.checked:before { color: #111; }

#toast { position: absolute; left: 50%; bottom: 4rem; width: 60rem; margin-left: -30rem; text-align: center; background: rgba(30,30,30,.95); color: #fff; font-size: 1.5rem; padding: 1.2rem 2rem; border-radius: .6rem; z-index: 60; }
.empty { color: #888; font-size: 1.6rem; padding: 2rem 4rem; }

/* login user picker */
.user-row { padding: 1rem 1rem 1rem 1rem; margin: 0 -1rem; }
.card.user-tile .card-img { width: 10rem; height: 10rem; border-radius: 50%; }
.card.user-tile .card-title { width: 10rem; text-align: center; font-size: 1.5rem; }
.user-initial { position: absolute; left: 0; right: 0; top: 50%; margin-top: -2.5rem; text-align: center; font-size: 4rem; line-height: 5rem; color: #fff; }
.user-tile .card-img { background-color: #2e7d32; }
