/* B1 (private, unpublished): PC game-selection logo/video width.
   Mobile and the pre-coin boot lock screen keep their video size; the
   Boot Up control is recentered and scaled on every viewport (r2–r4). */
@media (min-width: 1024px) {
  html.hp-select .hp-screen {
    width: min(40rem, calc(100svh * 9 / 16));
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
  }
  html.hp-select.hp-returning .hp-screen {
    left: 50%;
    right: auto;
    width: min(40rem, calc(100svh * 9 / 16));
    max-width: 40rem;
    transform: translateX(-50%);
  }
}

/* B1 r5 (t1423/t1425 follow-on): Boot Up pill, coin-slot icon, and the
   dropping coin are sized from the rendered HoffPlanet sign / the
   object-fit:cover video scale, not from the visible box width.

   Horizontal alignment (r3, kept): neon ARCADE word + joystick shaft
   sit at source x = 369 / 720, so
     nudge = 0.0125 * max(boxW, boxH * 9/16).

   Width: the HoffPlanet rounded rect is 320 source px wide, so
     signW = 320 * cover-s,  cover-s = max(boxW/720, boxH/1280).
     pillW = 0.89 * signW
   (0.89 matches the 390x844 phone reference: 187 / 211).

   Height, type, slot, coin, and the gap above the sign use the same
   cover-s (source px × cover-s). Source vertical sizes are the phone
   layout (40/36/82/12.48 at 390×844) divided by that view's cover
   scale (844/1280). Dock is 47 source px above the sign top (y=540).

   When a wide 16:9 cover crop leaves less room above the sign than
   the natural stack+gap, only the vertical metrics shrink so the
   slot stays on screen. Pill width stays 0.89 × sign width. */
