/* Shared catalog game shell. Engine-specific styles remain inside the player. */
body.game-page { color-scheme: dark; }
body.game-page.light { color-scheme: light; }
.game-page [hidden] { display: none !important; }
.game-page :is(a, button, input):focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.game-content-column { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.game-page .main-content { flex: 1; min-width: 0; width: 100%; padding: 22px 28px 36px; overflow: visible; }
.game-page .main-content .game-window-container {
  --player-width: min(100%, var(--player-max, 1000px), max(320px, calc((100dvh - var(--topbar-height) - 150px) * var(--player-ratio, 1.333333))));
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  width: 100%; max-width: 1560px; margin-inline: auto; min-height: 0; padding: 0; gap: 14px;
}
.game-page .main-content .game-area {
  display: block; position: relative; width: var(--player-width); max-width: 100%;
  height: auto; min-height: 0; margin: 0;
}
.game-page .main-content .game-window {
  position: relative; width: 100%; max-width: none; min-width: 0; height: auto;
  aspect-ratio: var(--player-ratio, 1.333333); background: #07070b;
  border: 3px solid var(--border); border-radius: 14px; overflow: hidden; isolation: isolate;
  box-shadow: 0 7px 0 var(--comic-black), 0 12px 26px #0004;
}
.game-player { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.game-player > :is(iframe, embed, object) { display: block; width: 100%; height: 100%; border: 0; }
.game-page .main-content .game-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: var(--player-width); max-width: 100%; margin-top: 5px;
}
.game-page .game-window-title { margin: 0; font-size: clamp(1.1rem, 2.1vw, 1.6rem); font-weight: 900; color: var(--accent); line-height: 1.25; }
.game-page .fullscreen-btn { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border: 2px solid var(--accent); border-radius: 9px; background: transparent; color: var(--accent); cursor: pointer; }
.game-page .fullscreen-btn:hover { background: var(--accent); color: #111; }
.game-page .main-content .game-window:fullscreen,
.game-page .main-content .game-window.fullscreen { width: 100vw; height: 100dvh; max-width: none; border: 0; border-radius: 0; aspect-ratio: auto; }
.game-cover { position: absolute; inset: 0; z-index: 50; background: #07070b; color: #fff; }
.game-cover > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.game-cover-content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 12px; padding: 24px; background: linear-gradient(180deg, #07070b05 20%, #07070b55 48%, #07070bf5 100%); }
.game-cover-name { font-size: clamp(14px, 2.2vw, 24px); font-weight: 900; text-shadow: 0 2px 5px #000; text-align: center; }
.game-cover button { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 11px 25px; border: 3px solid #090b10; border-radius: 10px; box-shadow: 5px 5px 0 #090b10; background: var(--accent); color: #131313; font: 900 19px "Nunito", system-ui, sans-serif; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.game-cover button:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #090b10; }
.game-cover button svg { width: 21px; height: 21px; fill: currentColor; }
.game-cover-note { color: #bdc0cb; margin: 0; text-align: center; font-size: 11px; }
.game-page img.game-artwork-fallback { object-fit: contain; padding: 24px; background: var(--surface); }
.game-page .game-window-container > .suggested-games-section { width: 100%; max-width: 1080px; margin-top: 24px !important; }
.game-suggestions-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.game-page .suggested-games-title { margin: 0; font-size: 18px; color: var(--accent); font-weight: 900; }
.game-suggestions-heading > a { color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 800; }
.game-suggestions-heading > a:hover { color: var(--accent); }
.game-page .suggested-games-container { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: 100%; transform: none; }
.game-page .suggested-game-card { position: relative; display: block; width: auto; height: auto; min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; border: 2px solid var(--border); border-radius: 12px; box-shadow: 4px 5px 0 var(--comic-black); color: #fff; text-decoration: none; background: var(--surface); transition: transform .15s; }
.game-page .suggested-game-card img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.game-page .suggested-game-card span { position: absolute; inset: auto 0 0; padding: 22px 10px 9px; background: linear-gradient(transparent, #000e); color: #fff; font-size: 12px; font-weight: 900; text-align: center; }
.game-page .suggested-game-card:hover { transform: translateY(-5px); }
.game-site-footer { margin-top: auto; padding: 26px 28px 20px; background: var(--surface); border-top: 3px solid var(--comic-black); }
.game-footer-top, .game-footer-bottom { max-width: 1080px; margin-inline: auto; }
.game-footer-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.game-footer-brand img { display: block; width: min(190px, 100%); height: auto; }
.game-footer-brand { width: 190px; max-width: 100%; flex: 0 0 auto; }
.game-footer-links { display: flex; flex-wrap: wrap; gap: 12px 20px; font-size: 12px; font-weight: 800; }
.game-footer-top > .game-footer-links { flex-shrink: 0; max-width: 100%; }
.game-site-footer a { color: var(--text); text-decoration: none; }
.game-site-footer a:hover { color: var(--accent); text-decoration: underline; }
.game-footer-bottom { display: flex; justify-content: space-between; gap: 18px; margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; line-height: 1.7; }
.game-footer-bottom p { margin: 0; }
.game-footer-bottom a { white-space: nowrap; }
.game-page.light :is(.game-window-title, .suggested-games-title) { color: #8a4b05; }
.game-page.light .fullscreen-btn { color: #8a4b05; border-color: #8a4b05; }
.game-page.light :is(.logo-area img, .game-footer-brand img) { filter: drop-shadow(1px 1px 0 #171717) drop-shadow(-1px -1px 0 #171717); }
@media (min-width: 901px) {
  .game-page .main-content .game-window-container { --player-width: min(var(--player-max, 1000px), max(320px, calc((100dvh - var(--topbar-height) - 150px) * var(--player-ratio, 1.333333))), calc(100% - 2 * var(--game-rail-size, 250px) - 64px)); }
}
@media (max-width: 1100px) { .game-page .main-content { padding-inline: 20px; } }
@media (max-width: 767px) {
  body.game-page { padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
  .game-page .main-content { padding: 22px 14px 26px; }
  .game-page .main-content .game-window-container { --player-width: 100%; padding: 0 !important; gap: 12px !important; }
  .game-cover-content { padding: 14px; gap: 10px; }
  .game-cover button { min-height: 44px; padding: 7px 18px; font-size: 16px; }
  .game-cover-note { font-size: 10px; }
  .game-page .suggested-games-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-page .game-window-container > .suggested-games-section { margin-top: 18px !important; }
  .game-site-footer { padding: 24px 18px 20px; }
  .game-footer-top, .game-footer-bottom { flex-direction: column; align-items: flex-start; gap: 18px; }
}
@media (max-width: 700px) { .game-page .main-content { padding-top: 86px; } }
@media (prefers-reduced-motion: reduce) { .game-page :is(.game-cover button, .suggested-game-card) { transition: none; } }
