* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--glass);
  font-family: var(--font), sans-serif;
  touch-action: manipulation;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
  font-family: inherit;
}

body.play {
  touch-action: none;
}

button {
  cursor: pointer;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#hud {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 10px 0;
}

#timer {
  margin: 0;
  justify-self: start;
  color: var(--glass);
  font-size: 28px;
  line-height: 1;
  -webkit-text-stroke: 0.05em var(--ink);
  paint-order: stroke fill;
}

#live-score {
  margin: 0;
  justify-self: center;
  color: var(--lime);
  font-size: clamp(32px, 9vw, 48px);
  line-height: 0.9;
  -webkit-text-stroke: 0.05em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0 18px rgb(155 255 60 / 45%);
}

#hint {
  position: absolute;
  top: calc(56px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: var(--cyan);
  font-size: 16px;
  line-height: 1;
  -webkit-text-stroke: 0.04em var(--ink);
  paint-order: stroke fill;
}

#mute {
  pointer-events: auto;
  justify-self: end;
  background: var(--ink);
  color: var(--glass);
  border: 3px solid var(--cyan);
  border-radius: 999px;
  font-size: 16px;
  min-height: 44px;
  min-width: 44px;
  padding: 4px 12px;
}

#end {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-rows: auto minmax(96px, 1fr) auto;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  pointer-events: none;
  background: transparent;
}

#end[hidden],
#hud[hidden] {
  display: none !important;
}

.panel,
.actions {
  width: min(340px, 100%);
  margin: 0 auto;
  pointer-events: auto;
  text-align: center;
  background: rgb(11 16 38 / 88%);
  border-radius: 16px;
}

.panel {
  padding: 8px 12px 6px;
}

.actions {
  padding: 8px;
}

#tower-slot {
  min-height: 96px;
}

.kicker {
  margin: 0;
  color: var(--cyan);
  font-size: 18px;
}

.big-score {
  margin: 0;
  font-size: clamp(56px, 16vw, 96px);
  line-height: 0.9;
  color: var(--lime);
  -webkit-text-stroke: 0.045em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0 24px rgb(155 255 60 / 55%);
}

.sub {
  margin: 4px 0;
  font-size: 18px;
}

.actions button {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border-radius: 999px;
  font-size: 22px;
  border: 4px solid var(--ink);
}

.actions button:first-child {
  margin-top: 0;
}

#again {
  background: var(--lime);
  color: var(--ink);
}

#share {
  background: transparent;
  color: var(--glass);
  border-color: var(--cyan);
}

.home {
  min-height: 100%;
  background: var(--ink) url("/sprites/bg-lab.svg") center / cover no-repeat;
}

.home main {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  padding: 12vh 24px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.home h1 {
  margin: 0 -24px;
  line-height: 0;
}

.home h1 img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 12vh - (6 / 5) * min(42vw, 180px, 22vh) - 108px);
  object-fit: contain;
  object-position: left top;
}

#challenge {
  max-width: 18rem;
  margin: 14px 0 0;
  font-size: 20px;
  line-height: 1.25;
}

.play-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 18px;
  padding: 0 28px;
  background: var(--lime);
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  font-size: 28px;
  border: 4px solid var(--ink);
}

.mascot {
  position: fixed;
  right: 0;
  bottom: 0;
  width: min(42vw, 180px, 22vh);
  height: auto;
  pointer-events: none;
}