.hp-screen {
  container-type: size;
  --hp-sign-k: 0.0125;
}
.hp-screen .hp-controls,
.hp-screen .hp-coin {
  --hp-cover-s: max(calc(100cqw / 720), calc(100cqh / 1280));
  --hp-cover-w: max(100cqw, calc(100cqh * 9 / 16));
  --hp-nudge: calc(var(--hp-sign-k) * var(--hp-cover-w));
  --hp-sign-w: calc(320 * var(--hp-cover-s));
  --hp-sign-h: calc(76 * var(--hp-cover-s));
  --hp-sign-top: calc((100cqh - 1280 * var(--hp-cover-s)) * 0.5 + 540 * var(--hp-cover-s));
  --hp-src-btn-h: calc(40 * 1280 / 844);
  --hp-src-slot-s: calc(40 * 1280 / 844);
  --hp-src-slot-h: calc(36 * 1280 / 844);
  --hp-src-stack: calc(82 * 1280 / 844);
  --hp-src-gap: 47;
  --hp-src-font: calc(12.48 * 1280 / 844);
  --hp-src-mb: calc(6 * 1280 / 844);
  --hp-src-coin-start: calc(-52 * 1280 / 844);
  --hp-src-coin-end-k: calc(12 * 1280 / 844);
  --hp-v-s: min(var(--hp-cover-s), calc((var(--hp-sign-top) - 4px) / (var(--hp-src-stack) + var(--hp-src-gap))));
  --hp-btn-w: calc(0.89 * var(--hp-sign-w));
  --hp-btn-h: calc(var(--hp-src-btn-h) * var(--hp-v-s));
  --hp-slot-s: calc(var(--hp-src-slot-s) * var(--hp-v-s));
  --hp-slot-h: calc(var(--hp-src-slot-h) * var(--hp-v-s));
  --hp-stack: calc(var(--hp-src-stack) * var(--hp-v-s));
  --hp-dock: calc(var(--hp-sign-top) - var(--hp-src-gap) * var(--hp-v-s));
  --hp-coin-start: calc(var(--hp-src-coin-start) * var(--hp-v-s));
  --hp-coin-end: calc(var(--hp-dock) - var(--hp-stack) + var(--hp-src-coin-end-k) * var(--hp-v-s));
}
.hp-controls {
  transform: translateY(-100%) translateX(var(--hp-nudge)) !important;
  justify-content: center !important;
  inset-inline: 0 !important;
  top: var(--hp-dock) !important;
}
.hp-controls > div {
  width: var(--hp-btn-w) !important;
  max-width: none !important;
}
.hp-controls > div > .relative {
  height: var(--hp-slot-h) !important;
  margin-bottom: calc(var(--hp-src-mb) * var(--hp-v-s)) !important;
}
.hp-play {
  width: 100% !important;
  height: var(--hp-btn-h) !important;
  font-size: calc(var(--hp-src-font) * var(--hp-v-s)) !important;
  padding: 0 calc(12 * 1280 / 844 * var(--hp-v-s)) !important;
  box-shadow:
    inset 0 calc(2 * 1280 / 844 * var(--hp-v-s)) #ffffff24,
    inset 0 calc(-8 * 1280 / 844 * var(--hp-v-s)) calc(10 * 1280 / 844 * var(--hp-v-s)) #0000008c,
    0 0 0 calc(3 * 1280 / 844 * var(--hp-v-s)) #2c2422,
    0 0 0 calc(6 * 1280 / 844 * var(--hp-v-s)) #141110,
    0 calc(6 * 1280 / 844 * var(--hp-v-s)) #0c0908,
    0 calc(10 * 1280 / 844 * var(--hp-v-s)) calc(12 * 1280 / 844 * var(--hp-v-s)) #00000080 !important;
}
.hp-play.hp-insert {
  box-shadow:
    inset 0 calc(3 * 1280 / 844 * var(--hp-v-s)) #ffffffe6,
    inset 0 calc(-10 * 1280 / 844 * var(--hp-v-s)) calc(14 * 1280 / 844 * var(--hp-v-s)) #780a0059,
    0 0 0 calc(3 * 1280 / 844 * var(--hp-v-s)) #ffe08a,
    0 0 0 calc(6 * 1280 / 844 * var(--hp-v-s)) #6a3410,
    0 calc(6 * 1280 / 844 * var(--hp-v-s)) #3a1208,
    0 0 calc(16 * 1280 / 844 * var(--hp-v-s)) #ff6a2a,
    0 0 calc(34 * 1280 / 844 * var(--hp-v-s)) #ff9628e6 !important;
}
.hp-play:active:not(:disabled) {
  transform: translateY(calc(4 * 1280 / 844 * var(--hp-v-s))) !important;
}
.hp-slot {
  width: var(--hp-slot-s) !important;
  height: var(--hp-slot-h) !important;
  border-radius: calc(6 * 1280 / 844 * var(--hp-v-s)) !important;
  box-shadow:
    inset 0 0 0 calc(2 * 1280 / 844 * var(--hp-v-s)) #d7b56a,
    0 calc(4 * 1280 / 844 * var(--hp-v-s)) calc(8 * 1280 / 844 * var(--hp-v-s)) #00000073 !important;
}
.hp-slot-mouth {
  width: calc(5 * 1280 / 844 * var(--hp-v-s)) !important;
  height: calc(18 * 1280 / 844 * var(--hp-v-s)) !important;
  top: calc(7 * 1280 / 844 * var(--hp-v-s)) !important;
  border-radius: calc(3 * 1280 / 844 * var(--hp-v-s)) !important;
}
/* Coin matches the slot size and drops into the slot's actual position. */
.hp-coin {
  width: var(--hp-slot-s) !important;
  height: var(--hp-slot-s) !important;
  /* top is driven by @keyframes hp-coin-drop; do not use !important or the coin freezes at the start. */
  top: var(--hp-coin-start);
  left: 50% !important;
  margin-left: calc(-0.5 * var(--hp-slot-s) + var(--hp-nudge)) !important;
  box-shadow:
    inset 0 0 0 calc(3 * 1280 / 844 * var(--hp-v-s)) #e7c56a,
    inset 0 0 0 calc(5 * 1280 / 844 * var(--hp-v-s)) #78480a59,
    0 calc(4 * 1280 / 844 * var(--hp-v-s)) calc(6 * 1280 / 844 * var(--hp-v-s)) #0006 !important;
}
.hp-coin:after {
  top: calc(0.25 * var(--hp-slot-s)) !important;
  right: calc(0.25 * var(--hp-slot-s)) !important;
  bottom: calc(0.25 * var(--hp-slot-s)) !important;
  left: calc(0.25 * var(--hp-slot-s)) !important;
  border-width: calc(2 * 1280 / 844 * var(--hp-v-s)) !important;
}
@keyframes hp-coin-drop {
  0%   { opacity: 1; top: var(--hp-coin-start); transform: scaleX(.14); }
  12%  { top: calc(0.88 * var(--hp-coin-start) + 0.12 * var(--hp-coin-end)); transform: scaleX(1); }
  24%  { top: calc(0.76 * var(--hp-coin-start) + 0.24 * var(--hp-coin-end)); transform: scaleX(.13); }
  36%  { top: calc(0.64 * var(--hp-coin-start) + 0.36 * var(--hp-coin-end)); transform: scaleX(1); }
  48%  { top: calc(0.52 * var(--hp-coin-start) + 0.48 * var(--hp-coin-end)); transform: scaleX(.14); }
  60%  { top: calc(0.40 * var(--hp-coin-start) + 0.60 * var(--hp-coin-end)); transform: scaleX(1); }
  72%  { top: calc(0.28 * var(--hp-coin-start) + 0.72 * var(--hp-coin-end)); transform: scaleX(.16); }
  84%  { top: calc(0.16 * var(--hp-coin-start) + 0.84 * var(--hp-coin-end)); transform: scaleX(1); }
  92%  { top: calc(0.08 * var(--hp-coin-start) + 0.92 * var(--hp-coin-end)); opacity: 1; transform: scaleX(.18) scaleY(.72); }
  to   { top: var(--hp-coin-end); opacity: 0; transform: scaleX(.07) scaleY(.18); }
}

