/* ==========================================================================
   Math Memory — the parent area
   --------------------------------------------------------------------------
   The same game the children play: purple, Fredoka and Nunito, chunky
   rounded cards, Quackers in the empty states, a little bounce on a tap. It
   still reads in a glance, because a parent reads it in a hurry — so every
   number is big, and every emoji has a word next to it.

   The buttons are the .qa-btn family from css/auth-play.css, so a press feels
   the same on both sides of the app; this file only sizes them for pages that
   hold more than one.

   LOGICAL PROPERTIES ONLY. margin-inline / padding-inline / inset-inline /
   text-align: start — never left or right, so RTL needs no work here.

   Everything that moves stops in Calm mode and for prefers-reduced-motion.
   See the end of the file.
   ========================================================================== */

/* ==========================================================================
   The shell — header, tabs, bottom bar
   ========================================================================== */

/* The parent area takes the whole width and a quieter page: the drifting
   symbols behind the game are switched off, and the shell no longer clips —
   nothing here shakes, and a clipping ancestor can pin a fixed bottom bar to
   the end of the page instead of the screen. */
.app-shell[data-area="parent"] { overflow: visible; }
.app-shell[data-area="parent"] .app-main { max-width: none; }
.app-body[data-area="parent"]::after { display: none; }

.ps {
  position: relative;
  inline-size: 100%;
  min-block-size: 100vh;
  min-block-size: 100dvh;
  display: flex;
  flex-direction: column;
  color: #fff;
}

/* Components here set their own display, which would otherwise beat the
   hidden attribute and show a button meant to be gone. */
.ps [hidden], .ps-sheet [hidden] { display: none !important; }

.ps a:focus-visible,
.ps button:focus-visible,
.ps select:focus-visible,
.ps-sheet a:focus-visible,
.ps-sheet button:focus-visible,
.ps-toast-host button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* ---- Header ------------------------------------------------------------- */

.ps-head { padding-block-start: env(safe-area-inset-top); }
.ps-head__inner {
  max-inline-size: 1040px;
  margin-inline: auto;
  padding-inline: var(--s4);
  min-block-size: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}
