/* Kestrel Core components. Tokens live here so widgets render on-brand under any theme. */
:root {
	--kp-bg: #FFFFFF;
	--kp-card: #FFFFFF;
	--kp-surface: #F3F7F5;
	--kp-surface-2: #E8F0EC;
	--kp-line: #DCE5E0;
	--kp-line-strong: #B9CBC1;
	--kp-ink: #10201A;
	--kp-muted: #5B6E66;
	--kp-on-dark: #F4F7F5;
	--kp-on-dark-soft: #D2DED8;
	--kp-accent: #0E7A5A;
	--kp-accent-hover: #0A6249;
	--kp-accent-ink: #FFFFFF;
	--kp-gold: #E8A320;
	--kp-gold-ink: #7A4E00;
	--kp-live: #0E8F63;
	--kp-hot: #D9412F;
	--kp-scrim: 13, 22, 19;
	--kp-font-head: 'Sora', ui-sans-serif, system-ui, sans-serif;
	--kp-font-body: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
	--kp-r-sm: 6px;
	--kp-r-md: 12px;
	--kp-r-lg: 16px;
	--kp-r-pill: 999px;
	--kp-container: 1320px;
	--kp-gutter: 24px;
	--kp-section: 56px;
	--kp-ease: cubic-bezier(.2, .7, .2, 1);
}
@media (max-width: 767px) {
	:root { --kp-gutter: 16px; --kp-section: 36px; }
}

:where(.kp-hero, .kp-cats, .kp-ticker, .kp-shelf, .kp-steps, .kp-band, .kp-grid) :where(h1, h2, h3, p, ul, ol, li, figure) { margin: 0; padding: 0; }
:where(.kp-cats, .kp-ticker, .kp-steps) :where(ul, ol) { list-style: none; }
.kp-art, .kp-media-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kp-icon { width: 1em; height: 1em; flex: none; }
.kp-empty { color: var(--kp-muted); font-size: 14px; padding: 24px; border: 1px dashed var(--kp-line); border-radius: var(--kp-r-md); }

/* Buttons */
.kp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 22px; border-radius: var(--kp-r-pill);
	font: 600 15px/1 var(--kp-font-body); letter-spacing: .01em; text-decoration: none; white-space: nowrap;
	border: 1px solid transparent; cursor: pointer;
	transition: background-color .18s, border-color .18s, color .18s, transform .18s var(--kp-ease);
}
.kp-btn:active { transform: translateY(1px); }
.kp-btn--primary { background: var(--kp-accent); color: var(--kp-accent-ink); }
.kp-btn--primary:hover, .kp-btn--primary:focus-visible { background: var(--kp-accent-hover); color: var(--kp-accent-ink); }
.kp-btn--line { border-color: var(--kp-line); color: var(--kp-ink); background: transparent; }
.kp-btn--line:hover, .kp-btn--line:focus-visible { border-color: var(--kp-accent); color: var(--kp-accent); }
.kp-btn--ghost { background: rgba(238, 243, 239, .12); color: var(--kp-on-dark); border-color: rgba(238, 243, 239, .28); }
.kp-btn--ghost:hover, .kp-btn--ghost:focus-visible { background: rgba(238, 243, 239, .24); color: var(--kp-on-dark); }
.kp-btn--sm { min-height: 34px; padding: 0 16px; font-size: 13px; }
:where(.kp-hero, .kp-cats, .kp-ticker, .kp-shelf, .kp-steps, .kp-band, .kp-grid, .kp-site) :focus-visible { outline: 2px solid var(--kp-accent); outline-offset: 2px; }

