/* WebGames.io - the game page, on the look of the homepage: the same header, cream panels and cards over
   the candy pattern (home.css), the colors and the player from player.css. Here: the stage of the game,
   its bar (votes, favorite, fullscreen), the about text, the side cards, the banners and the search panel. */

/* layout: the game and its text beside a column of cards */
.play { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 18px; margin-top: 14px; }
/* home.css names the areas of its own grid */
.play > .side { grid-area: auto; }
.play-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.play .panel { border-radius: 30px; }

/* the stage */
.stage-panel { padding: 14px; }
.game-stage { overflow: hidden; border-radius: 22px; background: #2A1538; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.game-stage iframe { display: block; width: 100%; height: 520px; border: 0; background: #1A0D24; }

/* the bar under the game */
.game-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; padding: 0 4px 2px; }
.game-thumb { flex: none; width: 56px; height: 56px; border: 3px solid #fff; border-radius: 16px; object-fit: cover; background: #EADBC3; box-shadow: 0 3px 0 rgba(46, 31, 94, 0.14); }
.game-name { flex: 1 1 200px; min-width: 0; }
.game-name h1 { margin: 0; overflow-wrap: anywhere; color: var(--wg-ink); font: 700 28px/1.05 var(--wg-font-display); }
.game-sub { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wg-ink-soft); font-size: 14px; font-weight: 800; }
.game-bar .wg-fav { height: 46px; }
.game-bar .btn { white-space: nowrap; }