.ps-brand { display: flex; align-items: center; gap: 10px; min-inline-size: 0; }
.ps-brand__logo { inline-size: 34px; block-size: 34px; flex: none; }
.ps-brand__name { font: 600 20px/1 var(--font-display); color: #fff; white-space: nowrap; }

.ps-head__who {
  display: flex; align-items: center; gap: 10px;
  min-inline-size: 0;
  min-block-size: 48px;
  padding-block: 4px;
  padding-inline: 4px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  text-decoration: none;
  transition: background .15s ease;
}
.ps-head__who:hover { background: rgba(255, 255, 255, .18); }
.ps-head__face {
  display: grid; place-items: center;
  inline-size: 40px; block-size: 40px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--teal-2), var(--teal-3));
  font-size: 24px; line-height: 1;
  flex: none;
}
.ps-head__name {
  font: 600 17px/1.2 var(--font-display);
  max-inline-size: 34vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ps-head__name:empty { display: none; }
.ps-head__who:has(.ps-head__name:empty) { padding-inline-end: 4px; }

/* ---- Top tabs (tablet and desktop) --------------------------------------- */

.ps-tabs {
  display: none;
  position: sticky;
  inset-block-start: 0;
  z-index: 30;
  background: rgba(30, 14, 72, .94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-block-end: 1px solid rgba(255, 255, 255, .1);
}
.ps-tabs__inner {
  max-inline-size: 1040px;
  margin-inline: auto;
  padding-inline: var(--s4);
  padding-block: 8px;
  display: flex;
  gap: 8px;
}
.ps-tab {
  display: inline-flex; align-items: center; gap: 10px;
  min-block-size: 54px;
  padding-inline: 18px 22px;
  border-radius: 18px;
  color: rgba(255, 255, 255, .72);
  font: 600 19px/1 var(--font-display);
  text-decoration: none;
  transition: color .15s ease, background .15s ease, transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.ps-tab__icon { font-size: 24px; line-height: 1; }
.ps-tab:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.ps-tab:active { transform: scale(.96); }
.ps-tab.is-on {
  color: var(--ink-2);
  background: linear-gradient(180deg, var(--cta-2), var(--cta));
  box-shadow: 0 4px 0 var(--cta-shadow);
}

/* ---- Bottom bar (phones) ------------------------------------------------- */

.ps-nav {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 40;
  background: rgba(27, 12, 70, .97);
  border-block-start: 1px solid rgba(255, 255, 255, .12);
  padding-block-end: env(safe-area-inset-bottom);
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}
.ps-nav__list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.ps-nav__link {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  min-block-size: 66px;
  padding-block: 6px;
  color: rgba(255, 255, 255, .7);
  font: 600 13px/1.1 var(--font-display);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.ps-nav__icon {
  display: grid; place-items: center;
  inline-size: 52px; block-size: 34px;
  border-radius: var(--r-pill);
  font-size: 24px; line-height: 1;
  transition: background .15s ease;
}
.ps-nav__link.is-on { color: var(--gold); }
.ps-nav__link.is-on .ps-nav__icon { background: rgba(255, 215, 106, .22); }

/* ---- Content ------------------------------------------------------------- */

.ps-main {
  flex: 1 1 auto;
  inline-size: 100%;
  max-inline-size: 1040px;
  margin-inline: auto;
  padding-inline: var(--s4);
  padding-block: var(--s3) calc(100px + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  .ps-tabs { display: block; }
  .ps-nav { display: none; }
  .ps-head__inner, .ps-tabs__inner { padding-inline: 32px; }
  .ps-main { padding-inline: 32px; padding-block: 28px 72px; }
}

.ps-page { display: flex; flex-direction: column; gap: var(--s5); }
.ps-page--narrow { max-inline-size: 760px; margin-inline: auto; inline-size: 100%; }
.ps-page__head { display: flex; flex-direction: column; gap: 6px; }
.ps-page__head--action { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ps-title {
  display: flex; align-items: center; gap: 10px;
  font: 600 30px/1.15 var(--font-display);
  color: #fff;
  margin: 0;
}
.ps-title__icon { font-size: 32px; line-height: 1; }
@media (min-width: 768px) { .ps-title { font-size: 34px; } }

.ps-headbtn.qa-btn { inline-size: auto; flex: none; min-block-size: 50px; font-size: 17px; padding-inline: 16px 20px; }

.ps-loading {
  display: grid; place-items: center;
  min-block-size: 160px;
  font-size: 44px;
}
.ps-loading span { animation: mmbob 1.2s ease-in-out infinite; }

/* ---- Buttons: the .qa-btn family, sized for a page ---------------------- */

.ps-btn2.qa-btn {
  min-block-size: 56px;
  font-size: clamp(17px, 4.4vw, 20px);
  border-radius: 20px;
  text-decoration: none;
}
.ps-btn2.qa-btn--ghost { min-block-size: 52px; }
.ps-btn2.qa-btn--quiet { min-block-size: 48px; font-size: 16px; }

.qa-btn--danger {
  background: rgba(255, 90, 140, .16);
  border: 3px solid rgba(255, 140, 170, .5);
  color: #ffd3e0;
  box-shadow: 0 5px 0 rgba(122, 33, 69, .7);
}
.qa-btn--danger:active:not([disabled]) { box-shadow: 0 1px 0 rgba(122, 33, 69, .7); }

.ps-row { display: flex; flex-wrap: wrap; gap: 12px; }
.ps-row > * { flex: 1 1 150px; }
.ps-stack { display: flex; flex-direction: column; gap: 12px; }

/* ---- Small stat chip: emoji + big number -------------------------------- */

.ps-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-block-size: 38px;
  padding-inline: 10px 13px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .24);
  color: #fff;
  white-space: nowrap;
}
.ps-chip__icon { font-size: 18px; line-height: 1; }
.ps-chip__value { font: 700 20px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ps-chip--hot { background: rgba(255, 138, 43, .28); }

/* ---- Sections ---------------------------------------------------------- */

.ps-sec {
  display: flex; flex-direction: column; gap: 14px;
  background: rgba(255, 255, 255, .07);
  border: 2px solid rgba(255, 255, 255, .08);
  border-radius: 26px;
  padding: var(--s4);
}
@media (min-width: 768px) { .ps-sec { padding: var(--s5); } }
.ps-sec__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-block-size: 48px; }
.ps-sec__title {
  display: flex; align-items: center; gap: 10px;
  margin: 0;
  font: 600 22px/1.2 var(--font-display);
  color: #fff;
}
.ps-sec__icon {
  display: grid; place-items: center;
  inline-size: 44px; block-size: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .1);
  font-size: 24px; line-height: 1;
}
.ps-sec__head .qa-btn--quiet { align-self: center; }
.ps-sec__body { display: flex; flex-direction: column; gap: 12px; }

/* ---- Empty states: Quackers and one button ---------------------------- */

.ps-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--s4);
  padding-block: var(--s5);
  padding-inline: var(--s4);
  background: rgba(255, 255, 255, .06);
  border-radius: 28px;
  text-align: center;
}
.ps-empty > .qa-btn { max-inline-size: 360px; }
.ps-empty__text { font: 700 16px/1.4 var(--font-ui); color: rgba(255, 255, 255, .8); margin: 0; }

.ps-quack { align-self: center; }
.ps-quack .dk-bubble { max-inline-size: min(260px, calc(100vw - 200px)); }

.ps-note {
  margin: 0;
  align-self: center;
  padding-block: 8px;
  padding-inline: 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .1);
  font: 700 15px/1.3 var(--font-ui);
  color: rgba(255, 255, 255, .85);
}
.ps-note--warn { background: rgba(255, 215, 106, .16); color: #ffe3a0; }

.ps-bigface {
  align-self: center;
  display: grid; place-items: center;
  inline-size: 104px; block-size: 104px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold), var(--amber));
  border: 4px solid #fff;
  box-shadow: 0 7px 0 #d98e12;
  font-size: 60px; line-height: 1;
}

