/* ---------------------------------------------------------------------------
   Layer 4 — The guided tour (src/tour.js).

   One thing on the screen stays lit and everything else is shaded off. Your
   Assistant GM comes up from the bottom in a circle and speaks in a bubble
   that writes itself out.

   House rules: white board, 3px ink outlines, radius 9-13, Jersey 15 for the
   headings, Rubik at 700+ for everything else, solid saturated colour, no
   emoji, no left-edge stripe. Works at 375px with nothing off the side.
--------------------------------------------------------------------------- */

/* the click-catcher. Invisible: the shade is the spotlight's own shadow. */
.tr-catch { position: fixed; inset: 0; z-index: 9000; background: transparent; cursor: pointer; }

/* THE SPOTLIGHT. Its box-shadow is what darkens the rest of the screen, so
   the hole is exactly the element being talked about. */
.tr-spot {
  position: fixed; z-index: 9001; pointer-events: none;
  top: 0; left: 0; width: 0; height: 0;
  border: 3px solid #ffd34d; border-radius: 10px;
  box-shadow: 0 0 0 100vmax rgba(9, 18, 30, .74);
}
/* nothing to point at: the whole screen goes under the shade */
.tr-spot.blank { top: 50%; left: 50%; width: 0; height: 0; border: 0; border-radius: 0; }

/* --- the coach, coming up from the bottom ---------------------------------- */
.tr-dock {
  position: fixed; z-index: 9002; left: 0; right: 0; bottom: 0;
  display: flex; align-items: flex-end; gap: 14px;
  padding: 0 18px 18px;
  transform: translateY(115%);
  transition: transform .34s cubic-bezier(.22, .9, .3, 1.1);
}
.tr-dock.in { transform: translateY(0); }

/* him, in a circle */
.tr-man { flex: none; cursor: pointer; }
.tr-face {
  display: block; width: 128px; height: 128px; image-rendering: pixelated;
  background: var(--tm); border: 4px solid var(--ink); border-radius: 50%;
  object-fit: cover;
}

/* what he says */
.tr-bub {
  position: relative; flex: 1; min-width: 0; max-width: 620px; cursor: pointer;
  background: #fff; border: 3px solid var(--ink); border-radius: 13px;
  padding: 11px 14px 0; overflow: hidden;
}
/* the tail, pointing back at him */
.tr-bub::before {
  content: ''; position: absolute; left: -11px; bottom: 34px;
  width: 16px; height: 16px; background: #fff;
  border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
}

.tr-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-kick {
  padding: 3px 8px 2px; background: #ffd34d; color: var(--ink); border-radius: 7px;
  font: 900 10.5px var(--sans); letter-spacing: 1.2px; text-transform: uppercase;
}
.tr-who {
  flex: 1; min-width: 0; font: 800 11px var(--sans); color: var(--txt-3);
  text-transform: uppercase; letter-spacing: .8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-count {
  flex: none; padding: 3px 8px 2px; background: var(--ink); color: #fff;
  border-radius: 7px; font: 900 11px var(--sans); white-space: nowrap;
}

.tr-h {
  margin: 7px 0 6px; font-family: var(--disp); font-weight: 400; font-size: 33px;
  line-height: 1; letter-spacing: .5px; text-transform: uppercase; color: var(--ink);
}

/* the typed lines. A minimum height so the bubble does not jump about as the
   letters arrive. */
.tr-say { min-height: 42px; }
.tr-say p { margin: 0; font: 700 14px/1.5 var(--sans); color: var(--txt); min-height: 1px; }
.tr-say p + p { margin-top: 6px; color: var(--txt-2); }

/* The one thing to go and press. It is the point of the stop, so it is the
   only gold block in the bubble and it is typed out last. */
.tr-todo {
  margin-top: 10px; padding: 8px 11px 7px;
  background: #ffd34d; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 9px;
  font: 900 13px/1.4 var(--sans); min-height: 1.4em;
}
.tr-todo[hidden] { display: none; }

.tr-ft { display: flex; align-items: center; gap: 8px; margin: 11px 0 10px; }
.tr-b {
  padding: 8px 14px 7px; background: #fff; color: var(--ink); cursor: pointer;
  border: 3px solid var(--ink); border-radius: 9px;
  font: 900 12.5px var(--sans); white-space: nowrap;
}
.tr-b:hover { background: var(--ink); color: #fff; }
.tr-b.gold { background: #ffd34d; }
.tr-b.gold:hover { background: var(--ink); color: #fff; }
.tr-b[disabled] { opacity: .4; cursor: default; }
.tr-b[disabled]:hover { background: #fff; color: var(--ink); }
.tr-hint {
  flex: 1; text-align: right; font: 800 11.5px var(--sans); color: var(--txt-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-hint b { font-weight: 900; color: var(--ink); }

/* how far round the building you are */
.tr-bar { margin: 0 -14px; height: 6px; background: #e6ebf2; border-top: 3px solid var(--ink); }
.tr-bar i { display: block; height: 100%; background: #ffd34d; }

/* room under the board so the coach never stands on the thing he is lighting */
body.tour-on main { padding-bottom: 230px; }

/* --- the ways back in ------------------------------------------------------ */
/* a real entry in the tab bar while a tour is part-walked */
.tab.tr-tab { background: #ffd34d; color: var(--ink); }
.tab.tr-tab:hover { background: #fff; color: var(--ink); }

/* and a button inside the "?" panel, so it can always be run again */
.tr-again {
  width: 100%; padding: 9px 12px 8px; cursor: pointer;
  background: #ffd34d; color: var(--ink);
  border: 0; border-top: 3px solid var(--ink);
  font: 900 12.5px var(--sans); text-align: center;
}
.tr-again:hover { background: var(--ink); color: #fff; }

@media (max-width: 760px) {
  .tr-dock { gap: 10px; padding: 0 10px 10px; align-items: flex-end; }
  .tr-face { width: 64px; height: 64px; border-width: 3px; }
  .tr-bub { padding: 9px 11px 0; border-radius: 12px; }
  .tr-bub::before { left: -9px; bottom: 22px; width: 13px; height: 13px; }
  .tr-h { font-size: 25px; margin: 6px 0 5px; }
  .tr-say { min-height: 38px; }
  .tr-say p { font-size: 13px; }
  .tr-todo { font-size: 12.5px; margin-top: 8px; padding: 7px 9px 6px; }
  .tr-who { display: none; }
  .tr-hint { display: none; }
  .tr-ft { margin: 9px 0 9px; gap: 6px; }
  .tr-b { padding: 7px 10px 6px; font-size: 12px; flex: 1; }
  .tr-bar { margin: 0 -11px; }
  body.tour-on main { padding-bottom: 300px; }
}

/* the space bar, drawn as a key you can see */
.tr-key {
  display: inline-block; min-width: 62px; padding: 3px 10px 4px; margin: 0 1px;
  background: #fff; color: var(--ink); border: 3px solid var(--ink);
  border-bottom-width: 5px; border-radius: 7px;
  font: 900 10px var(--sans); letter-spacing: 1.4px; text-transform: uppercase;
  text-align: center; line-height: 1;
}