/* Badges */
.kp-badge {
	position: absolute; top: 10px; left: 10px; z-index: 2;
	padding: 4px 9px; border-radius: var(--kp-r-pill);
	font: 700 11px/1 var(--kp-font-body); letter-spacing: .05em; text-transform: uppercase;
}
.kp-badge--hot { background: var(--kp-hot); color: #FFFFFF; }
.kp-badge--new, .kp-badge--live { background: var(--kp-live); color: #FFFFFF; }

/* Round arrows */
.kp-arrows { display: flex; gap: 8px; }
.kp-arrow {
	display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
	border-radius: 50%; border: 1px solid var(--kp-line); background: var(--kp-surface); color: var(--kp-ink);
	font-size: 18px; cursor: pointer; transition: border-color .18s, color .18s, opacity .18s;
}
.kp-arrow:hover { border-color: var(--kp-accent); color: var(--kp-accent); background: var(--kp-card); }
.kp-arrow.swiper-button-disabled { opacity: .35; cursor: default; }
.kp-arrow.swiper-button-lock { display: none; }

/* Hero bento */
.kp-hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.kp-hero--solo { grid-template-columns: 1fr; }
.kp-hero__main { position: relative; border-radius: var(--kp-r-lg); overflow: hidden; background: var(--kp-surface); aspect-ratio: 2.1 / 1; min-height: 280px; }
.kp-hero__main .swiper, .kp-hero__main .swiper-wrapper { height: 100%; }
.kp-slide { position: relative; height: 100%; }
.kp-slide__media { position: absolute; inset: 0; }
.kp-slide__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(var(--kp-scrim), .9) 0%, rgba(var(--kp-scrim), .55) 42%, rgba(var(--kp-scrim), 0) 72%); }
.kp-slide__body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; height: 100%; padding: 40px 48px 64px; max-width: 560px; }
.kp-slide__title { font: 700 clamp(26px, 2.9vw, 44px)/1.08 var(--kp-font-head); color: var(--kp-on-dark); letter-spacing: -.01em; text-wrap: balance; }
.kp-slide__text { font: 400 16px/1.5 var(--kp-font-body); color: var(--kp-on-dark-soft); max-width: 40ch; }
.kp-slide .kp-btn { margin-top: 6px; }
.kp-hero__controls { position: absolute; z-index: 3; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 8px; }
.kp-hero__controls .kp-arrow { color: var(--kp-on-dark); background: rgba(var(--kp-scrim), .6); border-color: rgba(238, 243, 239, .2); backdrop-filter: blur(6px); }
.kp-hero__dots { display: flex; gap: 6px; padding: 0 4px; }
.kp-hero__dots .swiper-pagination-bullet { width: 8px; height: 8px; margin: 0 !important; padding: 0; border: 0; border-radius: var(--kp-r-pill); background: rgba(238, 243, 239, .45); opacity: 1; cursor: pointer; transition: width .25s var(--kp-ease), background-color .25s; }
.kp-hero__dots .swiper-pagination-bullet-active { width: 24px; background: var(--kp-gold); }
.kp-hero__toggle .kp-icon:last-child, .kp-hero__toggle.is-paused .kp-icon:first-child { display: none; }
.kp-hero__toggle.is-paused .kp-icon:last-child { display: block; }
.kp-hero__side { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }
.kp-tile { position: relative; display: flex; align-items: flex-end; min-height: 150px; padding: 20px; border-radius: var(--kp-r-lg); overflow: hidden; color: var(--kp-on-dark); text-decoration: none; isolation: isolate; }
.kp-tile__art { position: absolute; inset: 0; z-index: -1; transition: transform .5s var(--kp-ease); }
.kp-tile__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(var(--kp-scrim), .85), rgba(var(--kp-scrim), .1) 70%); }
.kp-tile__body { display: flex; flex-direction: column; gap: 4px; padding-right: 48px; }
.kp-tile__title { font: 700 20px/1.15 var(--kp-font-head); }
.kp-tile__text { font: 400 14px/1.4 var(--kp-font-body); color: var(--kp-on-dark-soft); }
.kp-tile__go { position: absolute; right: 18px; bottom: 18px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--kp-gold); color: #1A1206; font-size: 18px; transition: transform .25s var(--kp-ease); }
a.kp-tile:hover .kp-tile__art { transform: scale(1.04); }
a.kp-tile:hover .kp-tile__go { transform: translateX(3px); }

