/* Keel for Samsung TVs: a fixed 1920x1080 canvas, the same colours as Keel for Android. */
:root {
    --ink: #0b1120; --panel: #121a2c; --panel2: #18223a; --line: #26324d; --text: #e8edf8; --muted: #93a0bf;
    --blue: #2f6be0; --bluehi: #5a8ef6; --orange: #d9622b; --violet: #8a4fd8; --green: #2fb27a; --red: #e0566b; --gold: #f2b84b;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 1920px; height: 1080px; overflow: hidden; background: var(--ink); color: var(--text);
             font-family: 'SamsungOne', 'Samsung Sans', 'Roboto', 'Segoe UI', sans-serif; font-size: 26px; }
body.playing { background: transparent; }
body.playing #app > :not(.player) { visibility: hidden; }
#avplayer, #html5player { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; background: #000; }
#html5player { object-fit: contain; }
body:not(.playing) #avplayer, body:not(.playing) #html5player { visibility: hidden; }
#app { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
h1 { font-size: 64px; margin: 0 0 16px; letter-spacing: -1px; }
h2 { font-size: 34px; margin: 0 0 14px; }
h3 { font-size: 28px; margin: 28px 0 14px; }
p { margin: 0 0 16px; line-height: 1.45; }
.muted { color: var(--muted); }
.small { font-size: 21px; }
.mono { font-family: 'Roboto Mono', Consolas, monospace; letter-spacing: 1px; }
.green { color: var(--green); } .blue { color: var(--bluehi); } .red { color: var(--red); } .gold { color: var(--gold); }
.row { display: flex; gap: 18px; flex-wrap: wrap; margin: 18px 0; }
.pad { padding: 30px 0; }

