/* ============================================================
 *  Games v2 — Visual Upgrade
 *  Hall + game page framework
 * ============================================================ */

/* ─── Games Hall Hero ──────────────────────────────────────── */
.games-page {
  min-height: calc(100vh - 70px);
  background: var(--bg-page);
}

.games-hero {
  position: relative;
  padding: 130px 0 80px;
  margin-top: -70px;
  background:
    radial-gradient(ellipse at top right, rgba(45, 140, 212, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(232, 168, 56, 0.12) 0%, transparent 45%),
    linear-gradient(180deg, #0A2540 0%, #132F52 60%, #1A3A63 100%);
  color: #fff;
  overflow: hidden;
  text-align: center;
}
.games-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center top, black 25%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center top, black 25%, transparent 70%);
  pointer-events: none;
}
.games-hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 60px;
  background: var(--bg-page);
  clip-path: ellipse(65% 100% at 50% 100%);
  -webkit-clip-path: ellipse(65% 100% at 50% 100%);
}
.games-hero .container { position: relative; z-index: 1; }

.games-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(232, 168, 56, 0.12);
  border: 1px solid rgba(232, 168, 56, 0.25);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: #F5C76B;
  margin-bottom: 20px;
}
.games-badge .dot {
  width: 6px; height: 6px;
  background: #E8A838;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(232, 168, 56, 0.2);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(232, 168, 56, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(232, 168, 56, 0.08); }
}

.games-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 14px;
}
.games-title em {
  font-style: normal;
  background: linear-gradient(135deg, #F5C76B 0%, #E8A838 50%, #F5D28A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.games-subtitle {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.68);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.games-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 500px;
  margin: 0 auto;
}
.games-stat { text-align: center; }
.games-stat .num {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
}
.games-stat .num span { color: #E8A838; font-size: 20px; }
.games-stat .label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

/* ─── Game Cards Grid ──────────────────────────────────────── */
.games-section {
  padding: 64px 0;
}
.games-section-header {
  text-align: center;
  margin-bottom: 36px;
}
.games-section-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.games-section-desc {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.game-card {
  position: relative;
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 48px rgba(10, 37, 64, 0.14), 0 8px 20px rgba(10, 37, 64, 0.08);
}
.game-card__header {
  height: 110px;
  background: var(--game-gradient, linear-gradient(135deg, #1D6FB8, #2D8CD4));
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px 20px;
}
.game-card__header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}
.game-card__icon {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
}
.game-card__badge {
  position: relative;
  z-index: 1;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.game-card__body {
  padding: 20px;
}
.game-card__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.game-card__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  min-height: 42px;
}
.game-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.game-card__highscore {
  font-size: 12px;
  color: var(--text-light);
}
.game-card__highscore strong {
  font-weight: 700;
  color: var(--color-gold-500);
  font-size: 15px;
  margin-left: 4px;
}
.game-card__cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-blue-600);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.game-card:hover .game-card__cta {
  color: var(--color-blue-500);
  gap: 8px;
}

/* ─── Game Page Framework ──────────────────────────────────── */
.game-page {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 60px;
  background:
    radial-gradient(ellipse at top, var(--game-glow, rgba(29, 111, 184, 0.1)) 0%, transparent 50%),
    var(--bg-page);
}

.game-container {
  width: 100%;
  max-width: 720px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--game-bg, linear-gradient(135deg, #0A2540, #132F52));
  color: #fff;
}
.game-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.game-header__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.game-header__title {
  font-size: 16px;
  font-weight: 700;
}
.game-header__subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}
.game-header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.game-score {
  text-align: right;
}
.game-score__label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.game-score__value {
  font-size: 22px;
  font-weight: 800;
  color: #F5C76B;
  line-height: 1;
  letter-spacing: -0.02em;
}

.game-progress {
  height: 4px;
  background: var(--border-subtle);
  position: relative;
  overflow: hidden;
}
.game-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, #E8A838, #F5C76B);
  transition: width 0.3s ease;
  border-radius: 0 2px 2px 0;
}

.game-body {
  padding: 32px 28px;
}

/* Start screen */
.game-start {
  text-align: center;
  padding: 24px 0;
}
.game-start__icon {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: var(--game-gradient, linear-gradient(135deg, #1D6FB8, #2D8CD4));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(29, 111, 184, 0.3);
}
.game-start h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.game-start p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.7;
}
.game-start__stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 28px;
}
.game-start__stat { text-align: center; }
.game-start__stat .num {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-gold-500);
  line-height: 1;
}
.game-start__stat .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Question area */
.game-question {
  text-align: center;
  margin-bottom: 28px;
}
.game-question__label {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-soft);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.game-question__text {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.game-question__phonetic {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: var(--font-mono);
}

/* Options */
.game-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.game-option {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 2px solid var(--border-default);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s ease;
}
.game-option:hover {
  border-color: var(--color-blue-300);
  background: var(--color-blue-50);
}
.game-option.is-correct {
  border-color: var(--color-green-500);
  background: var(--color-green-100);
  color: var(--color-green-600);
}
.game-option.is-wrong {
  border-color: var(--color-red-500);
  background: var(--color-red-100);
  color: var(--color-red-600);
}

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.game-footer__left {
  font-size: 13px;
  color: var(--text-muted);
}
.game-footer__left strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* End screen */
.game-end {
  text-align: center;
  padding: 16px 0;
}
.game-end__trophy {
  font-size: 64px;
  margin-bottom: 16px;
}
.game-end h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.game-end__score {
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  margin: 16px 0;
  background: linear-gradient(135deg, #E8A838, #F5C76B);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}
.game-end__message {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.game-end__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.game-end__stat {
  padding: 16px 8px;
  background: var(--bg-soft);
  border-radius: 12px;
}
.game-end__stat .num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.game-end__stat .label {
  font-size: 12px;
  color: var(--text-muted);
}
.game-end__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Dark mode ────────────────────────────────────────────── */
html[data-theme="dark"] .games-hero {
  background:
    radial-gradient(ellipse at top right, rgba(45, 140, 212, 0.12) 0%, transparent 55%),
    linear-gradient(180deg, #051830 0%, #0A2540 60%, #132F52 100%);
}
html[data-theme="dark"] .games-hero::after {
  background: var(--bg-page);
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .games-hero { padding: 110px 0 60px; }
  .games-title { font-size: 32px; }
  .games-subtitle { font-size: 15px; }
  .games-stats { gap: 28px; }
  .games-stat .num { font-size: 22px; }
  .games-grid { grid-template-columns: 1fr; }
  .game-page { padding: 90px 12px 40px; }
  .game-body { padding: 24px 20px; }
  .game-question__text { font-size: 24px; }
  .game-options { grid-template-columns: 1fr; }
  .game-end__score { font-size: 44px; }
  .game-end__stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .game-end__stat { padding: 12px 4px; }
  .game-end__stat .num { font-size: 18px; }
}
