/* Ticket Time — clock-reading boarding mini-game (All Aboard) */

.tkt {
  position: fixed;
  inset: 0;
  z-index: 120;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  color: #263238;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
.tkt[hidden] {
  display: none;
}
.tkt__canvas {
  position: absolute;
  inset: 0;
  display: block;
}
.tkt__top {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tkt__title,
.tkt__seats {
  padding: 6px 14px;
  background: #fff;
  border: 4px solid #263238;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.3);
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}
.tkt__seats {
  background: #e3f2fd;
  font-weight: 600;
}
.tkt__seats b {
  font-size: 1.2rem;
}
.tkt__done {
  margin-left: auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: #ff9800;
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 1.3rem;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.3);
  cursor: pointer;
}
.tkt__ask {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top)) + 62px);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 16px;
  background: #fff;
  border: 4px solid #263238;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.25);
  font-weight: 800;
  font-size: clamp(1.05rem, 4.6vw, 1.35rem);
  white-space: nowrap;
}

/* Digital clock answers (LCD look) */
.tkt__answers {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 30rem;
  margin: 0 auto;
}
.tkt__ans {
  min-height: 4.4rem;
  border-radius: 1.2rem;
  border: 5px solid #263238;
  background: #37474f;
  box-shadow:
    inset 0 0 0 4px #546e7a,
    0 6px 0 #263238;
  font: inherit;
  font-weight: 800;
  font-size: clamp(1.9rem, 9vw, 2.4rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #b9f6ca;
  text-shadow: 0 0 10px rgba(105, 240, 174, 0.75);
  cursor: pointer;
  transition: transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.tkt__ans:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow:
    inset 0 0 0 4px #546e7a,
    0 2px 0 #263238;
}
.tkt__ans.is-right {
  background: #2e7d32;
  color: #fff;
  text-shadow: 0 2px 0 #1b5e20;
  animation: tkt-right 0.4s ease-out;
}
.tkt__ans.is-wrong {
  background: #78909c;
  color: #cfd8dc;
  text-shadow: none;
  text-decoration: line-through;
  animation: tkt-shake 0.35s ease-out;
  cursor: default;
}
/* JG-045: after the clock is read out, the answer that's left glows to be tapped */
.tkt__ans.is-hint {
  background: #2e7d32;
  color: #fff;
  text-shadow: 0 2px 0 #1b5e20;
  box-shadow:
    inset 0 0 0 4px #66bb6a,
    0 6px 0 #263238,
    0 0 0 6px rgba(255, 213, 79, 0.85);
  animation: tkt-hint 1s ease-in-out infinite;
}
@keyframes tkt-hint {
  50% { transform: scale(1.06); }
}
.tkt__ans:disabled:not(.is-right):not(.is-wrong) {
  opacity: 0.7;
}
@keyframes tkt-right {
  50% { transform: scale(1.08); }
}
@keyframes tkt-shake {
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

/* End card */
.tkt__end {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(38, 50, 56, 0.35);
}
.tkt__end[hidden] {
  display: none;
}
.tkt__end-card {
  width: min(380px, 100%);
  box-sizing: border-box;
  padding: 20px 18px 18px;
  text-align: center;
  background: #fff;
  border: 5px solid #263238;
  border-radius: 28px;
  box-shadow: 0 8px 0 rgba(38, 50, 56, 0.4);
  animation: tkt-pop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes tkt-pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.tkt__end-icon {
  font-size: 3rem;
  line-height: 1;
}
.tkt__end-title {
  margin: 6px 0 4px;
  font-size: 1.9rem;
  font-weight: 800;
}
.tkt__end-sub {
  margin: 0 0 14px;
  font-weight: 600;
  opacity: 0.85;
}
.tkt__end-go {
  font: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 12px 22px;
  color: #fff;
  text-shadow: 0 2px 0 #263238;
  background: #43a047;
  border: 4px solid #263238;
  border-radius: 999px;
  box-shadow: 0 5px 0 #263238;
  cursor: pointer;
}

/* Wide screens: answers in one row */
@media (min-aspect-ratio: 11/10) {
  .tkt__answers {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 44rem;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .tkt__ask {
    top: 8px;
    left: auto;
    right: 70px;
    transform: none;
    font-size: 1rem;
    padding: 4px 12px;
  }
  .tkt__top {
    top: 8px;
  }
  .tkt__seats {
    display: none;
  }
  .tkt__answers {
    left: auto;
    right: 12px;
    bottom: 10px;
    width: min(44rem, calc(100% - 24px));
    gap: 8px;
  }
  .tkt__ans {
    min-height: 3.4rem;
    font-size: 1.7rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tkt__ans.is-right,
  .tkt__ans.is-wrong,
  .tkt__ans.is-hint,
  .tkt__end-card {
    animation: none;
  }
}

/* JG-006: Ticket Time is played over the live 3D station; the game's HUD and controls step aside */
.aa-root.is-ticket .aa-chrome,
.aa-root.is-ticket [data-control-bar],
.aa-root.is-ticket .aa-bubbles,
.aa-root.is-ticket .aa-quips,
.aa-root.is-ticket .aa-wishes {
  visibility: hidden;
}
