/* Game buy box — ONE template for every product that has a Game (1.0.393, Mark 2026-10-07, "Games are membership-only").
   PHP: inc/game-buybox.php · JS: assets/js/hft-game-box.js. Loaded only on product pages of products with a Game.
   Brand: buttons from hft-pdp-editions.css (.hft-ed-cta pink, .hft-ed-sec white); the join block = the homepage
   "Ready for everything?" band (navy field, yellow dots, Fredoka heading, pink pill), compact. */

/* ---------- which parts show ---------- */
/* Game-only: the Game pane is the whole box (no price, cart, claim card or download — even if a plugin prints one). */
#hft-buybox.hft-gm-only > :not(.hft-gm-pane):not(.hft-gm-switch):not(script):not(style) { display: none !important; } /* 1.0.399: keep the linked switcher */
/* One upsell only: the membership join block replaces the claimed-visitor membership card on these products. */
#hft-buybox.hft-gm-nm .hft-fc--used { display: none !important; }

/* ---------- the switch: Game | Printable PDF (1.0.400: links only — see the 1.0.399 block at the end) ----------
 * 1.0.395 (Mark 2026-10-07): the Pop-Ups "type toggle" — plum box, white half / solid plum half, no icons
 * (source: Pop-Ups mockups/popup-1/product.tpl.html .fmt). Same markup + JS as 1.0.393; only the look changed.
 * -webkit-text-fill-color is set on purpose: the theme's anti-Elementor rules would otherwise paint the text navy. */