/* r7m t1686: same green "ACTIVE GAME" light as the Ant Hill co-op/versus
   buttons, shown on the Ant Hill game card when a joinable lobby is listed. */
/* r7n t1689: reserved slot ABOVE the card image so the badge never
   covers the painted "ANT HILL: COLONY WARS" title or the mode chips
   in .hp-ant-multi below the art. Works in portrait and desktop. */
.hpAhLiveSlot{
  display:none;
  justify-content:flex-end;
  align-items:center;
  width:100%;
  box-sizing:border-box;
  padding:5px 8px 4px;
  background:#161014;
  border-bottom:1px solid #3a2a32;
  position:relative;
  z-index:5;
  pointer-events:none;
}
.hpAhLiveSlot.hpAhLiveSlotOn,
.hpAhLiveSlot:has(.hpAhLiveBadge[data-on="1"]){display:flex}
.hpAhLiveBadge{
  display:none;
  align-items:center;
  gap:4px;
  font:700 9px/1 var(--font-sans,system-ui);
  letter-spacing:.05em;
  white-space:nowrap;
  text-transform:uppercase;
  color:#dcffe4;
  background:rgba(34,140,70,.28);
  border:1px solid #4be37a;
  border-radius:999px;
  padding:3px 7px 3px 5px;
  box-shadow:0 0 8px rgba(75,227,122,.5);
  position:static;
  top:auto;
  left:auto;
  right:auto;
  z-index:5;
  pointer-events:none;
  flex:none;
}
.hpAhLiveBadge[data-on="1"]{display:inline-flex}
.hpAhLiveBadge i{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#5cf08a;
  box-shadow:0 0 6px #5cf08a;
  animation:ah70cPulse 1.6s ease-in-out infinite;
  display:block;
  flex:none;
}
@keyframes ah70cPulse{50%{opacity:.45}}


/* r7p: the leftover .hp-rot-locked styles grey/desaturate the Ant Hill card
   while the weekly prize list is still loading (ready=false). That made the
   painted card look washed out in portrait. Weekly tiles keep their own
   loading treatment; the Ant Hill art stays in color. */
.hp-antWrap.hp-rot-locked{
  opacity:1;
  filter:none;
}
.hp-antWrap.hp-rot-locked .hp-ant{
  filter:none;
  opacity:1;
}
