.cdj-game {
  --cdj-ink: var(--rde-jeux-text, #1a2332);
  --cdj-muted: var(--rde-jeux-text-muted, #5c6b7a);
  --cdj-line: var(--rde-jeux-card-border, #d7dee6);
  --cdj-accent: #0f6e56;
  --cdj-higher: #1f6feb;
  --cdj-lower: #c2410c;
  --cdj-win: #0f6e56;
  --cdj-lose: #9a3412;
  --cdj-link: var(--rde-jeux-accent, #075ac8);
  --cdj-link-hover: var(--rde-jeux-button-hover, #054a9e);
  --cdj-bg: linear-gradient(160deg, #f4f7fa 0%, #e8eef4 55%, #f7f3ea 100%);
  max-width: 34rem;
  margin: 1.5rem auto;
  padding: 1.75rem 1.5rem 1.5rem;
  color: var(--cdj-ink);
  background: var(--cdj-bg);
  border: 1px solid var(--cdj-line);
  border-radius: 4px;
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

.cdj-game__eyebrow {
  margin: 0 0 0.5rem;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cdj-muted);
}

.cdj-game__question {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.25;
  font-weight: 600;
}

.cdj-game__blank {
  display: inline-block;
  min-width: 2.5ch;
  padding: 0 0.15em;
  border-bottom: 2px solid var(--cdj-accent);
  color: var(--cdj-accent);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  letter-spacing: 0.05em;
}

.cdj-game__hint {
  margin: 0 0 1.25rem;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  color: var(--cdj-muted);
}

.cdj-game__choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.cdj-game__choice {
  padding: 0.85rem 0.75rem;
  border: 1px solid var(--cdj-line);
  border-radius: 3px;
  background: #fff;
  color: var(--cdj-ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.cdj-game__choice:hover:not(:disabled) {
  border-color: var(--cdj-ink);
  transform: translateY(-1px);
}

.cdj-game__choice:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.cdj-game__choice.is-wrong {
  border-color: var(--cdj-lose);
  background: #fff5f2;
  color: var(--cdj-lose);
  text-decoration: line-through;
}

.cdj-game__choice.is-correct {
  border-color: var(--cdj-win);
  background: #eef8f4;
  color: var(--cdj-win);
  opacity: 1;
}

.cdj-game__form {
  display: none;
}

.cdj-game__status {
  min-height: 1.4em;
  margin: 0.85rem 0 0.5rem;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
}

.cdj-game__status.is-higher { color: var(--cdj-higher); }
.cdj-game__status.is-lower { color: var(--cdj-lower); }
.cdj-game__status.is-win { color: var(--cdj-win); }
.cdj-game__status.is-lose { color: var(--cdj-lose); }

.cdj-game__tries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.cdj-game__try {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--cdj-line);
  background: rgba(255, 255, 255, 0.7);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.cdj-game__try-hint {
  font-weight: 600;
}

.cdj-game__result {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cdj-line);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.cdj-game__answer {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.cdj-game__link {
  color: var(--cdj-link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cdj-game__link:hover,
.cdj-game__link:focus {
  color: var(--cdj-link-hover);
}

.cdj-game--empty {
  text-align: center;
  color: var(--cdj-muted);
}

.cdj-game .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .cdj-game {
    animation: cdj-fade 0.45s ease-out both;
  }

  .cdj-game__try {
    animation: cdj-slide 0.28s ease-out both;
  }

  .cdj-game__status.is-higher,
  .cdj-game__status.is-lower {
    animation: cdj-pulse 0.35s ease-out;
  }
}

@keyframes cdj-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes cdj-slide {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

@keyframes cdj-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
