/* Say Hello. The gate's tokens, sets and buttons (../../assets/gate.css), plus this. */

[hidden] { display: none !important; }

.sh-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: min(760px, 100% - 24px);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 0 10px;
}
.sh-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px 8px 11px;
  border-radius: 8px;
  background: var(--sign);
  color: var(--sign-ink);
  font: 800 1rem/1 var(--f-sign);
  text-decoration: none;
  box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5px var(--sign-ink), 0 5px 0 -2px var(--sign-deep);
}
.sh-back:hover { background: var(--sign-hi); }
.sh-back svg { width: 16px; height: 16px; fill: currentColor; transform: rotate(180deg); }
#sound { justify-self: end; font-size: 1.15rem; padding: 8px 12px 7px; }

/* the name in the banner's letters, in Gil Lister's colours, and the O is a pipe he pops out of now and then */
.sh-title { margin: 0; font: 400 clamp(1.4rem, 6vw, 2.6rem)/1 var(--f-toy); white-space: nowrap; }
.sht { display: inline-flex; gap: .01em; }
.sht > span {
  display: inline-block;
  color: #e9b08c;
  text-shadow:
    -.015em -.015em 0 #ffe3cf,
    .01em .02em 0 #6b3a26, .02em .04em 0 #6b3a26, .03em .06em 0 #6b3a26, .04em .08em 0 #6b3a26,
    .06em .15em .1em rgba(6, 3, 18, .65);
}
.sht > .sht-gap { width: .26em; }
.sht > .sht-pipe {
  color: #aab0b6;
  text-shadow:
    -.015em -.015em 0 #eef1f4,
    .01em .02em 0 #3f4448, .02em .04em 0 #3f4448, .03em .06em 0 #3f4448, .04em .08em 0 #3f4448,
    .06em .15em .1em rgba(6, 3, 18, .65);
  animation: sh-pop 3.6s ease-in-out infinite;
}
@keyframes sh-pop {
  0%, 80%, 100% { transform: none; }
  84% { transform: translateY(-.16em); }
  88% { transform: translateY(-.16em); }
  93% { transform: translateY(0); }
}

.sh-main {
  display: grid;
  justify-items: center;
  width: min(760px, 100% - 24px);
  margin: 0 auto;
  padding-bottom: 20px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.sh-set { width: auto; padding: 14px 14px 46px; }
.sh-screen {
  aspect-ratio: 9 / 16;
  height: min(76vh, 740px);
  width: auto;
  border-radius: 16px / 20px;
  touch-action: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sh-screen canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.sh-ch { top: 10px; left: 12px; }
.sh-hellos { top: 10px; right: 12px; transition: transform .12s; }
.sh-hellos.bump { transform: scale(1.2); }
.sh-misses { top: 36px; right: 12px; font-size: 1.1rem; letter-spacing: .12em; color: #e9b08c; }
/* the narrator reads over the back wall, so the pipes stay clear */
.sh-sub {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 13.5%;
  z-index: 3;
  margin: 0;
  text-align: center;
  font: 400 clamp(1.2rem, 4.4vw, 1.6rem)/1.15 var(--f-osd);
  color: #fff;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  pointer-events: none;
}

.sh-card {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  text-align: center;
  background: rgba(10, 7, 24, .66);
  cursor: default;
}
.sh-play {
  padding: 10px 22px 8px;
  border: 2px solid #5b4d91;
  border-radius: 6px;
  background: #1b1634;
  color: #fff;
  font: 400 clamp(1.7rem, 6vw, 2.2rem)/1 var(--f-osd);
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: 0 3px 0 #0a0816, 0 0 24px rgba(233, 176, 140, .25);
}
.sh-play:hover { border-color: var(--window); }
.sh-play:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a0816; }
.sh-hint { margin: 0; max-width: 24ch; font: 400 1.25rem/1.2 var(--f-osd); color: var(--ink); text-shadow: 2px 2px 0 #000; }
.sh-lore { color: var(--cream); }
.sh-over-title { margin: 0; max-width: 13ch; font-size: clamp(1.45rem, 5.4vw, 2.2rem); }
.sh-over-line { margin: 0; max-width: 24ch; font: 400 clamp(1.25rem, 4.2vw, 1.5rem)/1.2 var(--f-osd); color: var(--ink); text-shadow: 2px 2px 0 #000; }
.sh-over-stats { margin: 0; font: 400 1.15rem/1.2 var(--f-osd); letter-spacing: .03em; color: var(--muted); text-shadow: 2px 2px 0 #000; }
.sh-over-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 4px; }
.sh-share { align-self: stretch; }

.sh-stats { margin: 12px 0 0; font: 400 1.3rem/1.2 var(--f-osd); letter-spacing: .03em; color: var(--muted); text-align: center; }
.sh-about { max-width: 40ch; margin: 18px auto 0; text-align: center; }
.sh .foot a { color: var(--muted); text-decoration: none; }
.sh .foot a:hover { color: var(--ink); }

@media (pointer: coarse) {
  .sh-hint-keys { display: none; }
}

/* a phone held upright: the game is the whole screen and never scrolls */
@media (max-width: 599px) and (orientation: portrait) {
  html, body.sh { height: 100%; overscroll-behavior: none; }
  body.sh { display: flex; flex-direction: column; min-height: 100dvh; }
  .sh-bar { grid-template-columns: auto 1fr auto; width: calc(100% - 16px); gap: 8px; padding: max(8px, env(safe-area-inset-top)) 0 8px; }
  .sh-title { justify-self: center; font-size: clamp(1.15rem, 5.8vw, 1.8rem); }
  .sh-back { padding: 7px 9px 6px 8px; font-size: .9rem; gap: 5px; }
  .sh-back svg { width: 13px; height: 13px; }
  #sound { font-size: 1.1rem; padding: 7px 10px 6px; }
  .sh-main { flex: 1; width: calc(100% - 16px); align-content: start; padding-bottom: 8px; touch-action: none; }
  .sh-set { padding: 8px 8px 30px; border-radius: 20px 20px 16px 16px; }
  .sh-set .tv-plate { left: 14px; bottom: 8px; font-size: .95rem; }
  .sh-set .tv-knob { right: 14px; bottom: 6px; width: 17px; height: 17px; }
  .sh-set .tv-knob-2 { right: 38px; bottom: 9px; width: 12px; height: 12px; }
  .sh-screen { height: min(calc(100dvh - 140px), calc((100vw - 32px) * 16 / 9)); }
  .sh-ch, .sh-hellos { top: 8px; font-size: 1.25rem; }
  .sh-ch { left: 10px; } .sh-hellos { right: 10px; }
  .sh-misses { top: 30px; right: 10px; }
  .sh-stats { margin-top: 6px; font-size: 1.1rem; }
  .sh-about, .sh .foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sht > .sht-pipe { animation: none; }
}