/* ==========================================================================
   👨‍👩‍👧 Kids
   ========================================================================== */

.ps-kids {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: var(--s4);
}
.ps-kids__item { display: flex; }

.ps-kid-wrap { position: relative; display: flex; inline-size: 100%; }
.ps-kid {
  inline-size: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-block-size: 220px;
  padding-block: 22px 18px;
  padding-inline: var(--s4);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 45%),
    linear-gradient(165deg, var(--indigo), #2d1566);
  border: 3px solid rgba(255, 255, 255, .16);
  border-radius: 30px;
  box-shadow: 0 8px 0 #1c0b47;
  color: #fff;
  text-align: center;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ps-kid:hover { transform: translateY(-3px); border-color: rgba(255, 215, 106, .6); }
.ps-kid:active { transform: translateY(5px); box-shadow: 0 2px 0 #1c0b47; }
.ps-kid__face {
  display: grid; place-items: center;
  inline-size: 96px; block-size: 96px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold), var(--amber));
  border: 4px solid #fff;
  box-shadow: 0 6px 0 #d98e12;
  font-size: 56px; line-height: 1;
}
.ps-kid__name {
  font: 600 26px/1.15 var(--font-display);
  overflow-wrap: anywhere;
}
.ps-kid__stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ps-kid--add {
  justify-content: center;
  background: rgba(255, 255, 255, .04);
  border: 3px dashed rgba(255, 255, 255, .3);
  box-shadow: none;
}
.ps-kid--add:active { box-shadow: none; }
.ps-kid__face--add {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .35);
  box-shadow: none;
  font-size: 44px;
}

.ps-kid__prize {
  position: absolute;
  inset-block-start: 10px;
  inline-size: 48px; block-size: 48px;
  display: grid; place-items: center;
  border-radius: 16px;
  cursor: pointer;
  inset-inline-end: 10px;
  background: linear-gradient(180deg, var(--gold), var(--amber));
  box-shadow: 0 4px 0 #d98e12;
  font-size: 26px; line-height: 1;
  animation: ps-wiggle 2.6s ease-in-out infinite;
}
.ps-kid__prize-n {
  position: absolute;
  inset-block-start: -6px;
  inset-inline-end: -6px;
  min-inline-size: 22px; block-size: 22px;
  padding-inline: 5px;
  border-radius: var(--r-pill);
  background: #ff3d8b;
  color: #fff;
  font: 800 13px/22px var(--font-ui);
}

.ps-menu {
  position: absolute;
  inset-block-start: 64px;
  inset-inline-end: 10px;
  z-index: 20;
  min-inline-size: 220px;
  display: flex; flex-direction: column;
  padding: 8px;
  background: #2f1a66;
  border: 2px solid rgba(255, 255, 255, .2);
  border-radius: 20px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .45);
  transform-origin: 100% 0;
}
.ps-menu__item {
  display: flex; align-items: center; gap: 12px;
  min-block-size: 50px;
  padding-inline: 12px;
  border-radius: 14px;
  color: #fff;
  font: 600 18px/1.1 var(--font-display);
  text-align: start;
  cursor: pointer;
}
.ps-menu__icon { font-size: 22px; inline-size: 26px; text-align: center; }
.ps-menu__item:hover, .ps-menu__item:focus-visible { background: rgba(255, 255, 255, .12); }
.ps-menu__item.is-danger { color: #ffc3d6; }

.ps-check {
  display: flex; align-items: center; gap: 12px;
  min-block-size: 48px;
  font: 700 16px/1.3 var(--font-ui);
  cursor: pointer;
}
.ps-check input { inline-size: 24px; block-size: 24px; flex: none; accent-color: var(--gold); }

/* ==========================================================================
   One child's page
   ========================================================================== */

.pc { gap: var(--s4); }

.pc-head {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: start;
  gap: 8px;
}
.pc-back, .pc-more {
  display: grid; place-items: center;
  inline-size: 48px; block-size: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
}
.pc-back { font: 700 32px/1 var(--font-ui); }
.pc-back span { transform: translateY(-2px); }
[dir="rtl"] .pc-back span { transform: scaleX(-1) translateY(-2px); }
.pc-more { font: 700 26px/1 var(--font-ui); }
.pc-back:hover, .pc-more:hover, .pc-more[aria-expanded="true"] { background: rgba(255, 255, 255, .22); }
.pc-head__who { display: flex; flex-direction: column; align-items: center; gap: 8px; min-inline-size: 0; }
.pc-head__face {
  display: grid; place-items: center;
  inline-size: 112px; block-size: 112px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold), var(--amber));
  border: 5px solid #fff;
  box-shadow: 0 7px 0 #d98e12;
  font-size: 64px; line-height: 1;
}
.pc-head__name {
  margin: 0;
  font: 600 32px/1.15 var(--font-display);
  text-align: center;
  overflow-wrap: anywhere;
}
.pc-head__name:focus { outline: none; }
.pc-head .ps-menu { inset-block-start: 58px; inset-inline-end: 0; }

