/* Games section: catalog cards, game page, shared game UI.
   ========================================================================== */

/* ---------- Hero ---------- */
.games-hero,
.game-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--game-accent, var(--c-accent)) 55%, transparent) 0%, transparent 55%),
    var(--c-navy);
}
.games-hero::after,
.game-hero::after { /* court arc */
  content: ""; position: absolute; right: -120px; bottom: -220px; width: 520px; height: 520px;
  border: 2px solid rgba(255,255,255,.08); border-radius: 50%; pointer-events: none;
}
.game-hero .breadcrumbs__list { color: rgba(255,255,255,.7); }

/* ---------- Catalog grid ---------- */
.game-grid { display: grid; gap: 20px; }
@media (min-width: 640px) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }

/* ---------- Card ---------- */
.game-card { height: 100%; }
.game-card__link {
  display: flex; flex-direction: column; height: 100%;
  overflow: hidden; border-radius: var(--r-xl);
  background: var(--c-surface); border: 1px solid var(--c-line);
  box-shadow: 0 1px 2px rgba(15,19,32,.04);
  color: inherit; text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.game-card__link:hover,
.game-card__link:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--game-accent) 45%, var(--c-line));
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--game-accent) 60%, rgba(15,19,32,.4));
}
.game-card__media { position: relative; display: block; aspect-ratio: 8 / 5; overflow: hidden; background: var(--c-navy); }
.game-cover { display: block; width: 100%; height: 100%; transition: transform .5s ease; }
.game-card__link:hover .game-cover { transform: scale(1.06); }
.game-card__tag {
  position: absolute; left: 14px; top: 14px;
  padding: 5px 10px; border-radius: var(--r-pill);
  background: rgba(11,15,26,.55); backdrop-filter: blur(6px);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.game-card__play {
  position: absolute; right: 14px; bottom: 14px;
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--c-accent); color: var(--c-ink);
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  transform: scale(.85); opacity: .9; transition: transform .25s ease, opacity .25s ease;
}
.game-card__play svg { width: 24px; height: 24px; margin-left: 3px; }
.game-card__link:hover .game-card__play { transform: scale(1); opacity: 1; }
.game-card__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 20px 20px; }
.game-card__title { font-family: var(--f-display); font-size: 30px; font-weight: 800; line-height: 1; text-transform: uppercase; color: var(--c-ink); }
.game-card__text { color: var(--c-muted); font-size: 15px; line-height: 1.5; }
.game-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 6px; }
.game-card__best { font-size: 13px; font-weight: 700; color: var(--c-muted); }
.game-card__best b { color: var(--c-ink); }
.game-card__cta { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 14px; font-weight: 800; color: var(--c-accent-text); }
.game-card__cta svg { width: 16px; height: 16px; transition: transform .2s ease; }
.game-card__link:hover .game-card__cta svg { transform: translateX(3px); }

/* Compact (sidebar) */
.game-list { display: grid; gap: 12px; }
.game-card--compact .game-card__link { flex-direction: row; border-radius: var(--r-lg); }
.game-card--compact .game-card__media { flex: 0 0 112px; aspect-ratio: auto; min-height: 76px; }
.game-card--compact .game-card__tag,
.game-card--compact .game-card__play { display: none; }
.game-card--compact .game-card__body { padding: 12px 14px; gap: 4px; justify-content: center; }
.game-card--compact .game-card__title { font-size: 20px; }
.game-card--compact .game-card__foot { padding-top: 0; }
.game-card--compact .game-card__cta { margin-left: 0; font-size: 13px; }

/* ---------- Game box ---------- */
.game-box { padding: 0; overflow: hidden; }
.game-hud {
  display: flex; justify-content: space-around; gap: 8px;
  padding: 12px 16px; background: var(--c-navy); color: #fff;
}
.game-hud__item { display: grid; justify-items: center; gap: 2px; min-width: 64px; }
.game-hud__label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-on-dark-muted); }
.game-hud__item b { font-family: var(--f-display); font-size: 30px; line-height: 1; }
.game-stage { position: relative; min-height: 420px; background: var(--c-surface-2); user-select: none; -webkit-user-select: none; }
.game-stage canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
.game-stage canvas:active { cursor: grabbing; }

