.game-card[data-cabinet="aurora"] {
  --cabinet-frame: url("../art/lobby/frames/aurora.png");
  --cabinet-tube: url("../art/lobby/frames/aurora-tube.png");
  --cabinet-edge: #8cf5d6;
  --cabinet-metal: #39b89c;
  --cabinet-highlight: #dcfff4;
  --cabinet-shadow: #3b1d6e;
  --cabinet-gem: #e8d6ff;
  --cabinet-glass: #070b2a;
  --cabinet-glow: #3dffb466;
  --cabinet-light: #a8ffe0;
  --cabinet-radius: 26px 26px 6px 6px;
  --cabinet-ratio: 2.42;
  --prize-top: #2c2a7a;
  --prize-bottom: #0a0d33;
  --prize-secondary: #1d4a5e;
  --brand-top: 55%;
  --brand-height: 42%;
}
.game-card[data-cabinet="aurora"] .game-card-jackpot.grand { border-radius: 14px 14px 4px 4px / 8px 8px 4px 4px; }
.game-card[data-cabinet="aurora"] .game-card-jackpot.major { border-radius: 4px 4px 10px 10px; border-color: #a77ce8; }
.game-card[data-cabinet="aurora"] .game-card-art {
  border-radius: 16px 16px 4px 4px;
  border-top-color: var(--cabinet-light);
  box-shadow: inset 0 0 10px #000a, inset 0 12px 14px -10px #7dffd099;
}

.game-card[data-cabinet="imperial"] {
  --cabinet-frame: url("../art/lobby/frames/imperial.png");
  --cabinet-tube: url("../art/lobby/frames/imperial-tube.png");
  --cabinet-edge: #ffe08a;
  --cabinet-metal: #d89b28;
  --cabinet-highlight: #fff4c8;
  --cabinet-shadow: #4a0918;
  --cabinet-gem: #ff7a92;
  --cabinet-glass: #280410;
  --cabinet-glow: #ff4a6e66;
  --cabinet-light: #fff0b8;
  --cabinet-radius: 18px 18px 4px 4px;
  --cabinet-ratio: 2.4;
  --prize-top: #5e0d24;
  --prize-bottom: #1e030b;
  --prize-secondary: #4a1a08;
  --brand-top: 54%;
  --brand-height: 43%;
}
.game-card[data-cabinet="imperial"] .game-card-jackpot.grand { border-radius: 12px 12px 3px 3px / 7px 7px 3px 3px; }
.game-card[data-cabinet="imperial"] .game-card-jackpot.major { border-radius: 3px 3px 8px 8px; border-color: #f0be52; }
.game-card[data-cabinet="imperial"] .game-card-art {
  border-radius: 14px 14px 4px 4px;
  border-top-color: var(--cabinet-edge);
  box-shadow: inset 0 0 10px #000b, inset 0 12px 14px -10px #ffd87288;
}

.game-card[data-cabinet="mascot"] {
  --cabinet-frame: url("../art/lobby/frames/mascot.png");
  --cabinet-tube: url("../art/lobby/frames/mascot-tube.png");
  --cabinet-edge: #fff099;
  --cabinet-metal: #2bb86e;
  --cabinet-highlight: #eaffd8;
  --cabinet-shadow: #0a3b20;
  --cabinet-gem: #7dffb0;
  --cabinet-glass: #0c3d24;
  --cabinet-glow: #38e88266;
  --cabinet-light: #d8ffdf;
  --cabinet-radius: 24px 24px 10px 10px;
  --cabinet-ratio: 2.38;
  --prize-top: #185e38;
  --prize-bottom: #082616;
  --prize-secondary: #2c1e54;
  --brand-top: 55%;
  --brand-height: 42%;
}
.game-card[data-cabinet="mascot"] .game-card-jackpot.grand { border-radius: 14px 14px 4px 4px / 9px 9px 4px 4px; }
.game-card[data-cabinet="mascot"] .game-card-jackpot.major { border-radius: 4px 4px 10px 10px; border-color: #6fe89a; }
.game-card[data-cabinet="mascot"] .game-card-art {
  border-radius: 20px 20px 8px 8px;
  border-top-color: var(--cabinet-edge);
  box-shadow: inset 0 0 10px #0009, inset 0 12px 14px -10px #a2ffbe88;
}

@container (max-height: 280px) {
  .game-card-crown { --crown-slot: 13px; }
  .game-card-brand { top: 52%; }
  .game-card[data-cabinet="storm"] .game-card-brand { top: 49%; }
  .game-card-name { bottom: 22px; }
  .game-card-ribbon { height: 21px; min-height: 21px; }
}
.game-card.soon { cursor: default; }
.game-card-status {
  position: absolute;
  z-index: 2;
  top: 7px;
  right: 5px;
  padding: 4px 7px;
  border: 1px solid #efd486;
  border-radius: 3px;
  background: #211132e8;
  color: var(--gold-light);
  font-family: var(--display);
  font-size: .51rem;
  letter-spacing: .08em;
  line-height: 1.2;
  box-shadow: 0 2px 4px #0009;
}


.tile {
  position: relative;
  color: var(--muted);
  text-align: center;
}

.tile:active {
  transform: translateY(2px);
}

.lobby-tiles {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.lobby-tiles .tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 44px;
  padding: 0;
  background: none;
}

.tile-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border: 0;
  background: none;
}

.tile-state {
  position: relative;
  z-index: 1;
  margin-top: -17px;
  min-height: calc(1.2em + 4px);
  border: 0;
  color: var(--text);
  font-family: var(--display);

  letter-spacing: 0.03em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;

  background: none;
  padding: 2px 0;
  font-size: .7rem;
  -webkit-text-stroke: 1.5px var(--bg-deep);
  paint-order: stroke fill;
  text-shadow: 0 1px 1px var(--bg-deep);
}

.tile-state:empty {
  visibility: hidden;
}

.tile-name {
  margin-top: 2px;
  color: var(--gold-light);
  font-family: var(--display);

  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.8);

  font-size: .7rem;
}

.tile.ready .tile-ring::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: var(--gold-light);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  pointer-events: none;
  animation: lobby-icon-spark 1.8s ease-in-out infinite;
}

