/* ==========================================================================
   Newyoufah – games page (design-slot-page)
   ========================================================================== */

.nyf-games { display: flex; flex-direction: column; gap: 20px; }
.nyf-games .nyf-page-head { margin-bottom: 0; }
.nyf-games__search { flex: 0 1 340px; }
.nyf-games__intro { max-width: 80ch; color: var(--nyf-text-soft); }
.nyf-games__intro > :last-child { margin-bottom: 0; }

/* Provider chips */
.nyf-chips { display: flex; gap: 8px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: thin; }

.nyf-chip {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--nyf-border-strong);
	border-radius: var(--nyf-radius-pill);
	background: var(--nyf-surface);
	color: var(--nyf-text-soft);
	font-weight: 600;
	font-size: .875rem;
	white-space: nowrap;
}

.nyf-chip:hover { border-color: var(--nyf-gold-4); color: var(--nyf-gold-2); }
.nyf-chip[aria-pressed="true"] { border-color: #F7DC8C; background: linear-gradient(110deg, #B8862E, #F7DC8C, #D9AA3F); color: #1A1205; }

/* Sort tabs + legend */
.nyf-games__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 10px 14px;
	border: 1px solid var(--nyf-border);
	border-radius: 14px;
	background: var(--nyf-surface);
}

.nyf-sorts { display: flex; flex-wrap: wrap; gap: 6px; }

.nyf-sort {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 14px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--nyf-muted);
	font-weight: 600;
	font-size: .875rem;
}

.nyf-sort .nyf-icon { width: 16px; height: 16px; }
.nyf-sort:hover { color: var(--nyf-gold-2); }
.nyf-sort[aria-pressed="true"] { background: rgba(217, 170, 63, .18); color: var(--nyf-gold-2); box-shadow: inset 0 -2px 0 var(--nyf-gold-2); }

