/* Zona — adult party games. Uses the tokens defined in site.css */

.games-page {
  --lv1: #3ecf8e;
  --lv2: #ffb020;
  --lv3: #ff6b3d;
  --lv4: #ef0a6b;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---- hero / index ---- */
.games-hero {
  margin-bottom: 1.25rem;
  padding: 1.4rem 1.25rem;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(239, 10, 107, 0.22) 0%, transparent 55%),
    linear-gradient(145deg, #2a1018 0%, var(--bg-card) 55%, #1a0a0e 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.games-hero__title {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.games-hero__lead {
  margin: 0 0 1rem;
  max-width: 62ch;
  color: var(--text-muted);
  line-height: 1.65;
}

.games-levels-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}

.games-levels-legend__item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--lv1);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.games-levels-legend__item strong { color: #fff; font-size: 0.92rem; }
.games-levels-legend__item--hot { border-inline-start-color: var(--lv2); }
.games-levels-legend__item--bold { border-inline-start-color: var(--lv3); }
.games-levels-legend__item--explicit { border-inline-start-color: var(--lv4); }

.games-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.games-cat-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.games-cat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.games-cat-card__main {
  display: block;
  color: inherit;
  text-decoration: none;
}

.games-cat-card__icon {
  display: inline-grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  margin-bottom: 0.6rem;
  font-size: 1.8rem;
  background: rgba(239, 10, 107, 0.14);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
}

.games-cat-card__title {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
  color: #fff;
}

.games-cat-card__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.games-cat-card__games {
  list-style: none;
  margin: auto 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.games-cat-card__games .cat-chip {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
}

.games-note {
  margin: 1.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
}

.games-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.games-crumbs a { color: var(--text-muted); text-decoration: none; }
.games-crumbs a:hover { color: #fff; }

.games-subtitle {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.05rem;
  color: #fff;
}

/* ---- category page ---- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.game-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.game-card__icon { font-size: 2.2rem; line-height: 1; }
.game-card__title { margin: 0.2rem 0 0; font-size: 1.15rem; color: #fff; }
.game-card__text { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--text-muted); flex: 1; }
.game-card__meta { font-size: 0.78rem; color: var(--text-dim); }
.game-card__cta { margin-top: 0.4rem; }

/* ---- play page: controls ---- */
.game-controls {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.game-panel {
  padding: 0.95rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.game-panel__title {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.game-panel__title small { font-weight: 400; color: var(--text-dim); }

.game-levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

.game-level {
  --c: var(--lv1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.6rem 0.75rem;
  font-family: var(--font);
  text-align: start;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--c);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.game-level--hot { --c: var(--lv2); }
.game-level--bold { --c: var(--lv3); }
.game-level--explicit { --c: var(--lv4); }

.game-level__label { font-size: 0.98rem; font-weight: 700; color: #fff; }
.game-level__hint { font-size: 0.74rem; line-height: 1.3; }

.game-level:hover { background: rgba(255, 255, 255, 0.07); transform: translateY(-1px); }

.game-level.is-on {
  color: #fff;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  border-color: var(--c);
  box-shadow: 0 0 0 1px var(--c), 0 4px 16px color-mix(in srgb, var(--c) 30%, transparent);
}

.game-players__form { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }

.game-players__form input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.game-players__form input:focus { outline: none; border-color: var(--border-strong); }

.game-players__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.game-player {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.35rem 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: #fff;
  background: rgba(239, 10, 107, 0.16);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}

.game-player__x {
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.game-player__x:hover { color: #fff; background: var(--accent); }

/* ---- stage ---- */
.game-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-height: 320px;
  padding: 1.25rem 1rem 1.5rem;
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(239, 10, 107, 0.12) 0%, transparent 60%),
    var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.game-stage__empty {
  margin: 2.5rem 0 1rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  text-align: center;
}

.game-turn-slot { min-height: 2rem; }

.game-turn {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.3rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.game-turn__label { font-size: 0.82rem; color: var(--text-muted); }
.game-turn__name { font-size: 1.05rem; color: var(--accent-2); }

.game-face {
  --c: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
  width: min(100%, 560px);
  min-height: 190px;
  padding: 1.5rem 1.4rem 2.4rem;
  text-align: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 18%, #1a0a0e) 0%, #1a0a0e 100%);
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 28px color-mix(in srgb, var(--c) 22%, transparent);
  animation: game-pop 0.25s ease;
}

.game-face--l1 { --c: var(--lv1); }
.game-face--l2 { --c: var(--lv2); }
.game-face--l3 { --c: var(--lv3); }
.game-face--l4 { --c: var(--lv4); }

.game-face__kicker { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; color: var(--c, var(--accent-2)); }
.game-face__text { margin: 0; font-size: 1.4rem; font-weight: 600; line-height: 1.5; color: #fff; }

.game-face__level {
  position: absolute;
  bottom: 0.7rem;
  inset-inline-end: 0.9rem;
  padding: 0.12rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: color-mix(in srgb, var(--c, var(--accent)) 55%, transparent);
  border-radius: 999px;
}

.game-cardrow__info .game-face__level { position: static; align-self: flex-start; margin-top: 0.5rem; display: inline-block; background: rgba(239, 10, 107, 0.4); }

@keyframes game-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.game-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.game-hint { margin: 0; font-size: 0.82rem; color: var(--text-dim); text-align: center; }
.game-date { margin: 0; font-size: 0.95rem; color: var(--text-muted); }

/* ---- timer ---- */
.game-timer { width: min(100%, 420px); text-align: center; }
.game-timer__time { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; }
.game-timer__bar { height: 8px; margin-top: 0.4rem; overflow: hidden; background: rgba(255, 255, 255, 0.08); border-radius: 999px; }
.game-timer__fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1s linear; }

/* ---- ladder ---- */
.game-ladder { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; max-width: 520px; }

.game-ladder__dot {
  --c: var(--lv1);
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid var(--c);
  border-radius: 50%;
  opacity: 0.45;
}

.game-ladder__dot--l2 { --c: var(--lv2); }
.game-ladder__dot--l3 { --c: var(--lv3); }
.game-ladder__dot--l4 { --c: var(--lv4); }
.game-ladder__dot.is-done { background: var(--c); opacity: 1; }
.game-ladder__dot.is-current { opacity: 1; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 35%, transparent); }

.game-ladder__end {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.5;
}

/* ---- playing cards ---- */
.game-kings { display: flex; gap: 0.35rem; }
.game-kings__pip { font-size: 1.4rem; filter: grayscale(1); opacity: 0.35; }
.game-kings__pip.is-on { filter: none; opacity: 1; }

.game-cardrow {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: min(100%, 620px);
}

.game-cardrow__info { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; min-width: 0; }
.game-cardrow__title { margin: 0; font-size: 1.15rem; color: var(--accent-2); }
.game-cardrow__info .game-face__text { font-size: 1.15rem; }

.play-card {
  position: relative;
  flex: 0 0 auto;
  width: 112px;
  height: 160px;
  color: #17141a;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  animation: game-pop 0.25s ease;
}

.play-card.is-red { color: #d3123f; }

.play-card__corner {
  position: absolute;
  top: 8px;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.05;
}

.play-card__corner--br { top: auto; left: auto; bottom: 8px; right: 10px; transform: rotate(180deg); }
.play-card__suit { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.6rem; }

/* ---- dice ---- */
.game-dice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: min(100%, 720px);
}

.game-die {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 150px;
  padding: 0.8rem 0.6rem;
  text-align: center;
  background: linear-gradient(160deg, #3a1622 0%, #1a0a0e 100%);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.game-die.is-rolling { animation: game-shake 0.18s linear infinite; }
.game-die__label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; color: var(--accent-2); }
.game-die__text { margin: auto 0; font-size: 1.15rem; font-weight: 700; line-height: 1.4; color: #fff; }
.game-dice__summary { min-height: 1.6rem; margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--text); text-align: center; }

@keyframes game-shake {
  0% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(2px, -2px) rotate(1.5deg); }
  50% { transform: translate(-2px, 2px) rotate(-1.5deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

/* ---- wheel ---- */
.game-wheel {
  position: relative;
  width: min(360px, 86vw);
  aspect-ratio: 1;
  margin-top: 0.6rem;
}

.game-wheel__canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 0 6px #0f0406, 0 0 0 8px var(--accent), 0 14px 40px rgba(0, 0, 0, 0.55);
  will-change: transform;
}

.game-wheel__pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  margin-left: -14px;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid #fff;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6));
}

.game-wheel__result {
  min-height: 3.2rem;
  max-width: 560px;
  padding: 0.5rem 0.9rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  color: var(--text-muted);
}

.game-wheel__result.is-ready { color: #fff; font-size: 1.3rem; animation: game-pop 0.25s ease; }

/* ---- explicit confirmation ---- */
.game-explicit {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.game-explicit[hidden] { display: none !important; }

.game-explicit__panel {
  width: 100%;
  max-width: 440px;
  padding: 1.6rem 1.4rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), 0 0 40px rgba(239, 10, 107, 0.15);
}

.game-explicit__panel h2 { margin: 0 0 0.6rem; font-size: 1.25rem; color: #fff; }
.game-explicit__panel p { margin: 0; line-height: 1.6; color: var(--text-muted); }
.game-explicit__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.1rem; }

/* ---- responsive ---- */
@media (max-width: 768px) {
  .game-controls { grid-template-columns: 1fr; }
  .games-hero__title { font-size: 1.45rem; }
  .game-face__text { font-size: 1.2rem; }
  .game-face { min-height: 160px; padding: 1.2rem 1rem 2.3rem; }
  .game-cardrow { flex-direction: column; text-align: center; }
  .game-cardrow__info .game-face__level { align-self: center; }
  .game-dice { grid-template-columns: 1fr; }
  .game-die { min-height: 90px; }
  .game-stage { padding: 1rem 0.75rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .game-face, .play-card, .game-wheel__result.is-ready { animation: none; }
  .game-die.is-rolling { animation: none; }
}