.pc-qr { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.pc-qr__code {
  flex: none;
  inline-size: 168px;
  border-radius: 20px;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.pc-qr__code:hover { transform: scale(1.03); }
.pc-qr__code .ps-qr { max-inline-size: 168px; border-radius: 16px; }
.pc-qr__side { flex: 1 1 150px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-inline-size: 0; }
.pc-qr__side .qa-btn { inline-size: auto; }
.pc-qr__line { margin: 0; font: 700 16px/1.2 var(--font-ui); color: rgba(255, 255, 255, .8); }
.pc-qr__code-text {
  font: 500 clamp(24px, 7vw, 30px)/1.1 var(--font-mono);
  letter-spacing: .08em;
  color: var(--gold);
  -webkit-user-select: all;
  user-select: all;
}
.pc-qr .ps-note { align-self: flex-start; }

.pd-week { display: flex; flex-direction: column; gap: 8px; }
.pd-week__label { margin: 0; font: 600 18px/1.2 var(--font-display); color: rgba(255, 255, 255, .8); }

.pd-prize.is-link { cursor: pointer; }
.pd-prize.is-link:hover { border-color: rgba(255, 255, 255, .25); }

/* ==========================================================================
   Progress sections (used on a child's page)
   ========================================================================== */

.pd { display: flex; flex-direction: column; gap: var(--s4); padding-block-end: var(--s5); }

/* ---- Child faces ---- */

/* Face buttons: "who is this prize for" in the add-prize sheet. */
.pd-who { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 4px 8px; }
.ps-switch__kid {
  flex: none;
  display: inline-flex; align-items: center; gap: 10px;
  min-block-size: 58px;
  padding-inline: 6px 18px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .08);
  border: 3px solid transparent;
  color: rgba(255, 255, 255, .8);
  font: 600 18px/1 var(--font-display);
  cursor: pointer;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.ps-switch__kid:hover { background: rgba(255, 255, 255, .14); }
.ps-switch__kid.is-on {
  background: rgba(255, 215, 106, .18);
  border-color: var(--gold);
  color: #fff;
}
.ps-switch__face {
  display: grid; place-items: center;
  inline-size: 44px; block-size: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  font-size: 28px; line-height: 1;
}
.ps-switch__kid.is-on .ps-switch__face { background: linear-gradient(180deg, var(--gold), var(--amber)); }

.pd-never { display: flex; flex-direction: column; align-items: center; gap: var(--s4); }
.pd-never .qa-btn { max-inline-size: 360px; }

/* ---- 🗺️ Map ---- */

.pd-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 620px) { .pd-path { grid-template-columns: repeat(9, minmax(0, 1fr)); } }

.pd-node {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-block-size: 84px;
  padding-block: 8px 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .06);
  border: 3px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.pd-node:hover { transform: translateY(-2px); }
.pd-node__art { display: grid; place-items: center; block-size: 44px; }
.pd-node__emoji { font-size: 30px; line-height: 1; }
.pd-node__n { font: 700 19px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.pd-node.is-locked .pd-node__emoji { font-size: 22px; opacity: .6; }
.pd-node.is-done {
  background: rgba(92, 240, 174, .16);
  border-color: rgba(92, 240, 174, .5);
  color: #c9ffe4;
}
.pd-node.is-now {
  background: linear-gradient(180deg, var(--gold), var(--amber));
  border-color: #fff;
  box-shadow: 0 5px 0 #d98e12;
  color: var(--ink-2);
}
.pd-node .dk { --duck: 44px; }

.pd-nowchip {
  align-self: flex-start;
  margin: 0;
  padding-block: 8px;
  padding-inline: 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 215, 106, .16);
  color: var(--gold);
  font: 600 18px/1.2 var(--font-display);
}

/* ---- Week · Month · Year ---- */

.pd-range {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 6px;
  border-radius: 22px;
  background: rgba(0, 0, 0, .25);
  max-inline-size: 420px;
}
.pd-range__btn {
  min-block-size: 48px;
  border-radius: 16px;
  color: rgba(255, 255, 255, .75);
  font: 600 17px/1 var(--font-display);
  transition: background .15s ease, color .15s ease;
}
.pd-range__btn:hover:not(.is-on) { background: rgba(255, 255, 255, .1); color: #fff; }
.pd-range__btn.is-on {
  background: linear-gradient(180deg, #fff, #efe8ff);
  color: var(--ink-2);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .28);
}

/* ---- Four big numbers ---- */

.pd-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 620px) { .pd-tiles { grid-template-columns: repeat(4, 1fr); } }
.pd-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding-block: 14px 12px;
  padding-inline: 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .08);
  border: 2px solid rgba(255, 255, 255, .1);
  text-align: center;
}
.pd-tile__icon { font-size: 30px; line-height: 1.1; }
.pd-tile__value {
  font: 700 clamp(34px, 10vw, 42px)/1.05 var(--font-display);
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.pd-tile__label { font: 700 15px/1.2 var(--font-ui); color: rgba(255, 255, 255, .72); }

/* ---- 🎁 Prizes ---- */

.pd-noprize { display: flex; align-items: center; gap: 14px; }
.pd-noprize__art { font-size: 44px; line-height: 1; }
.pd-noprize .qa-btn { flex: 1 1 auto; }

.pd-prize {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(0, 0, 0, .22);
  border: 2px solid rgba(255, 255, 255, .08);
}
.pd-prize__art {
  position: relative;
  flex: none;
  display: grid; place-items: center;
  inline-size: 64px; block-size: 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .12);
  background-size: cover; background-position: center;
}
.pd-prize__emoji { font-size: 36px; line-height: 1; }
.pd-prize__who {
  position: absolute;
  inset-block-end: -6px; inset-inline-end: -6px;
  display: grid; place-items: center;
  inline-size: 30px; block-size: 30px;
  border-radius: 50%;
  background: #fff;
  font-size: 18px; line-height: 1;
}
.pd-prize__text { flex: 1 1 160px; display: flex; flex-direction: column; gap: 8px; min-inline-size: 0; }
.pd-prize__title { font: 600 21px/1.2 var(--font-display); color: #fff; overflow-wrap: anywhere; }
.pd-prize__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-prize__meta { font: 700 15px/1.3 var(--font-ui); color: rgba(255, 255, 255, .7); }

.pd-prize__progress { display: flex; align-items: center; gap: 10px; }
.pd-prize__bar {
  flex: 1 1 auto;
  block-size: 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}
.pd-prize__bar i {
  display: block; block-size: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal-2), var(--green-soft));
}
.pd-prize__count { flex: none; font: 700 17px/1 var(--font-display); color: #c9ffe4; }

/* Won and waiting to be handed over: the one thing asking the parent to do
   something today, so it is the only gold card. */
.pd-prize--owed {
  background: linear-gradient(180deg, rgba(255, 215, 106, .28), rgba(255, 182, 46, .16));
  border-color: var(--gold);
}
.pd-prize--owed .pd-prize__art { background-color: rgba(255, 255, 255, .25); animation: ps-wiggle 2.6s ease-in-out infinite; }
.pd-prize__give.qa-btn { flex: 1 1 100%; min-block-size: 60px; font-size: 22px; }
@media (min-width: 560px) { .pd-prize__give.qa-btn { flex: 0 0 auto; inline-size: auto; padding-inline: 24px 28px; } }

.pd-prize--given { opacity: .75; }
.pd-prize--given .qa-btn { inline-size: auto; flex: none; }

/* ---- 💪 Practice these ---- */

.pd-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pd-fact {
  display: grid; place-items: center;
  min-block-size: 72px;
  padding-inline: 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--card-front), var(--card-front-2));
  border: 3px solid #fff;
  box-shadow: 0 6px 0 #cdb58c;
  --eq-gap: 5px;
}
.pd-fact .eq { font-size: clamp(24px, 6.4vw, 28px); }