/* Planets already announce their waiting rewards over the art. The
   inherited loop goes too: WebKit keeps a running animation on a
   pseudo-element that content: none never draws, even once the floor
   is hidden, so nothing stays alive behind another screen. */
#lobby-pearls.ready .tile-ring::after {
  content: none;
  animation: none;
}

.tile.ready .tile-state {
  color: var(--gold);
}

.tile-ring .lobby-art,
.lobby-round-face .lobby-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

@keyframes lobby-icon-spark {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1); }
}



.tile,
.game-card,
.lobby-button {
  transition: transform 60ms ease-out;
}

.lobby-button:active:not(:disabled) {
  transform: scale(0.96);
}

.game-card:not(.soon)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--cabinet-light), inset 0 0 12px var(--cabinet-glow);
  opacity: 0.16;
  pointer-events: none;
  animation: fb-card-breathe 5s ease-in-out infinite alternate;
}

/* Keep the original shadows until WebKit has decoded the cache. */
.game-card.cabinet-cache-ready:not(.soon)::after {
  box-shadow: none;
  border-image: var(--cabinet-tube) 90 / 30px / 0 stretch;
}

.game-card.sapphire:not(.soon)::after {
  animation-delay: -2.5s;
}

.game-card-rim {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: inherit;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.game-card-rim::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 41%, rgba(255, 212, 90, 0.7) 46%,
    rgba(255, 242, 175, 0.95) 49%, #fff 50%, rgba(255, 242, 175, 0.95) 51%,
    rgba(255, 212, 90, 0.7) 54%, transparent 59%);
  transform: translateX(-150%);
  opacity: 0.22;
  animation: fb-rim-glint 18s ease-in-out 1.2s infinite;
}

.game-card-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
}

.game-card-sparkles::before,
.game-card-sparkles::after {
  content: "";
  position: absolute;
  top: -8px;
  left: -7px;
  box-sizing: content-box;
  width: 16px;
  height: 16px;
  margin: -4px;
  padding: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3CradialGradient id='g' r='.7071'%3E%3Cstop offset='.12' stop-color='%23fff'/%3E%3Cstop offset='.24' stop-color='%23fff2af'/%3E%3Cstop offset='.48' stop-color='%23ffd45a'/%3E%3C/radialGradient%3E%3Cfilter id='b' x='-50%' y='-50%' width='200%' height='200%'%3E%3CfeGaussianBlur stdDeviation='1.25'/%3E%3C/filter%3E%3Cpolygon points='12,4 13.76,10.24 20,12 13.76,13.76 12,20 10.24,13.76 4,12 10.24,10.24' fill='%23ffd45a' fill-opacity='.95' filter='url%28%23b%29'/%3E%3Cpolygon points='12,4 13.76,10.24 20,12 13.76,13.76 12,20 10.24,13.76 4,12 10.24,10.24' fill='url%28%23g%29'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  transform: scale(0);
  animation: fb-sparkle 14s ease-in-out 0.4s infinite;
}

