/* Game-won card ("end card"), shared by every language page that uses _core/templates/main-game.php.
   One card over the board: a header (box + title) and a middle area holding two views in one grid cell
   (the result, and the level choice after "new game"), so switching views never moves the header.
   Sizes follow the board: the card is a size container and most values are in cqi (1% of its width). */

/* Bold weights for the card (the pages load only the regular weight). Rubik and Noto Sans are variable fonts. */
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url("/icons/fonts/rubik/rubik-hebrew-var.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url("/icons/fonts/rubik/rubik-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/icons/fonts/poppins/poppins-latin-w500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/icons/fonts/poppins/poppins-latin-w700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/icons/fonts/poppins/poppins-latin-w800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "NotoSans"; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url("/icons/fonts/noto-sans/noto-sans-greek-var.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "NotoSans"; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url("/icons/fonts/noto-sans/noto-sans-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

.game-over.end-card {
  --end-navy: rgb(52, 72, 97);
  --end-navy-700: rgb(42, 59, 81);
  --end-sky: #53a1d6;
  --end-sky-100: #e3f1fb;
  --end-sky-50: #f2f8fd;
  --end-slate: rgb(110, 125, 140);
  --end-line: rgb(225, 232, 240);
  --end-gold: #f2b632;
  --end-gold-50: #fff6df;
  --end-gold-line: #f6dc93;
  --end-gold-ink: #9a6b00;
  container-type: size;
  box-sizing: border-box;
  border: 0;
  background: linear-gradient(180deg, var(--end-sky-50), #fff 55%);
  color: var(--end-navy);
  text-align: center;
}
.end-card *, .end-card *::before, .end-card *::after { box-sizing: border-box; }
.end-card .end-inner {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 5cqi 7cqi;
  font-size: clamp(12px, 4.2cqi, 20px); /* cqi resolve against the card (its parent container), not the page */
}
.end-card [hidden]:not(.end-view) { display: none !important; }

/* header */
.end-card .end-box {
  flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: .9cqi; width: 18cqi; height: 18cqi; padding: 1.2cqi;
  border-radius: 12px; background: #fff; box-shadow: 0 0 0 1.5px var(--end-line), 0 8px 18px rgba(83, 161, 214, .22);
}
.end-card .end-box i { border-radius: 3px; background: var(--end-sky); }
.end-card .end-box i:nth-child(5) { background: var(--end-gold); }
.end-card.end-play .end-box i { animation: end-fill .25s ease-out both; }
.end-card.end-play .end-box i:nth-child(2) { animation-delay: .05s; } .end-card.end-play .end-box i:nth-child(3) { animation-delay: .1s; }
.end-card.end-play .end-box i:nth-child(4) { animation-delay: .15s; } .end-card.end-play .end-box i:nth-child(6) { animation-delay: .2s; }
.end-card.end-play .end-box i:nth-child(7) { animation-delay: .25s; } .end-card.end-play .end-box i:nth-child(8) { animation-delay: .3s; }
.end-card.end-play .end-box i:nth-child(9) { animation-delay: .35s; } .end-card.end-play .end-box i:nth-child(5) { animation-delay: .5s; }
@keyframes end-fill { from { transform: scale(.2); opacity: 0; } }
.end-card .end-title { flex: none; margin: 3.4cqi 0 0; padding: 0; font-size: 1.6em; font-weight: 700; line-height: 1.15; color: var(--end-navy); }
.end-card.end-ltr .end-title { font-weight: 800; letter-spacing: -.01em; }

/* middle: both views share one grid cell, so its height never changes */
.end-card .end-middle { display: grid; width: 100%; margin-top: 1.6cqi; }
.end-card .end-view { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; }
.end-card .end-view[hidden] { visibility: hidden; pointer-events: none; }
.end-card .end-view.end-in { animation: end-viewin .3s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes end-viewin { from { opacity: 0; transform: translateY(6px); } }

.end-card .end-num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.end-card .end-time { font-size: 2.4em; font-weight: 800; line-height: 1; }
.end-card .end-chip {
  display: inline-flex; align-items: center; gap: .4em; margin-top: 2cqi; padding: .3em .8em;
  border-radius: 999px; background: var(--end-sky-100); font-size: .85em; font-weight: 500;
}
.end-card .end-actions { display: flex; flex-direction: column; align-items: center; gap: 1cqi; width: 100%; margin-top: 4.4cqi; }

.end-card .end-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; margin: 0;
  min-height: max(44px, 12cqi); padding: 0 1.2em; border: 0; border-radius: 10px;
  font: inherit; font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, transform .1s ease;
}
.end-card .end-btn:active { transform: translateY(1px); }
.end-card .end-btn-primary { width: min(100%, 64cqi); background: var(--end-navy); color: #fff; font-size: 1.12em; box-shadow: 0 6px 16px rgba(52, 72, 97, .22); }
.end-card .end-btn-primary:hover { background: var(--end-navy-700); }
.end-card .end-btn-quiet { min-height: 40px; background: transparent; color: var(--end-navy); font-weight: 500; font-size: .92em; }
.end-card .end-btn-quiet:hover { background: var(--end-sky-50); }
.end-card :focus-visible { outline: 3px solid var(--end-sky); outline-offset: 2px; }

/* share: one button; on desktop it opens three small icons in its place */
.end-card .end-share-menu { display: flex; gap: 2.4cqi; justify-content: center; align-items: center; min-height: 40px; }
.end-card .end-share-menu button {
  display: grid; place-items: center; width: max(36px, 9cqi); height: max(36px, 9cqi); padding: 0; border: 0; border-radius: 50%;
  cursor: pointer; transition: transform .15s ease, background-color .2s ease;
}
.end-card .end-share-menu button:hover { transform: scale(1.08); }
.end-card .end-share-wa { background: #25d366; } .end-card .end-share-fb { background: #1877f2; } .end-card .end-share-copy { background: #6c757d; }
.end-card .end-share-copy.end-copied { background: #28a745; }

/* invitation (Hebrew: 2nd win today -> daily competition; other languages: a win at Hard -> hardest sudoku) */
.end-card .end-invite {
  display: flex; align-items: center; gap: .7em; width: 100%; margin-top: 2.6cqi; padding: .5em .8em; min-height: 44px;
  border-radius: 12px; background: var(--end-gold-50); box-shadow: inset 0 0 0 1.5px var(--end-gold-line);
  color: var(--end-navy); text-decoration: none; text-align: start;
}
.end-card .end-invite svg { flex: none; color: var(--end-gold); }
.end-card .end-invite[data-icon="second-win"] .end-ic-hard, .end-card .end-invite[data-icon="hard-win"] .end-ic-daily { display: none; }
.end-card .end-invite-txt { flex: 1; line-height: 1.25; font-size: .86em; }
.end-card .end-invite-txt b { display: block; font-size: 1.05em; font-weight: 700; }
.end-card .end-invite-go { flex: none; font-weight: 700; font-size: .85em; color: var(--end-gold-ink); }
.end-card.end-play .end-invite { animation: end-rise .45s cubic-bezier(.22, 1, .36, 1) .6s both; }
@keyframes end-rise { from { transform: translateY(12px); opacity: 0; } }

/* level choice */
.end-card .end-mini { display: inline-flex; gap: .5em; align-items: baseline; color: var(--end-slate); font-size: .9em; }
.end-card .end-mini b { color: var(--end-navy); font-size: 1.15em; font-weight: 700; }
.end-card .end-which { margin: 2.6cqi 0 2.2cqi; padding: 0; font-size: .92em; font-weight: 500; color: var(--end-slate); }
.end-card .end-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6cqi; width: calc(100% + 6cqi); margin-inline: -3cqi; }
.end-card .end-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5em; min-width: 0;
  min-height: max(56px, 18cqi); margin: 0; padding: .4em .15em; border: 0; border-radius: 12px;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--end-line); color: var(--end-navy);
  font: inherit; font-size: .9em; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.end-card.end-ltr .end-tile { font-size: max(11px, .8em); letter-spacing: -.01em; }
.end-card a.end-tile { text-decoration: none; }
.end-card .end-tile:hover, .end-card .end-tile[aria-current] { box-shadow: inset 0 0 0 2px var(--end-sky); background: var(--end-sky-50); }
.end-card .end-tile small { display: none; font-size: max(10px, .72em); color: var(--end-slate); font-weight: 400; }
.end-card .end-tile[aria-current] small { display: block; }

/* level pips: 1-4 bars */
.end-card .end-pips { display: inline-flex; gap: 3px; align-items: flex-end; direction: ltr; }
.end-card .end-pips i { width: 4px; border-radius: 2px; background: var(--end-line); }
.end-card .end-pips i:nth-child(1) { height: 7px; } .end-card .end-pips i:nth-child(2) { height: 10px; }
.end-card .end-pips i:nth-child(3) { height: 13px; } .end-card .end-pips i:nth-child(4) { height: 16px; }
.end-card .end-pips[data-l="1"] i:nth-child(-n+1), .end-card .end-pips[data-l="2"] i:nth-child(-n+2),
.end-card .end-pips[data-l="3"] i:nth-child(-n+3), .end-card .end-pips[data-l="4"] i { background: var(--end-sky); }

/* small boards (short laptop windows) */
@container (max-height: 340px) {
  .end-card .end-inner { padding: 3cqi 6cqi; }
  .end-card .end-box { width: 15cqi; height: 15cqi; }
  .end-card .end-title { margin-top: 2.4cqi; font-size: 1.4em; }
  .end-card .end-time { font-size: 2.1em; }
  .end-card .end-chip { margin-top: 1.4cqi; }
  .end-card .end-actions { margin-top: 3cqi; gap: 0; }
  .end-card .end-invite { margin-top: 1.8cqi; padding-block: .3em; }
  .end-card .end-which { margin: 1.6cqi 0; }
  .end-card .end-tile small { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .end-card *, .end-card *::before, .end-card *::after { animation: none !important; transition: none !important; }
}
