/* Play More Games widget styles for the Super Soldier Battle desktop lobby.
   Base rules are the IFS / Arena Blasters widget (copied from
   /workspace/arena-blasters/site-remote/css/ifs-play-more.css).
   SSB-specific hooks below position a compact card on the RIGHT of the
   start/lobby screen and hide it on phones, touch, How to Play, and the
   sign-in gate / match pages (this file is only mounted on index.html). */

/* Drop-in Play More Games cards. Column count comes from --ifs-cols
   (set by js/ifs-play-more.js). Rotation (default) alternates indie
   portrait cards with landscape teasers. data-rotate="0" keeps a static grid. */
.ifs-play-more {
    margin-top: 1.25rem;
    max-width: 100%;
    min-width: 0;
    position: relative;
}
.ifs-play-more-label {
    margin: 0 0 0.55rem;
    padding: 0;
    color: #9aa0b5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.55px;
    line-height: 1.2;
    text-align: center;
    background: transparent;
    border: none;
}
.ifs-play-more-icons {
    display: grid;
    grid-template-columns: repeat(var(--ifs-cols, 4), minmax(0, 72px));
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 0;
    justify-content: center;
}
.ifs-play-more-wide .ifs-play-more-icons,
.ifs-play-more-short .ifs-play-more-icons {
    grid-template-columns: repeat(var(--ifs-cols, 6), minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.ifs-play-more-short .ifs-play-more-icons {
    gap: 6px;
}
.ifs-play-more-portrait .ifs-play-more-icons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
}
.ifs-play-more-icons a {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    aspect-ratio: 9 / 16;
    box-sizing: border-box;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(42, 209, 214, 0.4);
    box-shadow: 0 0 12px rgba(42, 209, 214, 0.22), inset 0 0 8px rgba(42, 209, 214, 0.08);
    background: rgba(8, 12, 28, 0.85);
    transition: border-color .15s, box-shadow .15s;
}
.ifs-play-more-icons a:hover,
.ifs-play-more-icons a:focus-visible {
    border-color: rgba(42, 209, 214, 0.9);
    box-shadow: 0 0 16px rgba(42, 209, 214, 0.45);
    outline: none;
}
.ifs-play-more-icons img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    object-fit: cover;
    object-position: 50% 50%;
    border: 0;
    transition: opacity .28s ease;
}
.ifs-play-more-start { opacity: 1; z-index: 1; }
.ifs-play-more-play { opacity: 0; z-index: 2; }
.ifs-play-more-icons a:hover .ifs-play-more-play,
.ifs-play-more-icons a:focus-visible .ifs-play-more-play { opacity: 1; }

/* Teaser slide */
.ifs-play-more-teasers {
    display: grid;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}
.ifs-play-more-teasers.is-pair { grid-template-columns: 1fr 1fr; }
.ifs-play-more-teasers.is-single { grid-template-columns: 1fr; max-width: 640px; }
.ifs-play-more-teaser {
    display: block;
    overflow: hidden;
    background: #0a0818;
    border-radius: 12px;
    border: 1px solid rgba(42, 209, 214, 0.4);
    box-shadow: 0 0 12px rgba(42, 209, 214, 0.22);
    aspect-ratio: 1200 / 630;
}
.ifs-play-more-teaser:hover,
.ifs-play-more-teaser:focus-visible {
    border-color: rgba(42, 209, 214, 0.9);
    box-shadow: 0 0 16px rgba(42, 209, 214, 0.45);
    outline: none;
}
.ifs-play-more-teaser img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    border: 0;
}

/* Rotating stage — height is set in JS to the tallest slide type for
   the current layout and stays constant between teasers and cards. */
.ifs-play-more-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    flex: 0 0 auto;
    transition: none;
    z-index: auto !important;
}
.ifs-play-more-stage .ifs-play-more-icons,
.ifs-play-more-stage .ifs-play-more-teasers {
    height: auto;
    width: 100%;
    flex: 0 0 auto;
}
.ifs-play-more-stage.is-instant { transition: none; }
.ifs-play-more-slide {
    position: absolute;
    top: 0;
    left: 0;
    bottom: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(0);
    box-sizing: border-box;
}
.ifs-play-more-slide.is-active {
    position: relative;
    height: 100%;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}
.ifs-play-more-slide.is-leaving,
.ifs-play-more-slide.is-entering {
    visibility: visible;
    pointer-events: none;
}
.ifs-play-more-slide.is-leaving { position: absolute; z-index: 2; }
.ifs-play-more-slide.is-entering { position: absolute; z-index: 3; }
.ifs-play-more-stage.is-sliding .ifs-play-more-slide.is-leaving,
.ifs-play-more-stage.is-sliding .ifs-play-more-slide.is-entering {
    transition: transform .5s ease;
}
.ifs-play-more-stage.is-instant .ifs-play-more-slide { transition: none; }