/* Category tiles */
.kp-cats__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; }
.kp-cat { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; height: 100%; padding: 16px; border-radius: var(--kp-r-md); background: var(--kp-surface); border: 1px solid var(--kp-line); color: var(--kp-ink); text-decoration: none; transition: border-color .18s, transform .18s var(--kp-ease), background-color .18s; }
.kp-cat:hover { border-color: var(--kp-accent); background: var(--kp-card); transform: translateY(-2px); color: var(--kp-ink); }
.kp-cat__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--kp-r-md); background: rgba(14, 122, 90, .1); color: var(--kp-accent); font-size: 24px; }
.kp-cat__label { font: 600 15px/1.2 var(--kp-font-head); }
.kp-cat__note { font: 400 12px/1.3 var(--kp-font-body); color: var(--kp-muted); margin-top: -6px; }

/* Ticker */
.kp-ticker { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 6px 0 6px; border-radius: var(--kp-r-pill); background: var(--kp-surface); border: 1px solid var(--kp-line); overflow: hidden; }
.kp-ticker__label { flex: none; padding: 6px 12px; border-radius: var(--kp-r-pill); background: rgba(232, 163, 32, .18); color: var(--kp-gold-ink); font: 700 11px/1 var(--kp-font-body); letter-spacing: .06em; text-transform: uppercase; }
.kp-ticker__viewport { flex: 1; display: flex; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.kp-ticker__track { display: flex; flex: none; gap: 48px; padding-right: 48px; animation: kp-marquee 45s linear infinite; }
.kp-ticker__track li { white-space: nowrap; font: 400 14px/1.4 var(--kp-font-body); color: var(--kp-ink); }
.kp-ticker__track a { color: inherit; text-decoration: none; }
.kp-ticker__track a:hover { color: var(--kp-accent); }
.kp-ticker:hover .kp-ticker__track, .kp-ticker:focus-within .kp-ticker__track, .kp-ticker.is-paused .kp-ticker__track { animation-play-state: paused; }
.kp-ticker__toggle { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--kp-muted); font-size: 16px; cursor: pointer; }
.kp-ticker__toggle:hover { color: var(--kp-ink); }
.kp-ticker__toggle .kp-icon:last-child, .kp-ticker.is-paused .kp-ticker__toggle .kp-icon:first-child { display: none; }
.kp-ticker.is-paused .kp-ticker__toggle .kp-icon:last-child { display: block; }
@keyframes kp-marquee { to { transform: translateX(-100%); } }

/* Shelves */
.kp-shelf__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.kp-shelf__title { font: 700 21px/1.2 var(--kp-font-head); color: var(--kp-ink); letter-spacing: -.005em; }
.kp-shelf__tools { display: flex; align-items: center; gap: 16px; }
.kp-shelf__all { font: 500 14px/1 var(--kp-font-body); color: var(--kp-muted); text-decoration: none; }
.kp-shelf__all:hover { color: var(--kp-accent); }
.kp-swiper { overflow: hidden; }
.kp-swiper:not(.swiper-initialized) .swiper-wrapper { display: flex; gap: 16px; overflow-x: auto; }
.kp-swiper:not(.swiper-initialized) .swiper-slide { flex: 0 0 min(220px, 42%); }
.kp-shelf--promos .kp-swiper:not(.swiper-initialized) .swiper-slide, .kp-shelf--posts .kp-swiper:not(.swiper-initialized) .swiper-slide { flex-basis: min(380px, 85%); }
.kp-swiper .swiper-slide { height: auto; }

