@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Baloo+2:wght@500;600;700;800&display=swap');

:root {
  --bg: #F0F4FF;
  --bg-soft: #E8EEFF;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-strong: #ffffff;
  --border: #D4DCFF;
  --border-strong: #B8C6FF;
  --text: #1a1f36;
  --muted: #6b7a99;
  --primary: #4361EE;
  --primary-strong: #3451D1;
  --success: #06d6a0;
  --warning: #FFB703;
  --danger: #ef233c;
  --purple: #7B2FBE;
  --pink: #F72585;
  --teal: #0BB4A1;
  --orange: #FB5607;
  --shadow-xs: 0 2px 12px rgba(67, 97, 238, 0.07);
  --shadow-sm: 0 10px 30px rgba(67, 97, 238, 0.10);
  --shadow-md: 0 18px 44px rgba(67, 97, 238, 0.14);
  --shadow-lg: 0 30px 80px rgba(67, 97, 238, 0.18);
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --font-display: "Baloo 2", Nunito, "Segoe UI", system-ui, sans-serif;
  --sidebar-width: 286px;
  --sidebar-collapsed-width: 88px;
  --topbar-height: 72px;
  --mobile-nav-height: 70px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family:
    Nunito,
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(247, 37, 133, 0.06), transparent 32%),
    radial-gradient(circle at 92% 6%, rgba(11, 180, 161, 0.07), transparent 30%),
    radial-gradient(circle at 85% 88%, rgba(123, 47, 190, 0.06), transparent 34%),
    radial-gradient(circle, rgba(67, 97, 238, 0.12) 1.5px, transparent 1.5px),
    radial-gradient(circle, rgba(123, 47, 190, 0.08) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 32px 32px, 16px 16px;
  background-position: 0 0, 0 0, 0 0, 0 0, 8px 8px;
  background-attachment: fixed, fixed, fixed, scroll, scroll;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: none;
}

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition:
    transform 180ms ease,
    width 180ms ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.brand-logo,
.auth-home-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-pill {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  color: white;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 1.4rem;
  box-shadow: 0 12px 26px rgba(67, 97, 238, 0.28);
}

.brand-text,
.brand-logo strong {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong,
.auth-home-link strong {
  font-size: 1rem;
}

.brand-text small,
.auth-home-link small {
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-toggle,
.mobile-menu-btn,
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--muted);
  border: 1px solid var(--border);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    background 160ms ease;
  box-shadow: var(--shadow-xs);
}

.sidebar-toggle:hover,
.mobile-menu-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-link,
.nav-dropdown-toggle,
.nav-sublink {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.nav-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.nav-link:hover,
.nav-dropdown-toggle:hover,
.nav-sublink:hover,
.nav-link.active,
.nav-dropdown-toggle.active,
.nav-sublink.active {
  background: rgba(67, 97, 238, 0.1);
  border-color: rgba(67, 97, 238, 0.18);
  color: var(--primary);
}

.nav-icon {
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-text {
  white-space: nowrap;
}

.nav-dropdown-menu {
  display: none;
  padding: 4px 0 8px 10px;
}

.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-sublink {
  padding: 10px 12px;
  font-size: 0.94rem;
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--border);
}

.mini-badge,
.nav-badge,
.chip,
.plan-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.mini-badge,
.nav-badge {
  background: rgba(245, 158, 11, 0.12);
  color: #9a5800;
}

.plan-chip {
  width: fit-content;
  margin-top: 8px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

.plan-chip.pro {
  background: rgba(124, 58, 237, 0.12);
  color: var(--purple);
}

.plan-chip.school {
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-card,
.guest-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.96));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.user-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #38bdf8);
  color: white;
  font-weight: 800;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-meta span,
.guest-card p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.footer-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 180ms ease;
}

.app-wrapper.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.app-wrapper.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.app-wrapper.sidebar-collapsed .brand-text,
.app-wrapper.sidebar-collapsed .nav-text,
.app-wrapper.sidebar-collapsed .chevron,
.app-wrapper.sidebar-collapsed .mini-badge,
.app-wrapper.sidebar-collapsed .nav-badge,
.app-wrapper.sidebar-collapsed .user-meta,
.app-wrapper.sidebar-collapsed .footer-actions,
.app-wrapper.sidebar-collapsed .guest-card p {
  display: none;
}

.app-wrapper.sidebar-collapsed .nav-link,
.app-wrapper.sidebar-collapsed .nav-dropdown-toggle,
.app-wrapper.sidebar-collapsed .nav-sublink,
.app-wrapper.sidebar-collapsed .brand-logo {
  justify-content: center;
}

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  z-index: 20;
}

.app-wrapper.sidebar-collapsed .topbar {
  left: var(--sidebar-collapsed-width);
}

.topbar-left,
.topbar-actions,
.notif-actions,
.cta-row,
.resource-head,
.panel-head,
.modal-card-head,
.modal-actions,
.hero-stats,
.room-participants {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left {
  flex: 1;
}

.page-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.page-subtitle {
  color: var(--muted);
  font-size: 0.83rem;
}

.mobile-menu-btn {
  display: none;
}

.notif-btn {
  position: relative;
}

.notif-btn.has-unread {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.18);
}

.notif-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--danger), #f97316);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  border: 2px solid white;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 40;
}

.notif-dropdown.open {
  display: block;
}

.notif-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.notif-header small,
.notif-body span,
.summary-meta,
.step-card p,
.testimonial-card span,
.faq-item p,
.record-line,
.panel-text,
.progress-line,
.resource-row span,
.empty-state p,
.inline-error,
.auth-switch {
  color: var(--muted);
}

.notif-list,
.notif-page-list {
  display: grid;
  gap: 0;
}

.notif-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(219, 228, 240, 0.75);
  transition: background 160ms ease;
}

.notif-item:hover {
  background: rgba(37, 99, 235, 0.04);
}

.notif-item.unread {
  background: rgba(37, 99, 235, 0.07);
}

.notif-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  color: white;
  font-weight: 800;
}

