/* Sized in rem. iPhone web copy of apps/ucl-tv/assets/app.css (html.touch is always on here), plus the web-only
 * parts at the end: tap-to-start, safe areas (notch), login sheet, player and VLC buttons.
 * Phones/tablets (html.touch): bigger rem plus their own layout, near the end of this file. */
:root {
  --night: #03061c; --navy: #070d3a; --royal: #13206b; --blue: #1d2f86; --silver: #dfe5f5; --steel: #9aa6cc;
  --gold: #e8c766; --live: #ff3b5c; --green: #1fa64a; --line: rgba(200,210,255,.16);
}
html { font-size: calc(100vw / 100); }
* { box-sizing: border-box; }
body {
  margin: 0; color: #fff; background: var(--night); overflow-x: hidden;
  font-family: Roboto, "Segoe UI", Arial, sans-serif; font-size: 1.45rem;
  background-image:
    radial-gradient(ellipse at 50% -20%, rgba(60,90,220,.55) 0%, rgba(7,13,58,0) 60%),
    radial-gradient(ellipse at 100% 100%, rgba(40,60,170,.35) 0%, rgba(3,6,28,0) 55%);
  min-height: 100vh;
}

/* ---------------------------------------------------------------- intro */
#intro { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; background: #02041a; display: none; opacity: 1; transition: opacity .8s; }
#intro.on { display: block; }
#intro.out { opacity: 0; }
body.intro-on #app { visibility: hidden; } /* nothing renders under the intro on a weak TV */
#introCanvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; }
.intro-title {
  position: absolute; left: 0; right: 0; top: 70%; text-align: center; opacity: 0;
  transform: translateY(1.5rem); transition: opacity 1.2s, transform 1.2s; will-change: opacity, transform;
}
#intro.titled .intro-title { opacity: 1; transform: none; }
.it-main {
  font-size: 5.2rem; font-weight: 900; letter-spacing: 1.1rem; padding-left: 1.1rem;
  background: linear-gradient(180deg, #ffffff 0%, #dfe5f5 45%, #8f9cc6 55%, #f4f6ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; will-change: opacity;
}
.it-tv { font-size: 2.2rem; font-weight: 800; letter-spacing: 1.4rem; padding-left: 1.4rem; color: var(--gold); margin-top: .3rem; }
.it-tag { font-size: 1.2rem; letter-spacing: .6rem; color: var(--steel); margin-top: .8rem; }
.intro-skip { position: absolute; right: 2.4rem; bottom: 1.8rem; color: rgba(200,210,255,.45); font-size: 1.1rem; letter-spacing: .15rem; }

/* ---------------------------------------------------------------- header */
.top { display: flex; align-items: center; gap: 1.4rem; width: 92%; margin: 0 auto; padding: 1.4rem 0 .6rem; }
#emblem { width: 6.2rem; height: 6.2rem; flex: none; }
.brand .b1 {
  font-size: 3.2rem; font-weight: 900; letter-spacing: .55rem;
  background: linear-gradient(180deg, #fff 0%, #dfe5f5 50%, #a3aed4 56%, #fff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .b1 span { color: var(--gold); -webkit-text-fill-color: var(--gold); }
.brand .b2 { color: var(--steel); letter-spacing: .3rem; font-size: 1.2rem; text-transform: uppercase; margin-top: .2rem; }
.clock { margin-left: auto; font-size: 2.4rem; font-weight: 800; color: var(--silver); font-family: "Roboto Mono", Consolas, monospace; }

main { width: 92%; margin: 0 auto; padding-bottom: 3rem; }

/* ---------------------------------------------------------------- day tabs */
.days { display: flex; gap: .8rem; margin: .8rem 0 1.4rem; flex-wrap: wrap; }
.day {
  border: .12rem solid var(--line); background: rgba(19,32,107,.55); color: var(--silver);
  border-radius: .8rem; padding: .55rem 1.3rem; font: inherit; font-size: 1.25rem; font-weight: 700; outline: none;
  text-align: center; line-height: 1.15;
}
.day small { display: block; font-size: .95rem; font-weight: 500; color: var(--steel); letter-spacing: .1rem; }
.day.sel { background: linear-gradient(180deg, #2a3fa8, #16226e); border-color: var(--silver); color: #fff; }
.day.sel small { color: var(--gold); }
.day .dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; background: var(--live); margin-left: .5rem; vertical-align: middle; animation: pulse 1.2s infinite; }

/* ---------------------------------------------------------------- game boxes */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.grid .loading, .grid .empty { grid-column: 1 / -1; text-align: center; color: var(--steel); padding: 4rem 1rem; }
.box {
  position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: center;
  border: .14rem solid var(--line); border-radius: 1.3rem; padding: 1rem 1.2rem 1.1rem; outline: none; font: inherit; color: #fff;
  background: linear-gradient(165deg, rgba(42,63,168,.75) 0%, rgba(14,22,84,.9) 55%, rgba(7,13,58,.95) 100%);
  box-shadow: 0 .6rem 1.8rem rgba(0,0,0,.4); overflow: hidden;
}
.box::before { /* faint star shimmer */
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(circle at 15% 20%, rgba(255,255,255,.35) 0 .08rem, transparent .1rem),
    radial-gradient(circle at 80% 30%, rgba(255,255,255,.3) 0 .06rem, transparent .08rem),
    radial-gradient(circle at 60% 85%, rgba(255,255,255,.25) 0 .07rem, transparent .09rem);
}
.box .when { display: flex; justify-content: space-between; align-items: center; font-size: 1.2rem; color: var(--steel); letter-spacing: .1rem; }
.box .when b { color: var(--silver); font-size: 1.5rem; letter-spacing: 0; }
.box .when .lv { color: #fff; background: var(--live); border-radius: .4rem; padding: .05rem .6rem; font-weight: 900; font-size: 1.15rem; }
.box .when .lv::before { content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #fff; margin-right: .4rem; vertical-align: middle; animation: pulse 1.2s infinite; }
.box .when .ft { color: var(--steel); font-weight: 800; }
.box .vs { display: flex; align-items: center; justify-content: space-between; margin: .7rem 0 .5rem; }
.box .tm { width: 38%; }
.box .tm img { display: block; width: 4.6rem; height: 4.6rem; object-fit: contain; margin: 0 auto .45rem; filter: drop-shadow(0 .2rem .4rem rgba(0,0,0,.5)); }
.box .tm div { font-size: 1.35rem; font-weight: 800; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.box .sc { width: 24%; font-size: 3rem; font-weight: 900; color: #fff; white-space: nowrap; }
.box .sc.pre { font-size: 1.6rem; color: var(--steel); font-weight: 700; }
.box .chs { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; min-height: 2.1rem; }
.chip { background: var(--silver); color: var(--navy); font-weight: 800; font-size: 1.05rem; padding: .2rem .65rem; border-radius: .45rem; }
.chip.app { background: transparent; color: var(--steel); border: .1rem solid var(--line); font-weight: 600; }
.chip.tbc { background: transparent; color: var(--steel); border: .1rem dashed var(--line); font-weight: 500; }
.box.live { border-color: rgba(255,59,92,.7); }

/* ---------------------------------------------------------------- picker sheet */
.modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; display: none; background: rgba(2,4,26,.82); align-items: center; justify-content: center; }
.modal.open { display: flex; }
.sheet {
  width: 70rem; max-height: 88vh; overflow-y: auto; border-radius: 1.6rem; padding: 2rem 2.6rem;
  background: linear-gradient(170deg, #1c2c86 0%, #0b1350 60%, #070d3a 100%);
  border: .15rem solid rgba(223,229,245,.35); box-shadow: 0 1.5rem 4rem rgba(0,0,0,.6);
}
.sheet .hd { display: flex; align-items: center; justify-content: center; gap: 2rem; }
.sheet .hd img { width: 6.5rem; height: 6.5rem; object-fit: contain; }
.sheet .hd .t { font-size: 2.4rem; font-weight: 900; text-align: center; }
.sheet .hd .t small { display: block; font-size: 1.3rem; color: var(--steel); font-weight: 500; margin-top: .3rem; letter-spacing: .1rem; }
.sheet h3 { margin: 1.6rem 0 .6rem; font-size: 1.3rem; letter-spacing: .3rem; color: var(--steel); text-transform: uppercase; font-weight: 700; }
.sheet .hint { color: var(--steel); font-size: 1.3rem; padding: .25rem 0; }
.sheet .hint b { color: var(--silver); }
.play {
  display: inline-block; margin: .4rem .8rem .4rem 0; padding: .8rem 1.6rem; border: 0; border-radius: .8rem;
  background: var(--green); color: #fff; font: inherit; font-weight: 800; font-size: 1.45rem; outline: none;
}
.play::before { content: "\25B6  "; }
.play.alt { background: var(--blue); }
.play.alt::before { content: ""; }

/* ---------------------------------------------------------------- first-run setup */
.setup {
  margin: .4rem 0 1rem; padding: 1.2rem 2rem; border-radius: 1.3rem;
  background: linear-gradient(180deg, rgba(232,199,102,.2), rgba(232,199,102,.06)); border: .15rem solid var(--gold);
}
.setup .sh { font-size: 1.8rem; font-weight: 900; color: var(--gold); }
.setup p { margin: .5rem 0 .8rem; font-size: 1.3rem; line-height: 1.4; color: var(--silver); }

footer { margin-top: 2rem; display: flex; align-items: center; gap: 1.6rem; }
.btn-settings {
  border: .12rem solid var(--line); border-radius: .8rem; padding: .7rem 1.4rem; background: rgba(19,32,107,.7); color: #fff;
  font: inherit; font-size: 1.25rem; font-weight: 800; outline: none;
}
.status { color: var(--steel); font-size: 1.1rem; }

/* ---------------------------------------------------------------- remote focus */
.nav:focus, .nav.focus {
  border-color: #fff; box-shadow: 0 0 0 .3rem var(--silver), 0 0 2rem rgba(150,180,255,.85);
  transform: scale(1.04); transition: transform .12s;
}
.box.nav:focus { transform: scale(1.035); background: linear-gradient(165deg, rgba(62,88,210,.9) 0%, rgba(24,36,120,.95) 55%, rgba(10,18,72,1) 100%); }
.play.nav:focus { box-shadow: 0 0 0 .3rem #fff, 0 0 1.6rem rgba(31,166,74,.8); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ================================================================ phones and tablets (touch) */
/* Landscape phone: 2 games per row, text 25% bigger than on a TV. Portrait: 1 per row, much bigger. */
html.touch { font-size: calc(100vw / 80); -webkit-tap-highlight-color: transparent; }
.touch .grid { grid-template-columns: repeat(2, 1fr); }
.touch .sheet { width: 92%; max-height: 90vh; }
.touch .days { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: .2rem; }
.touch .days::-webkit-scrollbar { display: none; }
.touch .day { flex: none; }
/* No remote highlight on touch: a tap gives a quick press effect instead. */
.touch .nav:focus, .touch .box.nav:focus, .touch .play.nav:focus { box-shadow: none; transform: none; border-color: var(--line); }
.touch .day.sel:focus { border-color: var(--silver); }
.touch .nav:active { transform: scale(.97); filter: brightness(1.15); }

@media (orientation: portrait) {
  html.touch { font-size: calc(100vw / 42); }
  .touch .grid { grid-template-columns: 1fr; gap: 1rem; }
  .touch .top { gap: .8rem; padding-top: 1rem; }
  .touch #emblem { width: 4.4rem; height: 4.4rem; }
  .touch .brand .b1 { font-size: 2.1rem; letter-spacing: .2rem; }
  .touch .brand .b2 { font-size: .95rem; letter-spacing: .12rem; }
  .touch .clock { display: none; }
  .touch .sheet { padding: 1.4rem 1.4rem; }
  .touch .sheet .hd { gap: .8rem; }
  .touch .sheet .hd img { width: 4.2rem; height: 4.2rem; }
  .touch .sheet .hd .t { font-size: 1.7rem; }
  .touch .play { display: block; width: 100%; margin: .5rem 0; text-align: left; }
  .touch footer { flex-direction: column; align-items: flex-start; gap: .8rem; }
  .touch .it-main { font-size: 2.5rem; letter-spacing: .35rem; padding-left: .35rem; }
  .touch .it-tv { font-size: 1.6rem; letter-spacing: 1rem; padding-left: 1rem; }
  .touch .it-tag { font-size: .95rem; letter-spacing: .3rem; }
  .touch .intro-skip { right: 0; left: 0; text-align: center; }
}
/* Tablets: upright = 2 per row; sideways (big screens) = 3 per row like a TV. */
@media (orientation: portrait) and (min-width: 600px) {
  html.touch { font-size: calc(100vw / 64); }
  .touch .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (orientation: landscape) and (min-width: 1100px) {
  html.touch { font-size: calc(100vw / 96); }
  .touch .grid { grid-template-columns: repeat(3, 1fr); }
}

/* ================================================================ iPhone web app only */
/* Notch and home bar: keep content inside the safe area (the page runs full screen from the home screen). */
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
input, button { font: inherit; }

/* Tap to start (sound on iPhone needs a tap) */
#tapstart {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; display: none;
  flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #13206b 0%, #070d3a 45%, #02041a 100%);
}
#tapstart.on { display: flex; }
#tapstart .ts-icon { width: 44vmin; height: 44vmin; border-radius: 22%; box-shadow: 0 0 6rem rgba(120,150,255,.45); }
#tapstart .ts-main { margin-top: 2rem; font-size: 2.2rem; font-weight: 900; letter-spacing: .3rem; color: var(--silver); }
#tapstart .ts-main span { color: var(--gold); }
#tapstart .ts-go { margin-top: 1.6rem; padding: .7rem 2.2rem; border: .12rem solid var(--silver); border-radius: 3rem; color: #fff; font-weight: 800; letter-spacing: .2rem; animation: pulse 1.6s infinite; }

/* Play rows: Play + VLC side by side */
.prow { display: flex; align-items: stretch; gap: .6rem; }
.prow .play { flex: 1; }
.touch .prow .play { width: auto; }
.vlcbtn {
  display: flex; align-items: center; margin: .4rem 0; padding: 0 1.1rem; border-radius: .8rem;
  background: #f08a00; color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none;
}
@media (orientation: portrait) { .touch .prow .vlcbtn { margin: .5rem 0; } }

/* IPTV login sheet (slides up from the bottom) */
.lsheet { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 70; background: rgba(2,4,26,.75); display: flex; align-items: flex-end; }
.lsheet[hidden] { display: none; }
.lsheet-in {
  width: 100%; max-width: 760px; margin: 0 auto; max-height: 92vh; overflow: auto;
  background: linear-gradient(170deg, #1c2c86 0%, #0b1350 60%, #070d3a 100%); border-top: .2rem solid var(--gold);
  border-radius: 1.6rem 1.6rem 0 0; padding: 1.6rem 1.4rem calc(1.6rem + env(safe-area-inset-bottom));
}
.lsheet h3 { margin: 0 0 .4rem; font-size: 1.9rem; }
.muted { color: var(--steel); font-size: 1.2rem; margin: .3rem 0; }
.goldtxt { color: var(--gold); font-size: 1.2rem; margin: .3rem 0 .8rem; }
.lsheet label { display: block; font-size: 1.2rem; color: var(--steel); margin-top: .9rem; }
.lsheet input {
  display: block; width: 100%; margin-top: .35rem; padding: .9rem; border-radius: .8rem;
  border: .1rem solid #3d5f99; background: #12206b; color: #fff; font-size: 16px; /* 16px stops iPhone zooming in */
}
.row-btns { display: flex; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.lbtn { border: 0; border-radius: .8rem; padding: .8rem 1.2rem; background: var(--blue); color: #fff; font-weight: 800; font-size: 1.3rem; text-decoration: none; }
.lbtn.link { background: transparent; color: var(--steel); text-decoration: underline; font-weight: 500; }
.gold-btn { background: var(--gold); color: var(--navy); }
.msg { margin-top: .9rem; color: var(--gold); font-weight: 700; font-size: 1.3rem; }

/* Player */
.player { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: #000; z-index: 80; display: flex; flex-direction: column; }
.player[hidden] { display: none; }
.pbar { display: flex; align-items: center; gap: .6rem; padding: calc(.6rem + env(safe-area-inset-top)) .8rem .6rem; background: #0b1350; }
.pbar span { flex: 1; font-weight: 700; font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbtn.vlc { background: #f08a00; font-size: 1.15rem; }
.player video { flex: 1; width: 100%; min-height: 0; background: #000; }
.pmsg {
  position: absolute; left: 1rem; right: 1rem; bottom: calc(6rem + env(safe-area-inset-bottom)); text-align: center;
  color: #fff; background: rgba(29,47,134,.95); border-radius: .8rem; padding: .9rem; display: none; font-size: 1.25rem;
}
.pmsg.show { display: block; }