.hft-gm-switch {
	display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 16px; padding: 0;
	background: #fff; border: 2px solid var(--hft-plum, #5A2385); border-radius: 14px; overflow: hidden;
}
.hft-pdp .hft-gm-switch .hft-gm-tab {
	display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; margin: 0; padding: 11px 6px;
	border: 0 !important; border-radius: 0 !important; background: #fff !important; box-shadow: none !important;
	font: 800 15px/1.1 var(--ed-font, 'Nunito Sans', system-ui, sans-serif) !important; letter-spacing: 0;
	color: var(--hft-plum, #5A2385) !important; -webkit-text-fill-color: var(--hft-plum, #5A2385); cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.hft-pdp .hft-gm-switch .hft-gm-tab:hover { background: #F4EEFA !important; }
.hft-pdp .hft-gm-switch .hft-gm-tab[aria-selected="true"],
.hft-pdp .hft-gm-switch .hft-gm-tab[aria-selected="true"]:hover {
	background: var(--hft-plum, #5A2385) !important; color: #fff !important; -webkit-text-fill-color: #fff;
}
.hft-pdp .hft-gm-switch .hft-gm-tab:focus-visible { outline: 3px solid rgba(90, 35, 133, .45); outline-offset: -5px; }
.hft-gm-switch .hft-gm-ico { display: none; }
.hft-gm-ico { flex: none; }

/* ---------- Game pane ---------- */
.hft-gm-pane--game .hft-gm-row1 { display: flex; gap: 10px; align-items: stretch; }
.hft-gm-pane--game .hft-gm-row1 > .hft-ed-cta { flex: 1 1 auto; width: auto !important; min-width: 0; gap: 8px; }
/* pressable main button: the darker-pink bottom edge (Mark's button system) */
.hft-pdp .hft-pdp-summary .hft-gm-pane .hft-gm-play { box-shadow: 0 4px 0 #A4235C !important; transition: transform .12s ease, box-shadow .12s ease; }
.hft-pdp .hft-pdp-summary .hft-gm-pane .hft-gm-play:active { transform: translateY(3px); box-shadow: 0 1px 0 #A4235C !important; }
.hft-gm-sec { margin-top: 12px; }
.hft-gm-sec > .hft-cls-assign { flex: 1 1 100%; }
.hft-gm-note { margin: 12px 2px 0; font: 600 13px/1.45 var(--ed-font, 'Nunito Sans', system-ui, sans-serif); color: var(--ed-slate, #5A6B7D); text-align: center; }
.hft-gm-inc { text-align: center; }
.hft-gm-login { margin: 12px 0 0; text-align: center; font: 700 14px/1.4 var(--ed-font, 'Nunito Sans', system-ui, sans-serif); color: var(--ed-slate, #5A6B7D); }
.hft-gm-login a { color: var(--ed-navy, #1B437D) !important; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- the ONE join block — 1.0.396: Free Bundle design model (cream card, plum accent, pill, swash, sticker, checks) ---------- */
.hft-gm-join {
	/* 1.0.480 (Mark: "should it pop more?") — NAVY, the site-wide membership-offer colour (.hft-offer-panel), so it stands
	   apart from the white buy box and the cream page. Was cream #FFFCF6 with a plum top edge. */
	--gj-acc: #FBB915; --gj-tint: rgba(255, 255, 255, .07);
	position: relative; isolation: isolate; overflow: hidden; margin: 16px 0 0; padding: 20px 20px 18px;
	background: #1B437D; color: #fff; border: 2px solid #1B437D; border-top: 6px solid #FBB915;
	border-radius: 22px; text-align: left; box-shadow: 0 18px 36px -20px rgba(27, 67, 125, .7);
}
.hft-gm-join-deco i { position: absolute; border-radius: 50%; z-index: -1; }
.hft-gm-join-deco i:nth-child(1) { width: 190px; height: 190px; right: -70px; bottom: -110px; background: var(--gj-tint); }
.hft-gm-join-deco i:nth-child(2) { width: 90px; height: 90px; left: -34px; bottom: -40px; background: rgba(251, 185, 21, .18); }
.hft-gm-join-deco i:nth-child(3) { width: 10px; height: 10px; right: 104px; top: 16px; background: var(--ed-yellow, #FBB915); }
.hft-gm-join-sticker {
	position: absolute; right: 14px; top: 12px; width: 74px; height: 74px; border-radius: 50%; display: flex; flex-direction: column;
	align-items: center; justify-content: center; background: var(--ed-cta, #D6337B); color: #fff; -webkit-text-fill-color: #fff; border: 4px solid #fff;
	font: 700 15px/1 var(--ed-display, 'Fredoka', system-ui, sans-serif); text-align: center; box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .4);
	transform: rotate(-10deg); animation: hft-gj-bob 5s ease-in-out infinite;
}
.hft-gm-join-sticker b { font-size: 20px; line-height: .95; }
@keyframes hft-gj-bob { 0%, 100% { transform: rotate(-10deg) translateY(0); } 50% { transform: rotate(-6deg) translateY(-5px); } }
.hft-gm-join-pill {
	display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 12px 6px 10px; border-radius: 999px; background: #FBB915;
	border: 2px solid #FBB915; color: #1B437D; -webkit-text-fill-color: #1B437D;
	font: 800 13px/1 var(--ed-font, 'Nunito Sans', system-ui, sans-serif); box-shadow: 0 6px 16px -8px rgba(27, 67, 125, .35);
}
.hft-gm-join-pill svg { color: #1B437D; }
.hft-gm-join-h {
	margin: 12px 92px 12px 0; font: 600 24px/1.12 var(--ed-display, 'Fredoka', system-ui, sans-serif); letter-spacing: -.01em;
	color: #fff; -webkit-text-fill-color: #fff; text-wrap: balance;
}
.hft-gm-join-h em { font-style: normal; position: relative; white-space: nowrap; color: #fff; -webkit-text-fill-color: #fff; }
.hft-gm-join-h em::after {
	content: ""; position: absolute; left: -3%; right: -3%; bottom: .04em; height: .28em; background: var(--ed-yellow, #FBB915);
	border-radius: 999px; z-index: -1; opacity: .8; transform: rotate(-2deg);
}
.hft-gm-join-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 7px; }
.hft-gm-join-list li {
	position: relative; margin: 0; padding: 0 0 0 30px; font: 700 15px/1.35 var(--ed-font, 'Nunito Sans', system-ui, sans-serif);
	color: #fff; -webkit-text-fill-color: #fff;
}
.hft-gm-join-list li::before {
	content: ""; position: absolute; left: 0; top: 0; width: 21px; height: 21px; border-radius: 50%;
	background: var(--ed-yellow, #FBB915) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B437D' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/13px no-repeat;
}
.hft-pdp .hft-pdp-summary .hft-gm-join .hft-gm-join-btn {
	display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; box-sizing: border-box; min-height: 54px;
	padding: 12px 18px; border-radius: 999px; background: var(--ed-cta, #D6337B); color: #fff !important; -webkit-text-fill-color: #fff;
	font: 800 17px/1.1 var(--ed-font, 'Nunito Sans', system-ui, sans-serif); text-decoration: none !important;
	box-shadow: 0 4px 0 #A4235C; transition: transform .12s ease, background .15s ease, box-shadow .12s ease; /* 1.0.480: crisp, no glow */
}
.hft-pdp .hft-pdp-summary .hft-gm-join .hft-gm-join-btn:hover { background: var(--ed-cta-h, #B62A67); }
.hft-pdp .hft-pdp-summary .hft-gm-join .hft-gm-join-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #A4235C; }
.hft-gm-join-fine { margin: 11px 0 0; text-align: center; font: 600 13px/1.45 var(--ed-font, 'Nunito Sans', system-ui, sans-serif); color: #C9D6E6; -webkit-text-fill-color: #C9D6E6; }
.hft-gm-join-fine a { color: #fff !important; -webkit-text-fill-color: #fff; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.hft-gm-pane--pdfjoin .hft-gm-join { margin-top: 18px; }
@media (max-width: 480px) {
	.hft-gm-join { padding: 18px 16px 16px; }
	.hft-gm-join-h { font-size: 21px; margin-right: 80px; }
	.hft-gm-join-sticker { width: 66px; height: 66px; font-size: 13px; }
	.hft-gm-join-sticker b { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .hft-gm-join-sticker { animation: none; } }

/* ---------- the picture is the play button (Game tab / game-only) ---------- */
.hft-game-overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 5; cursor: pointer; border-radius: inherit; transition: background .15s; }
.hft-game-overlay:hover { background: rgba(255, 255, 255, .08); }

@media (max-width: 480px) {
	.hft-pdp .hft-gm-switch .hft-gm-tab { font-size: 15px; padding: 10px 4px; }
}
@media (prefers-reduced-motion: reduce) {
	.hft-pdp .hft-pdp-summary .hft-gm-pane .hft-gm-play, .hft-pdp .hft-pdp-summary .hft-gm-join .hft-gm-join-btn, .hft-gm-join-sticker, .hft-pdp .hft-gm-switch .hft-gm-tab { transition: none; }
}

/* ---------- 1.0.399 Game Products v2: the LINK switcher [Game | Printable PDF] on a game page and its worksheet page ----------
   Same labels and order on both pages (Mark). The page you are on = filled plum <span aria-current="page">; the other = an <a>
   to the other product's page. 1.0.401 (Mark): no arrow — a plain two-part toggle, an icon on each half, hover tint on the link. */
.hft-pdp .hft-gm-switch--link .hft-gm-tab { flex-direction: column; gap: 2px; text-decoration: none !important; min-height: 54px; padding: 8px; }
.hft-pdp .hft-gm-switch--link .hft-gm-tab[aria-current="page"] { cursor: default; }
.hft-pdp .hft-gm-switch--link .hft-gm-tab[aria-current="page"],
.hft-pdp .hft-gm-switch--link .hft-gm-tab[aria-current="page"]:hover { background: var(--hft-plum, #5A2385) !important; color: #fff !important; -webkit-text-fill-color: #fff; }
.hft-pdp .hft-gm-switch--link .hft-gm-tab--go:hover { background: #EFE5F8 !important; }
.hft-gm-switch--link .hft-gm-tab-l { display: inline-flex; align-items: center; gap: 6px; }
.hft-gm-switch--link .hft-gm-tab-ico { display: inline-block; font-size: .72em; line-height: 1; flex: none; }
.hft-gm-switch--link .hft-gm-tab-doc { width: 12px; height: 14px; }
.hft-gm-switch--link .hft-gm-tab-s { display: block; font: 700 11.5px/1.1 var(--ed-font, 'Nunito Sans', system-ui, sans-serif); opacity: .85; letter-spacing: .01em; }

/* 1.0.407 (Mark): the join box is on every product page for non-members. One offer per box — the claimed visitor's
   "Want this one free too?" card steps aside wherever the join box is present (browsers without :has() show both). */
#hft-buybox:has(.hft-gm-pane--pdfjoin) .hft-fc--used { display: none !important; }
