/* =====================================================================
   PlayStation Weihnachtsgewinnspiel 2026 – app page (/advent/{campaign})
   Design: Gabriel, „Adventskalender 2026 Blog Mini Version – V2“ (approved 16.11.2026).
   Desktop (≥ 900 px): white card = square game area left + side column right,
   centred on the dark Shapes background, never scrolls (iframe overlay in the blog).
   Mobile: one stacked card; the order of its parts depends on the step.
   ===================================================================== */

@font-face { font-family: 'PSAdv SST'; font-weight: 400; font-display: swap; src: url('fonts/SST-Roman-latin.40348.woff2') format('woff2'); }
@font-face { font-family: 'PSAdv SST'; font-weight: 500; font-display: swap; src: url('fonts/SST-Medium-latin.1167b.woff2') format('woff2'); }
@font-face { font-family: 'PSAdv SST'; font-weight: 700; font-display: swap; src: url('fonts/SST-Bold-latin.7c968.woff2') format('woff2'); }

:root {
  --deep: #000f55;           /* page background */
  --ps-blue: #0070cc;        /* primary buttons, links, current step */
  --ps-blue-hover: #0062b3;
  --gold: #f6c66a;
  --navy: #07123a;           /* prize panel */
  --navy-2: #142c78;
  --well: #eef1f7;           /* light well behind prize photos (Roland 26.11.: light, not blue) */
  --surface: #ffffff;
  --surface-2: #f1f4fa;      /* game area, list rows */
  --surface-3: #e3e7ee;
  --current-bg: #ecf3fc;
  --text: #1f1f1f;
  --text-2: #3c4043;
  --muted: #5f6368;
  --border: #c3c8d1;
  --input-border: #80868b;
  --error: #c5221f;
  --error-bg: #fbe9e9;
  --success: #137333;
  --success-bg: #e8f1eb;
  --hint-bg: #f9e8c6;
  --font: 'PSAdv SST', 'SST', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --r: 12px;
  --r-sm: 8px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: 220ms;
  /* Desktop geometry (frames 1440 × 900): area 696, column 328, gaps 12/32 */
  --area: 696px;
  --col: 328px;
}
@media (prefers-reduced-motion: reduce) { :root { --dur: 0ms; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body.psadv-page {
  min-height: 100vh; min-height: 100dvh;
  background-color: var(--deep);
  /* PlayStation Shapes (official geometry), white 10 %, see app.js SHAPE */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='148' height='154' viewBox='0 0 148 154' fill='%23fff' fill-opacity='.1'%3E%3Cpath transform='translate(37 38.5) scale(.62) translate(-396.26 -79.44)' d='M441.26,124.44h-90v-90h90V124.44z M428.17,47.53h-63.82v63.82h63.82V47.53z'/%3E%3Cpath transform='translate(111 38.5) scale(.62) translate(-83.6 -78.15)' d='M83.6,31.86L30,124.44h107.2L83.6,31.86z M52.7,111.35l30.9-53.37l30.9,53.37H52.7z'/%3E%3Cpath transform='translate(37 115.5) scale(.62) translate(-289.86 -79.43)' d='M334.86,43.69l-9.26-9.26l-35.74,35.74l-35.74-35.74l-9.26,9.26l35.74,35.74l-35.74,35.74l9.26,9.26l35.74-35.74l35.74,35.74l9.26-9.26l-35.74-35.74L334.86,43.69z'/%3E%3Cpath transform='translate(111 115.5) scale(.62) translate(-187.54 -79.44)' d='M187.54,30c-27.3,0-49.44,22.14-49.44,49.44c0,27.3,22.14,49.44,49.44,49.44c27.3,0,49.44-22.14,49.44-49.44C236.98,52.14,214.84,30,187.54,30z M187.54,115.79c-20.04,0-36.35-16.31-36.35-36.35c0-20.04,16.31-36.35,36.35-36.35c20.04,0,36.35,16.31,36.35,36.35C223.89,99.48,207.58,115.79,187.54,115.79z'/%3E%3C/svg%3E");
  background-size: 148px 154px;
  font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--text);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
.psadv-app { position: relative; min-height: 100vh; min-height: 100dvh; padding: 0 16px 16px; }
.psadv-app button { font-family: inherit; }
.psadv-app a { color: var(--ps-blue); }
.psadv-noscript { margin: 0; padding: 24px; color: #fff; }
.psadv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Bar: wordmark + close ---------- */
.psadv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; margin: 0 -4px 0 4px; }
.psadv-wordmark { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.2; color: #fff; }
.psadv-close {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.psadv-close:hover { background: rgba(255, 255, 255, .22); }
.psadv-close svg { width: 22px; height: 22px; }
.psadv-close:focus-visible, .psadv-btn:focus-visible, .psadv-answer:focus-visible, .psadv-linkbtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Card ---------- */
.psadv-stage {
  display: flex; flex-direction: column; gap: 16px;
  max-width: 480px; margin: 0 auto; padding: 16px;
  border-radius: var(--r); background: var(--surface); box-shadow: 0 16px 48px rgba(0, 4, 30, .45);
}
.psadv-head, .psadv-body, .psadv-area, .psadv-foot, .psadv-prizecard { min-width: 0; }
/* Mobile: the card fills the screen and the button sits at the bottom (V2), except the short end states */
@media (max-width: 899px) {
  .psadv-stage:not([data-step="done"]):not([data-step="already"]):not([data-step="idle"]) { min-height: calc(100vh - 76px); min-height: calc(100dvh - 76px); }
}
.psadv-foot { margin-top: auto; }
.psadv-head__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 8px; }
.psadv-daytag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px;
  border: 1px solid var(--ps-blue); border-radius: 4px; color: var(--ps-blue);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1;
}
.psadv-date { font-size: 14px; color: var(--muted); }
.psadv-title { margin: 0 0 6px; font-size: 26px; font-weight: 700; line-height: 1.2; outline: none; }
.psadv-instr { margin: 0; font-size: 15px; color: var(--text-2); }

/* Mobile order of the parts, per step */
.psadv-head { order: 1; }
.psadv-prizecard { order: 2; }
.psadv-area { order: 3; }
.psadv-body { order: 4; }
.psadv-foot { order: 5; }
.psadv-stage[data-step="play"] .psadv-body,
.psadv-stage[data-step="solved"] .psadv-body,
.psadv-stage[data-step="closed"] .psadv-body,
.psadv-stage[data-step="offline"] .psadv-body,
.psadv-stage[data-step="error"] .psadv-body { order: 2; }
.psadv-stage[data-step="form"] .psadv-area,
.psadv-stage[data-step="done"] .psadv-area,
.psadv-stage[data-step="already"] .psadv-area { display: none; }   /* mobile: compact prize card instead */

/* ---------- Game area ---------- */
.psadv-area { position: relative; border-radius: var(--r); background: var(--surface-2); overflow: hidden; }
.psadv-game { padding: 16px; }
.psadv-stage[data-step="start"] .psadv-area,
.psadv-stage[data-step="solved"] .psadv-area,
.psadv-stage[data-step="closed"] .psadv-area,
.psadv-stage[data-step="offline"] .psadv-area,
.psadv-stage[data-step="error"] .psadv-area { min-height: 260px; }
.psadv-stage[data-step="solved"] .psadv-area { min-height: 540px; }

/* Blurred preview behind start / solved / closed / offline */
.psadv-preview { position: absolute; inset: 0; padding: 16px; filter: blur(10px); opacity: .55; pointer-events: none; user-select: none; }
.psadv-veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; background: rgba(220, 229, 242, .79); }
.psadv-veil__icon { display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 12px; border-radius: 50%; background: var(--ps-blue); color: #fff; font-size: 48px; font-weight: 700; line-height: 1; }
.psadv-veil__icon svg { width: 46px; height: 46px; }
.psadv-veil__title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.psadv-veil__sub { margin: 0; font-size: 16px; color: var(--text-2); }
/* Start screen: today's prize under the start line (Claudia 25.11.) */
.psadv-veilprize { display: flex; align-items: center; gap: 12px; max-width: 100%; margin-top: 16px; padding: 8px 16px 8px 8px; border-radius: var(--r); background: #fff; box-shadow: 0 4px 16px rgba(0, 15, 85, .12); text-align: left; }
.psadv-veilprize__img { flex: none; display: block; box-sizing: border-box; width: 64px; height: 64px; padding: 4px; border-radius: var(--r-sm); background: var(--well); }
.psadv-veilprize__img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.psadv-veilprize__txt { display: flex; flex-direction: column; min-width: 0; }
.psadv-veilprize__kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ps-blue); }
.psadv-veilprize__name { font-size: 15px; font-weight: 700; line-height: 1.25; text-wrap: balance; }
.psadv-veil__icon { flex: none; }
/* Mobile start (Claudia 26.11., FB-29CD8A; Roland: „Los geht’s“ visible without scrolling): no blurred preview
   (it looked unfinished and bled out under the veil) – a compact card with the start line and today's prize,
   tighter steps, and the button pinned to the bottom of the screen while the card is taller than the screen. */
@media (max-width: 899px) {
  .psadv-stage[data-step="start"] .psadv-area { min-height: 0; }
  .psadv-stage[data-step="start"] .psadv-preview { display: none; }
  .psadv-stage[data-step="start"] .psadv-veil { position: static; gap: 2px; padding: 16px; background: none; }
  .psadv-stage[data-step="start"] .psadv-veil__icon { display: none; }
  .psadv-stage[data-step="start"] .psadv-veil__title { font-size: 20px; }
  .psadv-stage[data-step="start"] .psadv-veil__sub { font-size: 14px; }
  .psadv-stage[data-step="start"] .psadv-veilprize { align-self: stretch; margin-top: 12px; }
  .psadv-stage[data-step="start"] .psadv-veilprize__img { width: 84px; height: 84px; }
  .psadv-stage[data-step="start"] .psadv-label { margin-bottom: 6px; }
  .psadv-stage[data-step="start"] .psadv-rows--how { gap: 4px; }
  .psadv-stage[data-step="start"] .psadv-rows--how li { min-height: 0; padding-top: 7px; padding-bottom: 7px; font-size: 14px; line-height: 1.3; }
  .psadv-stage[data-step="start"] .psadv-rows--how .psadv-num { width: 22px; height: 22px; font-size: 12px; }
  .psadv-stage[data-step="start"] .psadv-howtip { margin-top: 6px; font-size: 12px; }
  .psadv-stage[data-step="start"] .psadv-foot {
    position: sticky; bottom: 0; z-index: 2; margin: 0 -16px -16px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 0 0 var(--r) var(--r); background: linear-gradient(rgba(255, 255, 255, 0), var(--surface) 12px);
  }
}
.psadv-veil--ok .psadv-veil__icon { width: 84px; height: 84px; background: var(--success-bg); border: 3px solid var(--success); color: var(--success); }
.psadv-veil--dim { background: rgba(220, 229, 242, .6); }
.psadv-progress { width: 136px; height: 3px; margin-top: 12px; border-radius: 2px; background: var(--border); overflow: hidden; }
.psadv-progress i { display: block; height: 100%; width: 0; background: var(--ps-blue); animation: psadv-fill 1.6s linear forwards; }
@keyframes psadv-fill { to { width: 100%; } }
.psadv-progress + .psadv-veil__sub { margin-top: 8px; font-size: 12px; }
.psadv-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--hint-bg); color: var(--text); font-size: 13px; font-weight: 500;
}
.psadv-badge--err { background: var(--error-bg); color: var(--error); }
.psadv-badge svg { width: 14px; height: 14px; }

