/* The results page in the same look as the home page (css/design.css): a score ring, the certificate first, the review,
 * the teacher's part folded. The test screens keep their original PISA-style look (sky-blue window, green buttons) at the
 * author's request. Loaded last. Everything sits under .app-results. */

/* ===================================================== results page ===== */
.app-results .hm-wrap, .app-results .km-wrap { max-width: 1040px; }
.app-results .km-res-main { padding: 0 0 48px; }
.app-results .results { max-width: none; }

/* the top: a ring and a few words */
.app-results .rh { margin: 0 calc(50% - 50vw); color: #fff; background:
  radial-gradient(800px 380px at 90% -20%, rgba(242, 180, 65, 0.22), transparent 60%),
  radial-gradient(600px 420px at 0% 120%, rgba(110, 200, 180, 0.2), transparent 60%),
  linear-gradient(135deg, #0d2b45, #17604f); }
.app-results .rh-in { max-width: 1040px; margin: 0 auto; padding: 40px 22px 44px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 34px; align-items: center; box-sizing: border-box; }
.app-results .rh-ring { position: relative; width: 190px; height: 190px; }
.app-results .rh-ring svg { display: block; width: 100%; height: 100%; }
.app-results .rh-arc { transition: stroke-dasharray 1s cubic-bezier(.2, .8, .2, 1); }
.app-results .rh-pct { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.app-results .rh-pct b { font-size: 46px; font-weight: 800; }
.app-results .rh-pct i { font-style: normal; font-size: 15px; color: #cde1e8; }
.app-results .rh-kicker { display: inline-block; margin-bottom: 8px; padding: 3px 14px; font-size: 14px; color: #d6f2ea; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 999px; }
.app-results .rh h1 { margin: 0 0 6px; font-size: 38px; line-height: 1.35; font-weight: 800; color: #fff; }
.app-results .rh p { margin: 0 0 18px; max-width: 560px; font-size: 17px; line-height: 1.8; color: #d3e3ec; }
.app-results .rh-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.app-results .rh-tile { min-width: 110px; padding: 8px 16px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 14px; }
.app-results .rh-tile b { display: block; font-size: 22px; line-height: 1.4; }
.app-results .rh-tile span { font-size: 13px; color: #c3d8e2; }
.app-results .rh-tile.warn { background: rgba(242, 180, 65, 0.2); border-color: rgba(242, 180, 65, 0.5); }
.app-results .rh-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.app-results .rh-cta button { font-family: inherit; cursor: pointer; transition: transform 0.15s, background 0.15s; }
.app-results .rh-main { min-height: 50px; padding: 0 24px; font-size: 17px; font-weight: 700; color: #1b2a14; background: #f2b441; border: 0; border-radius: 999px; box-shadow: 0 10px 22px -8px rgba(242, 180, 65, 0.7); }
.app-results .rh-alt { min-height: 50px; padding: 0 22px; font-size: 16px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1.5px solid rgba(255, 255, 255, 0.45); border-radius: 999px; }
.app-results .rh-main:hover, .app-results .rh-alt:hover { transform: translateY(-2px); }
.app-results .rh-link { min-height: 44px; padding: 0 6px; font-size: 15.5px; color: #cfe6ee; background: none; border: 0; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, 0.4); }
.app-results .rh-link:hover { color: #fff; }

/* sections as cards */
.app-results .results > :not(.rh) { max-width: 1040px; margin-left: auto; margin-right: auto; padding-left: 22px; padding-right: 22px; box-sizing: border-box; }
.app-results .cm-name, .app-results .cm-sharebar { max-width: 1040px; margin: 18px auto 0; border-radius: 16px; }
.app-results .res-sec { margin: 30px auto 0; }
.app-results .res-sec-h { margin: 0 0 12px; font-size: 24px; border: 0; padding: 0; }
.app-results .rv { margin: 34px auto 0; }
.app-results .rv h2 { border-bottom: 0; padding-bottom: 0; font-size: 24px; }
.app-results .rv-card { border: 0; border-left: 5px solid #b4546a; border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.app-results .rv-card:hover { box-shadow: var(--shadow); }
.app-results .rv-none { padding: 18px; background: #eaf6ee; border-radius: 16px; color: #1f6a3b; text-align: center; }
.app-results .rv-key { border-radius: 10px; }
.app-results .res-proc { border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); border: 0; margin-top: 30px; }
.app-results .res-actions-main { margin: 22px auto 0; display: flex; flex-wrap: wrap; gap: 10px; }
.app-results .btn { border-radius: 999px; min-height: 44px; }
.app-results .btn-primary { background: var(--teal); border-color: var(--teal); }
.app-results .res-teacher { margin: 34px auto 0; background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm); }
.app-results .res-teacher > summary { padding: 14px 20px; font-size: 17px; font-weight: 700; color: var(--ink-2); cursor: pointer; list-style: none; }
.app-results .res-teacher > summary::-webkit-details-marker { display: none; }
.app-results .res-teacher > summary::after { content: ' ▾'; color: var(--ink-3); }
.app-results .res-teacher[open] > summary::after { content: ' ▴'; }
.app-results .res-teacher > :not(summary) { margin-left: 20px; margin-right: 20px; }
.app-results .res-teacher > .res-actions { margin-bottom: 20px; }
.app-results .pisa-cert-wrap { margin-top: 0; }

@media (prefers-reduced-motion: no-preference) {
  .app-results .rh-in > * { animation: hm-up 0.6s both; }
  .app-results .rh-in > :nth-child(2) { animation-delay: 0.1s; }
}
@media (max-width: 760px) {
  .app-results .rh-in { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 28px 16px 34px; gap: 18px; }
  .app-results .rh-ring { width: 160px; height: 160px; }
  .app-results .rh-pct b { font-size: 38px; }
  .app-results .rh h1 { font-size: 30px; }
  .app-results .rh p { font-size: 16px; }
  .app-results .rh-tiles, .app-results .rh-cta { justify-content: center; }
  .app-results .rh-main, .app-results .rh-alt { flex: 1 1 100%; }
  .app-results .results > :not(.rh) { padding-left: 14px; padding-right: 14px; }
  .app-results .res-teacher > :not(summary) { margin-left: 12px; margin-right: 12px; }
}
@media print {
  .app-results .rh, .app-results .res-sec-h { display: none; }
  .app-results .results > :not(.rh) { padding-left: 0; padding-right: 0; max-width: none; }
}

/* ---- score by topic ---- */
.app-results .tb { margin: 30px auto 0; }
.app-results .tb-list { list-style: none; margin: 0; padding: 6px 0; background: #fff; border-radius: 18px; box-shadow: var(--shadow-sm); }
.app-results .tb-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(100px, 1fr) 132px 64px; align-items: center; gap: 6px 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.app-results .tb-row:last-child { border-bottom: 0; }
.app-results .tb-name { color: var(--ink); font-weight: 600; font-size: 16px; line-height: 1.55; text-decoration: none; }
.app-results .tb-name:hover { color: var(--teal-strong); text-decoration: underline; }
.app-results .tb-bar { height: 12px; background: #e8eeeb; border-radius: 999px; overflow: hidden; }
.app-results .tb-bar i { display: block; height: 100%; border-radius: 999px; background: var(--c); transform-origin: left; }
.app-results .tb-val { font-size: 14px; font-weight: 600; color: var(--ink-2); line-height: 1.5; text-align: right; }
.app-results .tone-great { --c: #2f9e6f; } .app-results .tone-good { --c: #2e7a70; } .app-results .tone-mid { --c: #c9862b; } .app-results .tone-low { --c: #b4546a; } .app-results .tone-wait { --c: #8a96a3; }
.app-results .tb-go { min-height: 38px; padding: 0 16px; font: 600 14px inherit; font-family: inherit; color: var(--teal-strong); background: var(--teal-soft); border: 0; border-radius: 999px; cursor: pointer; transition: background 0.15s, transform 0.15s; }
.app-results .tb-go:hover { background: #cfe8e1; transform: translateY(-1px); }
.app-results .tb-ok { justify-self: center; color: #2f9e6f; font-weight: 800; }
.app-results .tb-next { margin: 14px 0 0; }

/* ---- the answers to look at again ---- */
.app-results .rv-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.app-results .rv-filters button { min-height: 40px; padding: 0 16px; font: 600 14.5px inherit; font-family: inherit; color: var(--ink-2); background: #fff; border: 1.5px solid var(--line-2); border-radius: 999px; cursor: pointer; }
.app-results .rv-filters button[aria-pressed='true'] { color: #fff; background: var(--teal); border-color: var(--teal); }
.app-results .rv-group[hidden], .app-results .rv-card[hidden] { display: none; }
.app-results .rv-gh { display: flex; align-items: center; gap: 10px; margin: 22px 0 8px; font-size: 18px; color: var(--ink); }
.app-results .rv-gh span { padding: 0 10px; font-size: 13px; font-weight: 700; color: #fff; background: #b4546a; border-radius: 999px; line-height: 1.7; }
.app-results .rv-card { margin: 10px 0; padding: 0; overflow: hidden; }
.app-results .rv-card > summary { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 12px 18px; cursor: pointer; list-style: none; }
.app-results .rv-card > summary::-webkit-details-marker { display: none; }
.app-results .rv-card > summary::after { content: '▾'; color: var(--ink-3); grid-column: 4; }
.app-results .rv-card[open] > summary::after { content: '▴'; }
.app-results .rv-card > summary { grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto 18px; }
.app-results .rv-q { font-size: 16px; line-height: 1.5; }
.app-results .rv-q small { color: var(--ink-3); font-size: 13px; }
.app-results .rv-short { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink-3); }
.app-results .rv-card[open] .rv-short { visibility: hidden; }
.app-results .rv-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.app-results .rv-body .rv-said { margin: 12px 0; }
.app-results .rv-good { margin: 18px 0 0; padding: 12px 16px; font-size: 15px; line-height: 1.9; color: #1f6a3b; background: #eaf6ee; border-radius: 14px; }
.app-results .rv-act { margin-top: 18px; }

/* ---- the top comes alive ---- */
.app-results .rh { position: relative; overflow: hidden; }
.app-results .rh-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.app-results .rh-confetti i { position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px; opacity: 0; animation: rh-fall linear forwards; }
@keyframes rh-fall { 0% { opacity: 1; top: -14px; } 100% { opacity: 0.9; top: 105%; transform: rotate(540deg) translateX(30px); } }
@media (prefers-reduced-motion: no-preference) {
  .app-results .rh-arc { animation: rh-draw 1.1s cubic-bezier(.2, .8, .2, 1) both; }
  .app-results .tb-bar i { animation: tb-grow 0.9s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes rh-draw { from { stroke-dasharray: 0 400; } }
@keyframes tb-grow { from { transform: scaleX(0); } }
@media (max-width: 760px) {
  .app-results .tb-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; }
  .app-results .tb-bar { grid-column: 1 / -1; grid-row: 2; }
  .app-results .tb-val { grid-column: 1; grid-row: 3; font-size: 13px; }
  .app-results .tb-go, .app-results .tb-ok { grid-column: 2; grid-row: 1; }
  .app-results .rv-card > summary { grid-template-columns: minmax(0, 1fr) auto 18px; padding: 12px 14px; }
  .app-results .rv-short { display: none; }
  .app-results .rv-body { padding: 4px 14px 14px; }
}
@media print { .app-results .rh-confetti, .app-results .tb { display: none; } .app-results .rv-card > summary::after { display: none; } }