.pd-allgood {
  margin: 0;
  font: 600 20px/1.2 var(--font-display);
  color: #c9ffe4;
}

/* ---- 📈 Trend ---- */

.pd-chart {
  display: flex; align-items: stretch; gap: 6px;
  block-size: 160px;
  padding-block: 4px;
}
.pd-chart--month { gap: 3px; }
.pd-bar {
  flex: 1 1 0;
  min-inline-size: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.pd-bar__col {
  flex: 1 1 auto;
  inline-size: 100%;
  display: flex; align-items: flex-end; justify-content: center;
}
.pd-bar i {
  display: block;
  inline-size: 100%;
  max-inline-size: 34px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--teal-2), var(--teal-3));
}
.pd-chart--month .pd-bar i { border-radius: 4px 4px 2px 2px; }
.pd-bar.is-quiet i { background: rgba(255, 255, 255, .12); }
.pd-bar__label { font: 700 14px/1 var(--font-display); color: rgba(255, 255, 255, .6); }
.pd-unit { margin: 0; font: 700 15px/1.2 var(--font-ui); color: rgba(255, 255, 255, .7); }

/* ---- 🕒 Recent ---- */

.pd-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pd-activity__row {
  display: flex; align-items: center; gap: 12px;
  min-block-size: 54px;
  padding-inline: 8px 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, .18);
}
.pd-activity__icon {
  display: grid; place-items: center;
  inline-size: 40px; block-size: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .1);
  font-size: 22px; line-height: 1;
  flex: none;
}
.pd-activity__what { flex: 1 1 auto; font: 600 18px/1.2 var(--font-display); color: #fff; min-inline-size: 0; overflow-wrap: anywhere; }
.pd-activity__when { flex: none; font: 700 14px/1 var(--font-ui); color: rgba(255, 255, 255, .6); }

/* ---- One table's facts (sheet) ---- */

.pd-fact-rows { display: flex; flex-direction: column; gap: 8px; }
.pd-fact-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-block-size: 56px;
  padding-inline: 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .22);
  border: 2px solid transparent;
}
.pd-fact-row__eq { font-size: 24px; }
.pd-fact-row__word { font: 700 15px/1.2 var(--font-ui); color: rgba(255, 255, 255, .7); white-space: nowrap; }
.pd-fact-row.is-mastered { border-color: rgba(92, 240, 174, .4); }
.pd-fact-row.is-mastered .pd-fact-row__word { color: var(--green-soft); }
.pd-fact-row.is-learning .pd-fact-row__word { color: var(--gold); }
.pd-fact-row.is-practice { border-color: rgba(255, 159, 199, .45); }
.pd-fact-row.is-practice .pd-fact-row__word { color: #ffb3d1; }

/* ---- Add prize: tables and photo ---- */

.pd-tablepick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 520px) { .pd-tablepick { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
.pd-tablepick__btn {
  position: relative;
  display: grid; place-items: center;
  min-block-size: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .08);
  border: 3px solid rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
}
.pd-tablepick__n { font: 700 20px/1 var(--font-display); }
.pd-tablepick__done { position: absolute; inset-block-start: -8px; inset-inline-end: -6px; font-size: 16px; }
.pd-tablepick__btn.is-done { opacity: .7; }
.pd-tablepick__btn.is-on {
  background: linear-gradient(180deg, var(--gold), var(--amber));
  border-color: #fff;
  color: var(--ink-2);
  box-shadow: 0 4px 0 #d98e12;
  opacity: 1;
}

.pd-photo { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pd-photo .qa-btn { inline-size: auto; flex: none; }
.pd-photo__img {
  display: grid; place-items: center;
  inline-size: 64px; block-size: 64px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .1) center / cover no-repeat;
  font-size: 28px; line-height: 1;
}
.ps-input--short { max-inline-size: 180px; }

/* ---- Prize card extras: custom marker, certificate, "Won" chip ---- */

.pd-prize__custom {
  position: absolute;
  inset-block-start: -6px; inset-inline-start: -6px;
  display: grid; place-items: center;
  inline-size: 26px; block-size: 26px;
  border-radius: 50%;
  background: #fff;
  font-size: 14px; line-height: 1;
}
.ps-chip--won { background: rgba(255, 215, 106, .22); }
.ps-chip__word { font: 700 16px/1 var(--font-display); }

.pd-prize__open {
  flex: none;
  border-radius: 18px;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.pd-prize__open:hover { transform: scale(1.05); }
.pd-prize--cert {
  background: linear-gradient(180deg, rgba(255, 239, 198, .2), rgba(255, 215, 106, .08));
  border-color: rgba(255, 215, 106, .45);
}
.pd-prize--cert .cert-actions { flex: 1 1 100%; }

/* ---- Add prize: the picks ---- */

.pd-note {
  margin: 0;
  padding-block: 8px;
  padding-inline: 14px;
  border-radius: var(--r-pill);
  align-self: flex-start;
  background: rgba(92, 240, 174, .16);
  color: #c9ffe4;
  font: 600 17px/1.2 var(--font-display);
}

.pd-tablepick__mark { position: absolute; inset-block-start: -9px; inset-inline-end: -7px; font-size: 16px; line-height: 1; }
.pd-tablepick__btn.is-done, .pd-tablepick__btn.is-locked { opacity: .55; }
.pd-tablepick__btn.is-on { opacity: 1; }

.pd-existing { display: flex; flex-direction: column; gap: 10px; }
.pd-existing:empty { display: none; }

.pd-picks { display: flex; flex-direction: column; gap: 14px; }
.pd-picks__title {
  margin: 0 0 8px;
  font: 600 18px/1.2 var(--font-display);
  color: rgba(255, 255, 255, .88);
}
.pd-picks__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 104px), 1fr));
  gap: 10px;
}
.pd-pick {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-block-size: 104px;
  padding-block: 10px 8px;
  padding-inline: 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .08);
  border: 3px solid rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), background .15s ease;
}
.pd-pick:hover { background: rgba(255, 255, 255, .14); }
.pd-pick__emoji { font-size: 40px; line-height: 1; }
.pd-pick__name { font: 600 15px/1.15 var(--font-display); text-align: center; overflow-wrap: anywhere; }
.pd-pick.is-on {
  background: linear-gradient(180deg, var(--gold), var(--amber));
  border-color: #fff;
  box-shadow: 0 5px 0 #d98e12;
  color: var(--ink-2);
  transform: translateY(-2px);
}