.ifs-play-more-dots {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin: 12px 0 0;
    padding: 0;
}
/* Beat host-page `button { min-width: 10vw; ... }` rules (Space Wow, etc.). */
.ifs-play-more .ipm-dot,
.ifs-play-more .ifs-play-more-dots button {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: block;
    flex: none;
    width: 8px !important;
    height: 8px !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    background: rgba(200, 210, 220, 0.35) !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    font-family: inherit;
    text-indent: 0;
    overflow: hidden;
    cursor: pointer;
}
.ifs-play-more .ipm-dot[aria-current="true"],
.ifs-play-more .ifs-play-more-dots button[aria-current="true"] {
    background: #d8ffe0 !important;
    box-shadow: 0 0 6px rgba(0, 255, 80, 0.7) !important;
    width: 8px !important;
    height: 8px !important;
}
.ifs-play-more .ipm-dot:hover,
.ifs-play-more .ifs-play-more-dots button:hover {
    background: rgba(200, 210, 220, 0.6) !important;
    color: transparent !important;
}
.ifs-play-more .ipm-dot[aria-current="true"]:hover,
.ifs-play-more .ifs-play-more-dots button[aria-current="true"]:hover {
    background: #d8ffe0 !important;
}

.ifs-play-more .ipm-arrow,
.ifs-play-more .ifs-play-more-arrow {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* Above Space Wow's global `div, button { z-index: 10 }` which was
       painting the stage over these 32px arrows. */
    z-index: 20 !important;
    flex: none;
    width: 32px !important;
    height: 32px !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(8, 12, 20, 0.72) !important;
    color: #e8ffe8 !important;
    font-size: 26px !important;
    font-family: inherit;
    line-height: 1 !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5) !important;
    cursor: pointer;
}
.ifs-play-more-prev { left: -6px; }
.ifs-play-more-next { right: -6px; }
.ifs-play-more .ipm-arrow:hover,
.ifs-play-more .ipm-arrow:focus-visible,
.ifs-play-more .ifs-play-more-arrow:hover,
.ifs-play-more .ifs-play-more-arrow:focus-visible {
    background: rgba(0, 200, 50, 0.85) !important;
    color: #e8ffe8 !important;
    outline: none;
}
@media (hover: hover) and (pointer: fine) {
    .ifs-play-more-rotate .ipm-arrow,
    .ifs-play-more-rotate .ifs-play-more-arrow { display: block; }
    .ifs-play-more-rotate { padding: 0 22px; }
}

@media (max-width: 700px) and (orientation: portrait) {
    .ifs-play-more-teasers.is-single { max-width: 100%; }
    .ifs-play-more-label { font-size: 0.8rem; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .ifs-play-more { margin-top: 8px; }
    .ifs-play-more-label { font-size: 10px; margin-bottom: 4px; }
    .ifs-play-more-teasers { gap: 8px; max-width: 86%; }
    .ifs-play-more-icons a,
    .ifs-play-more-teaser { border-radius: 8px; }
    .ifs-play-more-dots { margin-top: 8px; }
}


/* Reserve the tallest slide type + dots (and a little label slack) until
   JS marks the widget ready, so the first paint matches the final height. */
[data-ifs-play-more]:not([data-ifs-ready="1"]) {
    display: grid;
    min-height: 180px;
}
[data-ifs-play-more]:not([data-ifs-ready="1"])::before,
[data-ifs-play-more]:not([data-ifs-ready="1"])::after {
    content: "";
    grid-area: 1 / 1;
    width: 100%;
    height: 0;
    pointer-events: none;
}
/* Desktop / landscape: 6× 9:16 cards vs 2 teasers, plus dots + label slack. */
[data-ifs-play-more]:not([data-ifs-ready="1"])::before {
    padding-top: calc((100% - 50px) / 6 * 16 / 9 + 40px);
}
[data-ifs-play-more]:not([data-ifs-ready="1"])::after {
    padding-top: calc((100% - 12px) / 2 * 630 / 1200 + 40px);
}
@media (max-width: 700px) and (orientation: portrait) {
    [data-ifs-play-more]:not([data-ifs-ready="1"])::before {
        padding-top: calc((100% - 24px) / 4 * 16 / 9 + 40px);
    }
    [data-ifs-play-more]:not([data-ifs-ready="1"])::after {
        padding-top: calc(min(100%, 640px) * 630 / 1200 + 40px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ifs-play-more-stage,
    .ifs-play-more-slide,
    .ifs-play-more-icons img { transition: none; }
}


/* ---- SSB desktop lobby card (right side, vertically centered) ----
   Same compact 3-portrait / 1-teaser setup as Arena Blasters' left-side
   lobby card, restyled in SSB cyan and placed on the right so it sits
   beside the PLAY / HOW TO PLAY menu without covering it. Hidden on
   mobile/touch, phone widths, CrazyGames, How to Play, and loading. */
#ssbPlayMoreLobby.ssb-pm {
	display: none;
	pointer-events: auto;
	container-type: inline-size;
	box-sizing: border-box;
	margin-top: 0;
	z-index: 2;
}
#ssbPlayMoreLobby.ssb-pm.ifs-play-more { margin-top: 0; }

/* Desktop pointer devices only. 1100px matches the lobby ad breakpoint
   so the right column has room next to the centered menu. */
@media (min-width: 1100px) and (min-height: 600px) and (hover: hover) and (pointer: fine) {
	#game-ui:not(.mobile):not(.crazygames) #ssbPlayMoreLobby.ssb-pm-lobby {
		display: block;
	}
}

#game-ui.mobile #ssbPlayMoreLobby,
#game-ui.crazygames #ssbPlayMoreLobby,
body.ssb-info-open #ssbPlayMoreLobby,
body.ssb-lobby-loading #ssbPlayMoreLobby,
body.ssb-touch-play #ssbPlayMoreLobby {
	display: none !important;
}