/* Game card */
.kp-game { display: flex; flex-direction: column; gap: 4px; }
.kp-game__media { position: relative; aspect-ratio: 4 / 3; border-radius: var(--kp-r-md); overflow: hidden; background: var(--kp-surface); margin-bottom: 6px; }
.kp-game__media > .kp-art, .kp-game__media > .kp-media-img { transition: transform .4s var(--kp-ease); }
.kp-game__overlay { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(var(--kp-scrim), .72); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s; }
.kp-game__overlay .kp-btn { min-width: 96px; }
.kp-game:hover .kp-game__overlay, .kp-game:focus-within .kp-game__overlay { opacity: 1; }
.kp-game:hover .kp-game__media > .kp-art, .kp-game:hover .kp-game__media > .kp-media-img { transform: scale(1.05); }
@media (hover: none) {
	.kp-game__overlay { inset: auto 8px 8px auto; opacity: 1; background: none; backdrop-filter: none; }
	.kp-game__overlay .kp-btn--ghost { display: none; }
	.kp-game__overlay .kp-btn { min-width: 0; }
}
.kp-game__title { font: 600 14px/1.3 var(--kp-font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-game__title a { color: var(--kp-ink); text-decoration: none; }
.kp-game__title a:hover { color: var(--kp-accent); }
.kp-game__meta { font: 400 12px/1.3 var(--kp-font-body); color: var(--kp-muted); }

/* Promo card */
.kp-promo, .kp-news { display: flex; flex-direction: column; height: 100%; border-radius: var(--kp-r-md); background: var(--kp-card); border: 1px solid var(--kp-line); overflow: hidden; transition: border-color .18s, transform .18s var(--kp-ease); }
.kp-promo:hover, .kp-news:hover { border-color: var(--kp-line-strong); transform: translateY(-3px); }
.kp-promo__media { position: relative; display: block; aspect-ratio: 2.1 / 1; overflow: hidden; }
.kp-promo__body, .kp-news__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 16px 18px 18px; }
.kp-promo__title, .kp-news__title { font: 600 17px/1.3 var(--kp-font-head); }
.kp-promo__title a, .kp-news__title a { color: var(--kp-ink); text-decoration: none; }
.kp-promo__title a:hover, .kp-news__title a:hover { color: var(--kp-accent); }
.kp-promo__text, .kp-news__text { font: 400 14px/1.5 var(--kp-font-body); color: var(--kp-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kp-promo__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 8px; }
.kp-promo__end { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1.2 var(--kp-font-body); color: var(--kp-muted); }
.kp-news__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.kp-news__date { font: 500 12px/1 var(--kp-font-body); color: var(--kp-muted); }

/* Steps */
.kp-steps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 40px; padding: 40px; border-radius: var(--kp-r-lg); background: var(--kp-surface); border: 1px solid var(--kp-line); }
.kp-steps__head { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.kp-steps__title { font: 700 26px/1.15 var(--kp-font-head); color: var(--kp-ink); }
.kp-steps__intro { font: 400 15px/1.55 var(--kp-font-body); color: var(--kp-muted); }
.kp-steps__list { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; counter-reset: kp; }
.kp-steps__list::before { content: ""; position: absolute; top: 19px; left: 20px; right: 20px; height: 1px; background: var(--kp-line); }
.kp-step { position: relative; display: flex; flex-direction: column; gap: 8px; }
.kp-step__num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--kp-card); border: 1px solid var(--kp-accent); color: var(--kp-accent); font: 700 15px/1 var(--kp-font-head); margin-bottom: 6px; }
.kp-step__title { font: 600 16px/1.3 var(--kp-font-head); color: var(--kp-ink); }
.kp-step__text { font: 400 14px/1.5 var(--kp-font-body); color: var(--kp-muted); }

/* Notice band */
.kp-band { display: flex; align-items: center; gap: 20px; padding: 22px 24px; border-radius: var(--kp-r-lg); background: var(--kp-surface-2); border: 1px solid var(--kp-line); }
.kp-band__icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(14, 122, 90, .1); color: var(--kp-accent); font-size: 24px; }
.kp-band__body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.kp-band__title { font: 700 18px/1.25 var(--kp-font-head); color: var(--kp-ink); }
.kp-band__text { font: 400 14px/1.5 var(--kp-font-body); color: var(--kp-muted); max-width: 80ch; }