/* Anything the remote can land on */
.f, .cat, .chan, .poster { transition: transform 0.12s, box-shadow 0.12s, background 0.12s; }
.f.on, .cat.on, .chan.on, .poster.on { box-shadow: 0 0 0 5px #fff; transform: scale(1.04); position: relative; z-index: 2; }

.btn { font: inherit; font-size: 26px; font-weight: 600; color: var(--text); background: var(--panel2); border: 0;
       border-radius: 14px; padding: 18px 34px; }
.btn.primary { background: var(--blue); }
.btn.wide { display: block; width: 100%; text-align: left; margin-bottom: 14px; }

/* Start: playlists on the left, licence and phone pairing on the right */
.start { display: flex; gap: 60px; padding: 70px 90px; height: 1080px; }
.start .col { flex: 1; min-width: 0; }
.brand { font-size: 110px; }
.cards { display: flex; flex-direction: column; gap: 18px; margin: 30px 0 10px; max-height: 520px; }
.card { background: var(--panel); border-radius: 18px; padding: 26px 32px; display: flex; flex-direction: column; gap: 6px; }
.card b { font-size: 34px; }
.panel { width: 760px; background: var(--panel); border-radius: 28px; padding: 46px 50px; align-self: flex-start; }
.pair { display: flex; gap: 34px; align-items: center; }
.pair > div:last-child { display: flex; flex-direction: column; gap: 6px; }
.pair b { font-size: 34px; margin-bottom: 14px; }
.qr { background: #fff; border-radius: 12px; padding: 8px; flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }

/* Dialogs */
.dialog { width: 1100px; margin: 110px auto; background: var(--panel); border-radius: 28px; padding: 54px 60px; }
.dialog label { display: block; color: var(--muted); margin-bottom: 18px; }
.dialog input { display: block; width: 100%; margin-top: 8px; font: inherit; font-size: 30px; color: var(--text);
                background: var(--ink); border: 2px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.dialog input.on { border-color: #fff; transform: none; }
.dialog .qr { margin: 10px 0 24px; }
.status { color: var(--gold); min-height: 36px; }

/* Home tiles */
.home { padding: 90px 110px; }
.tiles { display: flex; gap: 40px; margin: 60px 0 40px; }
.tile { width: 520px; height: 300px; border-radius: 28px; display: flex; align-items: flex-end; padding: 36px; }
.tile b { font-size: 50px; }
.tile.live { background: linear-gradient(135deg, #2f6be0, #16306f); }
.tile.movie { background: linear-gradient(135deg, #d9622b, #6d2410); }
.tile.series { background: linear-gradient(135deg, #8a4fd8, #3a1c74); }

/* Browse */
.browse { display: flex; height: 1080px; }
.browse .cats { width: 470px; background: var(--panel); padding: 50px 26px 30px 46px; }
.browse .items { flex: 1; padding: 50px 60px 30px 50px; min-width: 0; position: relative; }
.cat { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; border-radius: 12px; height: 62px; align-items: center; }
.cat span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat i { font-style: normal; color: var(--muted); font-size: 21px; }
.cat.sel { background: var(--panel2); }
.cat.on { background: var(--blue); }
.cat.on i { color: #fff; }
.list { display: flex; flex-direction: column; gap: 10px; }
.chan { display: flex; align-items: center; gap: 22px; background: var(--panel); border-radius: 14px; padding: 0 24px; height: 76px; }
.chan i { font-style: normal; color: var(--muted); width: 70px; font-size: 22px; }
.chan img { width: 90px; height: 54px; object-fit: contain; }
.chan b { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan em { color: var(--gold); font-style: normal; }
.chan.on { background: var(--blue); transform: scale(1.02); }
/* minmax(0, ...): a long title must not widen its column and push the last posters off the screen. */
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 30px 26px; }
.poster { min-width: 0; }
.poster b { display: block; font-size: 22px; font-weight: 600; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster i { font-style: normal; color: var(--gold); font-size: 20px; }
.poster .art { height: 330px; border-radius: 16px; background: var(--panel2) center / cover no-repeat; position: relative;
               display: flex; align-items: center; justify-content: center; }
.poster .art span { font-size: 90px; color: var(--muted); }
.poster .art em { position: absolute; top: 10px; right: 14px; color: var(--gold); font-style: normal; font-size: 30px; }
.poster.on { box-shadow: none; }
.poster.on .art { box-shadow: 0 0 0 5px #fff; }
.hint { position: absolute; bottom: 24px; left: 50px; font-size: 21px; }

/* Series */
.series { padding: 70px 110px; }
.series .plot { max-width: 1500px; max-height: 120px; overflow: hidden; }
.series .chan em { font-size: 21px; }

/* Player overlay */
.player { position: absolute; inset: 0; }
.bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 90px 50px;
       background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0)); transition: opacity 0.3s; }
.bar.hidden { opacity: 0; }
.bar .title { display: flex; align-items: baseline; gap: 26px; margin-bottom: 18px; }
.bar .title b { font-size: 40px; }
.bar .state { font-style: normal; color: var(--gold); }
.seek { display: flex; align-items: center; gap: 24px; margin-bottom: 16px; }
.track { flex: 1; height: 10px; background: rgba(255, 255, 255, 0.3); border-radius: 5px; overflow: hidden; }
.track div { height: 100%; background: var(--bluehi); }

#toast { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); max-width: 1400px; background: var(--panel2);
         border: 1px solid var(--line); border-radius: 16px; padding: 20px 34px; font-size: 26px; z-index: 50; }
#toast[hidden] { display: none; }

/* The web player: a phone held upright is asked to turn (the canvas is landscape); anything clickable shows it. */
html.upright, html.upright body { width: 100%; height: 100%; }
html.upright #app, html.upright #html5player, html.upright #toast { display: none; }
html.upright body::after { content: 'Turn your device sideways to use Keel.'; position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 100;
                      background: var(--ink); display: flex; align-items: center; justify-content: center; text-align: center;
                      padding: 0 10%; font-size: 30px; font-weight: 700; line-height: 1.25; }
.f { cursor: pointer; }

/* The web player: the page is the window; the 1920x1080 canvas is scaled into it and centred (keel.js fitWeb). */
html.web { width: 100%; height: 100%; overflow: hidden; background: var(--ink); }
html.web body { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
html.web.upright body { transform: none; }