/* ---------- Column parts ---------- */
.psadv-label { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 10px; font-size: 16px; font-weight: 500; }
.psadv-label span { font-size: 14px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.psadv-stage[data-step="play"] .psadv-label, .psadv-stage[data-step="solved"] .psadv-label { margin: 0; }
.psadv-rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.psadv-rows li {
  display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; padding: 10px 12px;
  border-radius: var(--r-sm); background: var(--surface-2); font-size: 15px; color: var(--text-2);
}
.psadv-num {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 700; line-height: 1;
}
.psadv-rows--how li { min-height: 50px; }
.psadv-rows--how .psadv-num { width: 26px; height: 26px; font-size: 14px; background: var(--ps-blue); color: #fff; }
.psadv-rows--how b { font-weight: 500; color: var(--ps-blue); }
.psadv-howtip { margin: 10px 0 0; font-size: 13px; line-height: 1.4; color: var(--text-2, inherit); }
.psadv-rows li.is-done { background: var(--success-bg); color: var(--text); }
.psadv-rows li.is-done .psadv-num { background: var(--success); color: #fff; }
.psadv-rows li.is-current { background: var(--current-bg); box-shadow: inset 0 0 0 1px var(--ps-blue); color: var(--text); font-weight: 500; }
.psadv-rows li.is-current .psadv-num { background: var(--ps-blue); color: #fff; }
.psadv-rows li.is-todo { color: var(--muted); }
.psadv-ok { margin-left: auto; padding: 3px 6px; border: 1px solid var(--success); border-radius: 4px; background: #fff; color: var(--success); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1; }
.psadv-rows--list { display: none; }   /* per-game list: desktop only, mobile shows the counter */

.psadv-msg__title { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.psadv-msg__text { margin: 0; font-size: 15px; color: var(--text-2); }
.psadv-next { margin: 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 15px; color: var(--text-2); }
.psadv-next b { color: var(--text); }

/* ---------- Foot: button, note, steps ---------- */
.psadv-foot { display: flex; flex-direction: column; gap: 14px; }
.psadv-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; padding: 0 24px;
  border: 0; border-radius: 999px; background: var(--ps-blue); color: #fff !important; cursor: pointer;
  font: 500 16px/1 var(--font); text-decoration: none; transition: background var(--dur) var(--ease);
}
.psadv-btn:hover { background: var(--ps-blue-hover); }
.psadv-btn--ghost { background: #fff; color: var(--ps-blue) !important; box-shadow: inset 0 0 0 1.5px var(--ps-blue); }
.psadv-btn--ghost:hover { background: var(--current-bg); }
.psadv-btn[disabled], .psadv-btn[aria-busy="true"] { opacity: .6; cursor: default; }
.psadv-previewtag { display: inline-block; margin-left: 8px; padding: 3px 8px; border-radius: 4px; background: var(--gold); color: var(--deep); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; }
.psadv-note--preview { margin: 0 !important; padding: 8px 10px; border-radius: var(--r-sm); background: var(--hint-bg); color: var(--text) !important; }
.psadv-note { margin: -4px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.psadv-steps { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 15px; color: var(--muted); white-space: nowrap; }
.psadv-steps li { display: flex; align-items: center; gap: 6px; margin: 0; }
.psadv-steps li + li::before { content: ""; width: 10px; height: 1px; margin-right: 2px; background: var(--border); }
.psadv-steps .psadv-num { width: 22px; height: 22px; font-size: 11px; }
.psadv-steps li.is-current { color: var(--text); font-weight: 500; }
.psadv-steps li.is-current .psadv-num { background: var(--ps-blue); color: #fff; }
.psadv-steps li.is-done { color: var(--text); }
.psadv-steps li.is-done .psadv-num { background: var(--success); color: #fff; }
.psadv-steps li.is-done + li::before { background: var(--success); }

/* ---------- Prize: compact card (mobile) and hero (desktop area) ---------- */
.psadv-prizecard { display: none; }
.psadv-stage[data-step="form"] .psadv-prizecard,
.psadv-stage[data-step="done"] .psadv-prizecard,
.psadv-stage[data-step="already"] .psadv-prizecard { display: grid; }
.psadv-prizecard {   /* mobile: the prize big on a light well, name below (Claudia 25.11.) */
  grid-template-columns: minmax(0, 1fr); gap: 12px;
  padding: 0; border-radius: var(--r); background: none; color: var(--text);
}
.psadv-prizecard__img { height: 180px; padding: 12px; border-radius: var(--r); background: var(--well); overflow: hidden; }
.psadv-prizecard__img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.psadv-prizecard__txt { text-align: center; }
.psadv-prizecard .psadv-tags { justify-content: center; }
.psadv-prizecard .psadv-tag--ok { border-color: var(--success); color: var(--success); background: var(--success-bg); }
.psadv-prizeday { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ps-blue); }
.psadv-prizename { margin: 0 0 8px; font-size: 20px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; text-wrap: balance; }
.psadv-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.psadv-tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 1px solid var(--gold); border-radius: 6px; color: var(--gold); font-size: 12px; font-weight: 500; line-height: 1; }
.psadv-tag--ok { border-color: #94dbac; color: #94dbac; }

.psadv-hero { display: flex; flex-direction: column; height: 100%; padding: 20px 22px 24px; background: var(--navy); color: #fff; }
.psadv-hero__img { position: relative; flex: 1 1 auto; min-height: 0; margin-bottom: 22px; border-radius: var(--r-sm); background: var(--well); }
.psadv-hero__img img { position: absolute; top: 16px; left: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: contain; }
.psadv-hero__kicker { margin: 0 0 4px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.psadv-hero__name { margin: 0 0 10px; font-size: 28px; font-weight: 700; line-height: 1.2; text-wrap: balance; }
.psadv-hero .psadv-tag { height: 26px; font-size: 13px; }
.psadv-hero__text { margin: 12px 0 0; font-size: 14px; color: rgba(255, 255, 255, .85); }
.psadv-stamp {
  position: absolute; right: -14px; bottom: -14px; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 2px solid var(--success); border-radius: 6px; background: var(--success-bg);
  color: var(--success); font-size: 15px; font-weight: 700; transform: rotate(-8deg); box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}

/* ---------- Form ---------- */
.psadv-field { margin: 0 0 18px; }
.psadv-field label { display: block; margin: 0 0 8px; font-size: 16px; font-weight: 500; }
.psadv-input {
  width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--input-border); border-radius: var(--r-sm);
  background: #fff; color: var(--text); font: 400 16px/1 var(--font); -webkit-appearance: none; appearance: none;
}
.psadv-input::placeholder { color: #9aa0a6; }
.psadv-input:focus { outline: none; border-color: var(--ps-blue); box-shadow: 0 0 0 3px rgba(0, 112, 204, .25); }
.psadv-input[aria-invalid="true"] { border: 2px solid var(--error); }
.psadv-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 14px; line-height: 1.45; cursor: pointer; }
.psadv-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ps-blue); cursor: pointer; }
.psadv-check input[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 1px; }
.psadv-err { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; font-size: 14px; color: var(--error); }
.psadv-err::before { content: "!"; flex: none; display: grid; place-items: center; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; background: var(--error); color: #fff; font-size: 11px; font-weight: 700; }
.psadv-banner { margin: 18px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--error-bg); font-size: 13px; color: var(--text-2); }
.psadv-banner b { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 14px; color: var(--error); }
.psadv-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.psadv-linkbtn { padding: 0; border: 0; background: none; color: var(--ps-blue); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Quiz ---------- */
.psadv-quiz__q { margin: 0 0 14px; font-size: 18px; font-weight: 500; line-height: 1.3; }
.psadv-quiz__img { display: block; width: 100%; aspect-ratio: 16 / 8; margin: 0 0 12px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); }
.psadv-quiz__art { display: grid; place-items: center; padding: 0 12%; background: radial-gradient(circle at 30% 25%, #2f7fe8, #0b4fbf 55%, #062f8a); color: rgba(255, 255, 255, .9); }
.psadv-quiz__art svg { width: 100%; max-height: 46%; }
.psadv-quiz__answers { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.psadv-answer {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 14px; text-align: left;
  border: 0; border-radius: var(--r-sm); background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  font: 400 16px/1.25 var(--font); cursor: pointer; transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.psadv-answer:hover:not([disabled]) { box-shadow: inset 0 0 0 1.5px var(--ps-blue); }
.psadv-answer[disabled] { cursor: default; }
.psadv-answer b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--text-2); }
.psadv-answer.is-wrong { background: var(--error-bg); box-shadow: inset 0 0 0 2px var(--error); }
.psadv-answer.is-wrong b { background: var(--error); color: #fff; }
.psadv-answer.is-right { background: var(--success-bg); box-shadow: inset 0 0 0 2px var(--success); }
.psadv-answer.is-right b { background: var(--success); color: #fff; }
.psadv-toast { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 8px 10px; border-radius: var(--r-sm); background: var(--error-bg); font-size: 13px; color: var(--text); }
.psadv-toast::before { content: "!"; flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--error); color: #fff; font-size: 12px; font-weight: 700; }
@keyframes psadv-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.psadv-shake { animation: psadv-shake 200ms var(--ease) 2; }
@media (prefers-reduced-motion: reduce) { .psadv-shake { animation: none; } .psadv-progress i { animation-duration: 0s; } }

/* ---------- Shared game parts ---------- */
.psadv-label--sub { margin: 0 0 8px !important; }
.psadv-pair { display: flex; gap: 12px; margin-top: 16px; }
.psadv-pair .psadv-btn { flex: 1 1 0; min-width: 0; }
.psadv-extra { order: 4; }
.psadv-hintbox { margin: 0; padding: 10px 14px; border-radius: var(--r-sm); background: var(--hint-bg); font-size: 15px; color: var(--text); }
.psadv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.psadv-chips li { padding: 5px 10px; border-radius: 999px; background: var(--surface-3); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.psadv-chips s { text-decoration-thickness: 1.5px; }
.psadv-stage[data-step="play"] .psadv-scr__label + .psadv-hintbox { margin-top: 0; }
@media (max-width: 899px) { .psadv-app .psadv-desk { display: none !important; } }

/* ---------- Sliding puzzle ---------- */
.psadv-stage[data-mech="sliding"] .psadv-area,
.psadv-stage[data-mech="memory"] .psadv-area { background: transparent; overflow: visible; }
.psadv-stage[data-mech="sliding"][data-step="play"] .psadv-game,
.psadv-stage[data-mech="memory"][data-step="play"] .psadv-game { padding: 0; }
.psadv-slide__board {
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 4px;
  aspect-ratio: 1; padding: 4px; border-radius: var(--r); background: #0b1640; overflow: hidden;
}
.psadv-tile {
  position: relative; display: block; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 6px; overflow: hidden;
  background: radial-gradient(circle at 30% 30%, #3a8af0, #0b4fbf 60%, #072f88); cursor: default;
}
.psadv-tile--gap { background: transparent; }
.psadv-tile.is-movable { cursor: pointer; }
.psadv-tile.is-movable::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 3px var(--gold); pointer-events: none; }
.psadv-tile.is-movable:hover::after { box-shadow: inset 0 0 0 4px var(--gold); }
.psadv-tile:focus-visible { outline: 3px solid #fff; outline-offset: -3px; z-index: 1; }
.psadv-tile__img { position: absolute; top: 0; left: 0; width: 300%; height: 300%; max-width: none; object-fit: cover; pointer-events: none; user-select: none; }
.psadv-tile__img--2 { left: -100%; } .psadv-tile__img--3 { left: -200%; }
.psadv-tile__img--4 { top: -100%; } .psadv-tile__img--5 { top: -100%; left: -100%; } .psadv-tile__img--6 { top: -100%; left: -200%; }
.psadv-tile__img--7 { top: -200%; } .psadv-tile__img--8 { top: -200%; left: -100%; }
.psadv-tile b {
  position: absolute; z-index: 1; top: 8px; left: 8px; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px;
  border-radius: 4px; background: rgba(0, 15, 85, .85); color: #fff; font-size: 14px; font-weight: 500; line-height: 1;
}
.psadv-slide__peek { position: absolute; z-index: 2; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 8px; object-fit: cover; opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); }
.psadv-slide__board.is-peek .psadv-slide__peek { opacity: 1; }
.psadv-slide .psadv-btn--ghost { margin-top: 16px; }
/* Preview helper for the sliding puzzle (data-preview only) */
.psadv-tile.is-hint::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; box-shadow: inset 0 0 0 4px #e8364f; pointer-events: none; animation: psadv-hint 1s ease-in-out infinite alternate; }
@keyframes psadv-hint { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .psadv-tile.is-hint::before { animation: none; } }
.psadv-debug { margin-top: 16px; padding: 12px 14px; border: 2px dashed #e8364f; border-radius: var(--r-sm); background: #fff5f6; color: var(--text); font-size: 14px; }
.psadv-debug__head { margin: 0 0 4px; font-weight: 700; color: #b0213a; }
.psadv-debug__head span { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.psadv-debug__moves { margin: 0 0 10px; overflow-wrap: anywhere; }
.psadv-slide .psadv-debug .psadv-btn--ghost { margin-top: 0; }
.psadv-target { display: block; width: 100%; aspect-ratio: 1; margin-top: 14px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-2); }

/* ---------- Memory ---------- */
.psadv-mem__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.psadv-mem__grid li { min-width: 0; min-height: 0; margin: 0; }
.psadv-card {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px;   /* square (Roland 26.11.) */
  background: transparent; cursor: pointer; perspective: 700px;
}
.psadv-card[aria-disabled="true"] { cursor: default; }
.psadv-card__back, .psadv-card__face {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 10px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden; transition: transform 300ms var(--ease);
}
.psadv-card__back { background: var(--ps-blue); color: #fff; }
.psadv-card__back svg { width: 34%; max-width: 40px; height: auto; }
.psadv-card:hover:not([aria-disabled="true"]) .psadv-card__back { background: var(--ps-blue-hover); }
.psadv-card__face { padding: 0; overflow: hidden; background: #fff; transform: rotateY(180deg); box-shadow: 0 6px 16px rgba(0, 15, 85, .22); }
.psadv-card__face img { display: block; width: 100%; height: 100%; object-fit: cover; }   /* motifs are 1:1 – game thumbnails edge to edge */
.psadv-card.is-open .psadv-card__back, .psadv-card.is-found .psadv-card__back { transform: rotateY(-180deg); }
.psadv-card.is-open .psadv-card__face, .psadv-card.is-found .psadv-card__face { transform: rotateY(0); }
.psadv-card.is-open { transform: rotate(-1.5deg); }
.psadv-card.is-found .psadv-card__face { box-shadow: 0 0 0 1.5px var(--success); }
.psadv-card__check {
  position: absolute; z-index: 1; top: -7px; right: -7px; display: grid; place-items: center; width: 22px; height: 22px;
  border: 2px solid #fff; border-radius: 50%; background: var(--success); color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
}
/* cards are re-rendered, so the flip runs as an animation on the changed card */
.psadv-card.is-flip-in .psadv-card__face { animation: psadv-face-in 300ms var(--ease); }
.psadv-card.is-flip-in .psadv-card__back { animation: psadv-back-in 300ms var(--ease); }
.psadv-card.is-flip-out .psadv-card__face { animation: psadv-face-out 300ms var(--ease); }
.psadv-card.is-flip-out .psadv-card__back { animation: psadv-back-out 300ms var(--ease); }
@keyframes psadv-face-in { from { transform: rotateY(180deg); } }
@keyframes psadv-back-in { from { transform: rotateY(0); } }
@keyframes psadv-face-out { from { transform: rotateY(0); } }
@keyframes psadv-back-out { from { transform: rotateY(-180deg); } }
.psadv-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.psadv-mem__found { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.psadv-mem__found li { aspect-ratio: 1; margin: 0; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.psadv-mem__found img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Word scramble ---------- */
.psadv-scr__top { display: grid; grid-template-areas: "label" "pool" "hint"; }
.psadv-scr__top .psadv-scr__label { grid-area: label; }
.psadv-scr__pool { grid-area: pool; }
.psadv-scr__hint { grid-area: hint; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.psadv-scr__label { margin: 0 0 10px; font-size: 15px; font-weight: 500; }
.psadv-scr__pool, .psadv-scr__slots { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.psadv-scr__pool { padding: 8px; border-radius: var(--r); background: var(--surface-3); box-shadow: inset 0 0 0 1px #d8dde6; }
.psadv-scr__pool li, .psadv-scr__slots li { flex: 1 1 0; min-width: 0; max-width: 72px; margin: 0; }
.psadv-scr__pool, .psadv-scr__slots { justify-content: center; }
.psadv-scr__sol { margin-top: 20px; }
.psadv-letter, .psadv-slot {
  display: grid; place-items: center; width: 100%; height: 60px; padding: 0; border: 0; border-radius: var(--r-sm);
  font: 700 20px/1 var(--font); text-transform: uppercase;
}
.psadv-letter { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); cursor: pointer; }
.psadv-letter:hover:not([aria-disabled="true"]) { box-shadow: inset 0 0 0 1.5px var(--ps-blue); }
.psadv-letter.is-used { background: transparent; box-shadow: none; color: #9aa0a6; font-weight: 500; cursor: default; }
.psadv-letter[aria-disabled="true"] { cursor: default; }
.psadv-slot { background: #f8f9fb; color: #fff; }
.psadv-slot.is-filled { background: #142a78; cursor: pointer; }
.psadv-slot.is-next { background: #fff; box-shadow: inset 0 0 0 2px var(--ps-blue); }
.psadv-slot.is-next::after { content: ""; width: 40%; height: 2px; margin-top: 22px; background: var(--ps-blue); }
.psadv-letter:focus-visible, .psadv-slot:focus-visible, .psadv-item:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.psadv-scr .psadv-toast, .psadv-order .psadv-toast { margin-top: 14px; }

/* ---------- Order ---------- */
.psadv-order__q { margin: 0 0 14px; font-size: 18px; font-weight: 700; line-height: 1.3; text-wrap: balance; }   /* per-day heading (Claudia 25.11.) */
.psadv-order__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.psadv-order__list li { margin: 0; }
.psadv-item { display: flex; align-items: stretch; gap: 12px; width: 100%; padding: 0; border: 0; background: none; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.psadv-item[aria-disabled="true"] { cursor: default; }
.psadv-item__pos {
  flex: none; display: grid; place-items: center; width: 44px; min-height: 64px; border: 1.5px dashed #9aa0a6; border-radius: 999px;
  background: var(--surface-2); font-size: 17px; font-weight: 500; color: var(--text-2);
}
.psadv-item__card {
  flex: 1 1 auto; display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 64px; padding: 10px 16px;
  border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); transition: box-shadow var(--dur) var(--ease);
}
.psadv-item:hover:not([aria-disabled="true"]) .psadv-item__card { box-shadow: inset 0 0 0 1.5px var(--ps-blue), 0 1px 3px rgba(0, 0, 0, .08); }
.psadv-item__label { font-size: 17px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.psadv-item__cover { flex: none; width: 36px; height: 44px; border-radius: 4px; object-fit: cover; }
.psadv-item.is-picked .psadv-item__pos { border: 0; background: var(--ps-blue); color: #fff; font-weight: 700; }
.psadv-item.is-picked .psadv-item__card { box-shadow: inset 0 0 0 1.5px var(--ps-blue), 0 6px 16px rgba(0, 112, 204, .15); }
/* locked after a wrong check: already in the right place */
.psadv-item.is-fixed { cursor: default; }
.psadv-item.is-fixed .psadv-item__pos { background: var(--success); }
.psadv-item.is-fixed .psadv-item__card { background: var(--success-bg); box-shadow: inset 0 0 0 1.5px var(--success); }
.psadv-rows--order li { min-height: 38px; padding: 6px 10px; font-size: 14px; }
.psadv-rows--order li.is-set { color: var(--text); }
.psadv-rows--order li.is-set .psadv-num { background: var(--ps-blue); color: #fff; }
.psadv-rows--order li.is-todo .psadv-num { background: #fff; }
.psadv-rows--order li.is-fixed { background: var(--success-bg); }
.psadv-rows--order li.is-fixed .psadv-num { background: var(--success); }

/* ---------- Motion: short, soft, never in the way (all off under prefers-reduced-motion) ---------- */
/* card rises once when the page opens; content eases in when the step changes */
.psadv-stage { animation: psadv-card-in 420ms var(--ease) both; }
@keyframes psadv-card-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.psadv-stage.is-entering > * { animation: psadv-enter 360ms var(--ease) both; }
.psadv-stage.is-entering > .psadv-prizecard, .psadv-stage.is-entering > .psadv-body { animation-delay: 50ms; }
.psadv-stage.is-entering > .psadv-area { animation-delay: 90ms; }
.psadv-stage.is-entering > .psadv-extra, .psadv-stage.is-entering > .psadv-foot { animation-delay: 130ms; }
@keyframes psadv-enter { from { opacity: 0; transform: translateY(8px); } }

/* press feedback */
.psadv-btn, .psadv-answer, .psadv-letter, .psadv-slot, .psadv-item__card, .psadv-card { transition-property: background, box-shadow, transform; transition-duration: var(--dur); transition-timing-function: var(--ease); }
.psadv-btn:active:not([disabled]), .psadv-answer:active:not([disabled]), .psadv-letter:active:not([aria-disabled="true"]),
.psadv-slot.is-filled:active, .psadv-item:active:not([aria-disabled="true"]) .psadv-item__card { transform: scale(.97); transition-duration: 90ms; }
.psadv-card:hover:not([aria-disabled="true"]) { transform: translateY(-2px); }

/* quiz: the next question slides in */
.psadv-fx-next { animation: psadv-next 320ms var(--ease) both; }
@keyframes psadv-next { from { opacity: 0; transform: translateX(16px); } }

/* solved: ring scales in, the check draws itself, the text follows */
.psadv-stage.is-entering .psadv-veil--ok .psadv-veil__icon { animation: psadv-ring 380ms cubic-bezier(.2, .9, .3, 1.15) 120ms both; }
@keyframes psadv-ring { from { opacity: 0; transform: scale(.6); } }
.psadv-veil__icon svg { width: 48px; height: 48px; }
.psadv-checkdraw { stroke-dasharray: 22; stroke-dashoffset: 0; }
.psadv-stage.is-entering .psadv-checkdraw { animation: psadv-draw 360ms ease-out 380ms both; }
@keyframes psadv-draw { from { stroke-dashoffset: 22; } }
.psadv-stage.is-entering .psadv-veil--ok > p, .psadv-stage.is-entering .psadv-veil--ok > .psadv-progress { animation: psadv-enter 320ms var(--ease) 450ms both; }

/* done: the stamp is pressed on, the tags follow */
.psadv-stage.is-entering .psadv-stamp { animation: psadv-stamp 420ms cubic-bezier(.3, 1.3, .5, 1) 380ms both; }
@keyframes psadv-stamp { from { opacity: 0; transform: rotate(-8deg) scale(1.6); } }
.psadv-stage.is-entering .psadv-tag--ok { animation: psadv-pop 320ms cubic-bezier(.3, 1.3, .5, 1) 380ms both; }

/* memory: found pair pulses, mismatch nudges before it closes */
.psadv-fx-match { animation: psadv-pulse 420ms var(--ease) 260ms both; }
.psadv-fx-match .psadv-card__check { animation: psadv-pop 300ms cubic-bezier(.3, 1.3, .5, 1) 300ms both; }
@keyframes psadv-pulse { 50% { transform: scale(1.05); } }
.psadv-fx-miss { animation: psadv-nudge 300ms var(--ease); }
@keyframes psadv-nudge { 25% { transform: translateX(-3px) rotate(-1.5deg); } 75% { transform: translateX(3px) rotate(-1.5deg); } }

/* scramble letter / order number snaps into place */
.psadv-fx-pop { animation: psadv-pop 240ms cubic-bezier(.3, 1.3, .5, 1) both; }
@keyframes psadv-pop { from { opacity: 0; transform: scale(.6); } }

@media (prefers-reduced-motion: reduce) {
  .psadv-app *, .psadv-app *::before, .psadv-app *::after, .psadv-stage { animation: none !important; transition: none !important; }
  .psadv-progress i { width: 100%; }
}

/* ---------- Terms: the only overlay (bottom sheet mobile, dialog desktop) ---------- */
.psadv-dialog { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 15, 85, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.psadv-dialog__box { display: flex; flex-direction: column; width: 100%; max-height: 88dvh; background: #fff; border-radius: var(--r) var(--r) 0 0; box-shadow: 0 16px 48px rgba(0, 4, 30, .5); padding-bottom: env(safe-area-inset-bottom); }
.psadv-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--surface-3); }
.psadv-dialog__head h2 { margin: 0; font-size: 18px; font-weight: 500; }
.psadv-dialog__x { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); cursor: pointer; }
.psadv-dialog__x svg { width: 18px; height: 18px; }
.psadv-dialog__body { overflow: auto; padding: 16px 18px; font-size: 14px; color: var(--text-2); }
.psadv-dialog__body h3 { margin: 16px 0 2px; font-size: 15px; font-weight: 500; color: var(--text); }
.psadv-dialog__body p { margin: 0; }
.psadv-dialog__link { margin-top: 12px !important; }
.psadv-dialog__note { padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; }
.psadv-dialog__foot { padding: 12px 18px; border-top: 1px solid var(--surface-3); }

/* ================= Desktop: game area + side column, never scrolls ================= */
@media (min-width: 900px) {
  /* The area shrinks with the window, but not below 400 px: on lower windows the page scrolls
     instead of cutting off the game's buttons (client feedback FB-7C35AF, 1280 × 631). */
  :root { --area: max(400px, min(696px, calc(100vh - 204px), calc(100vw - var(--col) - 200px))); }
  .psadv-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: 80px 0; overflow: auto; }
  .psadv-app > .psadv-stage { margin: auto; }
  .psadv-bar { position: absolute; top: 10px; left: 36px; right: 26px; height: 64px; margin: 0; }
  .psadv-close { width: 64px; height: 64px; background: var(--deep); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
  .psadv-close:hover { background: #0b1d6e; }
  .psadv-close svg { width: 26px; height: 26px; }

  .psadv-stage {
    display: grid; grid-template-columns: var(--area) var(--col); grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: 32px; row-gap: 0; max-width: none; height: calc(var(--area) + 24px); padding: 12px 32px 12px 12px;
  }
  .psadv-area { grid-column: 1; grid-row: 1 / 4; height: var(--area); display: flex !important; flex-direction: column; }
  .psadv-head { grid-column: 2; grid-row: 1; padding-top: 10px; }
  .psadv-body { grid-column: 2; grid-row: 2; min-height: 0; overflow: auto; padding-top: 24px; }
  .psadv-foot { grid-column: 2; grid-row: 3; padding-bottom: 9px; }
  .psadv-prizecard { display: none !important; }
  .psadv-stage[data-step] .psadv-area { min-height: 0; }

  .psadv-head__meta { flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 20px; }
  .psadv-title { margin-bottom: 14px; font-size: 32px; }
  .psadv-instr { font-size: 16px; }
  .psadv-stage[data-step="form"] .psadv-title, .psadv-stage[data-step="done"] .psadv-title, .psadv-stage[data-step="already"] .psadv-title { margin-bottom: 12px; }
  .psadv-rows--list { display: grid; }
  .psadv-stage[data-step="play"] .psadv-label, .psadv-stage[data-step="solved"] .psadv-label { margin: 0 0 14px; }

  .psadv-game { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 32px; }
  .psadv-preview { padding: 32px; }
  .psadv-veil__icon { width: 96px; height: 96px; font-size: 56px; margin-bottom: 20px; }
  .psadv-veil--ok .psadv-veil__icon { width: 96px; height: 96px; }
  .psadv-veil__title { font-size: 32px; }

  .psadv-quiz__q { margin-bottom: 24px; font-size: clamp(22px, calc(var(--area) * .046), 32px); font-weight: 700; line-height: 1.2; }
  .psadv-quiz__img { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; margin-bottom: 20px; }
  .psadv-quiz__answers { grid-template-columns: 1fr 1fr; gap: 8px; }
  .psadv-answer { min-height: 60px; font-size: 20px; font-weight: 500; }
  .psadv-answer b { width: 40px; height: 40px; font-size: 20px; }

  .psadv-app .psadv-mob, .psadv-extra { display: none !important; }
  .psadv-label--sub { margin-top: 0 !important; }
  .psadv-desk .psadv-label--sub { margin-top: 24px !important; }
  .psadv-hintbox { font-size: 14px; }

  /* sliding / memory fill the square area */
  .psadv-stage[data-mech="sliding"] .psadv-area { overflow: hidden; }
  .psadv-stage[data-mech="sliding"][data-step="play"] .psadv-game { padding: 0; }
  .psadv-slide__board { width: 100%; height: 100%; padding: 6px; gap: 6px; }
  .psadv-tile b { top: 12px; left: 12px; min-width: 28px; height: 28px; font-size: 16px; }
  .psadv-mem { height: 100%; }
  .psadv-mem { display: flex; flex-direction: column; justify-content: center; }
  .psadv-mem__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
  .psadv-stage[data-mech="memory"] .psadv-preview, .psadv-stage[data-mech="sliding"] .psadv-preview { padding: 0; }
  .psadv-stage[data-mech="memory"] .psadv-preview .psadv-mem, .psadv-stage[data-mech="sliding"] .psadv-preview .psadv-slide { height: 100%; padding: 0; }

  /* scramble / order: grey area, buttons bottom left / right */
  .psadv-scr, .psadv-order { padding: 24px; }
  .psadv-scr__top { grid-template-areas: "label hint" "pool pool"; grid-template-columns: auto 1fr; }
  .psadv-scr__hint { margin: 0 0 10px; text-align: right; font-size: 14px; }
  .psadv-scr__sol { margin-top: 64px; }
  .psadv-scr__pool { padding: 12px; gap: 8px; }
  .psadv-scr__slots { gap: 8px; }
  .psadv-scr__pool li, .psadv-scr__slots li { max-width: 80px; }
  .psadv-letter, .psadv-slot { height: 84px; font-size: 26px; }
  .psadv-scr .psadv-pair, .psadv-order .psadv-pair { justify-content: space-between; margin-top: auto; padding-top: 20px; }
  .psadv-scr .psadv-pair .psadv-btn, .psadv-order .psadv-pair .psadv-btn { flex: none; width: auto; height: 44px; padding: 0 22px; font-size: 15px; }
  .psadv-scr__top, .psadv-order__list, .psadv-order__q { margin-top: auto; }
  .psadv-order__q + .psadv-order__list { margin-top: 0; }
  .psadv-order__q { margin-bottom: 20px; font-size: clamp(20px, calc(var(--area) * .04), 28px); line-height: 1.2; }
  .psadv-veilprize { margin-top: 24px; padding-right: 22px; }
  .psadv-veilprize__img { width: 84px; height: 84px; }
  .psadv-veilprize__name { font-size: 17px; }
  .psadv-order__list { gap: 12px; }
  .psadv-item__pos { width: 42px; min-height: 66px; }
  .psadv-item__card { padding: 10px 22px; }

  /* Low windows (laptops with browser bars, 125–150 % scaling): order and scramble get compact so
     they fit the smaller area without scrolling. */
  @media (max-height: 800px) {
    .psadv-scr, .psadv-order { padding: 18px 20px; }
    .psadv-order__list { gap: 8px; }
    .psadv-item__pos { width: 40px; min-height: 50px; }
    .psadv-item__card { min-height: 50px; padding: 6px 18px; }
    .psadv-item__label { font-size: 16px; }
    .psadv-item__cover { height: 38px; }
    .psadv-letter, .psadv-slot { height: 64px; font-size: 22px; }
    .psadv-scr__sol { margin-top: 28px; }
    .psadv-scr .psadv-pair, .psadv-order .psadv-pair { padding-top: 14px; }
  }

  .psadv-dialog { align-items: center; }
  .psadv-dialog__box { width: min(458px, 92vw); max-height: 80dvh; border-radius: var(--r); }
}
.psadv-debug .psadv-pair { margin-top: 0; }
.psadv-target--small { width: 45%; margin-top: 8px; }
.psadv-debug.psadv-desk { margin-top: 12px; }
.psadv-debug .psadv-btn { padding: 8px 12px; font-size: 14px; min-height: 0; }
@media (max-height: 820px) { .psadv-target--small { display: none; } }
/* Share (done / already) */
.psadv-share { margin-top: 14px; padding: 14px; border-radius: var(--r-sm); border: 1px solid var(--line, #dfe3ea); }
.psadv-share__lead { margin: 0 0 10px; font-size: 15px; color: var(--text-2); }
.psadv-share__lead b { color: var(--text); }
.psadv-share__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.psadv-share__msg { margin: 10px 0 0; font-size: 14px; color: var(--text-2); }
.psadv-share__text { display: block; width: 100%; margin-top: 8px; padding: 8px 10px; font: inherit; font-size: 14px; border: 1px solid var(--line, #dfe3ea); border-radius: var(--r-sm); resize: none; }
