/* Mario-hry.cz – vzhled „Kostka“: nebe s paprsky, zelené kopce, ?-kostka, cihlová zem v patičce.
   Třídy jsou stejné jako v šablonách jádra (app/UI); přepsané šablony jsou v sites/mario/templates.
   Žádná grafika Nintenda – kostka, kopce, mraky a cihly jsou vlastní kresba v CSS / SVG. */

@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 800; font-display: swap;
	src: url(../fonts/baloo2-latin-ext.woff2) format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 800; font-display: swap;
	src: url(../fonts/baloo2-latin.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap;
	src: url(../fonts/nunito-latin-ext.woff2) format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap;
	src: url(../fonts/nunito-latin.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Press Start 2P"; font-style: normal; font-weight: 400; font-display: swap;
	src: url(../fonts/pressstart-latin-ext.woff2) format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Press Start 2P"; font-style: normal; font-weight: 400; font-display: swap;
	src: url(../fonts/pressstart-latin.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
	--sky: #55b6f0;
	--sky-light: #8ed8f8;
	--red: #e4312b; /* čepice: logo, aktivní menu, odkazy */
	--red-dark: #b9221d;
	--coin: #ffc531; /* mince: kostka, štítky „nové“ */
	--coin-dark: #d98e12;
	--pipe: #22a845; /* trubka: tlačítko Hrát, kopce */
	--pipe-dark: #157431;
	--brick: #b5541e; /* cihla: patička */
	--ink: #1e2140; /* noc: text, plocha hry */
	--muted: #5a6283;
	--bg: #f2f9fe;
	--card: #ffffff;
	--line: #d5e6f2;
	--tint: #eef6fb;
	--shadow: 0 4px 0 var(--line);
	--display: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
	--body: "Nunito", "Segoe UI", system-ui, sans-serif;
	--pixel: "Press Start 2P", ui-monospace, monospace;
	--wrap: 1280px; /* 4 karty po 300 px (= reklama 300×250) + mezery + okraje */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--coin); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; text-wrap: balance; letter-spacing: .005em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 16px; }
.pixel { font-family: var(--pixel); font-size: 10px; letter-spacing: .06em; color: var(--brick); text-transform: uppercase; margin: 0; }

/* ---------------------------------------------------------- hlavička: nebe s paprsky, mraky, kopce */
.sky { position: relative; overflow-x: clip; color: #fff; /* clip jen do stran (mraky), rozbalené menu Další smí přes okraj dolů */
	background: repeating-conic-gradient(from 0deg at 50% 130%, rgba(255, 255, 255, .12) 0 5deg, transparent 5deg 10deg), linear-gradient(#45aaea, var(--sky-light)); }
.sky__in { position: relative; z-index: 2; display: flex; align-items: center; gap: 24px; padding-top: 16px; padding-bottom: 8px; flex-wrap: wrap; }
.cloud { position: absolute; z-index: 1; height: 22px; background: #fff; border-radius: 99px; opacity: .85; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 30px; height: 30px; left: 12px; top: -14px; }
.cloud::after { width: 40px; height: 40px; left: 34px; top: -22px; }
.cloud--1 { width: 92px; left: 34%; top: 34px; }
.cloud--2 { width: 70px; left: 66%; top: 80px; opacity: .6; }
.cloud--3 { width: 110px; left: 86%; top: 22px; opacity: .75; }
@media (prefers-reduced-motion: no-preference) {
	.cloud { animation: cloud 60s linear infinite alternate; }
	.cloud--2 { animation-duration: 80s; }
	@keyframes cloud { to { transform: translateX(-60px); } }
}
.logo { display: inline-flex; align-items: center; gap: 12px; flex: none; color: #fff; }
.logo:hover { color: #fff; }
.logo__kostka { width: 48px; height: 48px; flex: none; transition: transform .2s; }
.logo:hover .logo__kostka { transform: translateY(-5px); }
.logo__word { font-family: var(--display); font-weight: 800; font-size: 38px; line-height: 1; text-shadow: 0 3px 0 var(--red-dark), 0 5px 0 rgba(0, 0, 0, .12); }
.logo__word small { font-size: .55em; color: var(--coin); text-shadow: 0 2px 0 #a85f08; margin-left: 1px; }
.search { margin-left: auto; flex: 0 1 380px; display: flex; background: #fff; border-radius: 99px; padding: 4px 4px 4px 16px; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); outline: none; padding: 6px 0; }
.search input::placeholder { color: #7b84a8; }
.search button { border: 0; border-radius: 99px; background: var(--red); color: #fff; font: 800 14px var(--body); padding: 0 18px; cursor: pointer; }
.search button:hover { background: var(--red-dark); }
.search:focus-within { box-shadow: 0 0 0 3px var(--coin), 0 3px 0 rgba(0, 0, 0, .12); }

.menu { position: relative; z-index: 20; }
/* Další: rozbalovací seznam postaviček (details/summary) */
.menu__more details { position: relative; }
.menu__more summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--ink); background: #fff; border-radius: 10px; padding: 7px 14px; box-shadow: 0 3px 0 rgba(30, 33, 64, .18); white-space: nowrap; user-select: none; }
.menu__more summary::-webkit-details-marker { display: none; }
.menu__more summary::after { content: "\25BE"; font-size: 13px; line-height: 1; transition: transform .15s; }
.menu__more details[open] summary::after { transform: rotate(180deg); }
.menu__more summary:hover { transform: translateY(-2px); }
.menu__more.active summary { background: var(--red); color: #fff; box-shadow: 0 3px 0 #9e1d18; }
.menu__drop { position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; list-style: none; margin: 0; padding: 6px; background: #fff; border-radius: 12px; box-shadow: 0 12px 30px rgba(30, 33, 64, .25); display: grid; gap: 2px; }
.menu .menu__drop li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-weight: 800; font-size: 15px; color: var(--ink); white-space: nowrap; background: none; box-shadow: none; transform: none; }
.menu .menu__drop li a::before { content: ""; width: 10px; height: 10px; border-radius: 50% !important; background: var(--c); flex: none; }
.menu .menu__drop li a:hover { background: var(--tint); color: var(--ink); }
.menu .menu__drop li a.current { background: var(--tint); }
.menu__in { list-style: none; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; padding-bottom: 16px; }
.menu__item a { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--ink); background: #fff; border-radius: 10px; padding: 7px 14px; box-shadow: 0 3px 0 rgba(30, 33, 64, .18); white-space: nowrap; transition: transform .12s; }
.menu__item a::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--coin)); flex: none; }
.menu__item a:hover { color: var(--ink); transform: translateY(-2px); }
.menu__item.active a { background: var(--red); color: #fff; box-shadow: 0 3px 0 #9e1d18; }
.menu__item.active a::before { background: #fff; }
.hills { position: relative; z-index: 1; height: 30px;
	background: radial-gradient(70px 36px at 6% 100%, #34b85a 98%, transparent), radial-gradient(110px 44px at 27% 100%, #2ba84e 98%, transparent),
		radial-gradient(80px 32px at 52% 100%, #34b85a 98%, transparent), radial-gradient(130px 48px at 78% 100%, #2ba84e 98%, transparent),
		radial-gradient(70px 30px at 97% 100%, #34b85a 98%, transparent); }

/* ---------------------------------------------------------- obsah */
.page { padding-top: 24px; padding-bottom: 56px; min-height: 60vh; }
.flash { background: #e6f8ee; color: #136b34; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.flash--error { background: #ffe8e5; color: #9c2414; }
.section-title { font-size: 28px; margin: 0 0 14px; }
.section-head { display: flex; align-items: baseline; gap: 12px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--red); }
.crumbs span { color: var(--ink); font-weight: 700; }

/* hra dne + žebříček */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .8fr); gap: 22px; background: var(--card); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 26px; }
.hero__pic { display: block; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--ink); }
.hero__pic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.hero__pic:hover img { transform: scale(1.03); }
.hero__pic .hero__none { object-fit: contain; padding: 18%; }
.hero__text { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; }
.hero__text h2 { margin: 0; font-size: clamp(28px, 3vw, 36px); }
.hero__about { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero__meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; font-weight: 700; }
.hero__meta li { background: var(--tint); color: #3c4470; border-radius: 99px; padding: 2px 10px; }
.play-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; margin-top: 4px; background: var(--pipe); color: #fff; font: 800 22px/1 var(--display); padding: 10px 22px 10px 12px; border-radius: 12px; box-shadow: 0 4px 0 var(--pipe-dark); transition: transform .1s; }
.play-btn:hover { color: #fff; transform: translateY(-2px); }
.play-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--pipe-dark); }
.top5 { border-left: 2px dashed var(--line); padding-left: 18px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.top5__title { font-size: 20px; margin: 0 0 8px; }
.top5__list { list-style: none; margin: 0; padding: 0; counter-reset: top; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.top5__list li { counter-increment: top; min-width: 0; } /* bez min-width by se řádek roztáhl podle názvu a přetekl */
.top5__list a { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 4px 6px; }
.top5__list a:hover { background: var(--tint); color: var(--ink); }
.top5__list a::before { content: counter(top); flex: none; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--coin); color: #5a3300; font: 800 16px/1 var(--display); box-shadow: 0 2px 0 var(--coin-dark); }
.top5__list li:first-child a::before { background: var(--red); color: #fff; box-shadow: 0 2px 0 #9e1d18; }
.top5__name { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top5__count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* nadpis kategorie / postavičky */
.intro { position: relative; overflow: hidden; color: #fff; padding: 24px 28px; border-radius: 20px; margin-bottom: 22px; background: var(--c, var(--red)); box-shadow: 0 5px 0 rgba(0, 0, 0, .14); }
.intro::after { content: ""; position: absolute; right: -20px; top: -20px; width: 150px; height: 150px; background: url(/assets/img/kostka.svg) center / contain no-repeat; opacity: .25; transform: rotate(12deg); }
.intro h1 { position: relative; z-index: 1; font-size: clamp(30px, 4vw, 44px); margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.intro p { position: relative; z-index: 1; margin: 0; max-width: 72ch; font-size: 17px; color: rgba(255, 255, 255, .92); }
.intro:not([style]) { --c: var(--sky); background: linear-gradient(120deg, #2f95d8, var(--sky)); }
.count { font-family: var(--body); font-weight: 700; font-size: 16px; color: rgba(255, 255, 255, .85); text-shadow: none; }

/* karty her: 4 sloupce po 300 px, karta = reklama 300×250; řádky se střídají 3 hry + reklama / 4 hry
   (24 her + 4 reklamy = 7 plných řádků, šablony posílají adAt [4, 8, 18, 22]);
   náhled vyplní, co zbude po názvu a dvou řádcích textu; kategorie jako štítek přes obrázek (neubírá místo) */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 250px; gap: 16px; }
.card { position: relative; background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 4px 0 var(--line), 0 0 0 3px var(--coin); }
.card:hover .card__name a { color: var(--red); }
.card__link { display: block; flex: 1 1 auto; min-height: 0; }
.card__img { display: block; height: 100%; background: var(--ink); overflow: hidden; }
.card__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-none { background: var(--sky) url(/assets/img/kostka.svg) center / auto 60% no-repeat; }
.thumb-none img { display: none; }
.card__name { flex: none; margin: 9px 14px 2px; font-size: 19px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__name a::after { content: ""; position: absolute; inset: 0; }
.card__text { flex: none; margin: 0 14px 11px; font-size: 14px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 2.8em; }
.card .tags { position: absolute; z-index: 2; top: 10px; right: 10px; max-width: calc(100% - 80px); flex-wrap: nowrap; overflow: hidden; justify-content: flex-end; }
.card .tags li:nth-child(n+2) { display: none; } /* jen hlavní kategorie, další jsou na stránce hry */
.card .tags a { background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags a { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 800; color: #3c4470; background: var(--tint); border-radius: 7px; padding: 2px 9px; }
.tags a:hover { background: var(--red); color: #fff; }
.badge { position: absolute; z-index: 2; left: 10px; top: 10px; font-size: 12px; font-weight: 800; background: #fff; color: var(--ink); border-radius: 7px; padding: 2px 8px; box-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.badge small { font-size: 10px; }
.badge--new { background: var(--coin); font-family: var(--pixel); font-size: 9px; padding: 5px 7px; }

/* reklama: zřetelně odlišná od karet (bez nápisu „Reklama“) */
.ad { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto; max-width: 100%; overflow: hidden; }
.ad ins { display: block; }
.ad__empty { display: flex; align-items: center; justify-content: center; text-align: center; max-width: 100%; border: 2px dashed #b8ccdd; border-radius: 12px; color: #7b84a8; font-size: 12px;
	background: repeating-linear-gradient(45deg, #f7fbfe 0 10px, #eef5fa 10px 20px); }
.ad--mobile { display: none; }
.cards__ad { align-self: center; }
.ad--band { margin: 4px auto 26px; }
.cards + .pager + .ad--band, .cards + .ad--band { margin-top: 30px; }
.ad--above { margin: 0 auto 18px; }
.ad--under { margin: 26px auto 0; padding-top: 18px; border-top: 2px dashed var(--line); width: 100%; }
.ad--side { margin: 6px 0 0; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 28px 0 0; font-weight: 800; }
.pager a, .pager span { min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.pager a:hover { background: var(--tint); color: var(--ink); }
.pager__current { background: var(--red) !important; color: #fff; box-shadow: 0 4px 0 #9e1d18 !important; }
.pager__gap { background: none !important; box-shadow: none !important; }

/* kategorie a postavičky na úvodní stránce */
.cats { margin-top: 10px; }
.cats__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.cat-box { display: flex; flex-direction: column; gap: 4px; border-radius: 16px; padding: 16px 14px 14px; background: var(--c); color: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .2); transition: transform .12s; }
.cat-box:hover { color: #fff; transform: translateY(-3px); }
.cat-box b { font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1.05; }
.cat-box span { font-size: 13px; line-height: 1.35; opacity: .9; }
.chars { margin-top: 30px; }
.chars__list { display: flex; flex-wrap: wrap; gap: 10px; }
.char { display: inline-flex; align-items: center; gap: 9px; background: #fff; border-radius: 99px; padding: 5px 16px 5px 5px; font-weight: 800; box-shadow: var(--shadow); }
.char:hover { color: var(--ink); box-shadow: 0 4px 0 var(--line), 0 0 0 3px var(--c); }
.char i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font: 800 17px/1 var(--display); font-style: normal; }
.about-site { margin-top: 34px; color: var(--muted); }
.about-site h2 { color: var(--ink); font-size: 22px; margin: 0 0 6px; }
.about-site p { margin: 0 0 8px; }
.about-site a { color: var(--red); font-weight: 700; }
.about-site a:hover { text-decoration: underline; }

/* ---------------------------------------------------------- stránka hry */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.detail--wide { grid-template-columns: minmax(0, 1fr); }
.detail__col { min-width: 0; }
.box { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); }
.detail__main { padding: 18px 22px 26px; }
.player { position: relative; background: var(--ink); border-radius: 14px; overflow: hidden; margin: 0 auto; max-width: 100%; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.player--scaled iframe { width: var(--native-w); height: var(--native-h); transform: scale(var(--scale)); transform-origin: 0 0; }
.player:fullscreen { border-radius: 0; }
.player:fullscreen iframe { width: 100%; height: 100%; transform: none; }
.player-bar { display: flex; align-items: center; gap: 10px 14px; margin: 14px 0 4px; flex-wrap: wrap; }
.game-actions { display: flex; align-items: center; gap: 10px; }
.player-bar .btn--pipe { margin-left: auto; }
.votes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vote { width: 44px; height: 40px; border: 0; border-radius: 10px; background: var(--tint); color: #3c4470; cursor: pointer; display: grid; place-items: center; box-shadow: 0 3px 0 var(--line); }
.vote svg { width: 20px; height: 20px; }
.vote--down svg { transform: scaleY(-1); }
.vote:hover { background: #e2eef7; }
.vote--up[aria-pressed="true"] { background: var(--pipe); color: #fff; box-shadow: 0 3px 0 var(--pipe-dark); }
.vote--down[aria-pressed="true"] { background: var(--red); color: #fff; box-shadow: 0 3px 0 #9e1d18; }
.votes__rating { font-weight: 800; font-variant-numeric: tabular-nums; }
.votes__hint { font-size: 13px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 16px; font: 800 15px var(--body); cursor: pointer; color: var(--ink); background: var(--tint); box-shadow: 0 3px 0 var(--line); }
.btn:hover { background: #e2eef7; }
.btn--pipe { background: var(--pipe); color: #fff; box-shadow: 0 3px 0 var(--pipe-dark); }
.btn--pipe:hover { background: #1e9a3e; }
.share { position: relative; }
.share__menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 5; min-width: 190px; padding: 6px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(30, 33, 64, .2); display: flex; flex-direction: column; }
.share__menu[hidden] { display: none; }
.share__menu a, .share__menu button { text-align: left; padding: 8px 10px; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; border-radius: 8px; }
.share__menu a:hover, .share__menu button:hover { background: var(--tint); }
.detail__head { margin: 18px 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.detail__head h1 { margin: 0; font-size: clamp(28px, 3.6vw, 40px); }
.note { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.about { display: flex; gap: 20px; align-items: flex-start; margin-top: 12px; }
.about__body { flex: 1; min-width: 0; }
.about__text { margin: 0; white-space: pre-line; max-width: 75ch; font-size: 17px; }
.about__body .controls { margin-top: 18px; }
.about__body .controls:first-child { margin-top: 0; }
.about__img { width: 220px; border-radius: 12px; flex: none; }
.controls, .gallery, .videos { margin-top: 22px; }
.controls h2, .gallery h2, .videos h2 { font-size: 22px; margin: 0 0 10px; }
.controls__list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 14px 26px; }
.control { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.control__inputs { display: flex; align-items: center; gap: 10px; min-height: 58px; }
.control__label { font-size: 13px; color: var(--muted); }
.controls kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 7px; background: #fff; border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 7px; font: 700 12px/1 var(--body); color: var(--ink); text-transform: uppercase; }
.controls kbd.k-wide { padding: 0 10px; text-transform: none; }
.keys { display: inline-flex; gap: 3px; }
.keys--col { flex-direction: column; }
.keys--arrows { display: inline-grid; grid-template-columns: repeat(3, 28px); grid-template-rows: 28px 28px; gap: 4px; }
.keys--arrows .k-up { grid-column: 2; }
.keys--arrows kbd:nth-child(2) { grid-column: 1; grid-row: 2; }
.keys--arrows kbd:nth-child(3) { grid-column: 2; grid-row: 2; }
.keys--arrows kbd:nth-child(4) { grid-column: 3; grid-row: 2; }
.mouse { display: block; }
.controls__text { margin: 0; color: var(--muted); }
.gallery__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery__item img { display: block; width: 100%; border-radius: 10px; }
.video { position: relative; aspect-ratio: 16 / 9; margin-bottom: 12px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 12px; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 95vw; max-height: 95vh; overflow: visible; }
.lightbox::backdrop { background: rgba(30, 33, 64, .85); }
.lightbox img { display: block; max-width: 95vw; max-height: 90vh; border-radius: 10px; }
.lightbox__close { position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; font-size: 22px; line-height: 1; cursor: pointer; }

.side { min-width: 0; display: grid; gap: 10px; align-content: start; }
.side > h2 { font-size: 22px; margin: 0; }
.side-list { display: grid; gap: 10px; }
.side-game { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; background: var(--card); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); }
.side-game:hover { box-shadow: 0 4px 0 var(--line), 0 0 0 3px var(--coin); color: var(--ink); }
.side-game__img { display: block; width: 120px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--ink); }
.side-game__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.side-game__name { font-family: var(--display); font-weight: 800; font-size: 16px; line-height: 1.15; }
.detail--wide .side-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* statické stránky */
.static-page { max-width: 820px; padding: 26px 30px; }
.static-page h1 { font-size: 34px; margin: 0 0 14px; }
.static-page__content { line-height: 1.65; }
.static-page__content a { color: var(--red); text-decoration: underline; }

/* ---------------------------------------------------------- patička: tráva a cihlová zem */
.ground { color: #ffe9d6; padding: 44px 0 20px; font-size: 15px;
	background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .22) 0 3px, transparent 3px 34px) 0 14px,
		repeating-linear-gradient(90deg, rgba(0, 0, 0, .22) 0 3px, transparent 3px 68px) 0 14px, var(--brick);
	box-shadow: inset 0 10px 0 #34b85a, inset 0 14px 0 #1e8e3e; }
.ground__in { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 26px; }
.ground__brand p { margin: 12px 0 0; max-width: 34ch; }
.logo--foot .logo__kostka { width: 38px; height: 38px; }
.logo--foot .logo__word { font-size: 30px; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.ground__col { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.ground__col a { background: rgba(0, 0, 0, .18); padding: 1px 8px; border-radius: 6px; }
.ground__title { margin: 0 0 4px; font-family: var(--display); font-weight: 800; font-size: 19px; color: #fff; }
.ground a:hover { color: var(--coin); }
.ground__credit { margin-top: 28px; padding-top: 16px; border-top: 2px solid rgba(0, 0, 0, .2); font-size: 13px; color: #ffd9bd; }
.privacy-hint { flex-basis: 100%; margin-top: 6px; font-size: 13px; opacity: .85; }

/* ---------------------------------------------------------- menší obrazovky */
@media (max-width: 1100px) {
	.hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.top5 { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 2px dashed var(--line); padding-top: 12px; }
	.top5__list { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
	.detail { grid-template-columns: minmax(0, 1fr); }
	.side-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
	.ad--side { display: none; }
	.cats__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.ground__in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1279px) { /* 4 karty by byly užší než reklama 300 px: 3 sloupce, poslední reklama pryč (27 políček = 9 řádků) */
	.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cards__ad--last { display: none !important; }
}
@media (max-width: 967px) { /* 2 sloupce: všechny 4 reklamy (28 políček = 14 řádků) */
	.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cards__ad--last { display: flex !important; }
}
@media (max-width: 760px) {
	.ad--desktop { display: none; }
	.ad--mobile { display: flex; }
	.sky__in { gap: 10px; padding-top: 12px; }
	.logo__word { font-size: 30px; }
	.logo__kostka { width: 40px; height: 40px; }
	.search { flex-basis: 100%; margin-left: 0; }
	.menu__in { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 12px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
	.menu__in::-webkit-scrollbar { display: none; }
	/* posuvný pás by seznam Další ořízl: na mobilu je přes celou šířku pod menu a maska pásu se při otevření vypne */
	.menu__in:has(details[open]) { -webkit-mask-image: none; mask-image: none; }
	.menu__drop { position: fixed; top: auto; left: 16px; right: 16px; margin-top: 8px; min-width: 0; }
	.hero { grid-template-columns: minmax(0, 1fr); padding: 12px; }
	.cats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.detail__main { padding: 12px 12px 20px; }
	.about { flex-direction: column; }
	.player-bar .btn--pipe { margin-left: 0; }
}
@media (max-width: 600px) {
	/* karty jako řádky: náhled vlevo, název a dva řádky textu vpravo; reklama 300×250 má celý řádek */
	.cards { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: 10px; }
	.cards__ad--last { display: flex !important; }
	.card { display: grid; grid-template-columns: 136px minmax(0, 1fr); grid-template-rows: auto 1fr; padding: 6px; border-radius: 12px; }
	.card:hover { transform: none; }
	.card__link { grid-row: 1 / span 2; align-self: center; }
	.card__img { height: auto; aspect-ratio: 16 / 10; border-radius: 8px; }
	.card__name { font-size: 16px; margin: 4px 10px 2px; }
	.card__text { margin: 0 10px; font-size: 13px; height: auto; max-height: 2.8em; align-self: start; }
	.card .tags { display: none; }
	.badge { font-size: 10px; }
	.section-title { font-size: 24px; }
	.intro { padding: 18px; }
	.ground__in { grid-template-columns: 1fr; }
	.page { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.card, .cat-box, .play-btn, .logo__kostka, .hero__pic img { transition: none; }
}
