/* 7arif end screen (retro/end.js): the back page. Uses the shared custom properties of web/style.css and
   games/retro/kit.css (--paper, --ink, --red, --yellow, --lime, --blue, --font-display, --font-ui ...), so it works on
   the main page and in every mini-game. No blur, only transform/opacity animate, every control >= 44 px, logical
   properties only. Tap skips (.is-skip), reduced motion = opacity.
   Visual system v2 (2026-11-17, SYS-END): order = score (56, anchored by end.js at --end-top) > verdict (24) + ONE
   context line (14) + on a loss "how close" (18) > Share ticket | Story (paper) > next game (paper card) > quiet part.
   Tiers: .is-loss (200 ms fade, paper score, never red), .is-win (stamp, yellow), .is-perfect (stamp, lime, two tapes).
   Entrance <= 5 blocks x 40 ms apart x 200 ms each (done ~400 ms). Tokens: kit.css / style.css SYSTEM TOKENS. */

.r-end { position: relative; text-align: center; color: var(--ink); }
.r-end h3 { font: 400 var(--fs-title)/var(--lh-title) var(--font-display); margin: 0 0 var(--s2); padding-top: 0; color: var(--ink); text-align: start; }
.r-end h4 { font: 800 var(--fs-meta)/1.5 var(--font-ui); margin: var(--s2) 0 var(--s1); color: var(--ink-meta, #4a3f2c); text-align: start; }
html[lang="en"] .r-end h3 { font: 800 var(--fs-title)/var(--lh-title) var(--font-ui); }

/* score (FIRST, anchored) + streak sticker beside it */
.r-end__head { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; min-height: 0; margin: 0; padding: var(--s3) 0 0; }
.r-end__score { display: inline-block; font-family: var(--font-display); font-weight: 400; font-size: var(--fs-score); line-height: 1.25; padding-top: 6px;
                color: var(--c-note); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); transform: rotate(-3deg);
                direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.r-end.is-win .r-end__score { color: var(--c-note); }
.r-end.is-perfect .r-end__score { color: var(--c-right); }
.r-end.is-loss .r-end__score { color: var(--c-paper-hi); }   /* a loss is never red */
/* tier 2 (perfect): two tape strips pin the score's top corners, above its figures (never over them) */
.r-end.is-perfect .r-end__score { position: relative; }
.r-end.is-perfect .r-end__score::before, .r-end.is-perfect .r-end__score::after {
  content: ""; position: absolute; top: -2px; width: 30px; height: 10px; background: rgba(244, 210, 31, .9); box-shadow: inset 0 0 0 1px rgba(26,26,26,.25); z-index: 2; }
.r-end.is-perfect .r-end__score::before { left: -6px; transform: rotate(-12deg); }
.r-end.is-perfect .r-end__score::after { right: -6px; transform: rotate(12deg); }
/* the streak sticker: THE kit sticker (.r-sticker.is-lg, kit.css / style.css; fit by retro/sticker.js): only its place here */
.r-end__sticker.r-sticker { position: absolute; inset-inline-end: 0; top: 0; }
/* phones: the head is a 3-column row (free | score | sticker): the score stays centred while there is room and never runs
   under the sticker (a 5-figure score at 320 px slides toward the free side instead) */
@media (max-width: 1023px) {
  .r-end__head:has(> .r-end__sticker.r-sticker) { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(calc(var(--sticker) + var(--s1)), 1fr); align-items: center; }
  .r-end__head > .r-end__score { grid-column: 2; }
  .r-end__head > .r-end__sticker.r-sticker { --st: var(--sticker); position: static; grid-column: 3; grid-row: 1; justify-self: end; align-self: start; }
}
.r-end__sticker.is-off { background: var(--yellow); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); color: var(--ink); }
.r-end__verdict { font: 400 var(--fs-title)/var(--lh-title) var(--font-display); margin: var(--s1) 0 0; padding: 0; }
html[lang="en"] .r-end__verdict { font: 800 var(--fs-title)/var(--lh-title) var(--font-ui); }
.r-end__ctx { margin: 0; font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui); color: var(--ink-meta, #4a3f2c); }
.r-end__close { margin: var(--s2) 0 0; font: var(--fw-body) var(--fs-body)/1.6 var(--font-ui); color: var(--ink); }
.r-end__calm { margin: 0 0 4px; font-size: var(--fs-meta); font-weight: 700; line-height: 1.6; color: var(--ink-meta, #4a3f2c); }
/* the main grid's live rarity level (app.js, live since 2026-11-18): one plain line of ink text under the verdict /
   context (body 18; no frame, so it never reads as a button; not yellow: yellow = attempts / streak; not red: red = wrong)
   and a quiet "how it's counted" text link in action navy (meta 14, 44 px tap height). Wraps at spaces, never cut. */
.r-end__level { margin: var(--s2) 0 0; font: var(--fw-body) var(--fs-body)/1.5 var(--font-ui); display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
                column-gap: var(--s2); row-gap: 0; }
.r-end__level > span { max-width: 100%; color: var(--ink); }
.r-end__how { min-height: 44px; padding: 0 var(--s1); background: none; border: 0; color: var(--c-action); font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui);
              text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.r-end__vs { display: inline-block; margin: 8px 0 2px; background: var(--yellow); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); padding: 4px 12px;
             font: 800 15px/1.5 var(--font-ui); }
.r-end__note { margin: 10px 0 0; padding: 8px 10px; border: 2px dashed var(--ink); background: var(--paper-clip, #FBF7EC); font-size: var(--fs-meta); font-weight: 700; line-height: 1.6; text-align: start; }

/* share: THE primary action = the navy-deep ticket (kit .r-btn: two punched notches), Cairo 800 18 */
.r-end__actions { margin: var(--s4) 0 0; }
.r-end__share { position: relative; display: flex; width: 100%; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--dock-h); padding: 0 20px;
                font: var(--fw-body) var(--fs-body)/1.5 var(--font-ui); color: var(--c-action-ink); background: var(--c-action); border: 2px solid var(--ink);
                box-shadow: 3px 3px 0 var(--ink); border-radius: 0; cursor: pointer; transition: transform 80ms; }
.r-end__share::before, .r-end__share::after { content: ""; position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--paper);
                border: 2px solid var(--ink); pointer-events: none; }
/* the punched notches: half discs bitten into the short edges, drawn INSIDE the ticket's border box (nothing past its edge) */
.r-end__share::before, .r-end__share::after { width: 8px; height: 14px; margin-top: -7px; border-radius: 0; }
.r-end__share::before { inset-inline-start: -2px; border-inline-start: 0; border-start-end-radius: 8px; border-end-end-radius: 8px; }
.r-end__share::after { inset-inline-end: -2px; border-inline-end: 0; border-start-start-radius: 8px; border-end-start-radius: 8px; }
.r-end__share svg { width: 22px; height: 22px; margin-top: 0; flex: 0 0 auto; }
.r-end__share:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
/* Post to your Story (retro/story.js): the second action, paper */
.r-end__story { display: flex; width: 100%; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--dock-h); margin: 10px 0 0; padding: 0 var(--s4);
                font: var(--fw-body) var(--fs-body)/1.5 var(--font-ui); color: var(--ink); background: var(--paper-clip, #FBF7EC); border: 2px solid var(--ink);
                box-shadow: 3px 3px 0 var(--ink); border-radius: 0; cursor: pointer; transition: transform 80ms; }
.r-end__story svg { width: 22px; height: 22px; margin-top: 0; flex: 0 0 auto; }
.r-end__story:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.r-end__story[aria-busy="true"] { opacity: .75; cursor: progress; }

/* the Story sheet (retro/story.js): the picture, how to save it, the steps */
html.r-story-open, html.r-story-open body { overflow: hidden; }
.r-story { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: stretch; justify-content: center; background: rgba(13, 18, 56, .9); }
.r-story__panel { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 520px; max-height: 100%; background: var(--paper, #EFE6D2); color: var(--ink, #1A1A1A);
                  font-family: var(--font-ui, "Cairo", system-ui, sans-serif); text-align: start; }
.r-story__head { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; background: var(--navy, #1E2A6B); color: var(--paper-clip, #FBF7EC);
                 border-block-end: 3px solid var(--ink, #1A1A1A); }
.r-story__head h2 { flex: 1 1 auto; margin: 0; font-family: var(--font-display, "Lalezar", sans-serif); font-weight: 400; font-size: 24px; line-height: 1.2; padding-top: 3px; }
html[lang="en"] .r-story__head h2 { font-family: var(--font-ui); font-weight: 900; font-size: 20px; padding-top: 0; }
.r-story__close { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 2px solid currentColor; border-radius: 0; background: transparent; color: inherit; cursor: pointer; }
.r-story__close svg { width: 22px; height: 22px; }
.r-story__body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.r-story__fig { margin: 0 auto; width: min(100%, calc(50svh * 9 / 16)); }
.r-story__img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; border: 3px solid var(--ink, #1A1A1A); box-shadow: 4px 4px 0 var(--ink, #1A1A1A);
                -webkit-touch-callout: default; user-select: auto; }
.r-story__acts { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; }
.r-story__btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 16px; text-decoration: none;
                font: var(--fw-body, 800) var(--fs-body, 18px)/1.5 var(--font-ui, "Cairo", sans-serif); color: var(--c-action-ink, #FBF7EC); background: var(--c-action, #0D1238);
                border: 2px solid var(--ink, #1A1A1A); box-shadow: 3px 3px 0 var(--ink, #1A1A1A); cursor: pointer; }
.r-story__btn.paper { color: var(--ink, #1A1A1A); background: var(--paper-clip, #FBF7EC); box-shadow: 3px 3px 0 var(--ink, #1A1A1A); }
.r-story__btn svg { width: 22px; height: 22px; margin-top: 0; flex: 0 0 auto; }
.r-story__hold { margin: 8px 0 0; font-size: 13px; font-weight: 700; color: var(--ink-meta, #4a3f2c); text-align: center; }
.r-story__steps { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 6px; }
.r-story__steps li { counter-increment: st; display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--paper-clip, #FBF7EC); border: 2px solid var(--ink, #1A1A1A);
                     font-weight: 800; font-size: 15px; line-height: 1.4; }
.r-story__steps li::before { content: counter(st); flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; background: var(--navy, #1E2A6B); color: var(--paper-clip, #FBF7EC);
                             font-weight: 900; font-size: 15px; line-height: 1; }
html[lang="ar"] .r-story__steps li::before { content: counter(st, arabic-indic); }
.r-story__tip { margin: 10px 0 0; padding: 8px 10px; border: 2px dashed var(--ink, #1A1A1A); font-size: 13px; font-weight: 700; line-height: 1.6; }
.r-story__tip.is-iab { background: #fff6c2; border-style: solid; }
@media (prefers-reduced-motion: reduce) { .r-end__story { transition: none; } }
@media (forced-colors: active) { .r-end__story, .r-story__btn { border: 1px solid CanvasText; } }

.r-end__out { margin: 14px 0 0; background: var(--paper-clip, #FBF7EC); border: 1.5px dashed var(--ink); padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere;
              font: 700 14px/1.6 var(--font-ui); text-align: start; unicode-bidi: plaintext; transition: opacity 300ms; }
.r-end__out.flash { background: #fff6c2; }

/* small buttons (nickname, install, reminder) */
.r-end__row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.r-end__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; min-width: 48px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 0;
              background: var(--c-action); color: var(--c-action-ink); font: 800 var(--fs-meta)/1.5 var(--font-ui); box-shadow: 2px 2px 0 var(--ink); cursor: pointer; transition: transform 80ms; }
.r-end__btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.r-end__btn.paper { background: var(--paper-clip, #FBF7EC); color: var(--ink); }
.r-end__btn.sm { min-height: 44px; padding: 0 12px; }
.r-end__btn svg { width: 20px; height: 20px; flex: 0 0 auto; }

/* nickname (asked once) */
.r-end__nick { margin: 14px 0 0; padding: 10px 12px 12px; background: var(--paper-clip, #FBF7EC); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); text-align: start; }
.r-end__nick label { display: grid; gap: 6px; font: 800 var(--fs-meta)/1.5 var(--font-ui); }
.r-end__nick input { min-height: 48px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 0; background: #fff; color: #1A1A1A; font: 700 17px var(--font-ui); width: 100%; }
.r-end__nick small { display: block; margin-top: 6px; font-size: var(--fs-meta); font-weight: 700; line-height: 1.5; color: var(--ink-meta, #4a3f2c); }
.r-end__nick .r-end__row { justify-content: flex-start; }
.r-end__nickis { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; font-size: var(--fs-meta); font-weight: 800; color: var(--ink-meta, #4a3f2c); }

/* the reveal: missed answers as greyed clippings */
.r-end__reveal { margin: 22px 0 0; text-align: start; }
.r-end__reveal ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.r-end__reveal li { display: grid; gap: 1px; padding: 8px 10px; background: var(--paper-2, #E6DAC0); border: 2px dashed rgba(26,26,26,.45); }
.r-end__q { font-size: var(--fs-meta); font-weight: 800; color: var(--ink-meta, #4a3f2c); line-height: 1.5; }
.r-end__a { font: var(--fw-body) var(--fs-body)/1.5 var(--font-ui); color: var(--ink); padding-top: 0; }
.r-end__a small { font: 800 var(--fs-meta)/1.5 var(--font-ui); color: var(--ink-meta, #4a3f2c); }
.r-end__n { justify-self: start; font: 800 var(--fs-meta)/1.5 var(--font-ui); background: var(--yellow); color: var(--ink); padding: 0 6px; }

/* stats + distribution */
.r-end__stats { margin: 22px 0 0; text-align: start; }
.r-end__tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.r-end__tile { text-align: center; border: 2px solid var(--ink); background: var(--paper-clip, #FBF7EC); padding: 4px 2px 3px; }
.r-end__tile b { display: block; font-family: var(--font-display); font-weight: 400; font-size: var(--fs-title); line-height: 1.5; padding-top: 0; }
.r-end__tile span { display: block; font-size: var(--fs-meta); font-weight: 800; line-height: 1.25; }
.r-end__dist { display: grid; gap: 4px; }
.r-end__bar { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 6px; font: 800 var(--fs-meta)/1 var(--font-ui); }
.r-end__bar > span { text-align: center; }
/* alignment pass 2026-11-12: a word label ("خسرت", "Lost") is wider than 22 px; every bar shares one label column
   as wide as the widest label (subgrid), so the bars still start on one line */
@supports (grid-template-columns: subgrid) {
  .r-end__dist { grid-template-columns: minmax(22px, max-content) minmax(0, 1fr); column-gap: 6px; }
  .r-end__dist > h4 { grid-column: 1 / -1; }
  .r-end__bar { grid-column: 1 / -1; grid-template-columns: subgrid; }
}
.r-end__bar i { display: flex; justify-content: flex-end; width: max(var(--w), 22px); min-height: 20px; background: var(--ink-soft, #6B5D43); color: #fff; font-style: normal; padding: 0 6px; }
.r-end__bar i b { font-size: var(--fs-meta); line-height: 22px; }
.r-end__bar i.is-zero { width: auto; background: transparent; color: var(--ink-meta, #4a3f2c); justify-content: flex-start; padding: 0 2px; border-inline-start: 2px solid var(--ink-soft, #6B5D43); }
.r-end__reads { margin: 10px 0 0; font-size: var(--fs-meta); font-weight: 800; color: var(--ink-meta, #4a3f2c); }

/* the countdown: one small line in the quiet part */
.r-end__count { margin: 0; padding: 0; color: var(--ink-meta, #4a3f2c); font: 800 var(--fs-meta)/1.5 var(--font-ui); text-align: center; }
.r-end__count bdi { font: 800 var(--fs-meta)/1 var(--font-ui); color: var(--ink); margin-inline-start: 4px; font-variant-numeric: tabular-nums; }
.r-end__link { color: var(--ink-meta, #4a3f2c); font-weight: 800; display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }

/* install offer + reminder */
.r-end__extra { margin: 18px 0 0; display: grid; gap: 10px; justify-items: center; }
.r-end__install { width: 100%; padding: 10px 12px 12px; background: var(--paper-clip, #FBF7EC); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.r-end__install b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 21px; line-height: 1.25; padding-top: 2px; }
html[lang="en"] .r-end__install b { font-family: var(--font-ui); font-weight: 900; font-size: 17px; }
.r-end__install small { display: block; font-size: 12.5px; font-weight: 700; line-height: 1.55; color: var(--ink-meta, #4a3f2c); margin-top: 4px; }
.r-end__ios { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0 2px; }
.r-end__key { display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid var(--ink); background: #fff; color: var(--blue); box-shadow: 2px 2px 0 var(--ink); }
.r-end__key svg { width: 26px; height: 26px; }
.r-end__arrow { width: 28px; height: 3px; background: var(--ink); position: relative; }
.r-end__arrow::after { content: ""; position: absolute; inset-inline-end: -2px; top: -5px; width: 10px; height: 10px; border-top: 3px solid var(--ink); border-inline-end: 3px solid var(--ink); transform: rotate(45deg); }
html[dir="rtl"] .r-end__arrow::after { transform: rotate(-45deg); }
.r-end__remind-note { margin: 0; font-size: 12.5px; font-weight: 700; line-height: 1.55; color: var(--ink-meta, #4a3f2c); }

/* the sequence (SYS-END): <= 5 blocks, 40 ms apart, 200 ms each, done by ~400 ms. The score lands as a stamp in 240 ms
   (win / perfect) or fades in 200 ms (loss); the perfect tier's two tapes land 240 -> 400 ms */
@keyframes r-end-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes r-end-stamp { 0% { opacity: 0; transform: scale(1.35) rotate(-8deg); } 100% { opacity: 1; transform: scale(1) rotate(-3deg); } }
@keyframes r-end-fade { from { opacity: 0; } to { opacity: 1; } }
.r-end.is-play .e-in { animation: r-end-in var(--end-in) cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(min(var(--i, 0), 4) * var(--end-step)); }
.r-end.is-play .r-end__score { animation: r-end-stamp var(--mark-in) cubic-bezier(.3,1.4,.5,1) 0ms both; }
.r-end.is-loss.is-play .r-end__score { animation: r-end-fade var(--end-in) linear both; }
.r-end.is-perfect.is-play .r-end__score::before, .r-end.is-perfect.is-play .r-end__score::after { animation: fx-tape 160ms 240ms ease-out both; }
.r-end.is-skip .e-in, .r-end.is-skip .r-end__score, .r-end.is-skip .r-end__score::before, .r-end.is-skip .r-end__score::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .r-end.is-play .e-in { animation: r-end-fade 150ms linear both !important; animation-delay: 0ms !important; }
  .r-end.is-play .r-end__score, .r-end.is-perfect.is-play .r-end__score::before, .r-end.is-perfect.is-play .r-end__score::after { animation: none !important; }
  .r-end__share, .r-end__btn, .r-end__next, .r-end__out { transition: none; }
}
@media (hover: hover) and (pointer: fine) {
  .r-end__share:hover, .r-end__btn:hover { transform: translate(-1px, -1px); }
  .r-end__next:hover { transform: translate(-1px, -2px); box-shadow: 4px 5px 0 var(--ink); }
}
@media (max-width: 359px) { .r-end__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .r-end__score { font-size: 84px; -webkit-text-stroke-width: 7px; } }
@media (forced-colors: active) { .r-end__share, .r-end__btn, .r-end__next, .r-end__tile { border: 1px solid CanvasText; } }

/* lead, 2026-11-09: global rule 12 (Arabic body text >= 16 px, line-height >= 1.6; Lalezar only >= 24 px) */
/* (v2: the scale's meta 14 / body 18 replace the 16 px step; Arabic line-height stays >= 1.5) */
html[lang="ar"] .r-end__calm, html[lang="ar"] .r-end__note, html[lang="ar"] .r-end__nick small, html[lang="ar"] .r-end__nickis,
html[lang="ar"] .r-end__q, html[lang="ar"] .r-end__reads, html[lang="ar"] .r-end__count, html[lang="ar"] .r-end__nick label { font-size: var(--fs-meta); line-height: 1.6; }
/* lead: contrast (AA) for the stats heading and distribution numbers */
.r-end h4 { color: var(--ink); }
.r-end__bar i { background: var(--ink); } .r-end__bar i b { color: #fff; }
.r-end__bar i.is-zero b { color: var(--ink-meta, #4a3f2c); }   /* a zero count sits on the paper, not on an ink bar */

/* the next game (owner 2026-11-13: players stop after the first game): ONE full-width PAPER card (SYS-END: not blue),
   meta label, the game name in Lalezar 24 (English Cairo 800 18), its one-line pitch in meta */
.r-end__go { display: grid; grid-template-columns: 1fr; gap: var(--s2); margin: var(--s4) 0 0; }
.r-end__go a { display: flex; flex-direction: column; justify-content: center; gap: 0; min-height: 72px; padding: var(--s2) var(--s3); min-width: 0; text-decoration: none; text-align: start;
               border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); background: var(--paper-clip, #FBF7EC); color: var(--ink); }
.r-end__go small { font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui); color: var(--ink-meta, #4a3f2c); }
.r-end__go b { font: 400 var(--fs-title)/1.5 var(--font-display); padding: 0; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[lang="en"] .r-end__go b { font: 800 var(--fs-body)/1.5 var(--font-ui); }
.r-end__go-desc { font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui); color: var(--ink-meta, #4a3f2c); }
.r-end__go a:active { translate: 2px 2px; box-shadow: 1px 1px 0 var(--ink); }
@media (hover: hover) and (pointer: fine) { .r-end__go a:hover { translate: 0 -2px; box-shadow: 4px 5px 0 var(--ink); } }
@media (forced-colors: active) { .r-end__go a { border: 1px solid CanvasText; } }

/* ---- sharing growth (2026-11-15, end.js): open in browser, the peak-moment box, the challenge ---- */
/* open in browser (TikTok / Facebook / Instagram in-app browsers only): end screen + Story sheet */
.r-iab { margin: 12px 0 0; text-align: start; }
.r-iab__go { display: flex; width: 100%; box-sizing: border-box; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 4px 16px 0; margin: 0; text-decoration: none;
             font-family: var(--font-display, "Lalezar", sans-serif); font-size: 22px; line-height: 1.1; color: #fff; background: var(--navy, #1E2A6B);
             border: 2px solid var(--ink, #1A1A1A); box-shadow: 3px 3px 0 var(--ink, #1A1A1A); border-radius: 0; cursor: pointer; }
.r-iab__go svg { width: 22px; height: 22px; margin-top: -4px; flex: 0 0 auto; }
.r-iab__go:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink, #1A1A1A); }
html[lang="en"] .r-iab__go { font-family: var(--font-ui); font-weight: 900; font-size: 18px; padding-top: 0; }
html[lang="en"] .r-iab__go svg { margin-top: 0; }
.r-iab__why { margin: 6px 0 0; font-size: 13px; font-weight: 700; line-height: 1.55; color: var(--ink-meta, #4a3f2c); text-align: center; }
.r-iab__how { margin: 8px 0 0; padding: 8px 10px 10px; background: #fff6c2; border: 2px solid var(--ink, #1A1A1A); }
.r-iab__how p { margin: 0 0 8px; font-size: 14px; font-weight: 800; line-height: 1.6; }
.r-iab__url { display: block; box-sizing: border-box; width: 100%; min-height: 44px; margin: 0 0 8px; padding: 0 10px; border: 2px solid var(--ink, #1A1A1A); border-radius: 0; background: #fff; color: #1A1A1A;
              font: 700 13px/1 var(--font-ui, sans-serif); text-overflow: ellipsis; }
.r-iab__done { display: block; margin-top: 6px; font-size: 13px; font-weight: 800; line-height: 1.5; }
.r-story .r-iab { margin-top: 14px; }

/* the peak moment: the same action row, highlighted, with one line above it */
.r-end__actions.is-peak { padding: var(--s2) var(--s3) var(--s3); background: var(--paper-clip, #FBF7EC); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.r-end__prompt { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; text-align: start; }
.r-end__ptxt { flex: 1 1 auto; min-width: 0; margin: 0; }
.r-end__ptxt b { display: block; font: 800 var(--fs-body)/1.5 var(--font-ui); padding: 0; }
.r-end__prompt .r-end__pclose { align-self: center; border-color: transparent; }
.r-end__pclose, .r-strip__x { flex: 0 0 auto; align-self: start; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 2px solid var(--ink, #1A1A1A); border-radius: 0;
                              background: transparent; color: var(--ink, #1A1A1A); cursor: pointer; }
.r-end__pclose svg, .r-strip__x svg { width: 20px; height: 20px; }
/* the mini story card (the Story picture in small: navy, the wordmark, the score, 7arif.com) */
.r-end__mini { flex: 0 0 auto; box-sizing: border-box; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center; width: 60px; aspect-ratio: 9 / 16; padding: 6px 2px 5px;
               background: radial-gradient(circle at 50% 45%, #2A3A8C, #1E2A6B 55%, #0D1238); border: 2px solid var(--ink, #1A1A1A); box-shadow: 3px 3px 0 var(--ink, #1A1A1A); transform: rotate(-4deg); }
.r-end__mini i { font: 400 20px/1 var(--font-display, "Lalezar", sans-serif); font-style: normal; color: var(--red, #D7262E); -webkit-text-stroke: 3px var(--paper, #EFE6D2); paint-order: stroke fill; padding-top: 3px; }
.r-end__mini b { font: 400 20px/1 var(--font-display, "Lalezar", sans-serif); color: var(--yellow, #F4D21F); -webkit-text-stroke: 3px var(--ink, #1A1A1A); paint-order: stroke fill; direction: ltr; unicode-bidi: isolate; white-space: nowrap; padding-top: 3px; }
.r-end__mini em { font: 900 7.5px/1 var(--font-ui, sans-serif); font-style: normal; color: var(--yellow, #F4D21F); direction: ltr; }

/* the challenge head-to-head: compact, in the verdict's place (its «ابعتله الرد» is the Share button of the row) */
.r-end__h2h { margin: 6px 0 0; }
.r-end__h2h-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.r-end__h2h-p { display: grid; gap: 0; justify-items: center; padding: 4px 4px 2px; border: 2px solid var(--ink); background: var(--paper-clip, #FBF7EC); min-width: 0; }
.r-end__h2h-p small { font: 800 var(--fs-meta)/1.5 var(--font-ui); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-end__h2h-p b { font: 400 30px/1 var(--font-display); padding-top: 4px; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.r-end__h2h.is-win .is-me, .r-end__h2h.is-lose .r-end__h2h-p:not(.is-me) { background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }
.r-end__h2h-vs { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; border: 2px solid var(--ink);
                 font: 900 12px/1 var(--font-ui); direction: ltr; }
.r-end__h2h-line { margin: 8px 0 0; font: 800 16px/1.5 var(--font-ui); }

/* strips above the game: the challenge banner, the result handed over from an in-app browser */
.r-strip { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; box-sizing: border-box; width: calc(100% - 24px); max-width: 560px; margin: 8px auto 4px;
           padding: 6px 6px 6px 10px; background: var(--yellow, #F4D21F); color: var(--ink, #1A1A1A); border: 2px solid var(--ink, #1A1A1A); box-shadow: 3px 3px 0 var(--ink, #1A1A1A);
           font-family: var(--font-ui, "Cairo", sans-serif); text-align: start; }
.r-strip[dir="rtl"] { padding: 6px 10px 6px 6px; }
.r-chb__vs { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink, #1A1A1A); color: #fff; border: 2px solid var(--ink, #1A1A1A);
             font: 900 12px/1 var(--font-ui, sans-serif); direction: ltr; }
.r-chb__t { flex: 1 1 auto; margin: 0; font-size: 15px; font-weight: 800; line-height: 1.5; }
.r-hand { flex-wrap: wrap; align-items: flex-start; background: var(--paper-clip, #FBF7EC); padding-block: 10px; }
.r-hand .r-strip__x { order: 2; }
.r-hand .r-end__mini { margin-top: 4px; }
.r-hand__body { flex: 1 1 0; min-width: 0; order: 1; }
.r-hand__body > b { display: block; font: 400 22px/1.25 var(--font-display, "Lalezar", sans-serif); padding-top: 2px; }
html[lang="en"] .r-hand__body > b { font: 900 17px/1.3 var(--font-ui, sans-serif); }
.r-hand__body > small { display: block; font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--ink-meta, #4a3f2c); }
.r-hand__acts { order: 3; flex: 1 0 100%; margin-top: 2px; }
.r-hand .r-end__share { font-size: 20px; min-height: 50px; }
.r-hand .r-end__story { font-size: 20px; min-height: 48px; margin-top: 8px; }
html[lang="en"] .r-hand .r-end__share, html[lang="en"] .r-hand .r-end__story { font-size: 16px; }
html[lang="ar"] .r-chb__t, html[lang="ar"] .r-iab__why, html[lang="ar"] .r-end__ptxt small, html[lang="ar"] .r-hand__body > small { font-size: 15px; line-height: 1.6; }
@media (max-width: 359px) { .r-end__mini { width: 50px; } .r-end__ptxt b { font-size: 20px; } .r-end__h2h-p b { font-size: 26px; }
  .r-end__actions.is-peak { padding: 4px 6px 10px; } }
@media (prefers-reduced-motion: reduce) { .r-iab__go, .r-end__chback { transition: none; } }
@media (forced-colors: active) { .r-iab__go, .r-end__chback, .r-strip, .r-end__actions.is-peak, .r-end__h2h { border: 1px solid CanvasText; } }

/* ---- end screen v2 (2026-11-15, players: "crowded and hard to follow") ----
   1) score + one verdict line, 2) ONE action row: Share | Story side by side, 3) ONE next-game card, then the quiet
   part (smaller, folded): the group table, «شوف الإجابات», «إحصائياتك», Versus (one small line), countdown, reminder. */
.r-end .r-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.r-end__actions { margin: 14px 0 0; }
.r-end__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.r-end__pair { gap: var(--gutter); }
.r-end__pair .r-end__share, .r-end__pair .r-end__story { width: 100%; min-width: 0; min-height: var(--dock-h); margin: 0; padding: 0 var(--s3); gap: var(--s2); white-space: nowrap; }
.r-end__pair .r-end__share span, .r-end__pair .r-end__story span { overflow: hidden; text-overflow: ellipsis; }
.r-end__pair .r-end__story { background: var(--paper-clip, #FBF7EC); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.r-end__pair .r-end__story[aria-busy="true"] span { white-space: normal; font-size: var(--fs-meta); line-height: 1.25; }
/* open in browser (in-app browsers only): a small link line under the row */
.r-end .r-iab { margin: 6px 0 0; text-align: center; }
.r-end .r-iab__go { display: inline-flex; width: auto; min-height: 44px; padding: 0 8px; gap: 6px; background: transparent; color: var(--ink); border: 0; box-shadow: none;
                    font: 800 var(--fs-meta)/1.5 var(--font-ui); text-decoration: underline; text-underline-offset: 3px; }
.r-end .r-iab__go svg { width: 18px; height: 18px; margin-top: 0; }
.r-end .r-iab__go:active { transform: none; box-shadow: none; }
.r-end .r-iab__how { text-align: start; }
/* the quiet part */
.r-end__quiet { display: grid; gap: var(--s3); margin: var(--s6) 0 0; padding: var(--s4) 0 0; border-top: 2px dashed rgba(26,26,26,.35); text-align: start; }
.r-end__quiet .r-end__note { margin: 0; padding: 0; border: 0; background: none; font-size: var(--fs-meta); color: var(--ink-meta, #4a3f2c); }
.r-end__quiet .r-end__nick, .r-end__quiet .r-end__nickis { margin: 0; }
.r-end__fold { border: 2px solid var(--ink); background: var(--paper-clip, #FBF7EC); }
.r-end__fold > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; cursor: pointer; list-style: none; font: var(--fw-body) var(--fs-body)/1.5 var(--font-ui); color: var(--ink); }
.r-end__fold > summary::-webkit-details-marker { display: none; }
.r-end__fold > summary > span { flex: 1 1 auto; min-width: 0; }
.r-end__fold > summary > small { flex: 0 0 auto; font: 800 var(--fs-meta)/1.5 var(--font-ui); color: var(--ink-meta, #4a3f2c); background: var(--paper-2, #E6DAC0); padding: 0 6px; }
.r-end__fold > summary::after { content: "+"; flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--ink); font: 900 18px/1 var(--font-ui); }
.r-end__fold[open] > summary::after { content: "\2212"; }
.r-end__fold > summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.r-end__fold[open] > summary { border-bottom: 2px solid var(--ink); }
.r-end__fold > :not(summary) { margin-inline: 10px; }
.r-end__fold > :last-child:not(summary) { margin-bottom: 12px; }
.r-end__reveal, .r-end__stats, .r-end__quiet > .r-end__fold { margin: 0; }
.r-end__reveal ul { margin-top: 10px; }
.r-end__reveal .r-end__calm { margin: 10px 10px 0; font-size: var(--fs-meta); }
.r-end__stats .r-end__tiles { margin-top: 10px; }
.r-end__shilla .r-shilla { margin-top: 10px; }
.r-end__shilla .r-shilla__acts .r-end__btn { min-height: 44px; }
/* Versus: one small secondary line (never louder than the next game) */
a.r-end__go-vs { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 2px solid var(--ink); background: transparent; color: var(--ink);
                 box-shadow: none; text-decoration: none; font: 800 var(--fs-meta)/1.5 var(--font-ui); }
a.r-end__go-vs:active { translate: 1px 1px; }
.r-end__extra { margin: 0; gap: 8px; }
.r-end__remind { min-height: 44px; font-size: var(--fs-meta); box-shadow: none; }
@media (forced-colors: active) { .r-end__fold, a.r-end__go-vs { border: 1px solid CanvasText; } }

/* ---- give up: the confirmation sheet (end.js confirmGiveUp) ---- */
html.r-confirm-open, html.r-confirm-open body { overflow: hidden; }
.r-confirm { position: fixed; inset: 0; z-index: 2147483001; display: flex; align-items: flex-end; justify-content: center; font-family: var(--font-ui, "Cairo", system-ui, sans-serif); }
.r-confirm__back { position: absolute; inset: 0; background: rgba(13, 18, 56, .72); }
.r-confirm__box { position: relative; box-sizing: border-box; width: 100%; max-width: 480px; display: grid; gap: 10px; padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
                  background: var(--paper, #EFE6D2); color: var(--ink, #1A1A1A); border: 3px solid var(--ink, #1A1A1A); border-bottom: 0; text-align: center;
                  animation: r-confirm-up 180ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes r-confirm-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.r-confirm__title { margin: 0; font: 400 var(--fs-title, 24px)/1.5 var(--font-display, "Lalezar", sans-serif); padding-top: 0; }
html[lang="en"] .r-confirm__title { font: 800 var(--fs-title, 24px)/1.5 var(--font-ui, sans-serif); }
.r-confirm__note { margin: 0; font-size: var(--fs-meta, 14px); font-weight: 700; line-height: 1.6; color: var(--ink-meta, #4a3f2c); }
.r-confirm__note.is-win { color: var(--ink, #1A1A1A); }
.r-confirm__keep { display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--dock-h, 52px); margin: 4px 0 0; padding: 0 16px; border: 2px solid var(--ink, #1A1A1A); border-radius: 0;
                   background: var(--c-action, #0D1238); color: var(--c-action-ink, #FBF7EC); box-shadow: 3px 3px 0 var(--ink, #1A1A1A); cursor: pointer;
                   font: var(--fw-body, 800) var(--fs-body, 18px)/1.5 var(--font-ui, "Cairo", sans-serif); }
.r-confirm__keep:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink, #1A1A1A); }
.r-confirm__keep:focus-visible, .r-confirm__yes:focus-visible { outline: 3px solid var(--blue, #2A4BA0); outline-offset: 3px; }
.r-confirm__yes { justify-self: center; min-height: 44px; margin: 4px 0 0; padding: 0 12px; border: 0; border-radius: 0; background: transparent; color: var(--ink, #1A1A1A); cursor: pointer;
                  font: 800 var(--fs-meta, 14px)/1.5 var(--font-ui, sans-serif); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 720px) { .r-confirm { align-items: center; } .r-confirm__box { border-bottom: 3px solid var(--ink, #1A1A1A); box-shadow: 6px 6px 0 var(--ink, #1A1A1A); } }
@media (prefers-reduced-motion: reduce) { .r-confirm__box { animation: none; } }
@media (forced-colors: active) { .r-confirm__box, .r-confirm__keep { border: 1px solid CanvasText; } }
/* the give-up button in every game: a small secondary text button (never the loud one) */
.r-giveup { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 10px; margin: 0; border: 0; border-radius: 0;
            background: transparent; color: var(--ink-meta, #4a3f2c); box-shadow: none; cursor: pointer; font: 800 14px/1.3 var(--font-ui, sans-serif);
            text-decoration: underline; text-underline-offset: 3px; }
.r-giveup:active { transform: none; box-shadow: none; }
.r-giveup.hidden { display: none; }
/* ---- UI/UX sweep (2026-11-16, P1-end): B1 share feedback, B2 labels, B3 order, B4 «شوف نتيجتك», B5 sticker,
   B6 today's bar, B7 open-in-browser x, E1 Arabic sizes ---- */
/* B1: the share box sits right under the Share | Story row; its status is its own line above the text */
.r-end__actions .r-end__out { margin: 10px 0 0; }
.r-end__out, .r-share-fix textarea { font-family: var(--font-ui), "Segoe UI Symbol", "Noto Sans Symbols 2", system-ui, sans-serif; }
.r-share-st { margin: 10px 0 0; padding: 6px 10px; background: var(--ink); color: var(--paper-clip, #FBF7EC); font: 800 15px/1.5 var(--font-ui); text-align: start; scroll-margin: 12px; }
.r-share-st[hidden] { display: none; }
.r-share-st + .r-end__out, .r-share-st + pre { margin-top: 0; }
.r-share-fix { margin: 0; display: grid; gap: 8px; justify-items: stretch; scroll-margin-bottom: 90px; }
.r-share-fix textarea { box-sizing: border-box; width: 100%; min-height: 120px; margin: 0; padding: 10px 12px; resize: none; border: 2px solid var(--ink); border-radius: 0;
                         background: #fff6c2; color: var(--ink); font-weight: 700; font-size: 15px; line-height: 1.6; unicode-bidi: plaintext; white-space: pre-wrap; }
.r-share-fix textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.r-share-fix__btn { justify-self: center; min-width: 120px; }
.r-end__out { scroll-margin-bottom: 90px; }
/* "اتنسخ! الصقها في واتساب" for ~2 s in place of the Share label: it may take two short lines, never an ellipsis */
.r-end__share.is-copied span, .r-end__pair .r-end__share.is-copied span { white-space: normal; overflow: visible; font-family: var(--font-ui); font-weight: 800; font-size: var(--fs-meta); line-height: 1.25; }
.r-end__share.is-copied { padding-top: 0; }

/* B2: «ابعت لصحابك» / «حطها ستوري» are never cut; narrow rows get smaller type and padding, very narrow ones stack */
.r-end__actions { container-type: inline-size; container-name: r-act; }
.r-end__pair .r-end__share span, .r-end__pair .r-end__story span { overflow: visible; text-overflow: clip; white-space: nowrap; }
/* the Share | Story pair never clips its label: no icons in the pair under 380 px (the ticket notches need the room) */
@media (max-width: 420px) { .r-end__pair .r-end__share svg, .r-end__pair .r-end__story svg { display: none; } .r-end__pair .r-end__share, .r-end__pair .r-end__story { padding-inline: 14px; } }
@container r-act (max-width: 270px) {   /* v2: the ticket notches need room: Share | Story stack below 270 px */
  .r-end__pair { grid-template-columns: 1fr; }
  .r-end__pair .r-end__share, .r-end__pair .r-end__story { font-size: var(--fs-body); }
}

/* B3: one loud thing below Share (the next-game card); the quiet group's buttons are paper */
.r-end__quiet .r-end__btn:not(.paper) { background: var(--paper-clip, #FBF7EC); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
/* the attempt's shape: the share rows as small squares under the verdict */
.r-end__shape { display: grid; justify-content: center; gap: 3px; margin: 8px 0 0; direction: inherit; }
.r-end__shape[hidden] { display: none; }
.r-end__shrow { display: flex; justify-content: center; gap: 3px; }
.r-end__shape i { display: block; width: 12px; height: 12px; box-sizing: border-box; border: 2px solid var(--ink); background: var(--paper-clip, #FBF7EC); }
.r-end__shape i.v1 { background: var(--lime); }
.r-end__shape i.v2 { background: var(--yellow); }

/* B4: «شوف نتيجتك», fixed at the bottom while the result is off screen: the dock box (SYS-POS), navy-deep (yellow is never a button) */
.r-see { position: fixed; z-index: 60; inset-inline: var(--margin, 16px); bottom: var(--dock-b, calc(12px + env(safe-area-inset-bottom, 0px))); margin: 0 auto; max-width: 488px;
         display: flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--dock-h, 52px); padding: 0 18px; border: 2px solid var(--ink, #1A1A1A); border-radius: 0;
         background: var(--c-action, #0D1238); color: var(--c-action-ink, #FBF7EC); box-shadow: 3px 3px 0 var(--ink, #1A1A1A); cursor: pointer; font: var(--fw-body, 800) var(--fs-body, 18px)/1.5 var(--font-ui, "Cairo", sans-serif); }
.r-see[hidden] { display: none; }
.r-see svg { width: 20px; height: 20px; flex: 0 0 auto; }
.r-see:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink, #1A1A1A); }
.r-end__score:focus { outline: none; }
.r-end { scroll-margin-top: 8px; }
@media (forced-colors: active) { .r-see { border: 1px solid CanvasText; } }

/* B5: storage refused = a tag under the score (the sticker itself: see the score block above) */
.r-end__sticker.is-off { position: static; display: block; width: max-content; max-width: 92%; aspect-ratio: auto; margin: 4px auto 0; border-radius: 0; padding: 3px 10px; transform: rotate(-2deg);
                         font: 800 var(--fs-meta)/1.5 var(--font-ui); text-align: center; }
.r-end__saved { margin: 10px 0 0; font: 700 var(--fs-meta)/1.6 var(--font-ui); color: var(--ink-meta, #4a3f2c); }

/* B6 / SYS-COLOUR: today's bar is navy-deep (the "you" colour), never red */
.r-end__bar.is-now i, .r-end.is-win .r-end__bar.is-now i, .r-end.is-loss .r-end__bar.is-now i { background: var(--c-action); color: var(--c-action-ink); outline: 0; }
.r-end.is-win .r-end__bar.is-now i b, .r-end__bar.is-now i b { color: var(--c-action-ink); }
.r-end__bar.is-now > span { text-decoration: underline; text-underline-offset: 3px; }

/* B7: «افتح في كروم» with its x (gone for 7 days) */
.r-iab__line { display: flex; align-items: center; justify-content: center; gap: 4px; }
.r-iab__x { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink-meta, #4a3f2c); cursor: pointer; }
.r-iab__x svg { width: 16px; height: 16px; }

/* E1: Arabic labels on the back page >= 14 px */
html[lang="ar"] .r-end__tag, html[lang="ar"] .r-end__issue, html[lang="ar"] .r-end h4, html[lang="ar"] .r-end__go small,
html[lang="ar"] .r-end__fold > summary > small, html[lang="ar"] .r-end__a small, html[lang="ar"] .r-end__n, html[lang="ar"] .r-end__tile span,
html[lang="ar"] .r-end__bar, html[lang="ar"] .r-end__remind-note, html[lang="ar"] .r-iab__done, html[lang="ar"] .r-end__h2h-p small,
html[lang="ar"] .r-end__install small, html[lang="ar"] .r-story__hold, html[lang="ar"] .r-story__tip, html[lang="ar"] .r-end__quiet .r-end__note { font-size: 14px; }
html[lang="ar"] .r-end__bar i b { font-size: 14px; }
html[lang="ar"] .r-end__tile span { line-height: 1.25; }
html[lang="ar"] .r-end__bar i { min-height: 22px; } html[lang="ar"] .r-end__bar i b { line-height: 22px; }
html[lang="ar"] .r-end__go-desc, html[lang="ar"] .r-end__remind-note, html[lang="ar"] .r-iab__url { font-size: 14px; line-height: 1.6; }

/* ===== round 2 (owner 2026-11-18, U5 + Q3): two actions, two colours. Share = the navy-deep ticket (above); the next
   game = a YELLOW card (--c-next, filled, ink rim + hard shadow, ink type); Story stays the paper secondary. ===== */
.r-end__go a { background: var(--c-next, #F4D21F); color: var(--ink); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.r-end__go small, .r-end__go-desc, html[lang="ar"] .r-end__go small, html[lang="ar"] .r-end__go-desc { color: var(--ink); }
.r-end__go b { color: var(--ink); }

/* ===== round 4 (owner 2026-11-19, ROUND4.md): the calm look on a page that opts in (body.r-calm): the back page sits
   straight on the blue. Light type, no boxes around the share row or the quiet part; Share = the navy-deep rounded
   button, Story = the outline secondary, the next game = the YELLOW card (U5) rounded with a soft drop, the folds = soft
   panels (they open). The score keeps its Lalezar moment and the yellow streak sticker. ===== */
.r-calm .r-end { color: var(--c-on); }
.r-calm .r-end h3, .r-calm .r-end h4, .r-calm .r-end__close, .r-calm .r-end__level > span { color: var(--c-on); }
.r-calm .r-end__ctx, .r-calm .r-end__calm, .r-calm .r-end__saved, .r-calm .r-end__quiet .r-end__note, .r-calm .r-iab__why, .r-calm .r-iab__x { color: var(--c-on-soft); }
.r-calm .r-end__how { color: var(--c-on); }
.r-calm .r-end__note { background: none; border: 1.5px dashed var(--c-line); border-radius: 12px; }
/* round 5 (owner 2026-11-19 late, ROUND5.md 50/50): the actions get live's press feel back, rounded: Share = the navy-deep
   button with a 2 px ink rim and the small hard drop (0 3px 0 ink); Story = a cream card button (ink rim, ink type, the
   same drop); the next game = the yellow card with the ink rim and drop; Versus line = a cream card. The folds stay
   soft panels on the blue (they hold the shilla table / stats in light type). */
.r-calm .r-end__share, .r-calm .r-see { border: 2px solid var(--ink); border-radius: var(--rad); box-shadow: 0 3px 0 var(--ink); }
.r-calm .r-end__share::before, .r-calm .r-end__share::after { content: none; }
.r-calm .r-end__share:active, .r-calm .r-see:active { transform: none; translate: 0 2px; box-shadow: 0 1px 0 var(--ink); }
.r-calm .r-end__pair .r-end__story, .r-calm .r-end__story { background: var(--paper-clip); color: var(--c-ink); border: 2px solid var(--ink); border-radius: var(--rad); box-shadow: 0 3px 0 var(--ink); }
.r-calm .r-end__story:active { transform: none; translate: 0 2px; box-shadow: 0 1px 0 var(--ink); }
.r-calm .r-end__actions.is-peak { padding: 0; background: none; border: 0; box-shadow: none; }
.r-calm .r-end__pclose { color: var(--c-on); border: 0; border-radius: 12px; }
.r-calm .r-end__go a { border: 2px solid var(--ink); border-radius: var(--rad); box-shadow: 0 3px 0 var(--ink); }
.r-calm .r-end__go a:active { translate: 0 2px; box-shadow: 0 1px 0 var(--ink); }
@media (hover: hover) and (pointer: fine) { .r-calm .r-end__go a:hover { translate: 0 -1px; box-shadow: 0 4px 0 var(--ink); } }
.r-calm .r-end .r-iab__go { color: var(--c-on); }
.r-calm .r-end__quiet { border-top: 1px solid var(--c-line); }
.r-calm .r-end__fold { border: 0; border-radius: var(--rad); background: var(--c-soft); }
.r-calm .r-end__fold > summary { color: var(--c-on); }
.r-calm .r-end__fold > summary > small { background: var(--c-soft-hi); color: var(--c-on); border-radius: 6px; }
.r-calm .r-end__fold > summary::after { border: 0; border-radius: 50%; background: var(--c-soft-hi); }
.r-calm .r-end__fold[open] > summary { border-bottom: 1px solid var(--c-line); }
.r-calm .r-end__fold > summary:focus-visible { outline-color: var(--c-note); }
.r-calm a.r-end__go-vs { background: var(--paper-clip); border: 2px solid var(--ink); border-radius: var(--rad); box-shadow: 0 3px 0 var(--ink); color: var(--c-ink); }
.r-calm a.r-end__go-vs:active { translate: 0 2px; box-shadow: 0 1px 0 var(--ink); }
.r-calm .r-end__quiet .r-end__btn:not(.paper), .r-calm .r-end__btn.paper { background: none; color: var(--c-on); border: 1.5px solid rgba(251, 247, 236, .5); border-radius: 12px; box-shadow: none; }
.r-calm .r-end__btn { border: 0; border-radius: 12px; box-shadow: none; }
.r-calm .r-end__shape i { border: 0; border-radius: 3px; background: var(--c-soft-hi); }
.r-calm .r-end__shape i.v1 { background: var(--lime); }
.r-calm .r-end__shape i.v2 { background: var(--yellow); }
.r-calm .r-end__reveal li { background: var(--c-soft); border: 0; border-radius: 10px; }
.r-calm .r-end__tile { border: 0; border-radius: 8px; background: var(--c-soft); }
.r-calm .r-end__bar i { background: var(--c-soft-hi); border-radius: 0 4px 4px 0; }
.r-calm .r-end__bar i b { color: var(--c-on); }
.r-calm .r-end__bar i.is-zero { background: none; border-inline-start-color: var(--c-line); }
.r-calm .r-end__bar i.is-zero b { color: var(--c-on-soft); }
.r-calm .r-end__bar.is-now i { background: var(--c-action); }
.r-calm .r-end__out { background: var(--c-soft); border: 1.5px dashed var(--c-line); border-radius: 12px; color: var(--c-on); }
.r-calm .r-end__nick, .r-calm .r-end__install { background: var(--c-soft); border: 0; border-radius: var(--rad); box-shadow: none; }
.r-calm .r-end__nick input { border-radius: 10px; border: 0; }
.r-calm .r-end__h2h-p { border: 0; border-radius: 12px; background: var(--c-soft); }
.r-calm .r-end__h2h.is-win .is-me, .r-calm .r-end__h2h.is-lose .r-end__h2h-p:not(.is-me) { background: var(--yellow); color: var(--c-ink); box-shadow: none; }
.r-calm .r-end__h2h-vs { background: var(--c-action); border: 0; }
.r-calm .r-end__count, .r-calm .r-end__link, .r-calm .r-end__reads, .r-calm .r-end__nickis, .r-calm .r-end__q, .r-calm .r-end__a small, .r-calm .r-end__nick small,
.r-calm .r-end__remind-note, .r-calm .r-end__install small { color: var(--c-on-soft); }
.r-calm .r-end__count bdi, .r-calm .r-end__a, .r-calm .r-end__nick label { color: var(--c-on); }
.r-calm .r-end__n { border-radius: 6px; }
/* round 4: give up on the calm blue */
.r-calm .r-giveup { color: var(--c-on-soft); }
/* round 4: the reveal folds per-row count is plain light text, not a yellow tag (yellow = the counter only) */
.r-calm .r-end__reveal :is(.r-end__n, .r-tag) { background: none; color: var(--c-on-soft); padding: 0; border: 0; box-shadow: none; }

/* ===== round 6 (owner 2026-11-20, ROUND6.md K7): under the yellow next-game card, a thinner full-width strip "كل الألعاب" /
   "All games" to the contents page: an egg-white card (ink rim + the small hard drop), the label in Cairo 800 18 with the
   four-squares mark of the Games pill. Every game (and home) gets it from end.js. ===== */
.r-end__go a.r-end__go-all { flex-direction: row; align-items: center; justify-content: center; gap: var(--s2); min-height: 52px; padding: 0 var(--s4);
  background: var(--paper-clip, #FBF7EC); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--rad, 14px); box-shadow: 0 3px 0 var(--ink);
  font: 800 var(--fs-body, 18px)/1.4 var(--font-ui); text-align: center; }
.r-end__go-all svg { flex: 0 0 auto; width: 20px; height: 20px; }
.r-end__go a.r-end__go-all:active { translate: 0 2px; box-shadow: 0 1px 0 var(--ink); }
@media (hover: hover) and (pointer: fine) { .r-end__go a.r-end__go-all:hover { translate: 0 -1px; box-shadow: 0 4px 0 var(--ink); background: #fff; } }