.pd-details { display: flex; flex-direction: column; gap: 14px; }
.pd-certnote:empty { display: none; }
.pd-certnote .cert { max-inline-size: 240px; }
.pd-save.qa-btn { min-block-size: 62px; font-size: 22px; }

/* ==========================================================================
   🎁 Prizes tab
   ========================================================================== */

.pz-kid {
  display: flex; flex-direction: column; gap: 12px;
  padding: var(--s4);
  border-radius: 26px;
  background: rgba(255, 255, 255, .07);
  border: 2px solid rgba(255, 255, 255, .08);
}
.pz-kid__head { display: flex; align-items: center; gap: 12px; }
.pz-kid__face {
  display: grid; place-items: center;
  inline-size: 60px; block-size: 60px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold), var(--amber));
  border: 3px solid #fff;
  font-size: 34px; line-height: 1;
  flex: none;
}
.pz-kid__name { flex: 1 1 auto; margin: 0; font: 600 24px/1.15 var(--font-display); overflow-wrap: anywhere; min-inline-size: 0; }
.pz-kid__head .qa-btn { inline-size: auto; flex: none; }

/* ==========================================================================
   🙂 Me
   ========================================================================== */

.ps-me {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding-block: var(--s5);
  padding-inline: var(--s4);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 45%),
    linear-gradient(165deg, var(--indigo), #2d1566);
  border: 3px solid rgba(255, 255, 255, .16);
  box-shadow: 0 8px 0 #1c0b47;
}
.ps-me__facewrap { position: relative; }
.ps-me__face {
  display: grid; place-items: center;
  inline-size: 124px; block-size: 124px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--teal-2), var(--teal-3));
  border: 5px solid #fff;
  box-shadow: 0 7px 0 var(--teal-deep);
  font-size: 72px; line-height: 1;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.ps-me__face:hover { transform: scale(1.04); }
