/*
 * TV styles. This is the game's own look, the same for every room whatever
 * its theme: dark wood, brass and paper. A room brings its picture and its
 * words; the frame around them does not change.
 *
 * Cards are places (the numbers of the spots). Diamonds are people (players).
 *
 * Smart TV browsers are slow and old, so: absolute positioning and flexbox
 * only, literal colours (no CSS variables), and nothing animates except
 * transform and opacity.
 *
 *   ink        #100d0a   bars, overlays
 *   panel      #1a1510   plates
 *   wall       #221b14   placeholder room
 *   line       #4a3b27   quiet borders
 *   brass      #c9a24b   the accent
 *   brass-hi   #ecc76b   lit, active
 *   parchment  #eadfc6   text
 *   muted      #9a8b70   secondary text
 *   red        #c8483c   wrong, offline
 *   green      #6fbf8f   solved
 */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #100d0a;
  color: #eadfc6;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  line-height: 1.14;
  /* Alegreya's default numerals dip below the line; clocks and codes need the straight, equal-width ones. */
  -webkit-font-feature-settings: 'lnum' 1, 'tnum' 1;
  font-feature-settings: 'lnum' 1, 'tnum' 1;
}

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

.hidden { display: none !important; }

/* ---- welcome and lobby: the QR on the left, what to do on the right ---- */

