/* Source: npm run build → rank02/css/main.css, rank03/css/main.css */
:root {
  --bg: #070910;
  --surface: #0f121c;
  --surface2: #151a28;
  --surface-glass: rgba(18, 22, 34, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --accent: #8b7cff;
  --accent-deep: #5b4fd4;
  --accent2: #5ee7b0;
  --text: #eef0f8;
  /* Meets ~4.5:1 on --bg for WCAG AA body-sized text */
  --text-muted: #9aa3b8;
  --code-bg: #0d1117;
  --radius: 16px;
  --shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.35);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .modal-backdrop,
  .modal,
  .lang-wheel-ring-bg,
  .suggest-fab,
  .transcendence-paddle,
  .transcendence-ball,
  .in-progress-text {
    animation: none !important;
  }
  .modal {
    opacity: 1;
    transform: none;
  }
  .card {
    transition: none !important;
  }
  .card:hover {
    transform: none !important;
  }
  .lang-btn:active {
    transform: none !important;
  }
}

html { scroll-behavior: smooth; }

.page-i18n-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition:
    opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-i18n-root.is-lang-switching {
  opacity: 0;
  transform: translateY(10px) scale(0.992);
  filter: blur(4px);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .page-i18n-root {
    transition: none;
  }
  .page-i18n-root.is-lang-switching {
    transform: none;
    filter: none;
  }
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(124, 110, 247, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(94, 231, 176, 0.05), transparent 50%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Background grid */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 110, 247, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 110, 247, 0.038) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  contain: strict;
  transform: translateZ(0);
}
body > *:not(.bg-grid):not(.modal-backdrop) { position: relative; z-index: 1; }

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 16, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 0 rgba(124, 110, 247, 0.12);
  padding: 0 24px;
  transform: translateZ(0);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  min-height: 64px;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  outline-offset: 4px;
}
.logo:focus-visible {
  outline: 2px solid var(--accent2);
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  line-height: 1;
  box-shadow:
    0 4px 20px rgba(139, 124, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.logo-text-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  line-height: 1.2;
  min-width: 0;
}

.logo-brand {
  font-size: clamp(14px, 2.8vw, 17px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-b-42 {
  color: #fff;
}

.logo-b-exam {
  background: linear-gradient(135deg, #c4b5fd 0%, var(--accent) 50%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-b-rank {
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

.logo-sub {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  gap: 3px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.lang-btn {
  min-width: 38px;
  padding: 7px 9px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.lang-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.lang-btn.is-active {
  color: #fff;
  background: linear-gradient(145deg, rgba(124, 110, 247, 0.55), rgba(91, 79, 212, 0.45));
  box-shadow:
    0 0 0 1px rgba(124, 110, 247, 0.5),
    0 4px 16px rgba(124, 110, 247, 0.25);
}

.lang-btn:active {
  transform: scale(0.96);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

/* GTA V Language Wheel Trigger Button */
.lang-wheel-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--surface-glass, rgba(20, 24, 38, 0.65));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  color: var(--text, #f3f4f6);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.lang-wheel-trigger:hover {
  border-color: rgba(139, 124, 255, 0.55);
  box-shadow: 0 0 20px rgba(139, 124, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-2px) scale(1.03);
}

.lang-wheel-trigger-flag {
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
}

.lang-wheel-trigger-label {
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.lang-wheel-trigger-arrow {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, color 0.2s ease;
}

.lang-wheel-trigger:hover .lang-wheel-trigger-arrow {
  transform: translateY(2px);
  color: #8b7cff;
}

/* GTA V Radial Language Wheel Overlay */
.lang-wheel-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  background: rgba(5, 7, 14, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lang-wheel-overlay.is-open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.lang-wheel-card {
  position: relative;
  width: 420px;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lang-wheel-overlay.is-open .lang-wheel-card {
  transform: scale(1);
}

.lang-wheel-close {
  position: absolute;
  top: -20px;
  right: -10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 20;
}

.lang-wheel-close:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: #ef4444;
  transform: scale(1.12);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
}

.lang-wheel-title-hud {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  white-space: nowrap;
}

.lang-wheel-title-hud span {
  color: #8b7cff;
  text-shadow: 0 0 12px rgba(139, 124, 255, 0.6);
}

/* Outer Glow Ring */
.lang-wheel-ring-bg {
  position: absolute;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  border: 2px dashed rgba(139, 124, 255, 0.25);
  box-shadow: inset 0 0 40px rgba(139, 124, 255, 0.08);
  animation: wheelRotate 45s linear infinite;
  animation-play-state: paused;
  pointer-events: none;
}

.lang-wheel-overlay.is-open .lang-wheel-ring-bg {
  animation-play-state: running;
}

@keyframes wheelRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Center Core Hub */
.lang-wheel-center {
  position: absolute;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(30, 20, 50, 0.95), rgba(12, 10, 22, 0.98));
  border: 2px solid rgba(139, 124, 255, 0.5);
  box-shadow: 0 0 35px rgba(139, 124, 255, 0.35), inset 0 0 20px rgba(139, 124, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 5;
  pointer-events: none;
  padding: 10px;
}

.lang-wheel-center-flag {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lang-wheel-center-name {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  line-height: 1.1;
}

.lang-wheel-center-sub {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ec4899;
  margin-top: 3px;
}

/* Sector Buttons */
.lang-wheel-sector {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 68px;
  margin-top: -34px;
  margin-left: -34px;
  transform: rotate(var(--angle)) translate(145px) rotate(calc(-1 * var(--angle)));
  border-radius: 50%;
  background: rgba(18, 14, 32, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, border-color 0.2s, box-shadow 0.2s;
  user-select: none;
  z-index: 10;
}

.lang-wheel-sector:hover,
.lang-wheel-sector.is-selected {
  transform: rotate(var(--angle)) translate(145px) rotate(calc(-1 * var(--angle))) scale(1.22);
  background: linear-gradient(135deg, rgba(139, 124, 255, 0.95), rgba(236, 72, 153, 0.95));
  border-color: #ffffff;
  box-shadow: 0 0 25px rgba(139, 124, 255, 0.85), 0 0 50px rgba(236, 72, 153, 0.6);
  z-index: 15;
}

.lang-wheel-sector.is-active-locale {
  border-color: #5ee7b0;
  box-shadow: 0 0 16px rgba(94, 231, 176, 0.6);
}

.sector-flag {
  font-size: 1.4rem;
  line-height: 1;
}

.sector-code {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.9);
}

.lang-wheel-sector.sector-0 { --angle: 270deg; }
.lang-wheel-sector.sector-1 { --angle: 310deg; }
.lang-wheel-sector.sector-2 { --angle: 350deg; }
.lang-wheel-sector.sector-3 { --angle: 30deg; }
.lang-wheel-sector.sector-4 { --angle: 70deg; }
.lang-wheel-sector.sector-5 { --angle: 110deg; }
.lang-wheel-sector.sector-6 { --angle: 150deg; }
.lang-wheel-sector.sector-7 { --angle: 190deg; }
.lang-wheel-sector.sector-8 { --angle: 230deg; }

/* Search */
#search {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  width: 240px;
  outline: none;
  transition: border-color 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
#search::placeholder { color: var(--text-muted); }
#search:focus {
  border-color: rgba(139, 124, 255, 0.55);
  box-shadow:
    0 0 0 3px rgba(124, 110, 247, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Main */
main {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 56px) clamp(20px, 4vw, 28px) 88px;
  flex: 1;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 56px;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  background: linear-gradient(125deg, #ffffff 0%, #e0dcff 38%, var(--accent) 62%, var(--accent2) 105%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}
.hero-sub {
  color: var(--text-muted);
  font-size: clamp(15px, 2.5vw, 17px);
  line-height: 1.6;
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 16px;
}
.hero-notice {
  background: rgba(251, 146, 60, 0.08);
  border: 1px solid rgba(251, 146, 60, 0.28);
  border-radius: 12px;
  padding: 10px 16px;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 22px;
  font-size: 13px;
  line-height: 1.5;
  color: #fdba74;
}
.hero-notice strong {
  color: #fb923c;
  font-weight: 700;
}
.stats-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.badge {
  background: linear-gradient(135deg, rgba(94, 231, 176, 0.12), rgba(94, 231, 176, 0.04));
  border: 1px solid rgba(94, 231, 176, 0.28);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--accent2);
  font-weight: 600;
  box-shadow: 0 0 24px rgba(94, 231, 176, 0.06);
}

/* Filters */
.filter-bar {
  max-width: 1100px;
  margin: 0 auto 36px;
  padding: 0 24px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-group-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  flex: 0 0 auto;
  min-width: 4.5rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.filter-chip {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(21, 26, 40, 0.75);
  color: #adb5c9;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.filter-chip:hover {
  color: var(--text);
  border-color: rgba(124, 110, 247, 0.35);
}

.filter-chip.is-active {
  color: #fff;
  background: linear-gradient(145deg, rgba(124, 110, 247, 0.55), rgba(91, 79, 212, 0.45));
  border-color: rgba(124, 110, 247, 0.5);
  box-shadow: 0 0 0 1px rgba(124, 110, 247, 0.35);
}

.filter-chip:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .filter-chip {
    transition: none;
  }
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Card */
.card {
  background: linear-gradient(165deg, rgba(22, 26, 40, 0.92) 0%, rgba(15, 18, 28, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition:
    transform 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.25s var(--ease-out);
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(139, 124, 255, 0.42);
  box-shadow:
    0 20px 56px rgba(124, 110, 247, 0.16),
    0 0 0 1px rgba(124, 110, 247, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card:hover::before { opacity: 1; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-num {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(124,110,247,0.12);
  border-radius: 6px;
  padding: 2px 8px;
  letter-spacing: 0.5px;
}

.diff-pill {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid transparent;
}

.diff-pill--easy {
  color: #6ee7b7;
  background: rgba(110, 231, 183, 0.12);
  border-color: rgba(110, 231, 183, 0.28);
}

.diff-pill--medium {
  color: #fcd34d;
  background: rgba(252, 211, 77, 0.12);
  border-color: rgba(252, 211, 77, 0.28);
}

.diff-pill--hard {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
}

.diff-pill--lv1 {
  color: #6ee7b7;
  background: rgba(110, 231, 183, 0.12);
  border-color: rgba(110, 231, 183, 0.28);
}

.diff-pill--lv2 {
  color: #fcd34d;
  background: rgba(252, 211, 77, 0.12);
  border-color: rgba(252, 211, 77, 0.28);
}

.diff-pill--lv3 {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.14);
  border-color: rgba(251, 146, 60, 0.35);
}

.diff-pill--lv4 {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
}

.diff-pill--lv5 {
  color: #f472b6;
  background: rgba(244, 114, 182, 0.12);
  border-color: rgba(244, 114, 182, 0.28);
}

.diff-pill--lv6 {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.28);
}

.card h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc--prototype {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.5;
}
.card-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-file {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent2);
  background: rgba(94,231,176,0.08);
  border-radius: 5px;
  padding: 2px 8px;
}
.card-arrow {
  color: var(--text-muted);
  font-size: 18px;
  transition: transform 0.2s, color 0.2s;
}
.card:hover .card-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

button.card {
  display: block;
  width: 100%;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* No results */
.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 0;
  font-size: 16px;
}
.hidden { display: none !important; }


/* Modal — must stay position:fixed (do not add .modal-backdrop to body > * stacking rule) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: rgba(6, 8, 14, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  isolation: isolate;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: linear-gradient(165deg, rgba(22, 26, 40, 0.98) 0%, rgba(12, 15, 24, 0.99) 100%);
  border: 1px solid rgba(139, 124, 255, 0.32);
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: min(85vh, 100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 24px 80px rgba(0,0,0,0.45);
  animation: modalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn {
  from { transform: translateY(16px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  padding: 28px 28px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(22, 26, 40, 0.98) 0%, rgba(18, 22, 34, 0.96) 100%);
  border-radius: 20px 20px 0 0;
  z-index: 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: visible;
}

.modal-header > div:first-child {
  min-width: 0;
  flex: 1;
}

.modal-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
}

.modal-header-actions .close-btn {
  margin-left: 0;
}
.modal-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(124,110,247,0.12);
  border-radius: 6px;
  padding: 2px 8px;
  display: inline-block;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.modal-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-meta-row .modal-num {
  margin-bottom: 0;
}

.modal-header h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}
.modal-file {
  font-size: 12px;
  color: var(--accent2);
  background: rgba(94,231,176,0.08);
  border-radius: 5px;
  padding: 2px 8px;
}

.close-btn {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 16px;
  transition: background 0.22s var(--ease-out), color 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(139, 124, 255, 0.2);
}

.moulinette-box {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.12) 0%, rgba(239, 68, 68, 0.08) 100%);
  border: 1px solid rgba(251, 146, 60, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(251, 146, 60, 0.06);
}

.moulinette-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.moulinette-content {
  flex: 1;
  min-width: 0;
}

.moulinette-title {
  font-size: 12px;
  font-weight: 700;
  color: #fb923c;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.moulinette-body {
  font-size: 13px;
  color: #f1f5f9;
  line-height: 1.55;
}

.moulinette-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.modal-body { padding: 24px 28px 28px; }

.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  margin-top: 24px;
}
.section-label:first-child { margin-top: 0; }

#modal-desc {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.code-block {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
  background: var(--code-bg);
  border: 1px solid rgba(124,110,247,0.2);
  border-radius: 10px;
  padding: 16px;
  color: #c9d1d9;
  white-space: pre-wrap;
  overflow-x: auto;
}

.example-item {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
}
.example-item .ex-in { color: #7dd3fc; }
.example-item .ex-out { color: var(--accent2); }
.example-item .ex-label { color: var(--text-muted); font-size: 11px; }
.example-item .ex-label.ex-label-spaced { margin-top: 6px; }

.modal-contribute-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    0 0 0 1px rgba(244, 63, 94, 0.45),
    0 8px 24px rgba(244, 63, 94, 0.26);
  transition:
    transform 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    filter 0.2s var(--ease-out);
  animation: suggestPulse 3.2s ease-in-out infinite;
}

.modal-contribute-btn:hover {
  animation-play-state: paused;
  transform: scale(1.04) translateY(-1px);
  box-shadow:
    0 0 0 2px rgba(244, 63, 94, 0.6),
    0 12px 28px rgba(244, 63, 94, 0.40);
  filter: brightness(1.08);
}

.modal-contribute-btn--header {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 999px;
}

.modal-contribute-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.modal-contribute-hint {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(288px, calc(100vw - 48px));
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(244, 63, 94, 0.45);
  background: linear-gradient(165deg, rgba(26, 30, 46, 0.99), rgba(14, 17, 28, 0.995));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(244, 63, 94, 0.25),
    0 12px 36px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 5;
}

.modal-contribute-hint__title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
  color: #f4f4ff;
}

.modal-contribute-hint__sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-muted);
}

.modal-contribute-hint::after {
  content: '';
  position: absolute;
  right: 18px;
  top: -7px;
  width: 12px;
  height: 12px;
  background: linear-gradient(165deg, rgba(26, 30, 46, 0.99), rgba(14, 17, 28, 0.995));
  border-left: 1px solid rgba(244, 63, 94, 0.45);
  border-top: 1px solid rgba(244, 63, 94, 0.45);
  transform: rotate(45deg);
}

.modal-contribute-hint.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .modal-contribute-hint {
    transition-duration: 0.01ms;
    transform: translateY(0);
  }

  .modal-contribute-hint.is-visible {
    transform: none;
  }
}

/* Footer */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, transparent 0%, rgba(124, 110, 247, 0.04) 100%);
  text-align: center;
  padding: 28px 24px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-links {
  margin-top: 10px;
  font-size: 13px;
}
.footer-links a {
  color: var(--accent);
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}
.footer-sep {
  color: var(--text-muted);
  opacity: 0.5;
  margin: 0 4px;
}

.footer-version {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  opacity: 0.9;
}

/* Suggest button + hint */
.suggest-fab {
  position: fixed !important;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 260;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    0 0 0 1px rgba(244, 63, 94, 0.45),
    0 8px 24px rgba(244, 63, 94, 0.3);
  transition: transform 0.2s var(--ease-out), filter 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
  animation: suggestPulse 3.2s ease-in-out infinite;
  contain: layout style;
  transform: translateZ(0);
}

.suggest-fab:hover {
  animation-play-state: paused;
  transform: scale(1.05) translateY(-1px) translateZ(0);
  filter: brightness(1.08);
  box-shadow:
    0 0 0 2px rgba(244, 63, 94, 0.6),
    0 12px 32px rgba(244, 63, 94, 0.45);
}

.suggest-fab__icon {
  flex-shrink: 0;
  opacity: 0.98;
}

.suggest-fab__label {
  white-space: nowrap;
}

@keyframes suggestPulse {
  0%,
  100% {
    transform: scale(1) translateZ(0);
  }
  50% {
    transform: scale(1.035) translateZ(0);
  }
}

.suggest-hint {
  position: fixed !important;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(68px, calc(16px + env(safe-area-inset-bottom) + 44px));
  z-index: 259;
  width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: linear-gradient(165deg, rgba(26, 30, 46, 0.99), rgba(14, 17, 28, 0.995));
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(124, 110, 247, 0.25),
    0 12px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.suggest-hint__title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
  color: #f4f4ff;
}

.suggest-hint__sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-muted);
}

.suggest-hint::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: linear-gradient(165deg, rgba(26, 30, 46, 0.99), rgba(14, 17, 28, 0.995));
  border-right: 1px solid rgba(167, 139, 250, 0.45);
  border-bottom: 1px solid rgba(167, 139, 250, 0.45);
  transform: rotate(45deg);
}

.suggest-hint.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

@media (max-width: 600px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    min-height: 64px;
    padding: 12px 0;
    gap: 12px;
  }
  .header-right {
    width: 100%;
    justify-content: flex-end;
  }
  #search { width: min(100%, 200px); flex: 1; min-width: 0; }
  .lang-switcher { justify-content: space-between; width: 100%; }
  .lang-btn { flex: 1; min-width: 0; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-group-label { min-width: 0; }
  .modal { max-height: 90vh; }
  .modal-header, .modal-body { padding: 20px; }
  .suggest-fab {
    left: 16px;
    right: 16px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .suggest-hint {
    left: 16px;
    right: 16px;
    width: auto;
    bottom: max(64px, calc(12px + env(safe-area-inset-bottom) + 44px));
  }
  .suggest-hint::after {
    right: calc(50% - 6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .suggest-fab {
    animation: none;
  }

  .suggest-hint {
    transition-duration: 0.01ms;
    transform: translateY(8px);
  }

  .suggest-hint.is-visible {
    transform: translateY(0);
  }
}

/* Rank 06 Transcendence Teaser Component */
.transcendence-hero {
  margin: 24px auto 48px;
  max-width: 860px;
}

.transcendence-card {
  background: linear-gradient(165deg, rgba(26, 18, 38, 0.95) 0%, rgba(15, 12, 24, 0.98) 100%);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: calc(var(--radius) + 8px);
  padding: clamp(24px, 5vw, 40px);
  box-shadow:
    0 24px 64px rgba(236, 72, 153, 0.18),
    0 0 0 1px rgba(236, 72, 153, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.transcendence-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ec4899, #d946ef, #8b7cff);
}

.transcendence-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.transcendence-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f472b6;
  background: rgba(236, 72, 153, 0.14);
  border: 1px solid rgba(236, 72, 153, 0.3);
  padding: 6px 14px;
  border-radius: 100px;
}

.transcendence-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ec4899;
  box-shadow: 0 0 10px #ec4899;
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

.transcendence-term {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: #f0abfc;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(236, 72, 153, 0.2);
}

.transcendence-arcade {
  position: relative;
  width: 100%;
  height: 180px;
  background: #080711;
  border: 1px solid rgba(236, 72, 153, 0.25);
  border-radius: 14px;
  margin-bottom: 28px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 30px rgba(236, 72, 153, 0.15);
}

.transcendence-paddle {
  position: absolute;
  top: 0;
  width: 10px;
  height: 54px;
  background: linear-gradient(180deg, #ec4899, #d946ef);
  border-radius: 6px;
  box-shadow: 0 0 14px #ec4899;
  will-change: transform;
}

.transcendence-paddle-left {
  left: 24px;
  animation: paddle-move-left 4s ease-in-out infinite alternate;
}

.transcendence-paddle-right {
  right: 24px;
  animation: paddle-move-right 4s ease-in-out infinite alternate;
}

.transcendence-ball {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 16px #fff, 0 0 24px #ec4899;
  animation: ball-bounce 4s linear infinite;
  will-change: transform;
}

.transcendence-net {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  background: repeating-linear-gradient(to bottom, rgba(236, 72, 153, 0.3) 0, rgba(236, 72, 153, 0.3) 8px, transparent 8px, transparent 16px);
  transform: translateX(-50%);
}

.transcendence-score {
  position: absolute;
  top: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  gap: 48px;
}

@keyframes paddle-move-left {
  0% { transform: translate3d(0, 20px, 0); }
  50% { transform: translate3d(0, 100px, 0); }
  100% { transform: translate3d(0, 40px, 0); }
}

@keyframes paddle-move-right {
  0% { transform: translate3d(0, 90px, 0); }
  50% { transform: translate3d(0, 30px, 0); }
  100% { transform: translate3d(0, 110px, 0); }
}

@keyframes ball-bounce {
  0% { transform: translate3d(38px, 40px, 0); }
  25% { transform: translate3d(calc(50vw - 45px), 130px, 0); }
  50% { transform: translate3d(calc(100% - 52px), 60px, 0); }
  75% { transform: translate3d(calc(50vw - 45px), 120px, 0); }
  100% { transform: translate3d(38px, 40px, 0); }
}

.transcendence-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.transcendence-feat-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 16px 18px;
}

.transcendence-feat-item h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.transcendence-feat-item p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.transcendence-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.transcendence-actions a,
.transcendence-actions a.btn-primary,
.transcendence-actions a.btn-pink {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 12px 24px !important;
  border-radius: 12px !important;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  border: none !important;
  cursor: pointer !important;
  color: #ffffff !important;
  -webkit-text-fill-color: initial !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
}

.transcendence-actions .btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 12px 24px !important;
  border-radius: 12px !important;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  background: linear-gradient(135deg, #7c6ef7 0%, #5b4fd4 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 20px rgba(124, 110, 247, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out) !important;
}

.transcendence-actions .btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 36px rgba(124, 110, 247, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.transcendence-actions .btn-pink {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 12px 24px !important;
  border-radius: 12px !important;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out) !important;
}

.transcendence-actions .btn-pink:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 36px rgba(236, 72, 153, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.in-progress-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.1rem, 2.8vw, 1.65rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 12px 0 24px;
  background: linear-gradient(90deg, #ec4899 0%, #f472b6 35%, #8b7cff 70%, #ec4899 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine-text 3s linear infinite, float-pulse 2.2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 20px rgba(236, 72, 153, 0.45));
}

@keyframes shine-text {
  to { background-position: 200% center; }
}

@keyframes float-pulse {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

/* RTL Support */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", "Geeza Pro", "Cairo", sans-serif;
}

/* Code, prototypes, signatures and examples must always remain LTR and left-aligned */
html[dir="rtl"] code,
html[dir="rtl"] pre,
html[dir="rtl"] .modal-signature,
html[dir="rtl"] .modal-code,
html[dir="rtl"] .code-block,
html[dir="rtl"] .example-box,
html[dir="rtl"] .example-item,
html[dir="rtl"] .card-signature,
html[dir="rtl"] .signature-code,
html[dir="rtl"] .signature-preview,
html[dir="rtl"] .param-box,
html[dir="rtl"] .output-box,
html[dir="rtl"] .mono,
html[dir="rtl"] .badge-lang,
html[dir="rtl"] .badge-python,
html[dir="rtl"] .modal-filename,
html[dir="rtl"] pre code {
  direction: ltr;
  text-align: left;
}

/* Modal header & contribute tooltip alignment */
html[dir="rtl"] .modal-contribute-stack {
  align-items: flex-start;
}

html[dir="rtl"] .modal-contribute-hint {
  right: auto;
  left: 0;
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .modal-contribute-hint::after {
  right: auto;
  left: 18px;
}

/* Modal text and headings */
html[dir="rtl"] .section-label,
html[dir="rtl"] .moulinette-title {
  letter-spacing: normal;
  text-transform: none;
}

html[dir="rtl"] #modal-desc {
  direction: rtl;
  text-align: right;
  line-height: 1.85;
}

html[dir="rtl"] #modal-desc code {
  direction: ltr;
  display: inline-block;
  unicode-bidi: embed;
}

/* Moulinette banner */
html[dir="rtl"] .moulinette-box {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .moulinette-title {
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
}

html[dir="rtl"] .moulinette-body {
  text-align: right;
  line-height: 1.6;
}

html[dir="rtl"] .moulinette-body code {
  direction: ltr;
  display: inline-block;
  unicode-bidi: embed;
}

/* Numbers and tags */
html[dir="rtl"] .modal-num,
html[dir="rtl"] .card-num,
html[dir="rtl"] .card-title,
html[dir="rtl"] .modal-title {
  unicode-bidi: embed;
}

/* Floating Action Button (FAB) and hint */
html[dir="rtl"] .suggest-hint {
  text-align: right;
}

/* Search input */
html[dir="rtl"] #search {
  text-align: right;
}

/* Filter chips */
html[dir="rtl"] .filter-chips {
  flex-direction: row;
}

/* Stats badges */
html[dir="rtl"] .stats-row {
  flex-direction: row;
}
