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

[hidden] { display: none !important; }

.sb-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;
}
.sb-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);
}
.sb-back:hover { background: var(--sign-hi); }
.sb-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: SIX in her cream and brown, BALLOONS one letter to a balloon, each one bobbing in turn on its string */
.sb-title { margin: 0; font: 400 clamp(1.3rem, 5.6vw, 2.4rem)/1 var(--f-toy); white-space: nowrap; }
.sbt { display: inline-flex; gap: .02em; }
.sbt > span { display: inline-block; animation: sb-bob 3.2s ease-in-out infinite; }
.sbt-gap { width: .28em; }
.sbt-s { color: #efe6d6; text-shadow: -.015em -.015em 0 #fffaf0, .01em .02em 0 #6b4a35, .02em .04em 0 #6b4a35, .03em .06em 0 #6b4a35, .04em .08em 0 #6b4a35, .06em .15em .1em rgba(6, 3, 18, .65); }
.sbt-b { --c: #7fc24a; --d: #3c6a1e; color: var(--c); text-shadow: -.015em -.015em 0 rgba(255, 255, 255, .55), .01em .02em 0 var(--d), .02em .04em 0 var(--d), .03em .06em 0 var(--d), .04em .08em 0 var(--d), .06em .15em .1em rgba(6, 3, 18, .65); }
.sbt-b:nth-child(6), .sbt-b:nth-child(12) { --c: #ef7440; --d: #7a3417; }
.sbt-b:nth-child(7), .sbt-b:nth-child(8) { --c: #5a9ad8; --d: #24476e; }
.sbt-b:nth-child(9), .sbt-b:nth-child(10) { --c: #a070d6; --d: #4d2c72; }
.sbt > span:nth-child(2) { animation-delay: .1s; } .sbt > span:nth-child(3) { animation-delay: .2s; }
.sbt > span:nth-child(5) { animation-delay: .4s; } .sbt > span:nth-child(6) { animation-delay: .5s; }
.sbt > span:nth-child(7) { animation-delay: .6s; } .sbt > span:nth-child(8) { animation-delay: .7s; }
.sbt > span:nth-child(9) { animation-delay: .8s; } .sbt > span:nth-child(10) { animation-delay: .9s; }
.sbt > span:nth-child(11) { animation-delay: 1s; } .sbt > span:nth-child(12) { animation-delay: 1.1s; }
@keyframes sb-bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-.07em) rotate(-3deg); }
  65% { transform: translateY(.03em) rotate(2deg); }
}

.sb-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;
}
.sb-set { width: auto; padding: 14px 14px 46px; }
.sb-screen {
  aspect-ratio: 9 / 16;
  height: min(72vh, 700px);
  width: auto;
  border-radius: 16px / 20px;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  container-type: size;   /* the cards size their text by the screen's height (cqh) */
}
.sb-screen canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.sb-ch { top: 10px; left: 12px; }
.sb-score { top: 10px; right: 12px; }
.sb-dist { top: 36px; right: 12px; font-size: 1.15rem; color: #f0e3c2; }
.sb-mult { top: 58px; right: 12px; font-size: 1.35rem; color: #f2d75c; }
.sb-banner {
  left: 0;
  right: 0;
  top: 40%;
  text-align: center;
  font-size: clamp(2rem, 8vw, 2.8rem);
  letter-spacing: .12em;
  opacity: 0;
}
.sb-banner.on { animation: sb-banner 1.6s steps(8) forwards; }
.sb-banner.hold { opacity: 1; animation: none; }
@keyframes sb-banner { 0% { opacity: 0; } 12%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* along the foot of the screen: the balloons she still has */
.sb-foot {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 9px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.sb-balloons { display: flex; gap: 6px; }
.sb-b {
  position: relative;
  width: 12px;
  height: 14px;
  border-radius: 50% 50% 46% 46% / 56% 56% 44% 44%;
  background: var(--c);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .28), inset 2px 2px 0 rgba(255, 255, 255, .35), 1px 1px 0 rgba(0, 0, 0, .6);
  transition: opacity .3s steps(3);
}
.sb-b::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 5px; background: rgba(240, 227, 194, .7); }
.sb-b-green { --c: #74b843; }
.sb-b-orange { --c: #e8683a; }
.sb-b-blue { --c: #4f8fcf; }
.sb-b-purple { --c: #9466cc; }
.sb-b.gone { opacity: .22; filter: grayscale(1); }

.sb-sub {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 11%;
  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;
}

/* centred, or from the top and scrolling on a short phone: the rule for every game's cards is in gate.css */
.sb-card {
  position: absolute;
  inset: 0;
  z-index: 3;
  gap: 12px;
  padding: 18px;
  text-align: center;
  background: rgba(16, 14, 22, .66);
}
.sb-play {
  padding: 10px 22px 8px;
  border: 2px solid #8fb8e0;
  border-radius: 6px;
  background: #22232e;
  color: #fff;
  font: 400 clamp(1.7rem, 6vw, 2.2rem)/1 var(--f-osd);
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: 0 3px 0 #0b0a10, 0 0 24px rgba(143, 184, 224, .25);
}
.sb-play:hover { border-color: var(--window); }
.sb-play:active { transform: translateY(2px); box-shadow: 0 1px 0 #0b0a10; }
.sb-hint { margin: 0; max-width: 25ch; font: 400 1.25rem/1.2 var(--f-osd); font-size: clamp(.95rem, 4.2cqh, 1.25rem); color: var(--ink); text-shadow: 2px 2px 0 #000; }
.sb-hint-touch { display: none; }
.sb-lore { color: var(--cream); }
.sb-over-title { margin: 0; max-width: 13ch; font-size: clamp(1.45rem, 5.4vw, 2.2rem); }
.sb-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; }
.sb-over-stats { margin: 0; max-width: 26ch; font: 400 1.15rem/1.2 var(--f-osd); letter-spacing: .03em; color: var(--muted); text-shadow: 2px 2px 0 #000; }
.sb-over-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 4px; }
.sb-share { align-self: stretch; }

/* under the set, for a touch screen: the two steering buttons under one thumb, FLAP under the other */
.sb-pad {
  display: none;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: 10px;
  width: min(420px, 100%);
  margin: 12px auto 0;
}
.sb-pad .sb-flap { grid-column: 3; margin-left: 8px; width: calc(100% - 8px); }
.sb-pad button {
  width: 100%;
  height: 58px;
  font: 400 1.6rem/1 var(--f-osd);
  letter-spacing: .1em;
  color: #cfe3f5;
  background: #21232c;
  border: 2px solid #4d5a70;
  border-radius: 10px;
  box-shadow: 0 3px 0 #0b0a10;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.sb-pad button:active, .sb-pad button.on { transform: translateY(2px); box-shadow: 0 1px 0 #0b0a10; border-color: #8fb8e0; }
.sb-stats { margin: 12px 0 0; font: 400 1.3rem/1.2 var(--f-osd); letter-spacing: .03em; color: var(--muted); text-align: center; }
.sb-about { max-width: 40ch; margin: 18px auto 0; text-align: center; }
.sb .foot a { color: var(--muted); text-decoration: none; }
.sb .foot a:hover { color: var(--ink); }

@media (pointer: coarse) {
  .sb-hint-keys { display: none; }
  .sb-hint-touch { display: block; }
  .sb-pad { display: grid; }
}

/* a phone held upright: the game is the whole screen and never scrolls */
@media (max-width: 599px) and (orientation: portrait) {
  html, body.sb { height: 100%; overscroll-behavior: none; }
  body.sb { display: flex; flex-direction: column; min-height: 100dvh; height: 100dvh; }
  .sb-bar { grid-template-columns: auto 1fr auto; width: calc(100% - 16px); gap: 8px; padding: max(8px, env(safe-area-inset-top)) 0 8px; }
  .sb-title { justify-self: center; font-size: clamp(.9rem, 4.4vw, 1.5rem); }
  .sb-back { padding: 7px 9px 6px 8px; font-size: .9rem; gap: 5px; }
  .sb-back svg { width: 13px; height: 13px; }
  #sound { font-size: 1rem; padding: 7px 8px 6px; white-space: nowrap; }
  .sb-main { flex: 1; min-height: 0; width: calc(100% - 16px); align-content: start; padding-bottom: 8px; touch-action: none; container-type: size; }
  .sb-set { padding: 8px 8px 30px; border-radius: 20px 20px 16px 16px; }
  .sb-set .tv-plate { left: 14px; bottom: 8px; font-size: .95rem; }
  .sb-set .tv-knob { right: 14px; bottom: 6px; width: 17px; height: 17px; }
  .sb-set .tv-knob-2 { right: 38px; bottom: 9px; width: 12px; height: 12px; }
  /* the screen takes all the height under the header: 125px is what else stands in .sb-main - the set's
     padding (38), the button (60) and the best line (27); the first line is for browsers without container units */
  .sb-screen { height: min(calc(100dvh - 252px), calc((100vw - 32px) * 16 / 9)); }
  .sb-screen { height: min(calc(100cqh - 125px), calc((100cqw - 16px) * 16 / 9)); }
  .sb-card { padding: 14px 12px; }
  .sb-hint { max-width: 30ch; }
  .sb-play { font-size: clamp(1.25rem, 5.6cqh, 1.7rem); }
  .sb-over-title { font-size: clamp(1.15rem, 4.8cqh, 1.45rem); }
  .sb-over-line { font-size: clamp(1rem, 4.2cqh, 1.25rem); }
  .sb-over-stats { font-size: clamp(.95rem, 3.8cqh, 1.15rem); }
  .sb-ch, .sb-score { top: 8px; font-size: 1.25rem; }
  .sb-ch { left: 10px; } .sb-score { right: 10px; }
  .sb-dist { top: 30px; right: 10px; }
  .sb-mult { top: 50px; right: 10px; font-size: 1.2rem; }
  .sb-pad button { font-size: 1.35rem; height: 52px; }
  .sb-pad { margin-top: 8px; }
  .sb-stats { margin-top: 6px; font-size: 1.1rem; }
  .sb-about, .sb .foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sbt > span { animation: none; }
}