.gate {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr {
  width: 380px;
  height: 380px;
  padding: 16px;
  background: #fff;
  border: 6px solid #c9a24b;
  border-radius: 6px;
  margin-right: 70px;
}
.qr svg { display: block; width: 100%; height: 100%; }
.gate-text { width: 640px; }
.brand {
  margin-bottom: 6px;
  font-family: 'Alegreya', Georgia, serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 3px;
  color: #c9a24b;
}
.gate-text h1 {
  margin: 0 0 14px;
  font-family: 'Alegreya', Georgia, serif;
  font-weight: 900;
  font-size: 48px;
  line-height: 1.08;
  color: #ecc76b;
}
.gate-text p { margin: 0 0 9px; font-size: 26px; color: #9a8b70; }
.gate-text p.big { font-size: 30px; color: #eadfc6; }
.gate-text a { color: #ecc76b; text-decoration: none; font-weight: 700; }
.gate-text p.notice { padding: 8px 14px; border-left: 6px solid #c8483c; background: #1a1510; color: #eadfc6; font-size: 23px; }

/* The pages around the game, at the foot of the first screen. */
.gate-foot { position: absolute; left: 0; right: 0; bottom: 16px; margin: 0; text-align: center; font-size: 19px; }
.gate-foot a { margin: 0 16px; color: #9a8b70; text-decoration: none; }
.gate-foot a:hover, .gate-foot a:focus { color: #ecc76b; }

/* The showcase: the games as upright cards in a row, one of them chosen with the remote's arrows. A card is its
   picture on top and, under it, its title, how many play, how long, how hard, and a ticket or free. */
#browse { position: absolute; left: 0; top: 0; right: 0; bottom: 0; text-align: center; }
#browse .brand { margin: 18px 0 0; font-size: 22px; }
#browse h1 { margin: 0 0 14px; font-family: 'Alegreya', Georgia, serif; font-weight: 900; font-size: 40px; line-height: 1.08; color: #ecc76b; }
#browse-cards { display: flex; justify-content: center; align-items: flex-start; height: 452px; }
.game-card {
  display: block; position: relative; width: 300px; height: 440px; margin: 4px 16px 0; box-sizing: border-box;
  border: 3px solid #4a3b27; border-radius: 10px; overflow: hidden;
  background: #1a1510; color: #eadfc6; text-align: left; text-decoration: none;
  transition: transform 0.15s;
}
.game-card.narrow { width: 268px; margin: 4px 10px 0; }
.game-card:hover, .game-card:focus { border-color: #ecc76b; outline: none; transform: scale(1.04); }
.game-pic { display: block; height: 200px; background: #221b14 62% 40% no-repeat; background-size: cover; }
.game-card b { display: block; height: 64px; margin: 12px 16px 8px; overflow: hidden; font-family: 'Alegreya', Georgia, serif; font-weight: 900; font-style: italic; font-size: 28px; line-height: 32px; }
.game-card.narrow b { font-size: 25px; }
.game-card .game-line { display: block; padding: 0 16px; font-size: 20px; line-height: 30px; color: #eadfc6; }
.game-card .game-line i { font-style: normal; color: #9a8b70; }
.game-card em {
  position: absolute; left: 16px; bottom: 14px; padding: 3px 14px; border: 2px solid #c9a24b; border-radius: 4px;
  color: #ecc76b; font-style: normal; font-weight: 700; font-size: 18px; letter-spacing: 1px;
}
.game-card em.free { border-color: #b83228; background: #b83228; color: #fff3e0; }
#browse-code { position: absolute; left: 0; right: 0; bottom: 46px; display: flex; align-items: center; justify-content: center; text-align: left; }
#browse-code .qr { width: 92px; height: 92px; margin: 0 18px 0 0; padding: 5px; border-width: 3px; border-radius: 4px; }
#browse-code p { margin: 0; font-size: 20px; line-height: 1.3; color: #9a8b70; }
#browse-code b { color: #eadfc6; }
#browse-code a { color: #ecc76b; text-decoration: none; font-weight: 700; }
#browse-notice { position: absolute; left: 50%; top: 8px; width: 760px; margin: 0 0 0 -380px; padding: 6px 14px; border-left: 6px solid #c8483c; background: #1a1510; color: #eadfc6; font-size: 20px; text-align: left; }
#browse .gate-foot { bottom: 10px; }

/* The three things to do, numbered like the spots of a room. */
.steps { list-style: none; margin: 18px 0 20px; padding: 0; }
.steps li { display: flex; align-items: center; margin-bottom: 14px; font-size: 28px; line-height: 1.12; color: #eadfc6; }
.steps li b {
  flex: none;
  width: 36px; height: 48px;
  margin-right: 20px;
  border: 2px solid #100d0a;
  border-top: 6px solid #c9a24b;
  border-radius: 3px;
  background: #f2c94c;
  color: #100d0a;
  font-family: 'Alegreya', Georgia, serif;
  font-weight: 900;
  font-size: 29px;
  line-height: 42px;
  text-align: center;
}

#lobby-players { display: flex; flex-wrap: wrap; margin: 18px 0 12px; }
.lobby-player {
  display: flex;
  align-items: center;
  width: 300px;
  height: 52px;
  margin: 0 14px 12px 0;
  padding: 0 14px;
  border: 1px solid #4a3b27;
  border-radius: 6px;
  background: #1a1510;
  font-family: 'Alegreya', Georgia, serif;
  font-size: 27px;
  font-weight: 700;
}
.lobby-player.empty { color: #5c4e39; font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 400; font-size: 23px; }
.lobby-player.away { opacity: 0.45; }
.lobby-player .dot {
  width: 20px; height: 20px; border-radius: 3px;
  margin: 0 18px 0 6px;
  transform: rotate(45deg);
  background: #2b2219;
  border: 2px solid #eadfc6;
}
.lobby-player.empty .dot { border-color: #4a3b27; }
#lobby-hint { color: #ecc76b !important; }

/* Full-screen buttons: a clear target for the TV remote's pointer. */
.full-btn {
  border: 2px solid #c9a24b;
  border-radius: 6px;
  background: #c9a24b;
  color: #100d0a;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 700;
  cursor: pointer;
}
.full-btn:focus { outline: 3px solid #eadfc6; outline-offset: 3px; }
.gate-buttons .full-btn { margin: 6px 14px 0 0; padding: 10px 30px; font-size: 26px; }
#top-full { margin-left: 16px; padding: 1px 12px; font-size: 17px; background: transparent; color: #ecc76b; }

/* ---- game: a thin bar, the room, a thin strip of players ---- */

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

#topbar {
  position: absolute;
  z-index: 5;
  left: 0; top: 0; right: 0;
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  background: #100d0a;
  border-bottom: 1px solid #c9a24b;
}
#title {
  flex: 1;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 700;
  font-size: 20px;
  white-space: nowrap;
}
#timer {
  position: absolute;
  left: 50%; top: 0;
  width: 140px; height: 37px;
  margin-left: -70px;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 900;
  font-size: 26px;
  line-height: 37px;
  text-align: center;
  color: #ecc76b;
}
#join-short { color: #7a6c54; font-size: 17px; white-space: nowrap; }

#room {
  position: absolute;
  left: 0; top: 38px; right: 0;
  height: 628px;
  background: #221b14;
  overflow: hidden;
}
#room-inner {
  position: absolute;
  left: 50%; top: 0;
  width: 1280px; height: 628px;
  margin-left: -640px;
}
#floor {
  position: absolute;
  left: 0; top: 540px; right: 0;
  height: 88px;
  background: #17120d;
  border-top: 2px solid #4a3b27;
}
/* Darkened edges, so the eye stays in the middle of the room. Static, drawn once. */
#vignette {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.5) 100%);
}
/* The picture frame: two brass lines and a diamond in each corner. */
#frame {
  position: absolute;
  z-index: 3;
  left: 7px; top: 7px; right: 7px; bottom: 7px;
  border: 2px solid #c9a24b;
}
#frame:after {
  content: "";
  position: absolute;
  left: 4px; top: 4px; right: 4px; bottom: 4px;
  border: 1px solid #7d6530;
}
#frame i {
  position: absolute;
  width: 16px; height: 16px;
  background: #c9a24b;
  border: 2px solid #100d0a;
  transform: rotate(45deg);
}
#frame i.tl { left: -9px; top: -9px; }
#frame i.tr { right: -9px; top: -9px; }
#frame i.bl { left: -9px; bottom: -9px; }
#frame i.br { right: -9px; bottom: -9px; }

/*
 * A spot. The dashed box stands in for an object in the room picture. What
 * stays in the real game is what sits on top of it: the brass letter, the
 * name and the state line.
 */
.spot {
  position: absolute;
  padding: 8px 10px;
  border: 2px dashed #5a4830;
  border-radius: 6px;
  background: #2b2219;
  overflow: hidden;
}
.spot .head { display: flex; align-items: center; }
.spot .letter {
  flex: none;
  width: 44px; height: 44px;
  margin-right: 10px;
  border-radius: 50%;
  border: 2px solid #100d0a;
  background: #c9a24b;
  color: #100d0a;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 900;
  font-size: 30px;
  line-height: 40px;
  text-align: center;
}
.spot .letter b { font-weight: 900; }
.spot .name {
  font-weight: 700;
  font-size: 20px;
  line-height: 1.05;
}
.spot .status {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.08;
  color: #9a8b70;
}
.spot.tone-on { border: 2px solid #ecc76b; background: #3a2e1c; }
.spot.tone-on .letter { background: #ecc76b; }
.spot.tone-on .status { color: #ecc76b; font-weight: 700; }
.spot.tone-done { border: 2px solid #6fbf8f; }
.spot.tone-done .status { color: #6fbf8f; 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); }
}
/* The whole picture shakes, as a snow globe is shaken (the gift of the Christmas promo). */
#room.quake { animation: quake 0.6s 3; }
@keyframes quake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  15% { transform: translate(-14px, 6px) rotate(-0.6deg); }
  35% { transform: translate(12px, -8px) rotate(0.5deg); }
  55% { transform: translate(-10px, -4px) rotate(-0.4deg); }
  75% { transform: translate(8px, 7px) rotate(0.3deg); }
}
@keyframes pulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* The belt between the crank and the cuckoo. */
.link {
  position: absolute;
  height: 5px;
  margin-top: -2px;
  background: #5a4830;
  transform-origin: 0 50%;
}
.link.active { background: #ecc76b; }

.pendulum {
  position: absolute;
  left: 50%;
  top: 190px;
  width: 5px;
  height: 190px;
  margin-left: -2px;
  background: #5a4830;
  transform-origin: 50% 0;
}
.pendulum:after {
  content: "";
  position: absolute;
  left: -18px; bottom: -20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #5a4830;
}
.pendulum.on { background: #c9a24b; animation: swing 1.6s ease-in-out infinite alternate; }
.pendulum.on:after { background: #ecc76b; }
@keyframes swing {
  from { transform: rotate(-14deg); }
  to { transform: rotate(14deg); }
}

#lights { position: absolute; display: flex; }
#lights .light {
  width: 22px; height: 22px;
  margin: 0 4px;
  border-radius: 50%;
  background: #17120d;
  border: 2px solid #7d6530;
}
#lights .light.lit { background: #ecc76b; border-color: #eadfc6; }
#lights.fail .light { background: #c8483c; border-color: #c8483c; }

/* One diamond per player. It slides when the player walks. */
.marker {
  position: absolute;
  z-index: 2;
  left: 0; top: 0;
  width: 50px; height: 50px;
  transition: transform 1s ease-in-out, opacity 0.3s;
}
.marker .gem {
  position: absolute;
  left: 6px; top: 6px;
  width: 38px; height: 38px;
  border: 3px solid #eadfc6;
  border-radius: 5px;
  transform: rotate(45deg);
}
.marker b {
  position: absolute;
  left: 0; top: 0;
  width: 50px;
  color: #100d0a;
  font-size: 24px;
  font-weight: 900;
  line-height: 50px;
  text-align: center;
}
.marker.offline { opacity: 0.3; }
.marker.holding .gem { border-color: #ecc76b; }

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

#hud {
  position: absolute;
  left: 0; top: 666px; right: 0;
  height: 54px;
  display: flex;
  padding: 7px 10px;
  background: #100d0a;
  border-top: 1px solid #c9a24b;
}
.slot {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  margin: 0 5px;
  padding: 0 10px;
  border: 1px solid #4a3b27;
  border-radius: 6px;
  background: #1a1510;
  overflow: hidden;
  white-space: nowrap;
}
.slot.empty { opacity: 0.35; }
.slot.offline { opacity: 0.5; }
.slot .seal {
  flex: none;
  width: 17px; height: 17px;
  margin: 0 11px 0 3px;
  border-radius: 3px;
  border: 2px solid #eadfc6;
  transform: rotate(45deg);
}
.slot .who {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  font-size: 21px;
}
/* The letter of the spot the player is at. It never gets cut off; the name next to it may. */
.slot .at {
  flex: none;
  width: 26px; height: 26px;
  margin-left: 12px;
  border-radius: 50%;
  background: #c9a24b;
  color: #100d0a;
  font-size: 16px;
  line-height: 26px;
  text-align: center;
}
.slot .at b { font-weight: 900; }
.slot .where {
  flex: 1;
  min-width: 0;
  margin-left: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 18px;
  color: #9a8b70;
}
.slot .items { flex: none; display: flex; margin-left: auto; padding-left: 4px; }
.slot .item {
  margin-left: 6px;
  padding: 0 7px;
  border: 1px solid #c9a24b;
  border-radius: 4px;
  color: #ecc76b;
  font-size: 17px;
  font-weight: 700;
  line-height: 24px;
}

/* A help note, pinned over the top bar like a slip of paper. */
#hint {
  position: absolute;
  z-index: 6;
  left: 0; top: 0; right: 0;
  padding: 9px 40px;
  background: #eadfc6;
  border-bottom: 3px solid #c9a24b;
  color: #2b2217;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

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

#clip {
  position: absolute;
  z-index: 20;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(10, 8, 6, 0.94);
}
#clip { animation: fade 0.35s; }
#clip-tag { margin-bottom: 18px; font-family: 'Alegreya', Georgia, serif; font-weight: 700; font-size: 30px; color: #c9a24b; }
#clip-text {
  padding: 0 80px;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 62px;
  font-weight: 900;
  line-height: 1.1;
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

#offline {
  position: absolute;
  z-index: 30;
  left: 0; right: 0; bottom: 0;
  padding: 8px;
  background: #c8483c;
  color: #100d0a;
  font-size: 21px;
  font-weight: 700;
  text-align: center;
}

/* An item in the strip is its thumbnail. */
.slot .item.thumb { padding: 0; border: 1px solid #c9a24b; border-radius: 5px; overflow: hidden; line-height: 0; }
.slot .item.thumb img { display: block; width: 30px; height: 30px; }

/* ---- reactions: icons that rise from a player's token ---- */

.emote {
  position: absolute;
  z-index: 4;
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  opacity: 0;
  animation: rise-a 1.7s ease-out forwards;
}
.emote.b { animation-name: rise-b; }
.emote.c { animation-name: rise-c; }
@keyframes rise-a {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-34px, -170px) scale(1.15); }
}
@keyframes rise-b {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(6px, -200px) scale(1.3); }
}
@keyframes rise-c {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(38px, -150px) scale(1); }
}

/* ---- a room with a picture ---- */

#room-image { position: absolute; top: 0; height: 628px; }
/* What is laid over the room's picture has an order of its own (a chair before the light of a doorway, a crank's grip
   before its hub), and none of it is ever before a spot's number or a player: the order stays inside this box. */
#layers { position: absolute; left: 0; top: 0; z-index: 0; }
/* Pieces of the room that stand before an open doorway: over its light, which is above the dark, and still behind
   every number and every player. */
#front { position: absolute; left: 0; top: 0; z-index: 0; }
#room.pictured { background: #100d0a; }
#room.pictured #floor, #room.pictured #links { display: none; }

/* A state layer: a cut-out of an edited room picture, faded in over the original. */
.layer { position: absolute; opacity: 0; transition: opacity 0.35s; }
.layer.on { opacity: 1; }
/* A layer that is let down: its window comes down over it and the picture inside goes up by as much, so only the
   window moves. Both take the same time in the same way, or the picture would be seen to slide. */
.layer.unrolls { opacity: 1; overflow: hidden; transform: translateY(-101%); transition: none; }
.layer.unrolls img { display: block; width: 100%; height: 100%; transform: translateY(101%); transition: none; }
.layer.unrolls.on, .layer.unrolls.on img { transform: translateY(0); transition: transform 0.9s cubic-bezier(0.45, 0, 0.85, 0.55) 0.35s; }
/* A painted thing that was filmed: one frame of its sheet shows through this box. It is there at once, and goes out softly. */
.motion { position: absolute; overflow: hidden; opacity: 0; }
.motion.on { opacity: 1; }
.motion.out { transition: opacity 0.3s; }
.motion img { position: absolute; left: 0; top: 0; max-width: none; }

/* The glass case of the clock: the pendulum swings inside it and is clipped by it. */
.case { position: absolute; overflow: hidden; }
.case .pendulum { top: 4px; width: 4px; margin-left: -2px; background: #8a6a2a; }
.case .pendulum:after { left: -13px; bottom: -14px; width: 30px; height: 30px; background: #c9a24b; border: 2px solid #6b4f1c; }
.case .pendulum.on { background: #8a6a2a; }
.case .pendulum.on:after { background: #ecc76b; }

/* Over a picture the box is invisible. Only its letter shows. */
#room.pictured .spot { padding: 0; border: 2px solid transparent; border-radius: 8px; background: transparent; overflow: visible; }
/* No outline around an active object: the picture shows what is happening. */
/* Over a picture a spot is just its letter. Names and states are on the phones; the picture shows the rest. */
#room.pictured .tag { position: absolute; left: 6px; top: 6px; }
#room.pictured .spot .name, #room.pictured .spot .status { display: none; }
#room.pictured .spot .letter {
  width: 42px; height: 42px;
  margin: 0;
  border: 2px solid #100d0a;
  font-size: 28px;
  line-height: 38px;
  box-shadow: 0 0 0 2px rgba(16, 13, 10, 0.55);
}
#room.pictured #lights .light { width: 18px; height: 18px; margin: 0 3px; background: rgba(16, 13, 10, 0.85); }
#room.pictured #lights .light.lit { background: #ecc76b; }
#room.pictured #lights.fail .light { background: #c8483c; }

/* ---- typeface: Alegreya for names, titles and letters; Alegreya Sans for everything else ---- */

#title, #timer, .spot .letter, .marker b, .slot .who, .slot .at,
#hint, #clip-text {
  font-family: 'Alegreya', Georgia, serif;
}
/* ---- the numbers of the spots as evidence markers: an upright yellow card with a black number and a folded top ---- */

.spot .letter, #room.pictured .spot .letter, .slot .at {
  /* Figures that all stand on the line and are all as tall as a capital: by itself the typeface draws a 3 and a 5
     that hang under it and a 1 that could be an I, and these are read from across a room. */
  -webkit-font-feature-settings: "lnum";
  font-feature-settings: "lnum";
  font-variant-numeric: lining-nums;
  position: relative;
  border-radius: 3px;
  border: 2px solid #100d0a;
  background: #f2c94c;
  color: #100d0a;
  overflow: hidden;
}
.spot .letter:before, .slot .at:before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 5px;
  background: #c9a24b;
  border-bottom: 1px solid #100d0a;
}
.spot .letter, #room.pictured .spot .letter {
  width: 36px; height: 48px;
  font-size: 29px;
  line-height: 50px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}
.slot .at { width: 20px; height: 27px; font-size: 16px; line-height: 28px; }
.slot .at:before { height: 3px; }

/* ---- moving parts over the room picture ---- */

/* A loose piece that turns about its own centre, like the crank handle on its axle. */
.sprite { position: absolute; }
.sprite.spin { animation: spin 1.5s linear infinite; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* A belt strand: light marks slide along it while it runs. */
.belt { position: absolute; height: 3px; margin-top: -1px; transform-origin: 0 50%; overflow: hidden; opacity: 0; }
.belt.on { opacity: 1; }
.belt i {
  display: block;
  width: 200%; height: 100%;
  background: repeating-linear-gradient(90deg, rgba(236, 199, 107, 0) 0, rgba(236, 199, 107, 0) 14px, rgba(236, 199, 107, 0.38) 14px, rgba(236, 199, 107, 0.38) 24px);
}
.belt.on i { animation: run 0.5s linear infinite; }
@keyframes run {
  from { transform: translateX(-24px); }
  to { transform: translateX(0); }
}

/*
 * Lamp light: a wide warm halo with a brighter core at the flame. The gradients
 * are drawn once. Opacity and size are moved by the page in random steps (see
 * waver in tv.js), each carried by a transition.
 */
.glow {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 100, 0.7) 0, rgba(255, 178, 72, 0.42) 26%, rgba(255, 154, 52, 0.18) 50%, rgba(255, 140, 40, 0) 72%);
  opacity: 0.5;
}
.glow .core {
  position: absolute;
  left: 36%; top: 36%;
  width: 28%; height: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 200, 0.8) 0, rgba(255, 220, 130, 0.45) 35%, rgba(255, 200, 100, 0) 72%);
  opacity: 0.75;
}

/* A bulb with a bad contact, a flame in a draught: a patch of dark over the painted lamp, there for an instant (stutter in tv.js). */
.lamp-dim {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(5, 7, 12, 0.95) 0, rgba(5, 7, 12, 0.7) 40%, rgba(5, 7, 12, 0) 72%);
  opacity: 0;
}
.glow.green { background: radial-gradient(circle, rgba(214, 255, 226, 0.5) 0, rgba(150, 230, 180, 0.26) 26%, rgba(120, 210, 160, 0.1) 50%, rgba(120, 210, 160, 0) 72%); }
.glow.green .core { background: radial-gradient(circle, rgba(245, 255, 248, 0.8) 0, rgba(190, 245, 210, 0.4) 38%, rgba(160, 235, 190, 0) 72%); }
.glow.screen { background: radial-gradient(circle, rgba(190, 240, 255, 0.5) 0, rgba(130, 215, 240, 0.25) 30%, rgba(110, 200, 230, 0.08) 52%, rgba(110, 200, 230, 0) 72%); }
.glow.screen .core { background: radial-gradient(circle, rgba(235, 252, 255, 0.7) 0, rgba(170, 230, 250, 0.3) 40%, rgba(150, 220, 245, 0) 72%); }
/* What glows of itself in the dark, as on the phone's picture of it: pale at its heart, brass at its edge. */
.glow.pale { background: radial-gradient(circle, rgba(255, 238, 190, 0.75) 0, rgba(236, 199, 107, 0.42) 18%, rgba(236, 199, 107, 0.14) 42%, rgba(236, 199, 107, 0) 70%); }
.glow.pale .core { left: 32%; top: 32%; width: 36%; height: 36%; background: radial-gradient(circle, rgba(255, 252, 236, 1) 0, rgba(255, 240, 196, 0.85) 30%, rgba(246, 214, 140, 0.35) 55%, rgba(236, 199, 107, 0) 72%); }

/*
 * ---- what lives in a room, and what shows that something happened (FX in tv.js) ----
 * Every one of these is drawn here and moved by the page with transform and opacity alone. Each is a box at 0,0 of
 * the room or at its own place; `on` is the room saying it is there.
 */
#shine { position: absolute; left: 0; top: 0; }
.fx { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity 0.9s; pointer-events: none; }
.fx.on { opacity: 1; }
.fx svg { display: block; width: 100%; height: 100%; }

/* A spider on its thread, and one that walks. */
.fx-spider .thread { position: absolute; left: 0; top: 0; width: 1px; background: rgba(196, 206, 220, 0.5); transform-origin: 50% 0; }
.fx-spider .bug { position: absolute; left: -9px; top: -5px; width: 18px; height: 14px; }
.fx-crawler .bug { position: absolute; left: -8px; top: -6px; width: 15px; height: 12px; }

/* Moths, a fly, dust, fireflies. */
.moth { position: absolute; left: -7px; top: -5px; width: 14px; height: 10px; }
.moth svg { fill: #d4cfbf; animation: flap 0.09s linear infinite alternate; }
.moth.still svg { animation: none; }
@keyframes flap {
  from { transform: scaleX(1); }
  to { transform: scaleX(0.25); }
}
/* A fly from above: its dark body is about three units by five, smaller than the dot it was; its wings blur in flight. */
.fly { position: absolute; left: -3.5px; top: -3.5px; width: 7px; height: 7px; }
.fly svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.fly.flying .wings { animation: buzz 0.04s linear infinite alternate; }
@keyframes buzz {
  from { transform: scaleX(1); opacity: 0.9; }
  to { transform: scaleX(0.6); opacity: 0.55; }
}
/* The hands of a wall clock, turned by the hour of the game: each turns about the foot of itself, the pin. */
.fx-hands { position: absolute; }
.fx-hands i { position: absolute; border-radius: 2px; background: #2b2217; transform-origin: 50% 100%; }
.fx-hands .minute { background: #1a1510; }
.fx-hands .pin { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #1a1510; }
.flake { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: #f4f8ff; opacity: 0; }
/* The four bulbs along the front of the little house of the Christmas promo: what its switches do. */
.glow.bulb-red { background: radial-gradient(circle, rgba(255, 170, 160, 0.95) 0, rgba(230, 60, 50, 0.6) 26%, rgba(200, 40, 30, 0.2) 50%, rgba(200, 40, 30, 0) 72%); }
.glow.bulb-green { background: radial-gradient(circle, rgba(190, 255, 200, 0.95) 0, rgba(60, 200, 90, 0.6) 26%, rgba(40, 170, 70, 0.2) 50%, rgba(40, 170, 70, 0) 72%); }
.glow.bulb-yellow { background: radial-gradient(circle, rgba(255, 250, 190, 0.95) 0, rgba(250, 210, 60, 0.6) 26%, rgba(230, 180, 30, 0.2) 50%, rgba(230, 180, 30, 0) 72%); }
.glow.bulb-blue { background: radial-gradient(circle, rgba(190, 215, 255, 0.95) 0, rgba(70, 120, 250, 0.6) 26%, rgba(40, 90, 230, 0.2) 50%, rgba(40, 90, 230, 0) 72%); }
.mote { position: absolute; left: 0; top: 0; width: 3px; height: 3px; border-radius: 50%; background: #e3eaf6; opacity: 0; }
.mote.warm { background: #ffb35c; }
.firefly {
  position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(236, 255, 160, 1) 0, rgba(196, 238, 96, 0.6) 32%, rgba(170, 220, 70, 0) 70%);
}

/* Embers over a fire are the same thing, smaller and red. */
.fx-fireflies.ember .firefly {
  left: -3px; top: -3px; width: 6px; height: 6px;
  background: radial-gradient(circle, rgba(255, 220, 150, 1) 0, rgba(255, 150, 60, 0.7) 40%, rgba(255, 120, 40, 0) 72%);
}

/* Eyes in a dark place. */
.fx-eyes .pair { position: absolute; width: 0; height: 0; opacity: 0; }
.fx-eyes .pair i { position: absolute; left: 0; top: 0; width: 4px; height: 4px; border-radius: 50%; background: #ecd77f; box-shadow: 0 0 5px 1px rgba(236, 215, 127, 0.6); }

/* A rat, a bat. */
.rat { position: absolute; left: -18px; top: -13px; width: 38px; height: 13px; opacity: 0; }
.bat { position: absolute; left: -16px; top: -6px; width: 32px; height: 13px; opacity: 0; }
.bat svg { animation: wing 0.15s linear infinite alternate; }
@keyframes wing {
  from { transform: scaleY(1); }
  to { transform: scaleY(0.3); }
}

/* Stars that twinkle, and one that falls. */
.star { position: absolute; left: -1px; top: -1px; width: 3px; height: 3px; border-radius: 50%; background: #f4f7ff; }
.falling { position: absolute; left: 0; top: 0; width: 46px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.95) 100%); }

/* Steam and smoke: puffs that rise, spread and are gone. */
.fx-steam b { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.fx-steam .puff {
  position: absolute; top: -17px; width: 34px; height: 34px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(228, 235, 242, 0.6) 0, rgba(228, 235, 242, 0.3) 45%, rgba(228, 235, 242, 0) 72%);
}
.fx-steam.smoke .puff { background: radial-gradient(circle, rgba(70, 76, 86, 0.6) 0, rgba(70, 76, 86, 0.3) 45%, rgba(70, 76, 86, 0) 72%); }
.fx-steam.on .puff.a { animation: steam-a 3s linear infinite; }
.fx-steam.on .puff.b { animation: steam-b 3s linear infinite; }
.fx-steam.on .puff.c { animation: steam-c 3s linear infinite; }
@keyframes steam-a {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  18% { opacity: 0.9; }
  100% { transform: translate(14px, -90px) scale(2); opacity: 0; }
}
@keyframes steam-b {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  22% { opacity: 0.8; }
  100% { transform: translate(-12px, -84px) scale(1.8); opacity: 0; }
}
@keyframes steam-c {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  15% { opacity: 0.85; }
  100% { transform: translate(4px, -96px) scale(2.3); opacity: 0; }
}

/* Water running from a spout. */
.fx-stream { overflow: hidden; border-radius: 3px; background: rgba(188, 214, 236, 0.3); }
.fx-stream i {
  display: block; width: 100%; height: 200%;
  background: repeating-linear-gradient(180deg, rgba(236, 246, 255, 0) 0, rgba(236, 246, 255, 0) 9px, rgba(236, 246, 255, 0.75) 9px, rgba(236, 246, 255, 0.75) 16px);
}
.fx-stream.on i { animation: pour 0.28s linear infinite; }
@keyframes pour {
  from { transform: translateY(-16px); }
  to { transform: translateY(0); }
}

/* Sparks. */
.fx-sparks .flash {
  position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 1) 0, rgba(170, 205, 255, 0.7) 30%, rgba(120, 170, 255, 0) 70%);
}
.fx-sparks i { position: absolute; left: -5px; top: -1px; width: 10px; height: 2px; border-radius: 1px; background: #eaf2ff; opacity: 0; }

/* A patch of light: cold by itself, or warm, or the green of a shade; `beam` is a shaft from its left end. */
.fx-light { transform-origin: 0 50%; }
.fx-light i { display: block; width: 100%; height: 100%; background: radial-gradient(ellipse at center, rgba(208, 224, 255, 0.62) 0, rgba(190, 210, 255, 0.3) 42%, rgba(190, 210, 255, 0) 72%); }
.fx-light.warm i { background: radial-gradient(ellipse at center, rgba(255, 214, 140, 0.62) 0, rgba(255, 190, 100, 0.3) 42%, rgba(255, 180, 90, 0) 72%); }
.fx-light.green i { background: radial-gradient(ellipse at center, rgba(190, 255, 214, 0.5) 0, rgba(150, 235, 180, 0.24) 42%, rgba(150, 235, 180, 0) 72%); }
.fx-light.red i { background: radial-gradient(ellipse at center, rgba(255, 96, 80, 0.6) 0, rgba(235, 70, 60, 0.28) 42%, rgba(235, 70, 60, 0) 72%); }
.fx-light.beam i { background: linear-gradient(90deg, rgba(216, 230, 255, 0.5) 0, rgba(216, 230, 255, 0.22) 55%, rgba(216, 230, 255, 0) 100%); }
.fx-light.slow { transition: opacity 6s; }
.fx-light.cone i { background: none; }

/* A door that has opened: light where the door was, growing from the latch, and light on the floor before it. */
.fx-door { opacity: 1; }
/* A crank fitted to its shaft: there from the moment the room names it, turning or not. */
.fx-crank { opacity: 1; transition: none; }
.fx-crank img { position: absolute; }
.fx-door .gap {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 42%, rgba(226, 238, 255, 0.96) 0, rgba(176, 202, 246, 0.9) 46%, rgba(96, 124, 178, 0.88) 100%);
  box-shadow: 0 0 30px 8px rgba(170, 200, 255, 0.38), inset 0 0 18px 4px rgba(20, 30, 52, 0.55);
  transform: scaleX(0); opacity: 0;
  transition: transform 1.6s ease-in-out, opacity 0.5s;
}
.fx-door.on .gap { transform: scaleX(1); opacity: 1; }
.fx-door .spill {
  position: absolute; left: -22%; width: 144%; opacity: 0; transition: opacity 1.8s;
  background: radial-gradient(ellipse at 50% 0, rgba(196, 216, 255, 0.5) 0, rgba(196, 216, 255, 0.2) 45%, rgba(196, 216, 255, 0) 75%);
}
.fx-door.on .spill { opacity: 1; }
.fx-door.warm .gap { background: radial-gradient(ellipse at 50% 42%, rgba(255, 236, 190, 0.96) 0, rgba(250, 200, 120, 0.9) 46%, rgba(170, 110, 50, 0.88) 100%); box-shadow: 0 0 30px 8px rgba(255, 200, 120, 0.38), inset 0 0 18px 4px rgba(52, 30, 12, 0.55); }
.fx-door.warm .spill { background: radial-gradient(ellipse at 50% 0, rgba(255, 210, 130, 0.5) 0, rgba(255, 200, 120, 0.2) 45%, rgba(255, 200, 120, 0) 75%); }
/* A way into the dark: a hidden passage has no lamp behind it. */
.fx-door.dark .gap {
  background: radial-gradient(ellipse at 50% 82%, rgba(128, 156, 204, 0.42) 0, rgba(52, 68, 98, 0.5) 24%, rgba(10, 13, 20, 0.97) 62%), #05070b;
  box-shadow: inset 0 0 16px 4px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(150, 172, 210, 0.28);
}
.fx-door.dark .spill { background: none; }

/* Something here is at work: a soft edge of light that breathes. */
.fx-pulse { border-radius: 10px; box-shadow: 0 0 20px 5px rgba(236, 199, 107, 0.5), inset 0 0 16px 3px rgba(236, 199, 107, 0.3); }
.fx-pulse.cold { box-shadow: 0 0 0 1px rgba(226, 238, 255, 0.6), 0 0 22px 6px rgba(200, 222, 255, 0.7), inset 0 0 18px 4px rgba(200, 222, 255, 0.4); }
.fx-pulse.red { box-shadow: 0 0 20px 5px rgba(232, 84, 70, 0.55), inset 0 0 16px 3px rgba(232, 84, 70, 0.3); }
.fx-pulse.green { box-shadow: 0 0 20px 5px rgba(120, 226, 150, 0.55), inset 0 0 16px 3px rgba(120, 226, 150, 0.3); }
.fx-pulse.on { animation: breathe 1.3s ease-in-out infinite alternate; }
@keyframes breathe {
  from { opacity: 0.2; }
  to { opacity: 0.95; }
}

/* Mist on a pane. */
.fx-mist { border-radius: 6px; transition: opacity 2.5s; background: radial-gradient(ellipse at center, rgba(206, 215, 223, 0.9) 0, rgba(206, 215, 223, 0.75) 60%, rgba(206, 215, 223, 0.4) 100%); }
.fx-mist.on { opacity: 0.8; }

/* A ball that turns. */
.fx-sheen { border-radius: 50%; overflow: hidden; }
.fx-sheen i { display: block; width: 60%; height: 100%; background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(236, 246, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%); }
.fx-sheen.on i { animation: sweep 0.9s linear infinite; }
@keyframes sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(170%); }
}

/* ---- sound button, shown only while the browser still blocks sound ---- */
#top-sound { margin-left: 16px; padding: 1px 12px; font-size: 17px; }

/* ---- loading, in the lobby ---- */
#lobby-loading { margin: 2px 0 12px; font-size: 22px; color: #9a8b70; }
#lobby-loading .track { width: 420px; height: 10px; margin-top: 8px; border-radius: 5px; background: #2b2219; overflow: hidden; }
#lobby-loading .track i { display: block; height: 100%; background: #c9a24b; transform-origin: 0 50%; transform: scaleX(0); transition: transform 0.2s; }

/* ---- the clock: brass while it runs, pale while it stands, red in extra time ---- */
#timer.still, #timer.over.still { color: #9a8b70; }
#timer.over { color: #e2675b; }

/* ---- film: a video file, or cards with words ---- */

#film {
  position: absolute;
  z-index: 8;
  left: 0; top: 0; right: 0; bottom: 0;
  background: #000;
}
#film-video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: #000; }
/* Under a voice the picture waits behind the dark, comes up out of it and goes back into it. */
#film-video.veiled { opacity: 0; }
#film-video.veiled.lit { animation: fade 1.3s forwards; }
#film-video.veiled.gone { animation: fade-out 1.3s forwards; }
#film-card.out { animation: fade-out 0.9s forwards; }
#curtain { position: absolute; z-index: 9; left: 0; top: 0; right: 0; bottom: 0; background: #000; pointer-events: none; }
#curtain.lift { animation: fade-out 1.6s forwards; }
@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
#film-card {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 110px;
  text-align: center;
  opacity: 0;
}
#film-card.in { animation: fade 1.2s forwards; }
#film-card h1 { margin: 0 0 22px; font-family: 'Alegreya', Georgia, serif; font-weight: 900; font-size: 76px; line-height: 1.05; color: #ecc76b; }
#film-card p { margin: 0; font-family: 'Alegreya', Georgia, serif; font-weight: 700; font-size: 44px; line-height: 1.2; color: #eadfc6; }
/* The words of a spoken film: subtitles on a shadow that fades upward, like the host's words over a room. */
#film-sub {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 70px 150px 44px;
  background: linear-gradient(to top, rgba(8, 7, 6, 0.96) 0, rgba(8, 7, 6, 0.86) 55%, rgba(8, 7, 6, 0) 100%);
  text-align: center;
}
#film-sub b {
  display: block;
  margin-bottom: 4px;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 20px;
  color: #8f2f26;
}
#film-sub span {
  display: block;
  font-family: 'Alegreya', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 38px;
  line-height: 1.14;
  color: #eadfc6;
}
#film-sub.in span { animation: fade 0.35s; }
#film-wait { position: absolute; left: 0; right: 0; top: 340px; font-size: 26px; color: #7a6c54; text-align: center; }
#film-sound { position: absolute; right: 40px; bottom: 40px; padding: 10px 30px; font-size: 26px; }