/* Grids for archives */
.kp-grid { display: grid; gap: 20px 16px; }
.kp-grid--games { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.kp-grid--promos { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Tablet */
@media (max-width: 1024px) {
	.kp-hero { grid-template-columns: 1fr; }
	.kp-hero__side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
	.kp-tile { min-height: 140px; }
	.kp-steps { grid-template-columns: 1fr; gap: 28px; padding: 32px; }
	.kp-cats__list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--kp-gutter); gap: 12px; margin: 0 calc(var(--kp-gutter) * -1); padding: 0 var(--kp-gutter) 4px; scrollbar-width: none; }
	.kp-cats__list::-webkit-scrollbar { display: none; }
	.kp-cats__list li { flex: 0 0 132px; scroll-snap-align: start; }
}
/* Mobile */
@media (max-width: 767px) {
	.kp-hero__main { aspect-ratio: 4 / 3.3; border-radius: var(--kp-r-md); }
	.kp-slide__media::after { background: linear-gradient(0deg, rgba(var(--kp-scrim), .95) 0%, rgba(var(--kp-scrim), .6) 45%, rgba(var(--kp-scrim), .05) 80%); }
	.kp-slide__body { justify-content: flex-end; padding: 20px 20px 64px; max-width: none; gap: 10px; }
	.kp-slide__text { font-size: 14px; }
	.kp-hero__controls { left: 16px; right: 16px; justify-content: space-between; bottom: 14px; }
	.kp-hero__controls .kp-arrow { width: 32px; height: 32px; font-size: 16px; }
	.kp-hero__controls .kp-arrow--prev, .kp-hero__controls .kp-arrow--next { display: none; }
	.kp-hero__side { gap: 10px; }
	.kp-tile { min-height: 116px; padding: 14px; border-radius: var(--kp-r-md); }
	.kp-tile__title { font-size: 15px; }
	.kp-tile__text { display: none; }
	.kp-tile__body { padding-right: 0; }
	.kp-tile__go { display: none; }
	.kp-cats__list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--kp-gutter); gap: 10px; margin: 0 calc(var(--kp-gutter) * -1); padding: 0 var(--kp-gutter) 4px; scrollbar-width: none; }
	.kp-cats__list::-webkit-scrollbar { display: none; }
	.kp-cats__list li { flex: 0 0 104px; scroll-snap-align: start; }
	.kp-cat { padding: 12px; gap: 8px; }
	.kp-cat__icon { width: 38px; height: 38px; font-size: 20px; }
	.kp-cat__label { font-size: 13px; }
	.kp-cat__note { display: none; }
	.kp-ticker { border-radius: var(--kp-r-md); }
	.kp-ticker__label { display: none; }
	.kp-shelf__title { font-size: 18px; }
	.kp-shelf .kp-arrows { display: none; }
	.kp-swiper { overflow: visible; }
	.kp-shelf { overflow: hidden; margin: 0 calc(var(--kp-gutter) * -1); padding: 0 var(--kp-gutter); }
	.kp-steps { padding: 24px 20px; }
	.kp-steps__list { grid-template-columns: 1fr; gap: 18px; }
	.kp-steps__list::before { top: 20px; bottom: 20px; left: 19px; right: auto; width: 1px; height: auto; }
	.kp-step { display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; row-gap: 2px; }
	.kp-step__num { grid-row: span 2; margin: 0; }
	.kp-band { flex-direction: column; align-items: flex-start; }
	.kp-grid--games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.kp-ticker__track { animation: none; }
	.kp-ticker__viewport { overflow-x: auto; }
	.kp-ticker__track[aria-hidden="true"], .kp-ticker__toggle { display: none; }
	.kp-cat, .kp-promo, .kp-news, .kp-tile__art, .kp-game__media > * { transition: none !important; }
}