/* the like / dislike blobs and the real score */
.vote { display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 14px 0 6px; border: 1px solid var(--wg-line-2); border-radius: 999px; background: var(--wg-paper); }
.vote-btn { padding: 2px 4px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; transition: opacity 0.15s ease, filter 0.15s ease; }
.vote-btn img { display: block; width: 42px; height: 38px; }
.vote-btn:hover { animation: blob 500ms 1 ease-in-out; }
.vote-btn:active { animation: blob-active 200ms 1 ease-in-out; }
.vote-btn.on { background: var(--wg-orange-soft); }
.vote-btn.off { opacity: 0.45; filter: grayscale(0.6); }
.score { display: flex; flex-direction: column; margin-left: 4px; line-height: 1.1; }
.score b { color: var(--wg-orange-text); font: 700 17px var(--wg-font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.score span { color: var(--wg-ink-soft); font-size: 12px; font-weight: 800; white-space: nowrap; }
@keyframes blob { 0% { transform: scale(1); } 25% { transform: scale(1, 1.15); } 60% { transform: scale(1.1, 0.95); } 100% { transform: scale(1); } }
@keyframes blob-active { 0% { transform: scale(1); } 90% { transform: scale(1.2, 0.9); } 100% { transform: scale(1); } }

/* the about text */
.game-info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.game-desc { min-width: 0; padding: 22px 26px; }
.game-desc .card-head { margin-bottom: 8px; }
.lead { margin: 0 0 6px; color: var(--wg-ink); font-size: 17px; font-weight: 700; line-height: 1.55; }
.about { max-width: 72ch; }
.about h3 { margin: 22px 0 8px; color: var(--wg-ink); font: 700 19px var(--wg-font-display); }
.about p { margin: 0 0 10px; color: var(--wg-ink-2); font-weight: 600; line-height: 1.65; }
.about ul, .about ol { margin: 0 0 12px; padding-left: 22px; color: var(--wg-ink-2); font-weight: 600; line-height: 1.6; }
.about li { margin-bottom: 4px; }
.about li::marker { color: var(--wg-orange); }
.about strong { color: var(--wg-ink); }
.about a { color: var(--wg-violet); font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.oops-ic { display: block; width: 110px; height: auto; margin: 4px auto 12px; }

/* side cards */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0; }
.facts dt, .facts dd { padding: 9px 0; border-bottom: 1px solid var(--wg-line); }
.facts dt { color: var(--wg-ink-soft); font-size: 14px; font-weight: 800; }
.facts dd { margin: 0; color: var(--wg-ink); font: 700 15px var(--wg-font-display); font-variant-numeric: tabular-nums; text-align: right; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 6px; border-radius: 12px; background: var(--wg-paper); color: var(--wg-ink); font: 600 14px var(--wg-font-display); text-decoration: none; box-shadow: var(--wg-shadow-sm); }
.tag img { width: 24px; height: 24px; }
.tag:hover { background: var(--wg-orange-soft); }
.comm { display: flex; flex-wrap: wrap; gap: 10px; }
.comm .btn { flex: 1 1 120px; text-decoration: none; }
.btn-discord { background: var(--wg-discord); box-shadow: 0 3px 0 #3C45B8; }
.btn-reddit { background: #E03D00; box-shadow: 0 3px 0 #A32C00; }
.shots { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.shots img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; background: #EADBC3; }

/* more games */
.more-panel { padding-top: 18px; }
.more-panel .sec-head { margin-bottom: 14px; }
.see-all { text-decoration: none; }

/* the header: the search box opens the search panel */
.search-open { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--wg-ink-soft); font-weight: 700; font-size: 15px; text-align: left; cursor: text; }
.search-box:has(.search-open:focus-visible) { border-color: var(--wg-violet); box-shadow: 0 0 0 3px var(--wg-violet-soft); }
.search-open:focus-visible { outline: none; }

/* banners: 300x600 on top of the side column, 160x600 around the about text where they fit, 300x250 always */
.ad-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ad-unit.s300x600 { flex: none; width: 300px; height: 600px; }
.ad-unit.s160x600 { flex: none; width: 160px; height: 600px; }
.ad-sky { display: none; box-sizing: border-box; padding: 10px; border-radius: 26px; background: var(--wg-cream); box-shadow: var(--wg-shadow); }

/* search panel (js/search.js) */
.sp { position: fixed; inset: 0; z-index: 200; }
.sp-backdrop { position: absolute; inset: 0; background: rgba(26, 12, 48, 0.62); }
.sp-sheet { position: absolute; top: 0; bottom: 0; left: 0; box-sizing: border-box; width: min(780px, calc(100% - 80px)); padding: max(24px, env(safe-area-inset-top, 0px)) 28px 40px max(28px, env(safe-area-inset-left, 0px)); overflow-y: auto; border-radius: 0 30px 30px 0; background: var(--wg-cream); box-shadow: 0 30px 80px rgba(20, 8, 40, 0.5); animation: sp-in 0.2s ease-out; }
@keyframes sp-in { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
.sp-top { display: flex; align-items: center; gap: 12px; }
.sp-bar { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; height: 60px; padding: 0 18px 0 8px; border: 1px solid var(--wg-line-2); border-radius: 999px; background: var(--wg-paper); }
.sp-bar:focus-within { border-color: var(--wg-violet); box-shadow: 0 0 0 3px var(--wg-violet-soft); }
.sp-cookie { flex: none; width: 46px; height: 46px; object-fit: contain; }
.sp-input { flex: 1; min-width: 0; height: 100%; padding: 0 8px; border: 0; background: transparent; color: var(--wg-ink); font: 700 19px var(--wg-font-body); }
.sp-input::placeholder { color: var(--wg-ink-soft); }
.sp-input:focus { outline: none; }
.sp-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.sp-mag { flex: none; width: 24px; height: 24px; opacity: 0.55; }
.sp-close { flex: none; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; background: var(--wg-paper); cursor: pointer; box-shadow: var(--wg-shadow-sm); }
.sp-close img { width: 24px; height: 24px; }
.sp-close:hover { background: var(--wg-orange-soft); }
.sp-themes { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 4px; padding: 6px; border: 1px solid var(--wg-line); border-radius: 18px; background: var(--wg-paper); }
.sp-pill { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 10px; border: 0; border-radius: 12px; background: transparent; color: var(--wg-ink); font: 600 14px var(--wg-font-display); white-space: nowrap; cursor: pointer; }
.sp-pill img { width: 26px; height: 26px; }
.sp-pill:hover { background: var(--wg-orange-soft); }
.sp-title { margin: 22px 2px 12px; color: var(--wg-ink); font: 700 24px/1.1 var(--wg-font-display); }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px 14px; }
.sp-thumb { position: relative; display: block; aspect-ratio: 1 / 1; padding: 0; overflow: hidden; border: 0; border-radius: 16px; background: #EADBC3; cursor: pointer; box-shadow: 0 3px 0 rgba(46, 31, 94, 0.12); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.sp-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sp-thumb .sp-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 7px; background: linear-gradient(transparent, rgba(35, 16, 63, 0.9)); color: #fff; font: 600 13px var(--wg-font-display); text-align: left; transform: translateY(101%); transition: transform 0.14s ease; }
.sp-thumb:hover { transform: translateY(-3px); box-shadow: 0 8px 16px rgba(46, 31, 94, 0.22); }
.sp-thumb:hover .sp-name, .sp-thumb:focus-visible .sp-name { transform: none; }
.sp-empty { grid-column: 1 / -1; padding: 30px 10px; color: var(--wg-ink-soft); font-weight: 800; text-align: center; }
html.sp-lock, html.sp-lock body { overflow: hidden; }

/* the side column goes under the game, as on the homepage */
@media (max-width: 1180px) {
	.play { grid-template-columns: minmax(0, 1fr); }
	.side { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); align-items: start; }
}
/* wide screens: the two skyscrapers around the about text */
@media (min-width: 1500px) {
	.shell { max-width: 1640px; }
	.ad-sky { display: flex; }
	.game-info:has(> .ad-sky:not([hidden])) { grid-template-columns: 180px minmax(0, 1fr) 180px; }
}
/* the 300x600 as before: from 1100px, in the column of cards under the game until 1180px */
@media (max-width: 1099px) {
	.ad-side { display: none; }
}
@media (max-width: 640px) {
	.stage-panel { padding: 8px; }
	.game-stage { border-radius: 16px; }
	.game-bar { gap: 10px; margin-top: 10px; padding: 0 2px 4px; }
	.game-thumb { width: 46px; height: 46px; border-radius: 13px; }
	.game-name h1 { font-size: 23px; }
	.vote { order: 3; }
	.game-bar .wg-fav, .game-bar .btn { order: 4; flex: 1 1 auto; }
	.game-desc { padding: 18px; }
	.sp-sheet { width: 100%; padding: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 30px max(14px, env(safe-area-inset-left, 0px)); border-radius: 0; box-shadow: none; }
	.sp-bar { height: 52px; }
	.sp-cookie { width: 38px; height: 38px; }
	/* 16px keeps iOS from zooming into the field on focus */
	.sp-input { font-size: 16px; }
	.sp-mag { display: none; }
	.sp-close { width: 48px; height: 48px; }
	.sp-themes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
	.sp-themes::-webkit-scrollbar { display: none; }
	.sp-title { font-size: 20px; }
	.sp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
}
/* a 300x250 needs 320px of card: narrower phones show it on the pattern, borrowing a little of the gutters */
@media (max-width: 351px) {
	.play .ad-box { display: flex; margin-inline: -10px; padding: 8px 0; background: transparent; box-shadow: none; }
	.play .ad-box .ad-label { color: #EDE4FF; }
}