.game-card-sparkles::after {
  top: auto;
  left: auto;
  right: -4px;
  bottom: 11px;
  width: 13px;
  height: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 21'%3E%3CradialGradient id='g' r='.7071'%3E%3Cstop offset='.12' stop-color='%23fff'/%3E%3Cstop offset='.24' stop-color='%23fff2af'/%3E%3Cstop offset='.48' stop-color='%23ffd45a'/%3E%3C/radialGradient%3E%3Cfilter id='b' x='-50%' y='-50%' width='200%' height='200%'%3E%3CfeGaussianBlur stdDeviation='1.25'/%3E%3C/filter%3E%3Cpolygon points='10.5,4 11.93,9.07 17,10.5 11.93,11.93 10.5,17 9.07,11.93 4,10.5 9.07,9.07' fill='%23ffd45a' fill-opacity='.95' filter='url%28%23b%29'/%3E%3Cpolygon points='10.5,4 11.93,9.07 17,10.5 11.93,11.93 10.5,17 9.07,11.93 4,10.5 9.07,9.07' fill='url%28%23g%29'/%3E%3C/svg%3E");
  animation-duration: 19s;
  animation-delay: 4s;
}

.game-list > .game-card:nth-child(even):not(.has-breakout) .game-card-sparkles::before { left: auto; right: -7px; }
.game-list > .game-card:nth-child(even) .game-card-sparkles::after { right: auto; left: -4px; }