@media (hover: none), (pointer: coarse), (max-width: 1099px) {
	#ssbPlayMoreLobby { display: none !important; }
}

#ssbPlayMoreLobby.ssb-pm-lobby {
	position: absolute;
	right: max(clamp(48px, 5vw, 120px), env(safe-area-inset-right, 0px));
	top: 54%;
	transform: translateY(-50%);
	width: clamp(160px, 17vw, 260px);
	padding: 10px 12px 9px !important;
	background: rgba(7, 11, 18, 0.82);
	border: 1px solid #2a5a8a;
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
	/* Stay below the upper-right lobby ad stack (#ssbLobbyAds is top:180px). */
}

/* On shorter desktops, sit a bit lower so the card stays by the soldiers
   / menu and clear of the top-right ads and sign-in pill. */
@media (min-width: 1100px) and (max-height: 820px) {
	#ssbPlayMoreLobby.ssb-pm-lobby {
		top: auto;
		bottom: 22%;
		transform: none;
	}
}

#ssbPlayMoreLobby .ifs-play-more-label {
	font: 800 9px 'Rajdhani', 'Orbitron', Arial, Helvetica, sans-serif;
	letter-spacing: 2.5px;
	color: #7ec8ff;
	text-transform: uppercase;
	text-align: left;
	margin-bottom: 7px;
	white-space: nowrap;
	overflow: hidden;
}

#ssbPlayMoreLobby .ifs-play-more-icons a,
#ssbPlayMoreLobby .ifs-play-more-teaser {
	border: 1px solid #2a5a8a;
	border-radius: 8px;
	box-shadow: 0 0 12px rgba(74, 200, 255, 0.18), inset 0 0 8px rgba(74, 200, 255, 0.06);
	background: #0d1520;
}
#ssbPlayMoreLobby .ifs-play-more-icons a:hover,
#ssbPlayMoreLobby .ifs-play-more-icons a:focus-visible,
#ssbPlayMoreLobby .ifs-play-more-teaser:hover,
#ssbPlayMoreLobby .ifs-play-more-teaser:focus-visible {
	border-color: #4ac8ff;
	box-shadow: 0 0 16px rgba(74, 200, 255, 0.4);
}

#ssbPlayMoreLobby .ipm-dot[aria-current="true"],
#ssbPlayMoreLobby .ifs-play-more-dots button[aria-current="true"],
#ssbPlayMoreLobby .ipm-dot[aria-current="true"]:hover {
	background: #7ec8ff !important;
	box-shadow: 0 0 6px rgba(74, 200, 255, 0.7) !important;
}
#ssbPlayMoreLobby .ipm-arrow {
	color: #cfefff !important;
	background: rgba(13, 21, 32, 0.85) !important;
	box-shadow: 0 0 0 1px #2a5a8a !important;
	width: 24px !important;
	height: 24px !important;
	font-size: 20px !important;
}
#ssbPlayMoreLobby .ipm-arrow:hover,
#ssbPlayMoreLobby .ipm-arrow:focus-visible {
	background: rgba(42, 90, 138, 0.95) !important;
	color: #fff !important;
}
#ssbPlayMoreLobby .ifs-play-more-dots { margin-top: 8px; }
#ssbPlayMoreLobby .ifs-play-more-icons {
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 7px !important;
}
#ssbPlayMoreLobby .ifs-play-more-icons a:nth-child(n+4) { display: none; }
#ssbPlayMoreLobby .ifs-play-more-teasers.is-pair { grid-template-columns: 1fr !important; }
#ssbPlayMoreLobby .ifs-play-more-teasers.is-pair .ifs-play-more-teaser:nth-child(n+2) { display: none; }
#ssbPlayMoreLobby .ifs-play-more-prev { left: -10px; }
#ssbPlayMoreLobby .ifs-play-more-next { right: -10px; }

#ssbPlayMoreLobby .ifs-play-more-stage { transition: none !important; }
#ssbPlayMoreLobby.ssb-pm-lobby .ifs-play-more-stage {
	height: max(calc((100cqw - 14px) * 16 / 27), calc(100cqw * .525 + 2px)) !important;
}

@media (min-aspect-ratio: 16/9) {
	#ssbPlayMoreLobby.ssb-pm-lobby { width: clamp(160px, 18vw, 260px); }
}