.notif-icon.success {
  background: linear-gradient(135deg, var(--success), #22c55e);
}

.notif-icon.warning {
  background: linear-gradient(135deg, var(--warning), #f97316);
}

.notif-icon.error {
  background: linear-gradient(135deg, var(--danger), #dc2626);
}

.notif-icon.info {
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
}

.notif-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notif-body strong,
.resource-head strong,
.panel-head h1,
.panel-head h2,
.question-box strong,
.feature-card h3,
.step-card h3,
.pricing-card h2,
.game-summary h3,
.auth-panel h1,
.auth-aside h2,
.dashboard-hero h1,
.hero-card h1,
.hero-lite h1 {
  font-weight: 800;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: calc(var(--topbar-height) + 18px) 24px calc(32px + var(--mobile-nav-height));
}

.hero-card,
.panel-card,
.pricing-card,
.feature-card,
.game-summary,
.step-card,
.testimonial-card,
.seo-card,
.auth-gate,
.dashboard-stat,
.resource-card,
.room-card,
.mini-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.hero-card {
  padding: 36px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  background: linear-gradient(135deg, #4361EE 0%, #7B2FBE 55%, #F72585 100%) !important;
  border: none !important;
  color: white;
}

.hero-copy h1,
.dashboard-hero h1,
.hero-lite h1,
.auth-gate h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 0.98;
}

.hero-copy p,
.hero-lite p,
.dashboard-hero p,
.auth-panel p,
.auth-aside p,
.feature-card p,
.game-summary p,
.testimonial-card p,
.seo-card p,
.mini-card p,
.auth-gate p,
.question-box p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-card .hero-copy p,
.hero-card .eyebrow,
.hero-card .hero-stats .stat-box span,
.hero-card .feature-burst {
  color: rgba(255, 255, 255, 0.88);
}

.hero-card .stat-box {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.22);
}

.hero-card .stat-box strong {
  color: white;
}

.hero-card .feature-burst {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.hero-card .feature-burst strong {
  color: white;
}

.hero-card .eyebrow {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.hero-card h1 {
  color: white !important;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 7px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(67, 97, 238, 0.14), rgba(247, 37, 133, 0.10));
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(67, 97, 238, 0.18);
}

.hero-panel,
.subject-grid,
.feature-grid,
.game-card-grid,
.step-grid,
.testimonial-grid,
.stats-grid,
.panel-grid,
.builder-grid,
.pricing-grid,
.quick-links,
.progress-list,
.compact-notifs,
.crossword-preview,
.answer-grid,
.social-grid {
  display: grid;
  gap: 16px;
}

.feature-burst,
.mini-card,
.question-box,
.dashboard-stat,
.upgrade-note {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
}

.feature-burst {
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.06));
}

.feature-burst strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.subject-grid,
.stats-grid,
.feature-grid,
.quick-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-stats,
.quick-links {
  margin-top: 18px;
}

.stat-box {
  flex: 1;
  min-width: 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
}

.stat-box strong {
  display: block;
  font-size: 1.5rem;
}

.stat-box span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.section-block,
.game-shell {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head h2,
.panel-head h1,
.panel-head h2,
.auth-panel h1,
.auth-aside h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.feature-card,
.step-card,
.testimonial-card,
.dashboard-stat,
.pricing-card,
.resource-card,
.room-card {
  padding: 20px;
}

.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-grid;
  place-items: center;
  font-size: 1.9rem;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
}

.feature-card:nth-child(1) .feature-icon {
  background: linear-gradient(135deg, #4361EE, #7B2FBE);
}

.feature-card:nth-child(2) .feature-icon {
  background: linear-gradient(135deg, #F72585, #FB5607);
}

.feature-card:nth-child(3) .feature-icon {
  background: linear-gradient(135deg, #FFB703, #FB5607);
}

.feature-card:nth-child(4) .feature-icon {
  background: linear-gradient(135deg, #06d6a0, #0BB4A1);
}

.game-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  perspective: 1400px;
}

.game-emoji {
  font-size: 2.4rem;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 50%;
  line-height: 1;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12) 48%, rgba(255, 255, 255, 0.06) 70%),
    rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.5),
    inset 0 -6px 10px rgba(0, 0, 0, 0.22),
    0 10px 18px rgba(0, 0, 0, 0.22);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
  animation: game-emoji-bob 3.4s ease-in-out infinite;
}

@keyframes game-emoji-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(-3deg); }
}

.game-summary:nth-child(2n) .game-emoji {
  animation-delay: 0.8s;
}

.game-summary:nth-child(3n) .game-emoji {
  animation-delay: 1.6s;
}

.game-summary {
  padding: 24px 22px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-xl) !important;
  transition:
    transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 200ms ease;
}

.game-summary:hover,
.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.social-btn:hover,
.answer-btn:hover,
.quick-link:hover,
.mobile-link:hover,
.color-tile:hover {
  transform: translateY(-2px);
}

.game-summary:hover {
  box-shadow: var(--shadow-lg);
}