.nyf-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; color: var(--nyf-muted); font-size: .75rem; }
.nyf-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.nyf-legend__item::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.nyf-legend__item--high { --c: #3DD68C; }
.nyf-legend__item--mid { --c: #F3C34E; }
.nyf-legend__item--low { --c: #F0883E; }

/* Grid */
.nyf-games__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.nyf-games__grid > li[hidden] { display: none; }
/* Customizer › หน้าเกม: "จำนวนคอลัมน์ (จอคอม)" – sets --nyf-games-cols */
@media (min-width: 1024px) {
	.nyf-games__grid { grid-template-columns: var(--nyf-games-grid, repeat(auto-fill, minmax(180px, 1fr))); }
}

@media (max-width: 480px) {
	.nyf-games__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

.nyf-gcard { display: flex; flex-direction: column; height: 100%; border-color: var(--nyf-border-strong); background: var(--nyf-surface); }
.nyf-gcard__media { color: inherit; text-decoration: none; }
.nyf-gcard__shade { position: absolute; inset: auto 0 0; z-index: 1; height: 45%; background: linear-gradient(180deg, rgba(12, 9, 4, 0), rgba(12, 9, 4, .92)); }

.nyf-gcard__caption {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 10px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
}

.nyf-gcard__prov {
	max-width: 100%;
	padding: 2px 7px;
	overflow: hidden;
	border: 1px solid var(--nyf-border-gold);
	border-radius: 6px;
	background: rgba(12, 9, 4, .8);
	color: var(--nyf-text);
	font-size: .6875rem;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.nyf-gcard__name {
	display: -webkit-box;
	max-width: 100%;
	overflow: hidden;
	font-family: var(--nyf-font-head);
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.2;
	letter-spacing: .3px;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
}

.nyf-gcard__foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding: 10px 12px 12px; border-top: 1px solid var(--nyf-border); }
.nyf-gcard__foot .nyf-rtp { padding: 0; border: 0; }
.nyf-gcard__cta { min-height: 44px; font-size: .875rem; }

.nyf-gcard__badge {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	padding: 4px 10px;
	border-bottom-right-radius: 10px;
	color: #1A1205;
	font-size: .6875rem;
	font-weight: 700;
}

.nyf-gcard__fav {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 4;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--nyf-gold-2);
}

.nyf-gcard__fav-dot { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--nyf-border-gold); border-radius: 50%; background: rgba(12, 9, 4, .7); }
.nyf-gcard__fav .nyf-icon { width: 16px; height: 16px; stroke-width: 2; }
.nyf-gcard__fav[aria-pressed="true"] .nyf-icon { fill: currentColor; }

/* RTP meter */
.nyf-rtp { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px 12px; border-top: 1px solid var(--nyf-border); }
.nyf-rtp--high { --c: #3DD68C; }
.nyf-rtp--mid { --c: #F3C34E; }
.nyf-rtp--low { --c: #F0883E; }
.nyf-rtp__row { display: flex; align-items: baseline; justify-content: space-between; }
.nyf-rtp__label { color: #D9C8A0; font-size: .75rem; font-weight: 600; }
.nyf-rtp__value { color: var(--c); font-family: var(--nyf-font-head); font-weight: 700; font-size: .95rem; }
.nyf-rtp__meter { height: 8px; overflow: hidden; border-radius: var(--nyf-radius-pill); background: #2E2310; }

.nyf-rtp__fill {
	position: relative;
	display: block;
	width: var(--w, 0%);
	height: 100%;
	overflow: hidden;
	border-radius: inherit;
	background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, transparent), var(--c));
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 1.2s cubic-bezier(.2, .8, .2, 1);
}

.nyf-rtp.is-in .nyf-rtp__fill { transform: scaleX(1); transition-delay: var(--delay, 0s); }

.nyf-rtp__fill::after {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 40%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
	transform: translateX(-150%);
	animation: nyf-rtp-run 2.8s ease-in-out infinite;
}

@keyframes nyf-rtp-run { 60%, 100% { transform: translateX(350%); } }

.nyf-no-js .nyf-rtp__fill,
.nyf-no-fx .nyf-rtp__fill { transform: none; transition: none; }
.nyf-no-fx .nyf-rtp__fill::after { display: none; }

@media (prefers-reduced-motion: reduce) {
	.nyf-rtp__fill { transform: none; transition: none; }
	.nyf-rtp__fill::after { display: none; }
}

.nyf-games__empty { padding: 32px 16px; border: 1px dashed var(--nyf-border-strong); border-radius: 14px; color: var(--nyf-muted); text-align: center; }
.nyf-games__note { margin: 0; color: var(--nyf-muted); font-size: .8125rem; text-align: center; }
.nyf-games__seo { padding: 24px; }
.nyf-games__seo h2 { font-size: 1.3rem; color: var(--nyf-gold-2); }
.nyf-games__seo > :last-child { margin-bottom: 0; }

/* ---------- Art card (slot games: real artwork with the name in the image) ----------
   Nothing is laid over the artwork except the badge (top-left) and a small favourite button (top-right);
   provider, name, RTP and the play button sit below the image. */
.nyf-gcard--art .nyf-gcard__media { background: linear-gradient(160deg, #0C0904 0%, #2A1F0B 55%, #4A3610 100%); }
.nyf-gcard--art .nyf-gcard__foot { gap: 8px; padding-top: 10px; border-top: 1px solid var(--nyf-border); }
.nyf-gcard__info { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; text-align: center; }
.nyf-gcard--art .nyf-gcard__prov { border-color: var(--nyf-border); background: transparent; color: var(--nyf-muted); font-size: .65rem; font-weight: 600; }
.nyf-gcard--art .nyf-gcard__name { font-size: .9375rem; min-height: 2.4em; display: -webkit-box; align-content: center; }
.nyf-gcard--art .nyf-gcard__badge { border-bottom-right-radius: 8px; padding: 3px 8px; font-size: .625rem; }
.nyf-gcard--art .nyf-gcard__fav { top: 4px; right: 4px; width: 32px; height: 32px; }
.nyf-gcard--art .nyf-gcard__fav-dot { width: 24px; height: 24px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .55); }
.nyf-gcard--art .nyf-gcard__fav .nyf-icon { width: 12px; height: 12px; }
.nyf-gcard--art .nyf-gcard__cta { min-height: 40px; }

/* Home rows: same art card, a little tighter */
.nyf-grid--cards .nyf-gcard--art .nyf-gcard__foot { padding: 8px 8px 10px; }
.nyf-grid--cards .nyf-gcard--art .nyf-gcard__name { font-size: .8125rem; }
.nyf-grid--cards .nyf-gcard--art .nyf-gcard__cta { min-height: 36px; padding-inline: 6px; font-size: .75rem; }

/* Load more */
.nyf-games__more-wrap { display: flex; justify-content: center; }
.nyf-games__more { min-width: 220px; min-height: 44px; }
.nyf-games__more[hidden] { display: none; }

/* Art card: name right under the image on every card; only the play button sticks to the bottom. */
.nyf-gcard--art .nyf-gcard__foot { flex: 1 1 auto; margin-top: 0; }
.nyf-gcard--art .nyf-gcard__cta { margin-top: auto; }

/* ==========================================================================
   Live casino provider cards (v1.6.0): the provider's own 7:10 portrait card, shown whole on a
   transparent background (the character may rise above the card's own panel), name + play button below.
   ========================================================================== */
.nyf-gcard--casino { overflow: visible; background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(0, 0, 0, .2)), var(--nyf-surface); }
.nyf-gcard__media--casino { position: relative; display: block; aspect-ratio: 7 / 10; overflow: hidden; border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: transparent; }
.nyf-gcard__media--casino > img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; transition: transform .35s ease; }
.nyf-gcard--casino:hover .nyf-gcard__media--casino > img { transform: translateY(-4px) scale(1.02); }
@media (prefers-reduced-motion: reduce) {
	.nyf-gcard--casino:hover .nyf-gcard__media--casino > img { transform: none; }
}
.nyf-gcard--casino .nyf-gcard__badge { border-bottom-right-radius: 8px; padding: 3px 8px; font-size: .625rem; }
.nyf-gcard--casino .nyf-gcard__fav { top: 4px; right: 4px; width: 32px; height: 32px; }
.nyf-gcard--casino .nyf-gcard__fav-dot { width: 24px; height: 24px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .55); }
.nyf-gcard--casino .nyf-gcard__fav .nyf-icon { width: 12px; height: 12px; }
.nyf-gcard--casino .nyf-gcard__foot { align-items: stretch; gap: 8px; padding: 10px 12px 12px; text-align: center; }
.nyf-gcard--casino .nyf-gcard__name { display: block; overflow: hidden; color: var(--nyf-text); font-size: .9375rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.nyf-gcard--casino .nyf-gcard__cta { min-height: 40px; padding-inline: 8px; }

/* Casino page grid: N per row (Customizer, 4 default), last row centred; 2 per row on phones. */
.nyf-games__grid--casino { --nyf-cc: 4; --nyf-cg: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--nyf-cg); }
.nyf-games__grid--casino > li { flex: 0 0 calc((100% - (var(--nyf-cc) - 1) * var(--nyf-cg)) / var(--nyf-cc)); min-width: 0; }
@media (max-width: 1023px) {
	.nyf-games__grid--casino > li { flex-basis: calc((100% - 2 * var(--nyf-cg)) / 3); }
}
@media (max-width: 767px) {
	.nyf-games__grid--casino { --nyf-cg: 12px; }
	.nyf-games__grid--casino > li { flex-basis: calc((100% - var(--nyf-cg)) / 2); }
	.nyf-gcard--casino .nyf-gcard__name { font-size: .8125rem; }
	.nyf-gcard--casino .nyf-gcard__cta { min-height: 36px; font-size: .75rem; }
}

/* Home "คาสิโนสด": one sliding row (default) or full-row grid. */
.nyf-live-row__track { gap: 14px; }
.nyf-live-row__track > li { flex: 0 0 calc((100% - 5 * 14px) / 5.4); }
@media (max-width: 1199px) {
	.nyf-live-row__track > li { flex-basis: calc((100% - 3 * 14px) / 3.5); }
}
@media (max-width: 767px) {
	.nyf-live-row__track > li { flex-basis: calc((100% - 14px) / 2.3); }
	.nyf-live-row .nyf-hscroll__btn { display: none; }
}
.nyf-live-row .nyf-hscroll__btn { top: calc(42% - 22px); }
.nyf-live-row .nyf-gcard__name { font-size: .8125rem; }
.nyf-live-row .nyf-gcard__cta { min-height: 36px; padding-inline: 6px; font-size: .75rem; }
.nyf-grid--live .nyf-gcard--casino .nyf-gcard__foot { padding: 8px 8px 10px; }
.nyf-grid--live .nyf-gcard--casino .nyf-gcard__cta { min-height: 36px; padding-inline: 6px; font-size: .75rem; }

