/* Game and subscription pages. Theme variables only, so every color theme works. */

.game-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.game-sub { font-size: 1rem; margin: 18px 0 8px; }
.game-inline-tag { margin: 0 0 0 6px; }
.game-disclosure { margin-top: 10px; }

/* ---------------------------------------------------------------- game page: top */
.game-top { padding: 0; overflow: hidden; }
.game-banner { position: relative; height: clamp(150px, 30vw, 360px); background: var(--panel-2); overflow: hidden; }
.game-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.game-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 45%, var(--panel) 100%); }
.game-banner-soft { height: clamp(110px, 16vw, 180px); }
.game-banner-soft img { filter: blur(26px) saturate(1.2); transform: scale(1.35); opacity: .6; }
.game-head { position: relative; display: grid; grid-template-columns: 190px minmax(0, 1fr); column-gap: 24px; padding: 0 24px 20px; margin-top: -96px; }
.game-head-cover { grid-row: 1 / span 2; }
.game-head-main { padding-top: 106px; }
.game-head-main h1 { font-size: 2.2rem; line-height: 1.1; margin: 0 0 10px; overflow-wrap: anywhere; }
.game-head-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.game-head-tags .tag { margin: 0; padding: 4px 11px; font-size: .82rem; text-decoration: none; }
.game-head-tags a.tag:hover { border-color: var(--muted); text-decoration: none; }
.game-head-more { padding-top: 14px; }
.game-head-note { margin: 8px 0 0; }
.game-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); border-top: var(--line-width) solid var(--line); }
.game-stats li { min-width: 0; display: flex; }
.game-stats li + li { border-left: var(--line-width) solid var(--line); }
.game-stats a { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; padding: 10px 16px; color: var(--text); text-decoration: none; }
.game-stats a:hover { background: var(--panel-2); text-decoration: none; }
.game-stats a:focus-visible { outline-offset: -2px; }
.game-stats strong { font-family: var(--font-head); font-size: 1.5rem; line-height: 1.1; }
.game-stats span { color: var(--muted); font-size: .82rem; line-height: 1.25; }
.pass-stats { margin: 16px -20px -20px; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }

@media (max-width: 700px) {
  .game-head { grid-template-columns: 104px minmax(0, 1fr); column-gap: 14px; padding: 0 16px 16px; margin-top: -52px; }
  .game-head-cover { grid-row: auto; }
  .game-head-main { padding-top: 60px; }
  .game-head-main h1 { font-size: 1.4rem; }
  .game-head-more { grid-column: 1 / -1; }
  .game-head-actions > .btn, .game-head-actions > form { flex: 1 1 140px; }
  .game-head-actions > form button { width: 100%; }
  .game-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-stats li { border-left: 0 !important; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
  .game-stats a { padding: 8px 12px; min-height: 60px; }
  .game-stats strong { font-size: 1.25rem; }
  .game-stats span { font-size: .76rem; }
}

/* ---------------------------------------------------------------- game page: body */
.game-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.game-main, .game-side { min-width: 0; }
.game-side { grid-column: 2; grid-row: 1; }
.game-main { grid-column: 1; grid-row: 1; }
@media (max-width: 900px) {
  .game-cols { display: block; }
}
.game-summary { margin: 0; max-width: 70ch; }
.game-live .title a { color: var(--text); }

.game-shots { display: flex; gap: 10px; overflow-x: auto; padding: 3px 3px 8px; scroll-snap-type: x proximity; }
.game-shot { flex: none; width: min(78vw, 340px); border-radius: 12px; overflow: hidden; scroll-snap-align: start; background: var(--panel-2); border: var(--line-width) solid var(--line); }
.game-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.game-shot:hover { border-color: var(--accent); }
.game-shot:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .game-shot img { transition: transform .2s; }
  .game-shot:hover img { transform: scale(1.03); }
}