/* ---- map: the rooms in a row ---- */

#map {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
#map h1 { margin: 0 0 40px; font-family: 'Alegreya', Georgia, serif; font-weight: 900; font-size: 64px; line-height: 1; color: #ecc76b; }
#map-path { display: flex; justify-content: center; margin-bottom: 40px; }
/* One room: its number on a plate, its name under it once it is known. */
.stop { position: relative; width: 190px; padding: 0 8px; }
.stop:before { content: ""; position: absolute; z-index: 0; left: -50%; right: 50%; top: 38px; height: 4px; background: #4a3b27; }
.stop:first-child:before { display: none; }
.stop.done:before, .stop.next:before { background: #c9a24b; }
.stop b {
  position: relative;
  z-index: 1;
  display: block;
  width: 80px; height: 80px;
  margin: 0 auto 14px;
  border: 3px solid #4a3b27;
  border-radius: 50%;
  background: #1a1510;
  color: #7a6c54;
  font-family: 'Alegreya', Georgia, serif;
  font-weight: 900;
  font-size: 40px;
  line-height: 74px;
}
.stop .t { display: block; height: 58px; overflow: hidden; font-size: 24px; font-weight: 700; line-height: 1.15; color: #5c4e39; }
.stop .ms { display: block; margin-top: 4px; font-family: 'Alegreya', Georgia, serif; font-weight: 700; font-size: 24px; color: #9a8b70; }
.stop.done b { border-color: #6fbf8f; background: #6fbf8f; color: #100d0a; }
.stop.done .t { color: #9a8b70; }
.stop.next b { border-color: #ecc76b; background: #ecc76b; color: #100d0a; transform: scale(1.18); }
.stop.next .t { color: #eadfc6; }
.stop.next .ms { color: #ecc76b; }
/* Eight to ten rooms still fit in one row: smaller plates, shorter names. */
#map-path.many .stop { width: 122px; padding: 0 4px; }
#map-path.many .stop b { width: 60px; height: 60px; font-size: 30px; line-height: 54px; }
#map-path.many .stop:before { top: 28px; }
#map-path.many .stop .t { height: 62px; font-size: 18px; }
#map-path.many .stop .ms { font-size: 20px; }
#map-clock { margin: 0 0 12px; font-family: 'Alegreya', Georgia, serif; font-weight: 700; font-size: 34px; color: #eadfc6; }
#map-clock.over { color: #e2675b; }
#map-hint { margin: 0; font-size: 26px; color: #ecc76b; }

/* ---- pause: over whatever was on screen, which still shows through ---- */

#paused {
  position: absolute;
  z-index: 25;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(10, 8, 6, 0.86);
}
#paused h1 { margin: 0 0 16px; font-family: 'Alegreya', Georgia, serif; font-weight: 900; font-size: 96px; line-height: 1; color: #ecc76b; }
#paused p { margin: 0 0 10px; font-size: 32px; }
#paused p.dim { color: #9a8b70; font-size: 26px; }

/* ---- the end: the result, and beside it the hall of fame ---- */

#end {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
#end-result { width: 580px; }
#end-team { margin: 0; font-family: 'Alegreya', Georgia, serif; font-weight: 900; font-size: 58px; line-height: 1.05; color: #ecc76b; }
#end-done { margin: 6px 0 0; font-size: 28px; color: #9a8b70; }
#end-total { margin: 8px 0 0; font-family: 'Alegreya', Georgia, serif; font-weight: 900; font-size: 104px; line-height: 1; color: #eadfc6; }
#end-over { margin: 6px 0 0; font-size: 26px; color: #e2675b; }
#end-rooms { display: flex; flex-wrap: wrap; justify-content: center; margin: 22px 0 12px; }
#end .row {
  display: flex; align-items: center;
  width: 540px; height: 42px;
  margin: 0 5px 6px; padding: 0 16px 0 8px;
  border: 1px solid #4a3b27; border-radius: 6px; background: #1a1510;
  font-size: 23px; text-align: left;
}
#end .row b {
  flex: none; width: 30px; height: 30px; margin-right: 14px;
  border-radius: 50%; background: #6fbf8f; color: #100d0a;
  font-family: 'Alegreya', Georgia, serif; font-weight: 900; font-size: 19px; line-height: 30px; text-align: center;
}
#end .row .t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; }
#end .row .ms { flex: none; margin-left: 12px; font-family: 'Alegreya', Georgia, serif; font-weight: 700; color: #ecc76b; }
/* Eight to ten rooms: two narrow columns. */
#end-rooms.two .row { width: 270px; height: 38px; font-size: 19px; padding-right: 10px; }
#end-rooms.two .row b { width: 26px; height: 26px; margin-right: 8px; font-size: 16px; line-height: 26px; }
#end-hints { margin: 0; font-size: 26px; color: #9a8b70; }

#end-fame { width: 540px; margin-left: 60px; padding-left: 60px; border-left: 1px solid #4a3b27; }
#end-fame h2 { margin: 0; font-family: 'Alegreya', Georgia, serif; font-weight: 900; font-size: 44px; line-height: 1; letter-spacing: 2px; color: #c9a24b; }
#fame-place { min-height: 31px; margin: 8px 0 14px; font-size: 26px; font-weight: 700; color: #eadfc6; }
#fame-list .row { width: 480px; margin-left: 0; margin-right: 0; }
#fame-list .row b { background: #2b2219; border: 1px solid #7d6530; color: #ecc76b; line-height: 28px; }
#fame-list .row.mine { border: 2px solid #ecc76b; background: #2b2219; }
#fame-list .row.mine b { background: #ecc76b; border-color: #ecc76b; color: #100d0a; }
#fame-list .gap { height: 22px; font-size: 24px; line-height: 14px; color: #7a6c54; }
/* A team that did not get out: on the list, with no place and no time. A room that was not solved. */
#fame-list .row.lost .t, #fame-list .row.lost .ms { color: #9a8b70; }
#fame-list .row.lost .ms { font-size: 20px; }
#end-rooms .row.unsolved .t, #end-rooms .row.unsolved .ms { color: #7a6c54; }

/* The team's name in the lobby. */
.gate-text p.team { margin: -6px 0 12px; font-family: 'Alegreya', Georgia, serif; font-weight: 700; font-size: 30px; color: #eadfc6; }

/* On the end screen, the way to the next game: the TV's QR, small, in the top left corner. */
#end-code { position: absolute; left: 26px; top: 22px; display: flex; align-items: center; text-align: left; }
#end-onward { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); padding: 12px 36px; font-size: 26px; white-space: nowrap; }
#end-code .qr { width: 92px; height: 92px; margin: 0 14px 0 0; padding: 5px; border-width: 2px; border-radius: 4px; }
#end-code p { margin: 0; font-size: 17px; line-height: 1.2; color: #7a6c54; }
#end-code b { color: #9a8b70; }

/* ---- what an experience with air, traps and a voice adds ---- */

/* The clock may carry a word ("Αέρας 62:10"), so it gets the room for it. */
#timer { width: 260px; margin-left: -130px; }
#timer.hit { color: #e2675b; animation: pulse 0.6s; }
#timer.low { color: #e2675b; }
#penalty {
  position: absolute;
  left: 50%; top: 0;
  height: 37px;
  margin-left: 140px;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 37px;
  white-space: nowrap;
  color: #e2675b;
}
/* A room's own time (a train's car), left of the game's clock: it ends where the clock's room begins. */
#car {
  position: absolute;
  right: 50%; top: 0;
  height: 37px;
  margin-right: 150px;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 37px;
  white-space: nowrap;
  color: #eadfc6;
}
#car.low { color: #e2675b; }
#car.still { color: #9a8b70; }
#penalty.go { animation: penalty 2.6s; }
@keyframes penalty {
  0% { opacity: 0; transform: scale(1.5); }
  8% { opacity: 1; transform: scale(1); }
  75% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* Darkness and fog. The letters stay bright; everything else goes under. */
#shade { position: absolute; left: -210px; top: 0; right: -210px; bottom: 0; opacity: 0; transition: opacity 0.7s; }
#shade.dark, .spot .veil.dark { background: #050403; }
#shade.fog, .spot .veil.fog { background: #7f8c86; }
.spot .veil { position: absolute; left: 0; top: 0; right: 0; bottom: 0; opacity: 0; transition: opacity 0.7s; }
.spot .tag { position: relative; z-index: 1; }
.spot .name, .spot .status { transition: opacity 0.7s; }

/* Something stands on a spot: nobody can go there. */
.spot.blocked { border: 2px solid #c8483c; }
.spot.blocked .status { color: #e2675b; font-weight: 700; }

/* Players who walked out of a solved room. */
.marker.gone { opacity: 0; }

/* One line across the top of the room: what the room wants said, or how the exit stands. */
#banner {
  position: absolute;
  z-index: 4;
  left: 190px; right: 190px; top: 15px;
  height: 36px;
  border: 1px solid #c9a24b;
  border-radius: 18px;
  background: #100d0a;
  color: #ecc76b;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 34px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}
#banner.exit { border-color: #6fbf8f; color: #6fbf8f; }
#banner.shut { border-color: #c8483c; color: #e2675b; }

/* The bag: what the group carries from room to room, on the floor to the left. */
#bag { position: absolute; left: 18px; top: 548px; width: 490px; height: 74px; overflow: hidden; }
#bag b, #bag span {
  float: left;
  height: 30px;
  margin: 0 6px 6px 0;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 17px;
  font-weight: 700;
  line-height: 28px;
  white-space: nowrap;
}
#bag b { padding-left: 0; color: #7a6c54; font-weight: 900; letter-spacing: 1px; }
#bag span { border: 1px solid #7d6530; background: #1a1510; color: #ecc76b; }
/* A thing with a picture is its picture: one row of them, with the word beside their middle. */
#bag span.pic { height: 44px; margin-right: 5px; padding: 0; overflow: hidden; line-height: 0; border-radius: 5px; }
#bag span.pic img { display: block; width: 42px; height: 42px; }
#bag.pics b { margin-top: 7px; }

/* The voice of the house, in the band between the two rows of spots. */
#voice {
  position: absolute;
  z-index: 4;
  left: 60px; right: 60px; top: 263px;
  min-height: 64px;
  padding: 7px 26px 9px;
  border-top: 1px solid #7d6530;
  border-bottom: 1px solid #7d6530;
  background: rgba(10, 8, 6, 0.95);
  text-align: center;
}
#voice b {
  display: block;
  font-family: 'Alegreya Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 18px;
  color: #8f2f26;
}
#voice span {
  display: block;
  font-family: 'Alegreya', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 27px;
  line-height: 1.12;
  color: #eadfc6;
}
#voice.in { animation: fade 0.4s; }

/* Low air: a dark red ring closes in from the edges. Drawn once; only its opacity moves. */
#air {
  position: absolute;
  z-index: 2;
  left: 0; top: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(60, 6, 4, 0) 46%, rgba(60, 6, 4, 0.8) 100%);
  opacity: 0;
  transition: opacity 2s;
}

/* A fright. One flash, never a flicker. */
#scare {
  position: absolute;
  z-index: 22;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1c0806;
}
#scare-flash { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: #f3ead2; opacity: 0; }
#scare-text {
  position: relative;
  padding: 0 110px;
  font-family: 'Alegreya', Georgia, serif;
  font-weight: 900;
  font-size: 56px;
  line-height: 1.12;
  text-align: center;
  color: #f3ead2;
}
/*
 * A fright that is seen. The breath before it: the whole screen dark and silent for less than half a second. Then
 * the thing is there, in the room, under the one flash; its words are a caption at the foot of the screen and do
 * not cover it. `wait` is the breath: the fright has begun and nothing of it shows yet.
 */