.game-summary.green {
  background: linear-gradient(135deg, #06d6a0 0%, #0BB4A1 60%, #118AB2 100%);
}

.game-summary.blue {
  background: linear-gradient(135deg, #4361EE 0%, #3A0CA3 100%);
}

.game-summary.orange {
  background: linear-gradient(135deg, #FFB703 0%, #FB5607 100%);
}

.game-summary.purple {
  background: linear-gradient(135deg, #7B2FBE 0%, #F72585 100%);
}

.game-summary.pink {
  background: linear-gradient(135deg, #F72585 0%, #FB5607 100%);
}

.game-summary.teal {
  background: linear-gradient(135deg, #0BB4A1 0%, #118AB2 100%);
}

.game-summary.violet {
  background: linear-gradient(135deg, #7209B7 0%, #4361EE 100%);
}

.game-summary.indigo {
  background: linear-gradient(135deg, #3A0CA3 0%, #4361EE 100%);
}

.game-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chip {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.arrow {
  font-size: 1.15rem;
  opacity: 0.85;
}

.summary-meta {
  color: rgba(255, 255, 255, 0.86);
}

.step-grid,
.testimonial-grid,
.panel-grid,
.builder-grid,
.pricing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.step-card span {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.1rem;
  color: white;
}

.step-card:nth-child(1) span { background: linear-gradient(135deg, #4361EE, #7B2FBE); }
.step-card:nth-child(2) span { background: linear-gradient(135deg, #F72585, #FB5607); }
.step-card:nth-child(3) span { background: linear-gradient(135deg, #FFB703, #FB5607); }
.step-card:nth-child(4) span { background: linear-gradient(135deg, #06d6a0, #0BB4A1); }

.testimonial-card footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
}

.seo-card {
  padding: 24px;
}

.dashboard-hero {
  padding: 26px 28px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.98));
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-stat {
  min-height: 110px;
}

.dashboard-stat strong {
  display: block;
  font-size: 1.45rem;
  margin-bottom: 8px;
}

.dashboard-stat span {
  color: var(--muted);
}

.panel-card {
  padding: 22px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.quick-links {
  margin-top: 10px;
}

.quick-link {
  padding: 16px;
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.12);
  font-weight: 700;
  color: var(--primary);
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.progress-row,
.resource-row,
.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid var(--border);
}

.progress-row strong,
.leaderboard-row strong {
  color: var(--primary);
}

.builder-grid {
  align-items: start;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.stack-form.subtle {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.field-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.text-input,
.select-input,
.text-area {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.text-input:focus,
.select-input:focus,
.text-area:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: white;
}

.text-area {
  min-height: 110px;
  resize: vertical;
}

.text-area.tall {
  min-height: 180px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.text-button-inline {
  padding: 0;
  border: none;
  background: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.password-field {
  position: relative;
}

.ghost-inline-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.social-btn,
.answer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  box-shadow: 0 10px 28px rgba(67, 97, 238, 0.30);
}

.ghost-btn,
.social-btn,
.answer-btn {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.danger-btn {
  background: linear-gradient(135deg, var(--danger), #f97316);
  color: white;
  box-shadow: 0 10px 28px rgba(239, 35, 60, 0.24);
}

.primary-btn.full,
.ghost-btn.full {
  width: 100%;
}

.large {
  padding: 14px 20px;
}

.compact {
  padding: 10px 12px;
}

.wrap {
  flex-wrap: wrap;
}

.selected {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.2);
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px dashed var(--border-strong);
}

.empty-state.compact {
  margin: 12px;
}

.upgrade-note {
  margin-bottom: 18px;
  color: var(--orange);
  font-weight: 700;
}

.resource-card p,
.auth-hint,
.policy-list p {
  color: var(--muted);
  line-height: 1.6;
}

.resource-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.resource-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.resource-btn {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 120ms ease;
}

.resource-btn:hover {
  transform: scale(1.07);
}

.edit-btn {
  background: rgba(67, 97, 238, 0.12);
  color: var(--primary);
}

.dup-btn {
  background: rgba(255, 183, 3, 0.14);
  color: #b07d00;
}

.del-btn {
  background: rgba(239, 35, 60, 0.10);
  color: var(--danger);
}

.bullet-list {
  margin: 12px 0 0 18px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.crossword-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crossword-index {
  width: 28px;
  color: var(--muted);
  font-weight: 700;
}

.crossword-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crossword-cell {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.12);
  font-weight: 800;
  color: var(--primary);
}

.auth-page {
  min-height: 100vh;
  padding: 26px;
}

.auth-shell {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-lg);
}

.auth-card.single {
  grid-template-columns: 1fr;
  width: min(680px, 100%);
}

.auth-aside,
.auth-panel {
  padding: 32px;
}

.auth-aside {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(248, 250, 252, 0.94));
  border-right: 1px solid var(--border);
}

.auth-list {
  margin: 18px 0 0 18px;
  padding: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.auth-hint {
  margin-top: 20px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(255, 255, 255, 0.76);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.social-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-error {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.16);
}

.auth-switch {
  margin-top: 18px;
}

.auth-switch a {
  color: var(--primary);
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 160ms ease,
    visibility 160ms ease;
  z-index: 60;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(560px, calc(100% - 32px));
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 160ms ease;
  z-index: 61;
}

.modal-card.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.country-card {
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.98);
}

.country-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.policy-list {
  display: grid;
  gap: 12px;
}

.split {
  justify-content: space-between;
}

.auth-gate,
.card-center,
.hero-lite {
  padding: 28px;
}

.hero-lite {
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.pricing-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pricing-card.current {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: var(--shadow-md);
}

.pricing-top p {
  color: var(--muted);
}

.price {
  font-size: 2rem;
  font-weight: 800;
}

.price small {
  font-size: 0.95rem;
  color: var(--muted);
}

.feature-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.game-shell .panel-card {
  max-width: 860px;
  margin: 0 auto;
}

.rope-track {
  position: relative;
  height: 18px;
  margin: 18px 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.18), rgba(239, 68, 68, 0.18));
  overflow: hidden;
}

.rope-center {
  position: absolute;
  inset: 0;
  width: 2px;
  margin: auto;
  background: rgba(15, 23, 42, 0.22);
}

.rope-marker {
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-sm);
}

.versus-grid,
.answer-grid,
.pricing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.score-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.92);
  text-align: center;
}

.score-card.active {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.08);
}

.score-card strong {
  display: block;
  margin-bottom: 8px;
}

.score-card span {
  font-size: 1.6rem;
  font-weight: 800;
}

.question-box h2 {
  margin: 8px 0 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.answer-grid {
  margin-top: 16px;
}

.answer-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.game-feedback {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid var(--border);
  color: var(--muted);
}

.move-list,
.leaderboard-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.move-list span,
.room-participants span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-weight: 700;
}

.routing-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.route-cell {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.96);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.route-cell.start {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
}

.route-cell.goal {
  background: rgba(245, 158, 11, 0.14);
  color: #a16207;
}

.route-cell.obstacle {
  background: rgba(15, 23, 42, 0.16);
  color: #1f2937;
}

.route-cell.visited {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.24);
}

.memory-display {
  margin: 18px 0;
  min-height: 96px;
  border-radius: 22px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0.3em;
  background: rgba(248, 250, 252, 0.96);
}

.memory-display.showing {
  background:
    radial-gradient(circle at center, rgba(37, 99, 235, 0.12), transparent 42%),
    rgba(248, 250, 252, 0.96);
}

.inline-form {
  margin-top: 16px;
}

.centered {
  text-align: center;
  letter-spacing: 0.1em;
}

.color-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.color-tile {
  aspect-ratio: 1;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

.flag-box {
  text-align: center;
}

.flag-emoji {
  font-size: clamp(3rem, 8vw, 5rem);
  margin-bottom: 8px;
}

.room-focus {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid var(--border);
}

.room-focus h3 {
  margin: 0 0 10px;
}

.room-focus p {
  color: var(--muted);
}

.text-link {
  color: var(--primary);
  font-weight: 700;
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  min-height: var(--mobile-nav-height);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: 0 -12px 24px rgba(15, 23, 42, 0.08);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mobile-link {
  padding: 10px 6px;
  border-radius: 14px;
  text-align: center;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid transparent;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

.mobile-link.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.16);
  color: var(--primary);
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 160ms ease,
    visibility 160ms ease;
  z-index: 28;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.tug-body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 24%),
    linear-gradient(180deg, #eef3f9 0%, #dde5ef 100%);
}

.tug-page-shell {
  min-height: 100vh;
  padding: 22px;
}

.tug-setup-shell,
.tug-stage-shell {
  width: min(1360px, 100%);
  margin: 0 auto;
}

.tug-setup-card,
.tug-result-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  border: 1px solid rgba(203, 213, 225, 0.88);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.tug-setup-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 18px 20px;
}

.tug-setup-card h1,
.tug-stage-topbar h1 {
  margin: 0;
  text-align: center;
  color: #2f82cb;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.tug-stepper {
  display: grid;
  grid-template-columns: auto 52px auto 52px auto;
  gap: 0;
  align-items: start;
  justify-content: center;
  margin: 20px auto 18px;
  max-width: 520px;
}

.tug-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #8a8f98;
  font-weight: 700;
}

.tug-step span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 2px solid #9bd0fb;
  color: #2f82cb;
  background: #edf7ff;
}

.tug-step.active {
  color: #202833;
}

.tug-step.active span,
.tug-step.done span {
  background: #2f82cb;
  border-color: #2f82cb;
  color: white;
}

.tug-step strong {
  font-size: 1rem;
}

.tug-step-line {
  align-self: start;
  margin-top: 17px;
  height: 2px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.42);
}

.tug-step-line.done {
  background: rgba(47, 130, 203, 0.34);
}

.tug-setup-head {
  text-align: center;
  margin-bottom: 14px;
}

.tug-setup-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: #6b6f76;
  font-weight: 900;
}

.tug-setup-head p {
  margin: 6px 0 0;
  color: #7f8691;
  font-size: 1rem;
}

.tug-step-content {
  min-height: 252px;
}

.tug-choice-grid,
.tug-difficulty-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tug-difficulty-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tug-choice-card {
  min-height: 78px;
  padding: 18px 18px;
  border-radius: 18px;
  background: #f4f4f5;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  color: #14181f;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.tug-difficulty-grid .tug-choice-card {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  align-items: center;
  gap: 10px;
  min-height: 116px;
}

.tug-choice-card:hover,
.tug-back-btn:hover,
.tug-next-btn:hover,
.tug-key:hover,
.tug-home-pill:hover,
.tug-lang-pill:hover {
  transform: translateY(-2px);
}

.tug-choice-card.selected {
  border-color: #2f8ee5;
  background: #dff0ff;
  box-shadow: 0 14px 26px rgba(47, 130, 203, 0.18);
}

.tug-choice-icon,
.tug-choice-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: white;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
  color: #14181f;
  font-size: 1.5rem;
  font-weight: 900;
}

.tug-choice-icon svg,
.tug-choice-badge svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tug-choice-card.selected .tug-choice-icon,
.tug-choice-card.selected .tug-choice-badge {
  background: #2f82cb;
  color: white;
}

.tug-choice-copy {
  display: grid;
  gap: 4px;
}

.tug-choice-card strong,
.tug-team-setup strong {
  font-size: 1.1rem;
  font-weight: 900;
}

.tug-choice-card small {
  display: block;
  margin-top: 4px;
  color: #6f7681;
}

.tug-team-setup-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
}

.tug-team-setup {
  padding: 18px 14px;
  border-radius: 18px;
  border: 2px solid #3794eb;
  background: #fbfcfe;
  text-align: center;
}

.tug-team-setup-red {
  border-color: #ef4444;
}

.tug-team-icon {
  display: inline-grid;
  place-items: center;
  width: 100%;
  color: #3794eb;
  margin-bottom: 10px;
}

.tug-team-setup-red .tug-team-icon {
  color: #ef4444;
}

.tug-team-icon svg {
  width: 42px;
  height: 42px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tug-team-input {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d7dce3;
  background: white;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #575d66;
}

.tug-team-input:focus {
  outline: none;
  border-color: #2f82cb;
  box-shadow: 0 0 0 4px rgba(47, 130, 203, 0.12);
}

.tug-versus {
  color: #2f82cb;
  font-size: 2rem;
  font-weight: 900;
}

.tug-wizard-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}

.tug-back-btn,
.tug-next-btn,
.tug-link-btn {
  min-width: 120px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.tug-back-btn,
.tug-link-btn {
  background: white;
  color: #2a2d32;
  border: 1px solid #dee3ea;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.tug-back-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.tug-next-btn {
  background: linear-gradient(135deg, #2f8ee5, #2f82cb);
  color: white;
  box-shadow: 0 14px 28px rgba(47, 130, 203, 0.24);
}

.tug-back-btn svg,
.tug-next-btn svg,
.tug-link-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tug-stage-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.tug-home-pill,
.tug-lang-pill {
  width: fit-content;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: #2f82cb;
  border: 1px solid #dbe2eb;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.tug-lang-pill {
  justify-self: end;
}

.tug-home-pill svg,
.tug-lang-pill svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.1;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tug-flag-chip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 42%, #ffffff 42% 58%, transparent 58%),
    linear-gradient(transparent 42%, #ffffff 42% 58%, transparent 58%),
    linear-gradient(90deg, transparent 46%, #ef4444 46% 54%, transparent 54%),
    linear-gradient(transparent 46%, #ef4444 46% 54%, transparent 54%),
    linear-gradient(135deg, #1d4ed8 0%, #1d4ed8 100%);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.tug-stage-layout {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 18px;
  align-items: start;
}

.tug-player-panel,
.tug-arena-panel {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  border: 1px solid #dce4ee;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.tug-player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  color: white;
  font-weight: 900;
}

.tug-player-head span {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: white;
  color: #1f2a37;
  display: inline-grid;
  place-items: center;
}

.tug-player-panel-blue .tug-player-head {
  background: linear-gradient(135deg, #2f8ee5, #2f82cb);
}

.tug-player-panel-red .tug-player-head {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.tug-problem {
  padding: 18px 20px 14px;
  text-align: center;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
}

.tug-problem-blue {
  background: rgba(47, 130, 203, 0.16);
  color: #2f82cb;
}

.tug-problem-red {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
}

.tug-answer-display {
  margin: 10px 14px 14px;
  min-height: 42px;
  border-radius: 14px;
  border: 2px solid #e1e7ef;
  background: white;
  display: grid;
  place-items: center;
  color: #63676d;
  font-size: 1.2rem;
  font-weight: 900;
}

.tug-keypad {
  padding: 0 10px 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tug-key {
  min-height: 74px;
  border-radius: 16px;
  background: white;
  border: 1px solid #e3e7ee;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  font-size: 1.9rem;
  font-weight: 900;
  color: #101418;
  display: grid;
  place-items: center;
}

.tug-key-clear {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.tug-key-submit {
  background: linear-gradient(135deg, #2f8ee5, #2f82cb);
  color: white;
  text-transform: uppercase;
  font-size: 1.15rem;
}

.tug-key svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tug-arena-panel {
  padding: 12px;
}

.tug-arena-scorebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f5f5f5, #eeeeee);
}

.tug-arena-scorebar div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 900;
  color: #2a2d32;
}

.tug-score-slot {
  display: grid !important;
  gap: 2px;
}

.tug-score-slot-left {
  justify-items: start;
}

.tug-score-slot-right {
  justify-items: end;
}

.tug-score-slot span {
  color: #2f82cb;
  font-size: 1.1rem;
}

.tug-timer {
  justify-content: center !important;
  color: #2f82cb !important;
  font-size: 1.4rem;
}

.tug-arena-scene {
  --tug-scale: 1;
  --scene-shift: 0px;
  --rope-tilt: 0deg;
  position: relative;
  min-height: 440px;
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid #d6e4d4;
  overflow: hidden;
  box-shadow: inset 0 -18px 34px rgba(31, 84, 49, 0.14);
}

.tug-scene-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.tug-bunting {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 58px;
  display: block;
  pointer-events: none;
}

.tug-cloud {
  animation: tug-cloud-drift 26s linear infinite;
}

.tug-cloud-b {
  animation-duration: 34s;
  animation-delay: -12s;
}

.tug-cloud-c {
  animation-duration: 42s;
  animation-delay: -25s;
}

@keyframes tug-cloud-drift {
  0% { transform: translateX(-80px); }
  100% { transform: translateX(1280px); }
}

.tug-arena-midline {
  position: absolute;
  top: 26%;
  bottom: 6%;
  left: 50%;
  border-left: 3px dashed rgba(255, 255, 255, 0.75);
  transform: translateX(-50%);
  filter: drop-shadow(0 1px 1px rgba(31, 84, 49, 0.3));
}

.tug-rope-line {
  position: absolute;
  left: 9%;
  right: 9%;
  top: calc(50% - 22px);
  height: 56px;
  transform: translateX(var(--scene-shift)) rotate(var(--rope-tilt)) scale(var(--tug-scale));
  transform-origin: center;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.tug-rope-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 10px 6px rgba(31, 84, 49, 0.22));
}

.tug-rope-flag {
  position: absolute;
  top: 16px;
  width: 34px;
  height: 44px;
  transform: translateX(-50%);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tug-rope-flag svg {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 8%;
  animation: tug-flag-swing 2.4s ease-in-out infinite;
  filter: drop-shadow(0 4px 4px rgba(31, 84, 49, 0.3));
}

@keyframes tug-flag-swing {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.tug-side {
  position: absolute;
  top: 50%;
  display: flex;
  gap: 14px;
  transform-origin: center;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tug-side-left {
  left: 9%;
  transform: translate(calc(var(--scene-shift) * 0.9), -50%) scale(var(--tug-scale));
}

.tug-side-right {
  right: 9%;
  transform: translate(calc(var(--scene-shift) * 0.9), -50%) scale(var(--tug-scale)) scaleX(-1);
}

.tug-player-figure {
  position: relative;
  width: 116px;
  height: 196px;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tug-player-figure svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.tug-fig-upper {
  transform-box: fill-box;
  transform-origin: 40% 90%;
  animation: tug-idle-heave 2.8s ease-in-out infinite;
}

.tug-player-figure:nth-child(2) .tug-fig-upper {
  animation-delay: 0.65s;
}

@keyframes tug-idle-heave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-3.5deg) translateY(1px); }
}

.tug-arena-scene.tug-pull-left .tug-rope-line {
  animation: tug-rope-left 320ms ease-out;
}

.tug-arena-scene.tug-pull-right .tug-rope-line {
  animation: tug-rope-right 320ms ease-out;
}

.tug-arena-scene.tug-pull-left .tug-side-left {
  animation: tug-side-left-drive 320ms ease-out;
}

.tug-arena-scene.tug-pull-left .tug-side-right {
  animation: tug-side-left-resist 320ms ease-out;
}

.tug-arena-scene.tug-pull-right .tug-side-right {
  animation: tug-side-right-drive 320ms ease-out;
}

.tug-arena-scene.tug-pull-right .tug-side-left {
  animation: tug-side-right-resist 320ms ease-out;
}

.tug-arena-scene.tug-pull-left .tug-side-left .tug-player-figure,
.tug-arena-scene.tug-pull-right .tug-side-right .tug-player-figure {
  animation: tug-figure-drive 320ms ease-out;
}

.tug-arena-scene.tug-pull-left .tug-side-left .tug-fig-upper,
.tug-arena-scene.tug-pull-right .tug-side-right .tug-fig-upper {
  animation: tug-upper-heave 320ms ease-out;
}

@keyframes tug-upper-heave {
  0% { transform: rotate(0deg); }
  45% { transform: rotate(-11deg) translate(-3px, 2px); }
  100% { transform: rotate(0deg); }
}

.tug-dust {
  position: absolute;
  bottom: 23%;
  width: 70px;
  height: 40px;
  pointer-events: none;
}

.tug-dust-left {
  left: 13%;
}

.tug-dust-right {
  right: 13%;
  transform: scaleX(-1);
}

.tug-dust span {
  position: absolute;
  bottom: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 187, 141, 0.85), rgba(214, 187, 141, 0));
  opacity: 0;
}

.tug-dust span:nth-child(1) { left: 4px; }
.tug-dust span:nth-child(2) { left: 26px; width: 22px; height: 22px; }
.tug-dust span:nth-child(3) { left: 48px; width: 13px; height: 13px; }

.tug-arena-scene.tug-pull-left .tug-dust-left span,
.tug-arena-scene.tug-pull-right .tug-dust-right span {
  animation: tug-dust-puff 460ms ease-out;
}

.tug-dust span:nth-child(2) { animation-delay: 40ms; }
.tug-dust span:nth-child(3) { animation-delay: 90ms; }

@keyframes tug-dust-puff {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  30% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(-22px, -26px) scale(1.7); }
}

@keyframes tug-rope-left {
  0% { transform: translateX(calc(var(--scene-shift) + 12px)) rotate(calc(var(--rope-tilt) + 1deg)) scale(var(--tug-scale)); }
  65% { transform: translateX(calc(var(--scene-shift) - 14px)) rotate(calc(var(--rope-tilt) - 1.5deg)) scale(var(--tug-scale)); }
  100% { transform: translateX(var(--scene-shift)) rotate(var(--rope-tilt)) scale(var(--tug-scale)); }
}

@keyframes tug-rope-right {
  0% { transform: translateX(calc(var(--scene-shift) - 12px)) rotate(calc(var(--rope-tilt) - 1deg)) scale(var(--tug-scale)); }
  65% { transform: translateX(calc(var(--scene-shift) + 14px)) rotate(calc(var(--rope-tilt) + 1.5deg)) scale(var(--tug-scale)); }
  100% { transform: translateX(var(--scene-shift)) rotate(var(--rope-tilt)) scale(var(--tug-scale)); }
}

@keyframes tug-side-left-drive {
  0% { transform: translate(calc(var(--scene-shift) + 8px), -50%) scale(var(--tug-scale)); }
  60% { transform: translate(calc(var(--scene-shift) - 18px), calc(-50% - 4px)) scale(var(--tug-scale)); }
  100% { transform: translate(calc(var(--scene-shift) * 0.9), -50%) scale(var(--tug-scale)); }
}

@keyframes tug-side-right-drive {
  0% { transform: translate(calc(var(--scene-shift) - 8px), -50%) scale(var(--tug-scale)) scaleX(-1); }
  60% { transform: translate(calc(var(--scene-shift) + 18px), calc(-50% - 4px)) scale(var(--tug-scale)) scaleX(-1); }
  100% { transform: translate(calc(var(--scene-shift) * 0.9), -50%) scale(var(--tug-scale)) scaleX(-1); }
}

@keyframes tug-side-left-resist {
  0% { transform: translate(calc(var(--scene-shift) + 6px), -50%) scale(var(--tug-scale)) scaleX(-1); }
  55% { transform: translate(calc(var(--scene-shift) - 8px), calc(-50% + 3px)) scale(var(--tug-scale)) scaleX(-1); }
  100% { transform: translate(calc(var(--scene-shift) * 0.9), -50%) scale(var(--tug-scale)) scaleX(-1); }
}

@keyframes tug-side-right-resist {
  0% { transform: translate(calc(var(--scene-shift) - 6px), -50%) scale(var(--tug-scale)); }
  55% { transform: translate(calc(var(--scene-shift) + 8px), calc(-50% + 3px)) scale(var(--tug-scale)); }
  100% { transform: translate(calc(var(--scene-shift) * 0.9), -50%) scale(var(--tug-scale)); }
}

@keyframes tug-figure-drive {
  0% { transform: translateY(0) rotate(0deg); }
  55% { transform: translateY(-4px) rotate(-3deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.tug-stage-message {
  margin-top: 12px;
  padding: 12px 14px 4px;
  text-align: center;
  color: #666c75;
  font-weight: 700;
}

.tug-stage-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.tug-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dce4ee;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
  justify-self: start;
  width: fit-content;
}

.tug-zoom-controls button {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #eef4fb;
  color: #2f82cb;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}

.tug-zoom-controls button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tug-social-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: center;
}

.tug-social-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dce4ee;
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.08);
  color: #2f82cb;
}

.tug-social-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.1;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tug-zoom-controls span,
.tug-footer-note {
  font-weight: 900;
  color: #2d3440;
}

.tug-footer-note {
  justify-self: end;
}

.tug-footer-note strong {
  color: #2f82cb;
}

.tug-result-card {
  max-width: 860px;
  margin: 36px auto 0;
  padding: 28px;
  text-align: center;
}

.tug-result-score {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.tug-result-score strong {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  color: #2f82cb;
}

.tug-result-score span {
  font-size: 1.1rem;
  font-weight: 900;
  color: #4c5561;
}

.tug-result-card p {
  color: #6d7480;
  font-size: 1.05rem;
}

.tug-result-rope {
  margin: 22px 0;
}

@media (max-width: 1180px) {
  .hero-card,
  .panel-grid,
  .builder-grid,
  .pricing-grid,
  .step-grid,
  .testimonial-grid {
    grid-template-columns: 1fr;
  }

  .game-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .tug-stage-layout {
    grid-template-columns: 1fr;
  }

  .tug-stage-footer {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .tug-footer-note {
    justify-self: center;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content,
  .app-wrapper.sidebar-collapsed .main-content {
    margin-left: 0;
  }

  .topbar,
  .app-wrapper.sidebar-collapsed .topbar {
    left: 0;
  }

  .mobile-menu-btn {
    display: inline-grid;
  }

  .tug-page-shell {
    padding: 16px;
  }

  .tug-stage-topbar {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

@media (max-width: 820px) {
  .auth-card,
  .hero-card,
  .subject-grid,
  .feature-grid,
  .game-card-grid,
  .stats-grid,
  .versus-grid,
  .answer-grid,
  .social-grid {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .topbar {
    padding: 0 14px;
  }

  .container {
    padding: calc(var(--topbar-height) + 14px) 14px calc(20px + var(--mobile-nav-height));
  }

  .modal-card {
    width: calc(100% - 20px);
  }

  .tug-team-setup-grid {
    grid-template-columns: 1fr;
  }

  .tug-versus {
    display: none;
  }

  .tug-arena-scene {
    min-height: 320px;
  }

  .tug-player-figure {
    width: 74px;
    height: 125px;
  }

  .tug-side {
    gap: 8px;
  }

  .tug-side-left {
    left: 5%;
  }

  .tug-side-right {
    right: 5%;
  }

  .tug-rope-line {
    left: 5%;
    right: 5%;
    top: calc(50% - 16px);
    height: 40px;
  }

  .tug-rope-flag {
    width: 26px;
    height: 34px;
    top: 12px;
  }
}

@media (max-width: 640px) {
  .topbar-left {
    min-width: 0;
  }

  .page-subtitle {
    display: none;
  }

  .hero-card,
  .panel-card,
  .dashboard-hero,
  .hero-lite,
  .auth-panel,
  .auth-aside {
    padding: 20px;
  }

  .cta-row,
  .hero-stats,
  .topbar-actions,
  .modal-actions,
  .footer-actions,
  .resource-head,
  .panel-head,
  .notif-actions {
    flex-wrap: wrap;
  }

  .primary-btn,
  .ghost-btn,
  .danger-btn,
  .social-btn {
    width: 100%;
  }

  .mobile-bottom-nav {
    display: grid;
  }

  .notif-dropdown {
    right: -6px;
    width: min(360px, calc(100vw - 20px));
  }

  .tug-choice-grid,
  .tug-difficulty-grid,
  .tug-stage-layout {
    grid-template-columns: 1fr;
  }

  .tug-stepper {
    grid-template-columns: 1fr;
    gap: 12px;
    justify-items: center;
  }

  .tug-step-line {
    display: none;
  }

  .tug-setup-card {
    padding: 20px 14px 18px;
  }

  .tug-player-panel,
  .tug-arena-panel,
  .tug-result-card {
    padding-left: 0;
    padding-right: 0;
  }

  .tug-stage-footer,
  .tug-wizard-actions {
    flex-direction: column;
  }

  .tug-back-btn,
  .tug-next-btn,
  .tug-link-btn {
    width: 100%;
  }

  .tug-arena-scene {
    min-height: 300px;
  }
}

/* ============================================================
   DESIGN REFRESH — typographie, animations et composants jeux
   ============================================================ */

/* ---------- Typographie ---------- */
h1,
h2,
h3,
h4,
.brand-text strong,
.auth-home-link strong,
.page-title,
.price,
.question-box h2,
.memory-display {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

/* ---------- Apparition douce du contenu ---------- */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 183, 3, 0.45);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(255, 183, 3, 0);
  }
}

@keyframes pop-in {
  0% {
    transform: scale(0.92);
  }
  60% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

.container > * {
  animation: rise-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.container > *:nth-child(2) {
  animation-delay: 60ms;
}

.container > *:nth-child(3) {
  animation-delay: 120ms;
}

.container > *:nth-child(4) {
  animation-delay: 180ms;
}

.container > *:nth-child(n + 5) {
  animation-delay: 240ms;
}

/* ---------- Accessibilite clavier ---------- */
:focus-visible {
  outline: 3px solid rgba(67, 97, 238, 0.45);
  outline-offset: 2px;
}

/* ---------- Sidebar / navigation ---------- */
.brand-pill {
  transform: rotate(-4deg);
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo:hover .brand-pill,
.auth-home-link:hover .brand-pill {
  transform: rotate(4deg) scale(1.06);
}

.nav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.nav-link,
.nav-dropdown-toggle {
  font-weight: 700;
}

.nav-link.active,
.nav-dropdown-toggle.active {
  background: linear-gradient(90deg, rgba(67, 97, 238, 0.14), rgba(123, 47, 190, 0.08));
  box-shadow: inset 3px 0 0 var(--primary);
}

.chevron {
  font-size: 0.8rem;
  color: var(--muted);
  transition: transform 200ms ease;
}

.nav-dropdown.open .chevron {
  transform: rotate(180deg);
}

.nav-sublink.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

/* ---------- Hero d'accueil : formes decoratives ---------- */
.hero-card {
  position: relative;
  overflow: hidden;
}

.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  pointer-events: none;
}

.hero-card::before {
  width: 340px;
  height: 340px;
  top: -150px;
  right: -110px;
}

.hero-card::after {
  width: 220px;
  height: 220px;
  bottom: -110px;
  left: -70px;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

/* ---------- Cartes de fonctionnalites ---------- */
.feature-card {
  transition:
    transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 220ms ease;
}

.feature-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
}

.feature-card:nth-child(1)::after {
  background: linear-gradient(90deg, #4361EE, #7B2FBE);
}

.feature-card:nth-child(2)::after {
  background: linear-gradient(90deg, #F72585, #FB5607);
}

.feature-card:nth-child(3)::after {
  background: linear-gradient(90deg, #FFB703, #FB5607);
}

.feature-card:nth-child(4)::after {
  background: linear-gradient(90deg, #06d6a0, #0BB4A1);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.step-card,
.testimonial-card {
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.step-card:hover,
.testimonial-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.testimonial-card {
  position: relative;
}

.testimonial-card p::before {
  content: "“";
  display: block;
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 0.6;
  margin-bottom: 10px;
  color: var(--primary);
  opacity: 0.5;
}

/* ---------- Cartes de jeux (hub + accueil) ---------- */
.game-summary {
  position: relative;
  overflow: hidden;
}

.game-summary::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.6px, transparent 1.6px);
  background-size: 22px 22px;
  opacity: 0.55;
  pointer-events: none;
}

.game-summary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  transform: translateX(-130%);
  pointer-events: none;
}

.game-summary:hover::after {
  transform: translateX(130%);
  transition: transform 650ms ease;
}

.game-summary > * {
  position: relative;
  z-index: 1;
}

.game-summary {
  transform-style: preserve-3d;
}

.game-summary:hover {
  transform: translateY(-6px) rotateX(5deg) rotateY(-4deg) scale(1.02);
}

.game-summary:hover .game-emoji {
  animation-play-state: paused;
  transform: translateY(-4px) scale(1.16) rotate(-7deg);
}

.game-summary h3 {
  margin: 8px 0 4px;
  font-size: 1.3rem;
  color: white;
}

.game-summary p {
  color: rgba(255, 255, 255, 0.92);
}

.game-emoji {
  transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-summary:hover .game-emoji {
  animation-play-state: paused;
  transform: translateY(-4px) scale(1.16) rotate(-7deg);
}

.arrow {
  transition: transform 200ms ease;
}

.game-summary:hover .arrow {
  transform: translateX(5px);
}

/* ---------- Boutons : retour tactile ---------- */
.primary-btn:active,
.ghost-btn:active,
.danger-btn:active,
.social-btn:active,
.quick-link:active {
  transform: translateY(1px) scale(0.98);
}

/* ---------- Hero de la page Jeux ---------- */
.hero-lite.games-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: none;
  color: white;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.14), transparent 36%),
    linear-gradient(135deg, #7B2FBE 0%, #4361EE 55%, #0BB4A1 120%);
  box-shadow: var(--shadow-md);
}

.games-hero h1 {
  color: white;
}

.games-hero p {
  color: rgba(255, 255, 255, 0.92);
}

.games-hero .eyebrow {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.games-hero-emojis {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  gap: 12px;
  flex-shrink: 0;
  perspective: 700px;
}

.games-hero-emojis span {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1) 55%),
    rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.35),
    inset 0 -5px 8px rgba(0, 0, 0, 0.18),
    0 10px 16px rgba(0, 0, 0, 0.2);
  animation: hero-coin-float 3.6s ease-in-out infinite;
}

@keyframes hero-coin-float {
  0%, 100% { transform: translateY(0) rotateY(0deg); }
  50% { transform: translateY(-6px) rotateY(24deg); }
}

.games-hero-emojis span:nth-child(2n) {
  animation-delay: 0.5s;
}

.games-hero-emojis span:nth-child(3n) {
  animation-delay: 1s;
}

/* ---------- Banniere de jeu ---------- */
.game-card {
  overflow: hidden;
}

.game-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  margin: -22px -22px 20px;
  color: white;
  position: relative;
  overflow: hidden;
}

.game-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1.6px, transparent 1.6px);
  background-size: 20px 20px;
  pointer-events: none;
}

.game-banner > * {
  position: relative;
  z-index: 1;
}

.game-banner.green {
  background: linear-gradient(135deg, #06d6a0 0%, #0BB4A1 60%, #118AB2 100%);
}

.game-banner.blue {
  background: linear-gradient(135deg, #4361EE 0%, #3A0CA3 100%);
}

.game-banner.orange {
  background: linear-gradient(135deg, #FFB703 0%, #FB5607 100%);
}

.game-banner.purple {
  background: linear-gradient(135deg, #7B2FBE 0%, #F72585 100%);
}

.game-banner.pink {
  background: linear-gradient(135deg, #F72585 0%, #FB5607 100%);
}

.game-banner.teal {
  background: linear-gradient(135deg, #0BB4A1 0%, #118AB2 100%);
}

.game-banner-emoji {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  animation: float-soft 3s ease-in-out infinite;
}

.game-banner-copy h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: white;
}

.game-banner-copy p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
}

.game-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: white;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.game-back:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: translateX(-2px);
}

.game-reset-btn {
  margin-left: auto;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  transition:
    transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 160ms ease;
}

.game-reset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.game-reset-btn:active {
  transform: translateY(1px) scale(0.97);
}

/* ---------- Barre de stats de jeu ---------- */
.game-statbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.game-stat {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(67, 97, 238, 0.08);
  border: 1px solid rgba(67, 97, 238, 0.16);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.92rem;
}

/* ---------- Boite de question ---------- */
.question-box {
  text-align: center;
  padding: 26px 22px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(123, 47, 190, 0.06), transparent 42%),
    linear-gradient(180deg, rgba(67, 97, 238, 0.06), rgba(255, 255, 255, 0.6));
  border: 1px solid rgba(67, 97, 238, 0.14);
}

.question-box > strong {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.question-box.result-box {
  background: linear-gradient(180deg, rgba(6, 214, 160, 0.12), rgba(11, 180, 161, 0.05));
  border-color: rgba(6, 214, 160, 0.3);
}

/* ---------- Boutons de reponse (style quiz) ---------- */
.answer-grid {
  gap: 12px;
}

.answer-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  text-align: left;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 3px 0 var(--border);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.answer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--border-strong);
}

.answer-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--border);
}

.answer-letter {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.answer-grid .answer-btn:nth-child(1) .answer-letter {
  background: linear-gradient(135deg, #4361EE, #3A0CA3);
}

.answer-grid .answer-btn:nth-child(2) .answer-letter {
  background: linear-gradient(135deg, #F72585, #FB5607);
}

.answer-grid .answer-btn:nth-child(3) .answer-letter {
  background: linear-gradient(135deg, #FFB703, #FB5607);
}

.answer-grid .answer-btn:nth-child(4) .answer-letter {
  background: linear-gradient(135deg, #06d6a0, #0BB4A1);
}

.answer-grid .answer-btn:nth-child(1):hover {
  border-color: #4361EE;
}

.answer-grid .answer-btn:nth-child(2):hover {
  border-color: #F72585;
}

.answer-grid .answer-btn:nth-child(3):hover {
  border-color: #FFB703;
}

.answer-grid .answer-btn:nth-child(4):hover {
  border-color: #06d6a0;
}

/* ---------- Jeu : algorithme de parcours ---------- */
.routing-grid {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #eef2ff, #e3eaff);
  border: 2px solid #d4dcff;
}

.route-cell {
  border-radius: 12px;
  border: 1px solid #e2e8ff;
  background: white;
  font-size: clamp(1.1rem, 3.4vw, 1.6rem);
  box-shadow: 0 2px 0 rgba(67, 97, 238, 0.08);
  transition: background 200ms ease;
}

.route-cell.start {
  background: rgba(67, 97, 238, 0.14);
  border-color: rgba(67, 97, 238, 0.32);
}

.route-cell.goal {
  background: #fff7e0;
  border-color: #ffd166;
  animation: pulse-glow 1.8s ease-in-out infinite;
}

.route-cell.obstacle {
  background: #fbeee4;
  border-color: #ecd5c2;
}

.route-cell.visited {
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.2), rgba(123, 47, 190, 0.16));
  border-color: rgba(67, 97, 238, 0.3);
  position: relative;
}

.route-cell.visited:not(.start):not(.goal)::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.move-list span {
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(123, 47, 190, 0.08));
  border: 1px solid rgba(67, 97, 238, 0.14);
}

/* ---------- Jeu : memoire ---------- */
.memory-display {
  border: none;
  color: rgba(255, 255, 255, 0.85);
  background:
    radial-gradient(circle at 50% 110%, rgba(67, 97, 238, 0.5), transparent 60%),
    linear-gradient(135deg, #1a1f36, #2b2f6e);
  box-shadow:
    inset 0 0 44px rgba(67, 97, 238, 0.35),
    var(--shadow-md);
}

.memory-display.showing {
  color: white;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.2), transparent 50%),
    linear-gradient(135deg, #4361EE, #7B2FBE);
  animation: pop-in 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* ---------- Jeu : couleurs ---------- */
.color-grid {
  max-width: 480px;
  margin: 18px auto 0;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--border);
}

.color-tile {
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.1);
  transition: transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.color-tile:hover {
  transform: scale(1.07);
}

.color-tile:active {
  transform: scale(0.93);
}

/* ---------- Jeu : drapeaux ---------- */
.flag-frame {
  width: 150px;
  height: 118px;
  margin: 14px auto;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: white;
  border: 3px solid rgba(11, 180, 161, 0.28);
  box-shadow: var(--shadow-sm);
  animation: float-soft 3.4s ease-in-out infinite;
}

.flag-frame .flag-emoji {
  margin: 0;
  font-size: clamp(3rem, 8vw, 4.4rem);
  line-height: 1;
}

/* ---------- Feedback et records ---------- */
.game-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  border-left: 4px solid rgba(67, 97, 238, 0.35);
}

.game-feedback::before {
  content: "💬";
  font-size: 1.1rem;
}

.record-line {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 183, 3, 0.13);
  border: 1px solid rgba(255, 183, 3, 0.3);
  color: #9a5800;
  font-weight: 800;
  font-size: 0.9rem;
}

.record-line::before {
  content: "🏆";
}

/* ---------- FAQ ---------- */
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  font-weight: 800;
  font-size: 1.1rem;
  transition: transform 200ms ease;
}

.faq-item[open] {
  border-color: rgba(67, 97, 238, 0.3);
  box-shadow: var(--shadow-sm);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

/* ---------- Navigation mobile ---------- */
.mobile-link-icon {
  display: block;
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 2px;
}

/* ---------- Responsive des nouveaux composants ---------- */
@media (max-width: 820px) {
  .games-hero-emojis {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar-actions {
    flex-wrap: nowrap;
  }

  .topbar-actions .primary-btn,
  .topbar-actions .ghost-btn {
    width: auto;
    padding: 10px 14px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .game-banner {
    flex-wrap: wrap;
    margin: -20px -20px 18px;
  }

  .game-banner-copy {
    min-width: 0;
  }

  .game-reset-btn {
    margin-left: 0;
    width: 100%;
  }

  .routing-grid,
  .color-grid {
    max-width: 100%;
  }
}

/* ---------- Mouvement reduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