.game-lightbox { border: 0; padding: 0; background: transparent; color: var(--text); width: min(96vw, 1280px); max-width: none; max-height: none; overflow: visible; }
.card > .game-lightbox { margin: auto; }
.game-lightbox::backdrop { background: var(--scrim); }
.game-lightbox-stage { background: var(--panel); border: var(--line-width) solid var(--line); border-radius: 14px 14px 0 0; overflow: hidden; }
.game-lightbox-stage img { display: block; width: 100%; height: auto; max-height: calc(100vh - 120px); object-fit: contain; background: var(--bg); }
.game-lightbox-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; background: var(--panel); border: var(--line-width) solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; }
.game-lightbox-bar button { min-width: 44px; padding: 8px 12px; }
.game-lightbox-count { min-width: 5.5em; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.game-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.game-person { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 12px 8px 8px; border-radius: 12px; background: var(--panel-2); border: var(--line-width) solid var(--line); color: var(--text); text-decoration: none; min-width: 0; }
.game-person:hover { border-color: var(--muted); color: var(--text); text-decoration: none; }
.game-person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.game-person-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.game-activity { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.game-activity .stat { font-size: 2rem; }
.game-activity .game-stat-text { font-size: 1.3rem; line-height: 1.6; }
.game-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.game-bars li { display: grid; grid-template-columns: minmax(0, 190px) minmax(40px, 1fr) auto; align-items: center; gap: 12px; }
.game-bars a { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); font-weight: 600; min-width: 0; }
.game-bars a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-bar { display: block; height: 8px; border-radius: 999px; background: var(--bar-track); overflow: hidden; }
.game-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.game-bar-n { font-size: .85rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) {
  .game-bars li { grid-template-columns: minmax(0, 1fr) 70px auto; gap: 8px; }
}

.game-similar { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 10px; }
.game-similar-tile { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; min-width: 0; }
.game-similar-tile:hover { text-decoration: none; color: var(--text); }
.game-similar-tile:hover .cover { box-shadow: 0 0 0 2px var(--accent); }
.game-similar-name { font-weight: 600; font-size: .85rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) { .game-similar { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.game-pass { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: var(--line-width) solid var(--line); color: var(--text); text-decoration: none; }
.game-pass + .game-pass { margin-top: 8px; }
.game-pass:hover { border-color: var(--muted); color: var(--text); text-decoration: none; }
.game-pass-name { font-weight: 700; }
.game-pass-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.game-pass-flags:empty { display: none; }
.game-pass-flags .tag { margin: 0; }

.game-buy { display: flex; flex-direction: column; gap: 8px; }
.game-buy .btn { width: 100%; }
.game-buy-note { margin-top: -4px; }

/* ---------------------------------------------------------------- browse filters (games.php, subscription.php) */
.game-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.game-filters-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.game-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 999px; background: var(--panel-2); border: var(--line-width) solid var(--line); color: var(--text); font-weight: 600; font-size: .88rem; text-decoration: none; white-space: nowrap; flex: none; }
.game-filter:hover { border-color: var(--muted); color: var(--text); text-decoration: none; }
.game-filter.on { background: var(--pick-on-bg); border-color: var(--pick-on-line); }
.game-clear { margin: 0 0 12px; }
#browse .cover-grid { margin-top: 14px; }
@media (max-width: 700px) {
  .game-filters { flex-wrap: nowrap; overflow-x: auto; margin-left: -20px; margin-right: -20px; padding: 3px 20px 6px; scrollbar-width: thin; }
}

/* ---------------------------------------------------------------- passes */
.pass-back { margin: 0 0 10px; }
.pass-back a { display: inline-flex; align-items: center; min-height: 32px; }
.pass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; margin-bottom: 18px; }
.pass-card { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pass-card > * { margin-top: 0; margin-bottom: 0; }
.pass-card h2 { font-size: 1.25rem; }
.pass-card h2 a { color: var(--text); }
.pass-mine { border-color: var(--good-line); }
.pass-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.pass-card-head .tag { margin: 0; }
.pass-provider { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pass-summary { color: var(--muted); }
.pass-price { font-weight: 700; }
.pass-facts { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 10px 0; min-height: 44px; align-items: center; color: var(--muted); font-size: .9rem; border-top: var(--line-width) solid var(--line); border-bottom: var(--line-width) solid var(--line); text-decoration: none; }
.pass-facts:hover { color: var(--text); text-decoration: none; }
.pass-facts strong { color: var(--text); font-family: var(--font-head); font-size: 1.15rem; }
.pass-actions { margin-top: auto; padding-top: 6px; }
.pass-actions .btn, .pass-actions button { min-height: 44px; }

.pass-head { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 8px 24px; }
.pass-head h1 { font-size: 2rem; margin: 4px 0 8px; }
.pass-head .pass-summary { max-width: 62ch; }
.pass-head-buy { display: flex; flex-direction: column; gap: 8px; }
.pass-head-buy .btn, .pass-head-buy button { width: 100%; }
.pass-head-buy .game-disclosure { margin-top: 0; }
.pass-head .pass-stats { grid-column: 1 / -1; }
.pass-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.pass-together { display: flex; align-items: center; gap: 14px; }
.pass-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-bottom: 10px; }
.pass-covers a { border-radius: 12px; display: block; }
.pass-covers a:hover .cover { box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 800px) {
  .pass-head { grid-template-columns: 1fr; }
  .pass-head h1 { font-size: 1.5rem; }
  .pass-cols { display: block; }
  .pass-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- admin: affiliate links */
.money-link { padding: 10px 12px; border-radius: 10px; background: var(--input-bg); border: var(--line-width) solid var(--line); overflow-wrap: anywhere; font-size: .9rem; }
.money-sub { padding: 14px 0; border-top: var(--line-width) solid var(--line); }
.money-sub h3 { margin: 0; }
.money-details { margin-top: 10px; padding: 4px 14px; border-radius: 10px; background: var(--panel-2); border: var(--line-width) solid var(--line); }
.money-details summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.money-details h3 { font-size: .95rem; margin: 10px 0 4px; }

/* Buy now dropdown and grouped buy links */
.buy-menu { position: relative; display: inline-block; }
.buy-menu > summary { list-style: none; cursor: pointer; }
.buy-menu > summary::-webkit-details-marker { display: none; }
.buy-menu > summary::after { content: ""; display: inline-block; margin-left: 8px; border: 5px solid transparent; border-top-color: currentColor; transform: translateY(3px); }
.buy-menu[open] > summary::after { transform: translateY(-2px) rotate(180deg); }
.buy-menu-list { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: 8px; background: var(--panel); border: var(--line-width) solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px var(--shadow); }
.buy-menu-list a { display: block; padding: 11px 12px; min-height: 44px; border-radius: 8px; color: var(--text); font-weight: 600; text-decoration: none; }
.buy-menu-list a:hover, .buy-menu-list a:focus-visible { background: var(--panel-2); text-decoration: none; }
.buy-menu-h { margin: 6px 12px 2px; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.buy-menu-note { margin: 6px 12px 4px; font-size: .75rem; color: var(--muted); }
.game-buy-h { margin: 10px 0 6px; font-weight: 700; font-size: .9rem; }
.game-buy-row { display: flex; flex-wrap: wrap; gap: 8px; }
.game-buy-row .btn { width: auto; flex: 1 1 auto; }
/* let the Buy now menu hang below the hero card */
.game-top { overflow: visible; position: relative; z-index: 3; }
.game-top .game-banner { border-radius: var(--radius) var(--radius) 0 0; }
.game-top .game-stats { border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
