/* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
 * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */

/* The resting screen, as the other screen apps draw it (Android's Resting.kt, the Xbox app's video.rs): laid out
   for 1280 x 720 and scaled to the TV, so it looks the same at 1080p and 4K. */
:root {
  --night: #0a1016;
  --ink: #e9f1f5;
  --muted: #a3b3bd;
  --green: #2ee0a4;
  --link: #6cc9ea;
  --problem: #ffb4a8;
  --card: rgba(18, 28, 37, 0.82);
  --card-line: #22303b;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: "SamsungOne", "Samsung Sharp Sans", "Tizen Sans", system-ui, sans-serif;
  cursor: none;
}

/* The pictures: one per computer showing, side by side (screen.js lays them out). */
#tiles video {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  box-sizing: border-box;
  display: none;
}
#tiles { visibility: hidden; }
body.showing #tiles { visibility: visible; }
/* With several, the one the remote's keys go to. */
#tiles video.focused { border: 4px solid var(--green); }
body.showing #resting { display: none; }

#resting {
  position: absolute;
  inset: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 18% 20%, rgba(21, 201, 143, 0.16), rgba(21, 201, 143, 0) 60vw),
    radial-gradient(circle at 85% 90%, rgba(59, 110, 240, 0.22), rgba(59, 110, 240, 0) 65vw),
    var(--night);
}

/* The 1280 x 720 layout, scaled by main.js to fill the screen both ways. */
#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  transform-origin: 0 0;
}

/* Against burn-in: everything over the background moves round a small circle, a place a minute. */
#drift {
  position: absolute;
  inset: 0;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  transition: transform 2s ease-in-out;
}

/* After ten quiet minutes the screen dims, still readable. */
#shade {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 3s;
  pointer-events: none;
}
#resting.dim #shade { opacity: 1; }

.brand { position: absolute; left: 72px; top: 56px; display: flex; align-items: center; }
.brand img { width: 40px; height: 40px; }
.brand span { font-size: 26px; font-weight: 700; padding-left: 14px; }

#clock { position: absolute; right: 72px; top: 62px; font-size: 26px; color: var(--muted); }

#heading { position: absolute; left: 72px; top: 196px; right: 72px; }
#lead { font-size: 22px; color: var(--muted); line-height: 1.15; }
#name { font-size: 84px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#problem { font-size: 22px; color: var(--problem); line-height: 1.15; max-width: 1100px; }
#problem:empty { display: none; }

.card {
  box-sizing: border-box;
  width: 300px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 18px;
  font-size: 22px;
  line-height: 1.15;
}
.card .n { font-size: 34px; font-weight: 700; color: var(--green); }
#cards { position: absolute; left: 72px; top: 420px; display: flex; align-items: stretch; }
#cards .card + .card { margin-left: 22px; }
#get { position: absolute; right: 72px; top: 420px; font-size: 19px; }
#get span { color: var(--link); }

#pin { font-size: 52px; font-weight: 700; color: var(--green); letter-spacing: 0.04em; white-space: nowrap; }
#pin:empty { display: none; }

#footer { position: absolute; left: 72px; bottom: 44px; font-size: 18px; color: var(--muted); }
#footer b, .card b { color: var(--ink); }

/* This screen's settings, over the resting screen. */
#settings {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
}
#settings.open { display: flex; }
#settings .panel { width: 560px; padding: 28px; background: #121c25; border: 1px solid var(--card-line); border-radius: 18px; }
#settings h2 { margin: 0 0 18px; font-size: 30px; }
#settings .item { font-size: 24px; padding: 14px 18px; border-radius: 12px; margin-top: 8px; border: 2px solid transparent; }
#settings .item.focus { border-color: var(--green); background: rgba(46, 224, 164, 0.12); }
#settings input {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  font-size: 28px;
  padding: 12px 14px;
  color: var(--ink);
  background: #0a1016;
  border: 2px solid var(--green);
  border-radius: 12px;
  outline: none;
}
#settings .hint { font-size: 18px; color: var(--muted); margin-top: 12px; }