#breath { position: absolute; z-index: 21; left: 0; top: 0; right: 0; bottom: 0; background: #000; opacity: 0; pointer-events: none; }
#fright { position: absolute; z-index: 3; transform-origin: 50% 100%; } /* in front of the numbers (1) and the players (2), behind his words (4) */
#fright-pic { display: block; width: 100%; height: 100%; }
/*
 * A fright that was filmed: a thing that moves, frame after frame, over the whole screen and in front of everything.
 * Its frames are one picture; the window is as large as the screen and the picture is moved under it, a frame at a
 * time, by `transform` alone.
 */
#flight { position: absolute; z-index: 23; left: 50%; top: 0; width: 1280px; height: 720px; margin-left: -640px; overflow: hidden; pointer-events: none; }
#flight-sheet { position: absolute; left: 0; top: 0; max-width: none; }
#fright.go { animation: fright-in 0.2s; }
@keyframes fright-in {
  0% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
/* Its flash is shorter than a told fright's, so that the thing is seen at once. */
#scare.seen.go #scare-flash { animation: scare-flash-seen 0.42s; }
@keyframes scare-flash-seen {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}
#scare.wordless #scare-text { display: none; }
#scare.seen { background: transparent; align-items: flex-end; }
#scare.seen #scare-text {
  width: 100%;
  padding: 70px 150px 92px;
  font-size: 34px;
  background: linear-gradient(180deg, rgba(8, 4, 3, 0) 0, rgba(8, 4, 3, 0.86) 46%, rgba(8, 4, 3, 0.94) 100%);
}
#scare.wait #scare-text, #scare.wait #scare-flash { opacity: 0; animation: none; }
#scare.go #scare-flash { animation: scare-flash 0.7s; }
#scare.go #scare-text { animation: scare-text 0.5s; }
#scare.out { opacity: 0; transition: opacity 0.6s; }
@keyframes scare-flash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes scare-text {
  0% { transform: scale(1.6); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* The lobby's small print: what kind of evening this is. */
.gate-text p.warning { margin: -4px 0 10px; font-size: 20px; line-height: 1.2; color: #9a8b70; }

/* More than ten rooms: three narrow columns. */
#end-rooms.three { margin: 14px 0 8px; }
#end.long #end-result { width: 672px; }
#end.long #end-fame { width: 420px; margin-left: 36px; padding-left: 36px; }
#end.long #fame-list .row { width: 400px; }
#end-rooms.three .row { width: 214px; height: 33px; margin: 0 3px 5px; padding: 0 8px 0 5px; font-size: 16px; }
#end-rooms.three .row b { width: 23px; height: 23px; margin-right: 6px; font-size: 14px; line-height: 23px; }
#end-rooms.three .row .ms { margin-left: 6px; }
#end.long #end-team { font-size: 46px; }
#end.long #end-total { font-size: 84px; }
#end-traps { margin: 4px 0 0; font-size: 22px; color: #9a8b70; }
#end-over.good { color: #6fbf8f; }
#end.failed #end-done { color: #e2675b; }

/* ---- a room of the mansion with its picture ---- */

/* The cold light of a bare bulb, where a flame's would be warm. */
.glow.cold { background: radial-gradient(circle, rgba(228, 238, 255, 0.55) 0, rgba(190, 212, 255, 0.28) 26%, rgba(160, 190, 255, 0.11) 50%, rgba(160, 190, 255, 0) 72%); }
.glow.cold .core { background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0, rgba(220, 232, 255, 0.4) 38%, rgba(200, 220, 255, 0) 72%); }
/* Over a picture the one veil over the room is the darkness; a second one in each spot would show as a box. */
#room.pictured .spot .veil { display: none; }
/* The bag lies on painted flagstones: its word gets a plate like its things. */
#room.pictured #bag b { padding-left: 9px; border: 1px solid #4a3b27; background: #100d0a; color: #9a8b70; }
/* Over a picture the host's words are subtitles: along the bottom, on a shadow that fades upward, not a band across the middle. */
#room.pictured #voice {
  z-index: 2;
  top: auto; bottom: 0;
  left: -210px; right: -210px;
  min-height: 0;
  padding: 54px 290px 20px;
  border: 0;
  background: linear-gradient(to top, rgba(8, 7, 6, 0.97) 0, rgba(8, 7, 6, 0.9) 52%, rgba(8, 7, 6, 0) 100%);
}
/* Over a picture, something standing on a spot turns its letter red and says what it is on a small plate. */
#room.pictured .spot.blocked .letter { background: #c8483c; }
#room.pictured .spot.blocked .status {
  display: block;
  position: absolute;
  left: 50px; top: 8px;
  margin: 0;
  padding: 2px 9px;
  border-radius: 4px;
  background: #100d0a;
  white-space: nowrap;
  font-size: 17px;
}

