/* ============================================================
 * FunClicker — splash fit for the shared game wrappers
 * (games/_shared/embed.php and games/_shared/scratch-embed.php)
 * ============================================================
 *
 * The wrapper lives inside the game frame, and on a phone that frame is only
 * 170-260 px tall (a 16:9 or 2:1 frame as wide as the screen). The desktop
 * splash needs about 250 px, so the title, the credit line or the logo were cut
 * off by the frame. Under 340 px of height the splash steps its type, gaps and
 * buttons down, and under 210 px it drops the hint line, so everything fits.
 * Heights are the frame's own (the viewport inside the iframe).
 *
 * Also the "Loading" panel shown between a tap on Play and the third-party
 * game answering, so the frame is never an unexplained black square.
 */

/* the Fun Clicker logo on the Scratch splash never takes more than a third of the frame */
.splash .logo { max-height: 32vh; object-fit: contain; }

@media (max-height: 340px) {
  .splash { gap: 8px; padding: 10px 16px; overflow: hidden; }
  .splash .vname {
    font-size: clamp(17px, 7.2vh, 22px); line-height: 1.15; max-width: 92%;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .splash .start-btn {
    font-size: 15px; padding: 8px 26px; min-height: 44px; border-width: 2px; gap: 8px;
    box-shadow: 0 4px 0 #3dc83d, 0 0 24px rgba(93, 251, 93, .4);
  }
  .splash .alt-btn { font-size: 12px; padding: 6px 14px; min-height: 36px; }
  .splash .hint { font-size: 11px; letter-spacing: .6px; }
  .splash .credit {
    font-size: 11px; line-height: 1.25; max-width: 94%;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .splash .logo { width: auto; max-width: 62%; max-height: 28vh; }
  .splash .gone { font-size: 12px; line-height: 1.35; }
  .splash.bright { padding-bottom: 10px; }
}
@media (max-height: 210px) {
  .splash .hint { display: none; }
  .splash .vname, .splash .credit { -webkit-line-clamp: 1; }
  .splash .logo { max-height: 24vh; }
}

.fc-loading {
  position: absolute; inset: 0; z-index: 20; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; background: #000; pointer-events: none;
  font: 700 12px/1 'Montserrat', system-ui, sans-serif; letter-spacing: 1.4px; text-transform: uppercase; color: #9a9ab8;
}
.fc-loading.on { display: flex; }
.fc-loading i {
  width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(93, 251, 93, .25); border-top-color: #5dfb5d;
}
@media (prefers-reduced-motion: no-preference) {
  .fc-loading i { animation: fc-spin .8s linear infinite; }
}
@keyframes fc-spin { to { transform: rotate(360deg); } }