.game-feature-sweep {
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.game-feature-shine {
  animation: fb-ribbon-shine 6s ease-in-out 0.6s infinite;
}

.game-card.soon .game-feature-shine {
  animation: none;
}

.game-logo-sparks {
  animation: fb-twinkle 3.4s ease-in-out infinite;
}

.game-list > .game-card:nth-child(4n + 2) .game-card-rim::before { animation-delay: 3.45s; }
.game-list > .game-card:nth-child(4n + 3) .game-card-rim::before { animation-delay: 5.7s; }
.game-list > .game-card:nth-child(4n) .game-card-rim::before { animation-delay: 7.95s; }
.game-list > .game-card:nth-child(4n + 2) .game-card-sparkles::before { animation-delay: 2.1s; }
.game-list > .game-card:nth-child(4n + 3) .game-card-sparkles::before { animation-delay: 3.8s; }
.game-list > .game-card:nth-child(4n) .game-card-sparkles::before { animation-delay: 5.5s; }
.game-list > .game-card:nth-child(4n + 2) .game-card-sparkles::after { animation-delay: 6.4s; }
.game-list > .game-card:nth-child(4n + 3) .game-card-sparkles::after { animation-delay: 8.8s; }
.game-list > .game-card:nth-child(4n) .game-card-sparkles::after { animation-delay: 1.6s; }
.game-list > .game-card:nth-child(4n + 2) .game-feature-shine { animation-delay: 2.1s; }
.game-list > .game-card:nth-child(4n + 3) .game-feature-shine { animation-delay: 3.6s; }
.game-list > .game-card:nth-child(4n) .game-feature-shine { animation-delay: 5.1s; }

.lobby-sign::before,
.lobby-sign::after {
  animation: fb-twinkle 2.6s ease-in-out infinite;
}

@keyframes fb-card-breathe {
  from { opacity: 0.12; }
  to { opacity: 0.3; }
}

@keyframes fb-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes fb-rim-glint {
  0% { transform: translateX(-150%); }
  10%, 100% { transform: translateX(150%); }
}

@keyframes fb-sparkle {
  0% { transform: scale(0.001) rotate(-45deg); }
  2.5% { transform: scale(1) rotate(0deg); }
  5%, 100% { transform: scale(0.001) rotate(45deg); }
}

@keyframes fb-ribbon-shine {
  0% { transform: translateX(0); }
  25%, 100% { transform: translateX(123.5294%); }
}

@media (prefers-reduced-motion: reduce) {
  .game-card-rim::before,
  .game-card-sparkles::before,
  .game-card-sparkles::after,
  .game-feature-shine,
  .game-logo-sparks,
  .game-card:not(.soon)::after,
  .lobby-sign::before,
  .lobby-sign::after {
    animation: none;
  }
  .tile,
  .game-card,
  .lobby-button {
    transition: none;
  }
}


.lobby-button {
  flex: none;
  height: 36px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  white-space: nowrap;

  min-height: 44px;
}

.lobby-button::before {
  content: "‹ ";
  font-size: 1rem;
}

.lobby-button:disabled {
  opacity: 0.45;
}

@media (max-height: 700px) {
  .lobby { gap: 6px; }
  .lobby-sign { padding: 7px 16px 6px; }
  .lobby-sign-title { font-size: 1.2rem; }
  .lobby-sign::before,
  .lobby-sign::after { font-size: 1.1rem; }
  .tile-ring { width: 50px; height: 50px; }
  .game-card { padding: 4px 3px 5px; gap: 3px; }
  .game-list { padding-top: 6px; padding-bottom: 8px; }
}


.app > .topbar { position: relative; z-index: 12; }
.machine-offers { position: relative; flex: none; width: 64px; }
.machine-offers-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 3px;
}
.machine-offers-title {
  font-family: var(--title);
  font-size: 11px;
  line-height: 1;
  letter-spacing: -0.035em;
  background: var(--gold-bevel);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 var(--gold-deep)) drop-shadow(0 2px 1px var(--bg-deep));
  transform: rotate(-7deg);
}
.machine-offers-alert {
  position: absolute;
  top: -2px;
  right: -3px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--gold-deep);
  border-radius: 50%;
  background: linear-gradient(var(--ruby), var(--red-dark));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6);
  color: var(--text);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 1px 0 #000;
}
.machine-offers-button .machine-offers-alert { top: auto; bottom: 0; right: 0; width: 18px; height: 18px; font-size: 16px; }
.machine-offers-time {
  align-self: stretch;
  margin-top: 3px;
  padding-left: 3px;
  padding-right: 20px;
  text-align: left;
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 11px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 1px 1px #000;
}
.machine-offers-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: -8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 120px;
  max-height: min(440px, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 90px));
  padding: 9px 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 2px solid var(--gold);
  border-top-color: var(--gold-light);
  border-radius: 8px 8px 16px 16px;
  background: linear-gradient(160deg, var(--red), var(--red-dark) 70%, var(--navy-deep));
  box-shadow: inset 0 0 0 2px var(--gold-deep), 0 5px 12px rgba(0, 0, 0, 0.65);
  transform-origin: top center;
  transform: scaleY(0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 240ms ease-in, opacity 180ms ease, visibility 0s linear 240ms;
}
.machine-offers.open .machine-offers-menu {
  transform: scaleY(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.25, 1.08), opacity 180ms ease;
}
.machine-offer-tile {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  min-height: 91px;
  padding: 8px 4px 3px;
  border: 2px solid var(--gold-dark);
  border-top-color: var(--gold-light);
  border-radius: 9px;
  background: radial-gradient(ellipse at 75% 28%, var(--violet), transparent 70%),
    linear-gradient(var(--console-light), var(--navy-deep));
  box-shadow: inset 0 0 0 1px var(--sapphire), 0 2px 0 var(--gold-deep);
  color: var(--text);
  font-family: var(--display);
  text-shadow: 0 1px 1px #000;
}
.machine-offer-tile:first-child {
  background: radial-gradient(ellipse at 75% 28%, var(--magenta), transparent 70%),
    linear-gradient(var(--violet), var(--navy-deep));
}
.machine-offer-tile img {
  position: absolute;
  top: 20px;
  right: 1px;
  width: 44px;
  height: 44px;
  object-fit: contain;
  opacity: 0.6;
}
.machine-offer-title, .machine-offer-detail, .machine-offer-time { position: relative; }
.machine-offer-title {
  margin: auto 0 3px;
  color: var(--gold-light);
  font-size: 17px;
  line-height: 1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 var(--gold-deep), 1px 2px 1px #000;
}
.machine-offer-detail { font-size: 12px; line-height: 1.1; }
.machine-offer-time {
  margin-top: 4px;
  padding-top: 2px;
  border-top: 1px solid var(--hairline);
  color: var(--ruby);
  font-size: 14px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.machine-offer-tile:active { transform: scale(0.97); }
.machine-offers-button:focus-visible, .machine-offer-tile:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}
/* Keep the balance readable alongside the compact offers sign. A long
   balance (a billion or more) takes the coin's room and trims the pill's
   gaps to 2px, so every 16-digit balance fits at 11px or more on the
   iPhone 16: Teko's figures differ in width, the fit sizes for the widest
   ("4", 0.568em in WebKit), and 16 of them need 117px of room. */
.app > .topbar .credits { gap: 4px; padding-right: 2px; }
.app > .topbar .credits.long-balance { gap: 2px; }
.app > .topbar .credits.long-balance .credits-coin { width: 0; margin-right: -2px; opacity: 0; }