/* Overlay (start / game over) */
.game-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px;
  background: rgba(11,15,26,.78); backdrop-filter: blur(3px); color: #fff; text-align: center;
}
.game-overlay[hidden] { display: none; }
.game-overlay__title { font-family: var(--f-display); font-size: clamp(40px, 6vw, 64px); font-weight: 800; line-height: .9; text-transform: uppercase; }
.game-overlay__text { max-width: 420px; color: var(--c-on-dark-muted); }
.game-overlay__score { font-family: var(--f-display); font-size: 72px; font-weight: 800; line-height: 1; color: var(--c-accent); }
.game-overlay__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.game-overlay .btn--outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }

/* ---------- Quiz UI ---------- */
.quiz { display: grid; gap: 18px; padding: 24px 20px 28px; justify-items: center; }
.quiz__progress { width: 100%; height: 6px; border-radius: var(--r-pill); background: var(--c-line); overflow: hidden; }
.quiz__progress span { display: block; height: 100%; width: 0; background: var(--c-accent); transition: width .3s ease; }
.quiz__meta { display: flex; justify-content: space-between; width: 100%; font-size: 13px; font-weight: 700; color: var(--c-muted); }
.quiz__timer { color: var(--c-accent-text); }
.quiz__photo {
  width: 220px; height: 220px; border-radius: 50%; object-fit: cover; object-position: top;
  background: radial-gradient(circle at 50% 30%, #fff, var(--c-bg-2)); border: 6px solid var(--c-surface);
  box-shadow: 0 10px 30px rgba(15,19,32,.15);
}
.quiz__logo { width: 180px; height: 180px; object-fit: contain; padding: 18px; border-radius: 50%; background: #fff; box-shadow: 0 10px 30px rgba(15,19,32,.12); }
.quiz__clue { display: grid; gap: 8px; width: 100%; max-width: 420px; }
.quiz__clue li { padding: 12px 16px; border-radius: var(--r-md); background: var(--c-surface); border: 1px solid var(--c-line); font-weight: 700; text-align: center; }
.quiz__question { font-family: var(--f-display); font-size: 28px; font-weight: 800; text-transform: uppercase; text-align: center; line-height: 1.05; }
.quiz__options { display: grid; gap: 10px; width: 100%; max-width: 560px; }
@media (min-width: 560px) { .quiz__options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quiz__option {
  padding: 14px 16px; border-radius: var(--r-md); border: 2px solid var(--c-line);
  background: var(--c-surface); color: var(--c-ink); font: inherit; font-weight: 700; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.quiz__option:hover:not(:disabled) { border-color: var(--c-ink); }
.quiz__option:active:not(:disabled) { transform: scale(.98); }
.quiz__option:disabled { cursor: default; }
.quiz__option--right { border-color: var(--c-win); background: #dcf5e3; color: #14532d; }
.quiz__option--wrong { border-color: var(--c-loss); background: #fde2e2; color: #7f1d1d; }
.quiz__feedback { min-height: 24px; font-weight: 700; text-align: center; }
.quiz__feedback a { color: var(--c-accent-text); }
.quiz__modes { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Higher or Lower ---------- */
.hol { display: grid; gap: 16px; padding: 24px 16px 28px; }
.hol__stat { text-align: center; font-family: var(--f-display); font-size: 26px; font-weight: 800; text-transform: uppercase; }
.hol__row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.hol__vs { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c-ink); color: #fff; font-family: var(--f-display); font-weight: 800; }
.hol__card {
  display: grid; justify-items: center; gap: 8px; padding: 18px 10px; border-radius: var(--r-lg);
  background: var(--c-surface); border: 1px solid var(--c-line); text-align: center; min-width: 0;
  border-top: 4px solid var(--team, var(--c-line));
}
.hol__card img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--c-bg-2); }
.hol__name { font-weight: 800; line-height: 1.2; }
.hol__team { font-size: 13px; color: var(--c-muted); }
.hol__value { font-family: var(--f-display); font-size: 44px; font-weight: 800; line-height: 1; }
.hol__value--hidden { color: var(--c-muted-2); }
.hol__buttons { display: grid; gap: 8px; width: 100%; }
.hol__buttons .btn { justify-content: center; }
.hol__value--up { color: var(--c-win); }
.hol__value--down { color: var(--c-loss); }
@media (max-width: 520px) {
  .hol__card img { width: 76px; height: 76px; }
  .hol__value { font-size: 34px; }
}