/* ---- the picture of the game behind the QR ---- */

/* Dimmed, so that the QR and the words stay the first thing read. It fills the stage whatever its width. */
#cover {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  background-color: #100d0a;
  background-size: cover;
  background-position: 60% 50%;
  background-repeat: no-repeat;
  opacity: 0.36;
}
/* Over a picture the small grey words need more weight to be read. */
#cover:not(.hidden) ~ .gate .gate-text p { color: #c9c0ac; }
#cover:not(.hidden) ~ .gate .gate-text p.big, #cover:not(.hidden) ~ .gate .steps li { color: #eadfc6; }

/* A table seen from above, in the middle of a room: a maze, its holes, and a ball. Drawn over the picture and under
   the numbers of the spots. Only transform and opacity move. */
#board { position: absolute; }
#board-plate {
  position: absolute; left: -10px; top: -10px; right: -10px; bottom: -10px;
  padding: 10px;
  border: 3px solid #c9a24b;
  border-radius: 8px;
  background: #100d0a;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.45), 0 0 0 3px #100d0a;
  transition: transform 0.6s ease-out;
}
#board-map { position: relative; }
#board-map svg { display: block; }
.board-floor { fill: #4a3b27; }
.board-wall { fill: none; stroke: #c9a24b; stroke-width: 4; stroke-linecap: round; }
.board-mark { fill: #9a8b70; stroke: #9a8b70; stroke-width: 0; opacity: 0.85; overflow: visible; }
.board-hole { fill: #050403; stroke: #7d6530; stroke-width: 2; }
.board-goal { fill: none; stroke: #ecc76b; stroke-width: 2.5; }
.board-rose { fill: none; stroke: #7d6530; stroke-width: 2; }
.board-north { fill: #c9a24b; }
.board-wind { fill: #c9a24b; font-size: 17px; font-weight: 700; }
#ball {
  position: absolute; left: 10px; top: 10px;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 2px solid #100d0a;
  background: #eadfc6;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
  text-align: center;
}
#ball b { display: block; font-size: 18px; line-height: 27px; color: #2b2217; font-feature-settings: "lnum"; -webkit-font-feature-settings: "lnum"; }
#ball.sunk { opacity: 0.55; }
/* A table that is a picture (art/table.py): old wood, channels lined with cloth, brass. The plate's own box and line
   go, and the picture carries its own rail; the ball on it is an ivory ball under the same light, from the upper left.
   Its numeral is the game's own letter, on the ball's white. */
#board.painted #board-plate { border-color: transparent; background: none; box-shadow: none; }
#board.painted .board-pic { position: absolute; display: block; max-width: none; border-radius: 9px; box-shadow: 0 16px 0 rgba(0, 0, 0, 0.5), 0 0 34px rgba(0, 0, 0, 0.7); }
#board.painted #board-map svg { position: relative; }
#board.painted .board-wind { fill: #c9a24b; font-size: 16px; }
#board.painted #ball {
  border: 0;
  background: radial-gradient(circle at 36% 30%, #fffdf3 0%, #f1e8d2 34%, #c9bb98 68%, #7d7157 100%);
  box-shadow: 4px 6px 5px rgba(0, 0, 0, 0.6);
}
#board.painted #ball b { line-height: 30px; }
#board.painted #ball.sunk { opacity: 0.4; }