.ps-me__faceedit {
  position: absolute;
  inset-block-end: 0; inset-inline-end: -4px;
  display: grid; place-items: center;
  inline-size: 40px; block-size: 40px;
  border-radius: 50%;
  background: #fff;
  font-size: 20px; line-height: 1;
  pointer-events: none;
}
.ps-me__namebtn {
  display: inline-flex; align-items: center; gap: 10px;
  min-block-size: 52px;
  padding-inline: 16px;
  border-radius: var(--r-pill);
  color: #fff;
  cursor: pointer;
}
.ps-me__namebtn:hover { background: rgba(255, 255, 255, .1); }
.ps-me__name { font: 600 30px/1.15 var(--font-display); overflow-wrap: anywhere; }
.ps-me__pen { font-size: 20px; }
.ps-me__phonerow {
  display: flex; align-items: center; gap: 10px;
  padding-inline: 16px 4px;
  min-block-size: 52px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .24);
  font-size: 20px;
}
.ps-me__phone { font: 700 19px/1 var(--font-ui); letter-spacing: .03em; }
.ps-eye {
  display: grid; place-items: center;
  inline-size: 48px; block-size: 48px;
  border-radius: 50%;
  font-size: 22px; line-height: 1;
  cursor: pointer;
}
.ps-eye:hover { background: rgba(255, 255, 255, .12); }

.ps-me__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ps-danger {
  margin-block-start: 28px;
  padding: var(--s4);
  border-radius: 26px;
  border: 2px dashed rgba(255, 140, 170, .45);
  background: rgba(255, 90, 140, .06);
}

/* ==========================================================================
   Sheets, fields, toast
   ========================================================================== */

.ps-sheet {
  position: fixed; inset: 0;
  z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(8, 4, 20, .72);
}
.ps-sheet__card {
  inline-size: 100%;
  max-inline-size: 580px;
  max-block-size: 92vh;
  max-block-size: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #3a1f86, #26115e);
  border: 3px solid rgba(255, 255, 255, .16);
  border-block-end: 0;
  border-radius: 30px 30px 0 0;
  padding-block: 14px calc(var(--s5) + env(safe-area-inset-bottom));
  padding-inline: var(--s4);
  color: #fff;
  text-align: start;
  animation: ps-rise .26s cubic-bezier(.3, 1.3, .5, 1) both;
}
@media (min-width: 768px) {
  .ps-sheet { align-items: center; padding: var(--s5); }
  .ps-sheet__card { border-radius: 30px; border-block-end: 3px solid rgba(255, 255, 255, .16); padding: 18px 26px 26px; }
}
.ps-sheet--small .ps-sheet__card { max-inline-size: 440px; }
@keyframes ps-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.ps-sheet__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 10px; }
.ps-sheet__title { font: 600 26px/1.2 var(--font-display); margin: 0; overflow-wrap: anywhere; }
.ps-sheet__x {
  flex: none;
  inline-size: 48px; block-size: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .12);
  color: #fff; font: 700 20px/1 var(--font-ui);
  cursor: pointer;
}
.ps-sheet__x:hover { background: rgba(255, 255, 255, .22); }
.ps-sheet__body { display: flex; flex-direction: column; gap: 16px; }
.ps-sheet__line {
  margin: 0;
  font: 600 18px/1.2 var(--font-display);
  color: rgba(255, 255, 255, .88);
  text-align: center;
}

.ps-field { display: flex; flex-direction: column; gap: 8px; }
.ps-field__label { font: 800 16px/1.2 var(--font-ui); color: rgba(255, 255, 255, .92); }
.ps-field__hint { font: 700 14px/1.3 var(--font-ui); color: rgba(255, 255, 255, .6); }

