/*
 * TV styles. Smart TV browsers are slow, so: absolute positioning and flexbox
 * only, and nothing animates except transform and opacity.
 */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #e8ecf5;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  background: #12141a;
  transform-origin: 0 0;
}

.hidden { display: none !important; }

/* ---- lobby ---- */

#lobby {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#qr {
  width: 380px;
  height: 380px;
  padding: 14px;
  background: #fff;
  border-radius: 18px;
  margin-right: 70px;
}
#qr svg { display: block; width: 100%; height: 100%; }
#lobby-text { width: 600px; }
#lobby-text h1 { margin: 0 0 18px; font-size: 44px; line-height: 1.15; }
#lobby-text p { margin: 0 0 14px; font-size: 26px; color: #aab3c8; }
#lobby-text p.big { font-size: 34px; color: #e8ecf5; }
#lobby-text a { color: #ffd23f; text-decoration: none; font-weight: 700; }
#lobby-players { display: flex; flex-wrap: wrap; margin: 26px 0 18px; }
.lobby-player {
  display: flex;
  align-items: center;
  width: 280px;
  height: 58px;
  margin: 0 14px 14px 0;
  padding: 0 16px;
  border-radius: 12px;
  background: #1d2230;
  font-size: 26px;
  font-weight: 700;
}
.lobby-player.empty { color: #5a637a; font-weight: 400; }
.lobby-player .dot {
  width: 26px; height: 26px; border-radius: 50%;
  margin-right: 14px;
  background: #3a4258;
}
#lobby-hint { color: #ffd23f !important; }

/* ---- game ---- */

#game { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }

#topbar {
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  background: #0d0f14;
  font-size: 24px;
  z-index: 5;
}
#title { flex: 1; font-weight: 700; }
#timer {
  width: 160px;
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffd23f;
}
#join-short { flex: 1; text-align: right; color: #7f89a3; font-size: 20px; }

#room {
  position: absolute;
  left: 0; top: 0;
  width: 1280px;
  height: 610px;
  background: #1a1e2a;
}
#floor {
  position: absolute;
  left: 0; top: 520px;
  width: 1280px; height: 90px;
  background: #141722;
  border-top: 3px solid #2b3246;
}

.spot {
  position: absolute;
  padding: 6px 10px;
  border: 3px solid #56618a;
  border-radius: 10px;
  background: #262d40;
  overflow: hidden;
}
.spot .head { display: flex; align-items: flex-start; }
.spot .letter {
  flex: none;
  margin-right: 10px;
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  color: #ffd23f;
}
.spot .name {
  padding-top: 9px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
}
.spot .status {
  margin-top: 6px;
  font-size: 19px;
  line-height: 1.2;
  color: #9aa4bd;
}
.spot.tone-on { border-color: #ffd23f; background: #3a3620; }
.spot.tone-on .status { color: #ffd23f; font-weight: 700; }
.spot.tone-done { border-color: #3ddc97; }
.spot.tone-done .status { color: #3ddc97; font-weight: 700; }
.spot.shake { animation: shake 0.45s; }
.spot.pulse { animation: pulse 0.6s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(7px); }
}
@keyframes pulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* The belt between the crank and the cuckoo. */
.link {
  position: absolute;
  height: 6px;
  margin-top: -3px;
  background: #56618a;
  transform-origin: 0 50%;
  opacity: 0.6;
}
.link.active { background: #ffd23f; opacity: 1; }

.pendulum {
  position: absolute;
  left: 50%;
  top: 150px;
  width: 6px;
  height: 150px;
  margin-left: -3px;
  background: #56618a;
  transform-origin: 50% 0;
}
.pendulum:after {
  content: "";
  position: absolute;
  left: -15px; bottom: -18px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #56618a;
}
.pendulum.on { background: #ffd23f; animation: swing 1.6s ease-in-out infinite alternate; }
.pendulum.on:after { background: #ffd23f; }
@keyframes swing {
  from { transform: rotate(-16deg); }
  to { transform: rotate(16deg); }
}

#lights { position: absolute; display: flex; }
#lights .light {
  width: 22px; height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: #2b3246;
  border: 2px solid #56618a;
}
#lights .light.lit { background: #3ddc97; border-color: #3ddc97; }
#lights.fail .light { background: #ff5d5d; border-color: #ff5d5d; }

/* One marker per player. It slides when the player walks. */
.marker {
  position: absolute;
  left: 0; top: 0;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 4px solid #fff;
  color: #10131a;
  font-size: 28px;
  font-weight: 800;
  line-height: 46px;
  text-align: center;
  transition: transform 1s ease-in-out, opacity 0.3s;
}
.marker.offline { opacity: 0.3; }
.marker.holding { border-color: #ffd23f; }

/* ---- bottom bar: who is where, who holds what ---- */

#hud {
  position: absolute;
  left: 0; top: 610px;
  width: 1280px; height: 110px;
  display: flex;
  padding: 10px 14px;
  background: #0d0f14;
}
.slot {
  flex: 1;
  margin: 0 6px;
  padding: 8px 14px 8px 20px;
  border-radius: 10px;
  background: #1d2230;
  border-left: 10px solid #3a4258;
  overflow: hidden;
}
.slot.empty { opacity: 0.35; }
.slot.offline { opacity: 0.5; }
.slot .who { font-size: 25px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.slot .where { font-size: 19px; color: #9aa4bd; line-height: 1.3; white-space: nowrap; }
.slot .items { display: flex; margin-top: 4px; }
.slot .item {
  padding: 1px 10px;
  margin-right: 8px;
  border-radius: 12px;
  background: #ffd23f;
  color: #10131a;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}

#hint {
  position: absolute;
  z-index: 6;
  left: 0; top: 0; right: 0;
  padding: 10px 40px;
  background: #ffd23f;
  color: #10131a;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

/* ---- overlays ---- */

#clip, #won {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(6, 7, 10, 0.93);
  z-index: 20;
}
#clip { animation: fade 0.35s; }
#clip-tag { font-size: 22px; color: #7f89a3; margin-bottom: 20px; }
#clip-text { font-size: 58px; font-weight: 800; padding: 0 80px; line-height: 1.15; }
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

#won h1 { margin: 0 0 20px; font-size: 110px; color: #3ddc97; }
#won p { margin: 0 0 12px; font-size: 36px; }
#won #won-next { margin-top: 26px; font-size: 26px; color: #9aa4bd; }

#offline {
  position: absolute;
  z-index: 30;
  left: 0; right: 0; bottom: 0;
  padding: 10px;
  background: #ff5d5d;
  color: #10131a;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}
