/* Smashburger and the Big Jump - styles just for this game.
   Anything here only affects this page. */

/* ---------- The stage (the box the game lives in) ---------- */

.stage.sb-stage {
  --stage-bg: #10213f;
  /* Fit on a laptop screen without scrolling, but never too tiny or huge. */
  height: clamp(22rem, calc(100svh - 15.5rem), 44rem);
  min-height: 0;
  padding: clamp(0.6rem, 2.5vw, 1.25rem);
  cursor: pointer;
  /* Taps are for hopping, not scrolling, zooming, or selecting text. */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Smaller page title so the game fits on screen. */
.game-head h1 {
  font-size: clamp(1.6rem, 5.2vw, 2.7rem);
}

.sb-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Over the dark game, focus rings are yellow; on the cream cards, red. */
.sb-stage :focus-visible {
  outline-color: var(--sun);
  outline-offset: 3px;
}

.sb-panel :focus-visible {
  outline-color: var(--red);
}

/* ---------- Mute button ---------- */

.sb-mute {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: var(--border);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.sb-mute:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.sb-mute:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.sb-mute svg {
  width: 1.5rem;
  height: 1.5rem;
}

.sb-mute__x,
.sb-mute.is-muted .sb-mute__waves {
  display: none;
}

.sb-mute.is-muted .sb-mute__x {
  display: inline;
}

.sb-mute.is-muted {
  background: #ffd6cf;
}

/* ---------- Cards that float over the game ---------- */

.sb-panel {
  position: relative;
  z-index: 2;
  grid-area: 1 / 1; /* all cards share the same spot in the middle */
  width: min(100%, 25rem);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 1.25rem 1.15rem;
  text-align: center;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: auto;
  touch-action: pan-y; /* long cards can scroll on phones */
  animation: sb-pop 0.28s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.sb-panel[hidden] {
  display: none;
}

@keyframes sb-pop {
  from {
    transform: scale(0.85) rotate(-2deg);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.sb-panel__kicker {
  display: inline-block;
  margin-bottom: 0.4rem;
  padding: 0.15rem 0.6rem;
  background: var(--red);
  color: var(--paper);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

.sb-panel__title {
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  text-shadow: 2px 2px 0 var(--sun);
}

.sb-panel__text {
  margin-top: 0.5rem;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.45;
}

.sb-panel__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem 0.9rem;
  margin-top: 0.9rem;
}

.sb-panel__btn {
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 1.1rem;
}

.sb-panel > .sb-panel__btn {
  margin-top: 0.9rem;
}

.sb-btn-alt {
  background: var(--sky);
  font-size: 1rem;
}

.sb-panel__hint {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

kbd {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  font-family: inherit;
  font-size: 0.85em;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-bottom-width: 3px;
  border-radius: 6px;
}

/* ---------- Pickle counts ---------- */

.sb-wallet {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  font-size: 0.92rem;
}

.sb-pickle {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle, #b4e67a 0 45%, #5cae3a 46%);
}

/* ---------- Missions ---------- */

.sb-missions {
  margin-top: 0.8rem;
  text-align: left;
}

.sb-missions__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px dashed var(--ink);
}

.sb-missions__title {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.sb-missions__list {
  display: grid;
  gap: 0.45rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.sb-mission {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
}

.sb-mission__check {
  position: relative;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--paper);
}

.sb-mission.is-done .sb-mission__check {
  background: var(--mint);
}

.sb-mission.is-done .sb-mission__check::after {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.05rem;
  width: 0.3rem;
  height: 0.6rem;
  border: solid var(--ink);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.sb-mission__body {
  display: grid;
  gap: 0.2rem;
}

.sb-mission__bar {
  display: block;
  height: 0.35rem;
  border-radius: 99px;
  background: rgba(16, 33, 63, 0.12);
  overflow: hidden;
}

.sb-mission__fill {
  display: block;
  height: 100%;
  background: var(--mint);
  border-radius: 99px;
}

.sb-mission__count {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.sb-mission.is-done .sb-mission__count {
  color: #13855c;
}

.sb-mission__reward {
  padding: 0.05rem 0.4rem;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: #c9ef9e;
  font-size: 0.75rem;
  font-weight: 800;
}

/* ---------- Placement on different screens ---------- */

/* On wide screens the "get ready" card sits to the right of the burger. */
@media (min-width: 48rem) {
  .sb-panel--ready {
    justify-self: end;
    margin-right: clamp(0rem, 5vw, 4rem);
  }
}

/* On narrow screens the cards sit at the bottom, out of the burger's way. */
@media (max-width: 40rem) {
  .sb-panel {
    align-self: end;
    padding: 0.75rem 0.9rem 0.9rem;
  }

  .sb-panel__text {
    margin-top: 0.3rem;
    font-size: 0.92rem;
  }

  .sb-panel--ready .sb-panel__kicker,
  .sb-panel--ready .sb-panel__text,
  .sb-panel__hint {
    display: none;
  }

  .sb-items {
    grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr));
    gap: 0.45rem;
  }

  .sb-item__pic {
    width: 64px;
    height: 61px;
  }

  .sb-item__tag {
    font-size: 0.68rem;
  }

  .game-head__tagline {
    font-size: 1rem;
  }

  .sb-ticket__lines {
    margin-top: 0.4rem;
    font-size: 0.9rem;
  }

  .sb-ticket__lines div {
    padding-block: 0.1rem;
  }

  .sb-mission {
    font-size: 0.8rem;
  }
}

/* ---------- Game over: the order ticket ---------- */

.sb-ticket {
  width: min(100%, 25rem);
  background:
    repeating-linear-gradient(to bottom, transparent 0 27px, rgba(89, 183, 255, 0.16) 27px 28px),
    #fffdf4;
}

@media (min-width: 48rem) {
  .sb-ticket {
    width: min(100%, 42rem);
  }

  .sb-ticket__cols {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.4rem;
    align-items: start;
  }

  .sb-ticket .sb-missions {
    margin-top: 0.35rem;
  }
}

.sb-ticket__order {
  margin-bottom: 0.25rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-dark);
}

.sb-ticket__best {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.2rem 0.7rem;
  background: var(--sun);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transform: rotate(-3deg);
}

.sb-ticket__close {
  margin-top: 0.45rem;
  font-weight: 800;
  color: var(--red-dark);
}

.sb-ticket__unlock {
  margin-top: 0.5rem;
  padding: 0.35rem 0.6rem;
  background: #c9ef9e;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.9rem;
}

.sb-ticket__best[hidden],
.sb-ticket__close[hidden],
.sb-ticket__unlock[hidden] {
  display: none;
}

.sb-ticket__lines {
  margin: 0.6rem 0 0;
  border-top: 2px dashed var(--ink);
  border-bottom: 2px dashed var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-align: left;
}

.sb-ticket__lines div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.22rem 0.2rem;
}

.sb-ticket__lines div + div {
  border-top: 1px dotted rgba(16, 33, 63, 0.4);
}

.sb-ticket__lines dt {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sb-ticket__lines dd {
  margin: 0;
  font-weight: 800;
}

/* ---------- The Kitchen ---------- */

.sb-kitchen {
  z-index: 4; /* above the mute button */
  width: min(100%, 50rem);
  text-align: left;
}

.sb-kitchen__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.sb-kitchen__note {
  margin-top: 0.3rem;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.92rem;
}

.sb-kitchen__group {
  margin: 0.8rem 0 0.45rem;
  font-size: 0.95rem;
}

.sb-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr));
  gap: 0.55rem;
}

.sb-item {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.15rem;
  padding: 0.4rem 0.35rem 0.5rem;
  font: inherit;
  color: var(--ink);
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.sb-item:hover {
  transform: translate(-1px, -2px);
  box-shadow: 4px 5px 0 var(--ink);
}

.sb-item__pic {
  width: 88px;
  height: 84px;
}

.sb-item__name {
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1.15;
}

.sb-item__tag {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink-soft);
}

.sb-item.is-on {
  background: #fff1bf;
  box-shadow: 0 0 0 3px var(--sun), 3px 3px 0 3px var(--ink);
}

.sb-item.is-on .sb-item__tag {
  color: var(--ink);
}

.sb-item.is-buyable .sb-item__tag {
  padding: 0.05rem 0.4rem;
  background: #c9ef9e;
  border-radius: 99px;
  color: var(--ink);
}

.sb-item.is-locked {
  background: #efe6d2;
}

.sb-item.is-locked .sb-item__pic {
  filter: grayscale(1) opacity(0.5);
}

.sb-kitchen > .sb-panel__btn {
  display: flex;
  margin: 1rem auto 0;
}

/* ---------- Controls list under the game ---------- */

.sb-help {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-weight: 600;
}