.ps-msg { font: 700 16px/1.4 var(--font-ui); color: rgba(255, 255, 255, .85); margin: 0; }
.ps-msg:empty { display: none; }
.ps-msg.is-error { color: #ffb3c9; }
.ps-msg.is-wrong { animation: qa-shake .45s ease; }

.ps-code {
  margin: 0;
  padding: var(--s4);
  border-radius: 18px;
  background: rgba(0, 0, 0, .3);
  color: var(--gold);
  font: 500 clamp(26px, 8vw, 34px)/1.1 var(--font-mono);
  letter-spacing: .12em;
  text-align: center;
  -webkit-user-select: all;
  user-select: all;
}
.ps-codetiles { -webkit-user-select: all; user-select: all; }

/* Face pickers use .qa-avatars from auth-play.css; nothing to add. */

/* ---- Typed confirmation ---- */

.ps-confirm { z-index: 80; background: rgba(8, 4, 20, .84); }
.ps-confirm__card { max-inline-size: 460px; display: flex; flex-direction: column; gap: 14px; }
.ps-confirm__mark { font-size: 56px; line-height: 1; text-align: center; }
.ps-confirm__title { text-align: center; }
.ps-confirm__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.ps-confirm__list li {
  display: flex; align-items: center; gap: 8px;
  min-block-size: 48px;
  padding-inline: 10px;
  border-radius: 14px;
  background: rgba(255, 90, 140, .12);
  font: 700 15px/1.2 var(--font-ui);
}
.ps-confirm__icon { font-size: 22px; line-height: 1; flex: none; }
.ps-confirm__final { margin: 0; text-align: center; font: 600 18px/1.2 var(--font-display); color: #ffc3d6; }
.ps-confirm__input { text-align: center; }

/* ---- Toast ---- */

.ps-toast-host {
  position: fixed;
  inset-inline: var(--s4);
  inset-block-end: calc(84px + env(safe-area-inset-bottom));
  /* Under an open sheet, which dims it, rather than over what the sheet asks. */
  z-index: 55;
  display: flex; justify-content: center;
  pointer-events: none;
}
@media (min-width: 768px) { .ps-toast-host { inset-block-end: var(--s5); } }
.ps-toast {
  display: flex; align-items: center; gap: 12px;
  min-block-size: 56px;
  padding-block: 6px;
  padding-inline: 18px 6px;
  border-radius: 22px;
  background: #fffdf6;
  color: var(--ink-2);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .25), 0 16px 30px rgba(0, 0, 0, .35);
  pointer-events: auto;
  max-inline-size: 480px;
}
.ps-toast__text { font: 600 18px/1.25 var(--font-display); text-align: start; overflow-wrap: anywhere; }
.ps-toast__undo {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  min-block-size: 48px;
  padding-inline: 14px;
  border-radius: 16px;
  background: rgba(42, 19, 80, .1);
  color: var(--ink-2);
  font: 700 17px/1 var(--font-display);
  cursor: pointer;
}
.ps-toast__undo:hover { background: rgba(42, 19, 80, .18); }
.ps-toast:not(:has(.ps-toast__undo)) { padding-inline-end: 18px; }

/* ==========================================================================
   Sign-in QR codes
   ========================================================================== */

/* Always black on white with a quiet zone, whatever the page around it —
   phone cameras read a dark-on-light code far more reliably. */
.ps-qr {
  inline-size: 100%;
  max-inline-size: 300px;
  aspect-ratio: 1;
  margin-inline: auto;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
}
.ps-qr svg { display: block; inline-size: 100%; block-size: 100%; }
.ps-qr.is-missing {
  display: grid; place-items: center;
  color: var(--ink); font: 700 24px var(--font-ui);
}

/* ==========================================================================
   Little movements, and turning them off
   ========================================================================== */

@keyframes ps-wiggle {
  0%, 84%, 100% { transform: rotate(0); }
  88% { transform: rotate(-9deg); }
  92% { transform: rotate(9deg); }
  96% { transform: rotate(-5deg); }
}
@keyframes ps-pop {
  0% { transform: scale(.85); opacity: 0; }
  70% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.ps .is-bounce,
.ps-sheet .is-bounce { animation: qa-bounce .45s cubic-bezier(.3, 1.6, .5, 1); }
.ps-menu.is-pop, .ps-toast.is-pop { animation: ps-pop .28s cubic-bezier(.3, 1.4, .5, 1); }

[data-calm] .ps *, [data-calm] .ps *::before, [data-calm] .ps *::after,
[data-calm] .ps-sheet, [data-calm] .ps-sheet *, [data-calm] .ps-toast-host * {
  animation: none !important;
}
[data-calm] .ps *, [data-calm] .ps-sheet * { transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .ps *, .ps *::before, .ps *::after,
  .ps-sheet, .ps-sheet *, .ps-toast-host * {
    animation: none !important;
    transition: none !important;
  }
}
