/* anglaisgratuit.fr games: the dark game card and its screens. Uses the site tokens, with fallbacks. */

.g-card {
  --g-lime: var(--lime, #C8FF2E);
  --g-violet: var(--violet, #9B85FF);
  --g-ink: var(--ink, #0D0D0F);
  --g-dark: var(--dark, #0D0D0F);
  --g-dark-2: var(--dark-2, #1F1F25);
  --g-line: var(--dark-line, #3A3A44);
  --g-muted: var(--on-dark-muted, #C9C9D1);
  --g-ko: var(--ko-on-dark, #FF7A7A);
  --g-display: var(--display, "Unbounded", "Arial Black", system-ui, sans-serif);
  --g-body: var(--body, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --g-r-lg: var(--r-lg, 28px);
  --g-r-md: var(--r-md, 20px);
  --g-r-sm: var(--r-sm, 14px);
  box-sizing: border-box;
  max-width: 760px;
  margin: 1.5rem auto 2.5rem;
  padding: clamp(18px, 4.5vw, 40px);
  background: var(--g-dark);
  color: #fff;
  border-radius: var(--g-r-lg);
  font-family: var(--g-body);
  line-height: 1.45;
  overflow-wrap: break-word;
  position: relative;
}
.g-card *, .g-card *::before, .g-card *::after { box-sizing: border-box; }
.g-card p { margin: 0; }
.g-card [lang="en"], .g-card strong, .g-card b { color: inherit; }
.g-card a { color: var(--g-lime); }
.g-card :focus-visible { outline: 3px solid var(--g-lime); outline-offset: 3px; }
.g-card [tabindex="-1"]:focus { outline: none; }

.g-sr, .g-offscreen {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.g-offscreen { position: fixed !important; left: -9999px; top: 0; }

.g-stage { display: flex; flex-direction: column; gap: 22px; }
.g-screen { display: flex; flex-direction: column; gap: 18px; }

.g-eyebrow {
  font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--g-muted);
}
.g-title {
  font-family: var(--g-display); font-weight: 800; font-size: clamp(1.35rem, 5vw, 2rem); line-height: 1.15;
  margin: 0; color: #fff; letter-spacing: -.01em;
}
.g-muted { color: var(--g-muted); }
.g-strong { font-weight: 700; }
.g-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--g-lime); font-weight: 600; text-underline-offset: 3px; }

/* ---------- buttons ---------- */

.g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 26px; border-radius: 999px; border: 2px solid transparent;
  font: 700 1rem/1.1 var(--g-body); cursor: pointer; text-decoration: none;
  background: #fff; color: var(--g-ink);
  transition: transform .12s ease, background-color .12s ease;
}
.g-btn:hover { transform: translateY(-1px); }
.g-btn:active { transform: translateY(1px); }
.g-btn.is-lime { background: var(--g-lime); color: var(--g-ink); }
.g-btn.is-ghost { background: transparent; color: #fff; border-color: var(--g-line); }
.g-btn.is-ghost:hover { border-color: #fff; }
.g-btn.is-big { min-height: 60px; padding: 14px 40px; font-size: 1.1rem; }
.g-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.g-chip {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px;
  background: var(--g-dark-2); border: 1px solid var(--g-line); color: #fff; font-weight: 700; font-size: .9rem;
}
.g-chip.is-lime { background: var(--g-lime); color: var(--g-ink); border-color: var(--g-lime); }

.g-ico { width: 1.2em; height: 1.2em; flex: none; }

.g-say {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--g-line);
  background: var(--g-dark-2); color: #fff; cursor: pointer; vertical-align: middle;
}
.g-say:hover { border-color: var(--g-lime); color: var(--g-lime); }
.g-say .g-ico { width: 24px; height: 24px; }
.no-speech .g-say { display: none; }

/* ---------- header, progress ---------- */

.g-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 16px; }
.g-count { font-weight: 700; color: var(--g-muted); font-size: .9rem; }
.g-segs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.g-seg { height: 8px; border-radius: 99px; background: var(--g-line); }
.g-seg.is-ok { background: var(--g-lime); }
.g-seg.is-ko { background: var(--g-ko); }
.g-seg.is-current { box-shadow: 0 0 0 2px #fff inset; background: var(--g-dark-2); }
.g-seg.is-current.is-ok { background: var(--g-lime); }
.g-seg.is-current.is-ko { background: var(--g-ko); }

.g-bar { height: 10px; border-radius: 99px; background: var(--g-line); overflow: hidden; }
.g-bar-fill {
  display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--g-lime);
  transform-origin: left center; transform: scaleX(var(--g-p, 1));
}
.g-bar.is-low .g-bar-fill { background: var(--g-ko); }

/* ---------- questions ---------- */

.g-prompt, .g-q { display: flex; flex-direction: column; gap: 10px; }
.g-instr { color: var(--g-muted); font-size: .92rem; }
.g-sentence {
  font-family: var(--g-display); font-weight: 700; font-size: clamp(1.25rem, 4.6vw, 1.8rem); line-height: 1.35; color: #fff;
}
.g-nowrap { white-space: nowrap; }
.g-blank {
  display: inline-block; width: 3.2em; height: .95em; margin: 0 .15em; vertical-align: -.1em;
  border-bottom: 4px solid var(--g-lime);
}
.g-ask { font-size: clamp(1.1rem, 4vw, 1.35rem); font-weight: 600; }
.g-ask-word {
  font-family: var(--g-display); font-weight: 800; font-size: clamp(1.6rem, 7vw, 2.4rem); color: var(--g-lime); line-height: 1.15;
}

.g-word-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.g-word {
  font-family: var(--g-display); font-weight: 800; color: #fff; line-height: 1.05; letter-spacing: -.01em;
  font-size: clamp(2.2rem, 11vw, 4rem); min-width: 0;
}
.g-word.is-long { font-size: clamp(1.6rem, 7.4vw, 3rem); }
.g-word.is-xl { font-size: clamp(1.3rem, 5.6vw, 2.2rem); }
.g-say-slot { display: inline-flex; }
.g-fr { font-size: 1rem; }
.g-means { font-size: clamp(1.1rem, 4.4vw, 1.45rem); }
.g-means strong { color: var(--g-lime); }

.g-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.g-options.is-stacked { grid-template-columns: 1fr; }
.g-options.is-pair { grid-template-columns: 1fr 1fr; }
.g-opt {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px;
  min-height: 64px; padding: 12px 16px; border-radius: var(--g-r-md);
  border: 2px solid var(--g-line); background: var(--g-dark-2); color: #fff;
  font: 700 clamp(1rem, 3.8vw, 1.2rem)/1.2 var(--g-body); text-align: center; cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
}
.g-opt:hover:not(:disabled) { border-color: var(--g-lime); transform: translateY(-2px); }
.g-opt:disabled { cursor: default; opacity: .55; }
.g-opt.is-right { opacity: 1; background: var(--g-lime); border-color: var(--g-lime); color: var(--g-ink); }
.g-opt.is-wrong { opacity: 1; background: transparent; border-color: var(--g-ko); color: var(--g-ko); border-style: dashed; }
.g-tag { flex-basis: 100%; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.g-hint { font-size: .78rem; font-weight: 600; color: var(--g-muted); }
.g-opt .g-hint { flex-basis: 100%; }
.g-opt.is-right .g-hint { color: var(--g-ink); }
.g-faux-amis .g-opt { min-height: 76px; font-size: clamp(1.05rem, 4.2vw, 1.3rem); }
.g-yes:not(:disabled) { background: #fff; color: var(--g-ink); border-color: #fff; }
.g-yes:not(:disabled) .g-hint { color: #55555F; }

/* ---------- feedback ---------- */

.g-feedback:empty { display: none; }
.g-feedback { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.g-verdict { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
.g-verdict .g-ico { width: 30px; height: 30px; padding: 5px; border-radius: 50%; }
.g-verdict.is-ok .g-ico { background: var(--g-lime); color: var(--g-ink); }
.g-verdict.is-ko { color: var(--g-ko); }
.g-verdict.is-ko .g-ico { background: var(--g-ko); color: var(--g-ink); }
.g-explain {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: var(--g-r-sm);
  background: var(--g-dark-2); border: 1px solid var(--g-line);
}
.g-filled { font-weight: 600; }

/* ---------- Verb Rush ---------- */

.g-hud { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.g-score { display: flex; flex-direction: column; gap: 2px; }
.g-score-num { display: inline-block; font-family: var(--g-display); font-weight: 800; font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1; color: #fff; }
.g-combo { display: flex; align-items: center; gap: 8px; }
.g-mult {
  display: inline-flex; align-items: center; justify-content: center; min-width: 56px; min-height: 40px; padding: 4px 12px;
  border-radius: var(--g-r-sm); font-family: var(--g-display); font-weight: 800; font-size: 1.25rem;
  background: var(--g-dark-2); border: 2px solid var(--g-line); color: #fff;
}
.g-mult.is-hot { background: var(--g-lime); border-color: var(--g-lime); color: var(--g-ink); }
.g-timer { display: flex; align-items: center; gap: 14px; }
.g-timer .g-bar { flex: 1 1 auto; }
.g-secs { flex: none; font-family: var(--g-display); font-weight: 800; font-size: 1.15rem; min-width: 3.2em; text-align: right; }
.g-secs.is-low { color: var(--g-ko); }
.g-form-label {
  align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: var(--g-violet); color: var(--g-ink);
  font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em;
}
.g-rush-form { display: flex; flex-direction: column; gap: 12px; }
.g-input {
  width: 100%; min-height: 60px; padding: 12px 18px; border-radius: var(--g-r-md);
  border: 2px solid var(--g-line); background: #fff; color: var(--g-ink);
  font: 700 clamp(1.2rem, 5vw, 1.5rem)/1.2 var(--g-body);
}
.g-input:focus { outline: 3px solid var(--g-lime); outline-offset: 2px; border-color: var(--g-ink); }
.g-input[readonly] { background: var(--g-dark-2); color: var(--g-muted); }
.g-rush-fb { display: flex; align-items: flex-start; gap: 8px; min-height: 1.6em; font-weight: 700; }
.g-rush-fb .g-ico { margin-top: .05em; }
.g-rush-fb.is-ok { color: var(--g-lime); }
.g-rush-fb.is-ko { color: var(--g-ko); }
.g-rush-fb .g-ico { width: 22px; height: 22px; }

.g-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.g-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  min-height: 120px; padding: 18px 20px; border-radius: var(--g-r-md); cursor: pointer;
  border: 2px solid var(--g-line); background: var(--g-dark-2); color: #fff; font: inherit;
  transition: transform .12s ease, border-color .12s ease;
}
.g-choice:hover { border-color: var(--g-lime); transform: translateY(-2px); }
.g-choice-title { font-family: var(--g-display); font-weight: 800; font-size: 1.2rem; }
.g-choice-sub { color: var(--g-muted); font-size: .92rem; }
.g-choice-best { margin-top: auto; padding: 3px 10px; border-radius: 999px; background: var(--g-lime); color: var(--g-ink); font-weight: 700; font-size: .85rem; }

.g-keys { color: var(--g-muted); font-size: .92rem; }
.g-keys kbd {
  display: inline-block; min-width: 1.8em; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--g-line);
  background: var(--g-dark-2); color: #fff; font: 700 .85rem/1.5 var(--g-body); text-align: center;
}

/* ---------- results ---------- */

.g-result-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 18px; }
.g-tile {
  display: flex; flex-direction: column; justify-content: center; gap: 4px; flex: 0 1 auto; min-width: 160px;
  padding: 20px 26px; border-radius: var(--g-r-md); background: var(--g-violet); color: var(--g-ink);
}
.g-tile-big { font-family: var(--g-display); font-weight: 800; font-size: clamp(2.6rem, 12vw, 4.2rem); line-height: 1; }
.g-tile-small { font-weight: 700; }
.g-result-side { display: flex; flex-direction: column; justify-content: center; gap: 10px; flex: 1 1 220px; }
.g-squares { display: flex; gap: 8px; }
.g-sq {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px;
}
.g-sq.is-ok { background: var(--g-lime); color: var(--g-ink); }
.g-sq.is-ko { background: var(--g-ko); color: var(--g-ink); }
.g-sq .g-ico { width: 24px; height: 24px; }
.g-summary { font-weight: 700; }
.g-streak { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--g-muted); }
.g-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; flex: 1 1 200px; }
.g-stats strong { font-family: var(--g-display); font-weight: 800; font-size: 1.2rem; color: #fff; }
.g-share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.g-share-status { font-weight: 700; color: var(--g-lime); }
.g-share-status:empty { display: none; }
.g-share-box {
  flex-basis: 100%; width: 100%; padding: 10px 12px; border-radius: var(--g-r-sm); border: 2px solid var(--g-line);
  background: #fff; color: var(--g-ink); font: 1rem/1.4 var(--g-body); resize: vertical;
}
.g-next { display: flex; align-items: center; gap: 8px; color: var(--g-muted); }
.g-next span span { color: #fff; font-weight: 700; }

.g-details { border-top: 1px solid var(--g-line); padding-top: 14px; }
.g-details summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: 12px; list-style: none; }
.g-details summary::-webkit-details-marker { display: none; }
.g-details summary::after {
  content: "+"; margin-left: auto; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%; background: var(--g-dark-2); border: 1px solid var(--g-line); font-size: 1.2rem; line-height: 1;
}
.g-details[open] summary::after { content: "\2212"; }
.g-recap, .g-missed-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.g-recap li { display: flex; align-items: flex-start; gap: 10px; }
.g-recap li > .g-ico { margin-top: .1em; }
.g-recap li.is-ok > .g-ico { color: var(--g-lime); }
.g-recap li.is-ko > .g-ico { color: var(--g-ko); }
.g-missed { display: flex; flex-direction: column; gap: 4px; }
.g-missed-list li { padding: 10px 14px; border-radius: var(--g-r-sm); background: var(--g-dark-2); border-left: 4px solid var(--g-ko); }

.g-others { border-top: 1px solid var(--g-line); padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.g-others-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.g-others-list a {
  display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 14px 16px; border-radius: var(--g-r-md);
  background: var(--g-dark-2); border: 2px solid var(--g-line); color: #fff; text-decoration: none;
}
.g-others-list a:hover { border-color: var(--g-lime); }
.g-others-list strong { font-family: var(--g-display); font-weight: 800; }
.g-others-list span { color: var(--g-muted); font-size: .9rem; }

/* ---------- motion ---------- */

@keyframes g-pop { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
.g-pop { animation: g-pop .28s ease-out; }
@keyframes g-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.g-feedback:not(:empty), .g-screen { animation: g-in .22s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .g-card, .g-card * { animation: none !important; transition: none !important; }
  .g-btn:hover, .g-opt:hover:not(:disabled), .g-choice:hover { transform: none; }
}

@media (max-width: 420px) {
  .g-card { border-radius: var(--g-r-md); }
  .g-options.is-pair { gap: 10px; }
  .g-opt { padding: 10px 12px; }
  .g-tile { flex: 1 1 100%; }
  .g-actions .g-btn { flex: 1 1 auto; }
}

@media print {
  .g-card { display: none; }
}
