/* Babs' Puzzles — iOS chrome on the cozy linen canvas. */
:root {
  --paper: #f6efe3;
  --card: #fffdf7;
  --ink: #46392c;
  --sub: #91816d;
  --acc: #c9764f;
  --acc-deep: #b06240;
  --line: #e8dcc8;
  --glass: rgba(246, 239, 227, 0.82);
  --dim: rgba(60, 45, 25, 0.35);
  --shadow: 0 6px 24px rgba(80, 60, 35, 0.13), 0 2px 6px rgba(80, 60, 35, 0.08);
  --rad: 18px;
  --font: -apple-system, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
  font-family: var(--font);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.3;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  opacity: 0;
  transition: opacity .3s ease;
}
body.ready { opacity: 1; }
html.modal-open,
html.playing,
body.modal-open,
body.playing {
  overflow: hidden;
  overscroll-behavior: none;
}
body.modal-open,
body.playing {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- family gate ---------- */
#gate {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  padding: calc(env(safe-area-inset-top) + 28px) max(env(safe-area-inset-left), 28px)
    calc(env(safe-area-inset-bottom) + 32px) max(env(safe-area-inset-right), 28px);
}
body.gated > :not(#gate) { visibility: hidden; }
.gatecard {
  width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 14px;
}
.gatecard h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.15; }
.gatesub { font-size: 17px; font-weight: 400; color: var(--sub); line-height: 1.35; }
#gateForm { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.gatelabel { font-size: 17px; font-weight: 600; }
#gatePass {
  width: 100%; min-height: 50px; padding: 0 16px;
  font: inherit; font-size: 17px; color: var(--ink);
  background: var(--card); border: none; border-radius: 14px;
  box-shadow: inset 0 0 0 1.5px var(--line);
  outline: none;
  -webkit-user-select: text; user-select: text;
}
#gatePass:focus { box-shadow: inset 0 0 0 2px rgba(201, 118, 79, 0.45); }
.gateerr { font-size: 17px; font-weight: 600; color: var(--acc-deep); }
#gateForm.shake { animation: gateShake 0.42s ease; }
@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- home ---------- */
#home {
  min-height: 100%;
  padding: 0 0 60px;
  max-width: none; margin: 0;
  overflow-x: hidden;
}
#home > :not(.homehead) {
  max-width: 1160px;
  margin-left: auto; margin-right: auto;
  padding-left: max(env(safe-area-inset-left), 26px);
  padding-right: max(env(safe-area-inset-right), 26px);
}
.homehead {
  position: relative;
  width: 100%;
  height: min(calc(env(safe-area-inset-top) + 88pt), 100pt);
  margin: 0 0 20pt;
  overflow: hidden;
}
@media (min-width: 768px) {
  .homehead { height: min(calc(env(safe-area-inset-top) + 88pt), 120pt); }
}
.homewordmark {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block; pointer-events: none;
}
.homehead::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 8pt;
  background: linear-gradient(to bottom, transparent 0%, transparent 40%, var(--paper) 100%);
  pointer-events: none; z-index: 1;
}
.headbtns {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 8px);
  right: max(env(safe-area-inset-right), 8px);
  z-index: 2;
  display: flex; gap: 10px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.15; }
#home h2 { font-size: 20px; font-weight: 600; color: var(--ink); margin: 30px 0 12px; }
.iconbtn {
  width: 48px; height: 48px; min-width: 48px; min-height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  transition: transform .12s ease;
}
#home .iconbtn {
  background: var(--card); box-shadow: var(--shadow);
}
.iconbtn:active { transform: scale(0.92); }

.daily {
  display: flex; width: 100%; text-align: left; align-items: stretch;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  overflow: hidden; min-height: 168px;
  transition: transform .14s ease;
}
.daily:active { transform: scale(0.985); }
.daily img { width: 42%; max-width: 340px; object-fit: cover; }
.dmeta { padding: 20px 22px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.dmeta small { color: var(--sub); font-weight: 600; font-size: 15px; }
.dmeta span { font-size: 22px; font-weight: 700; letter-spacing: -0.2px; }
.dmeta em { font-style: normal; color: var(--acc-deep); font-weight: 600; font-size: 17px; }

.hrow { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.hrow::-webkit-scrollbar { display: none; }
.ccard {
  position: relative; flex: 0 0 auto; width: 210px; text-align: left;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .14s ease;
}
.ccard:active { transform: scale(0.97); }
.ccard img { width: 100%; height: 132px; object-fit: cover; display: block; background: var(--line); }
.cmeta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.cmeta span { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmeta small { color: var(--sub); font-size: 15px; }
.ring {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%;
  background: conic-gradient(var(--acc) calc(var(--p) * 1%), rgba(255, 253, 247, 0.55) 0);
  box-shadow: 0 1px 5px rgba(60, 40, 20, 0.25);
}
.ring::after {
  content: "";
  position: absolute; inset: 6px; border-radius: 50%; background: var(--card);
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.pcard {
  position: relative; aspect-ratio: 4 / 3; border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow); background: var(--card);
  transition: transform .14s ease; text-align: left;
}
.pcard:active { transform: scale(0.97); }
.pcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px;
  color: #fff; font-weight: 600; font-size: 17px;
  background: linear-gradient(transparent, rgba(30, 20, 10, 0.66));
  white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-height: 1.25;
}
.donebadge {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--card); color: var(--acc-deep); font-weight: 700; font-size: 15px;
  display: grid; place-items: center; box-shadow: 0 1px 5px rgba(60, 40, 20, 0.25);
}
.pcard .pill {
  position: absolute; top: 8px; right: 8px; padding: 5px 11px; border-radius: 999px;
  background: var(--card); color: var(--acc-deep); font-weight: 700; font-size: 15px;
  box-shadow: 0 1px 5px rgba(60, 40, 20, 0.25);
}
.upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--ink); font-weight: 400; cursor: pointer;
  border: none; box-shadow: var(--shadow); background: var(--card);
}
.upload svg { width: 48px; height: 48px; }
.upload span { font-size: 17px; }

/* ---------- game ---------- */
#game {
  position: fixed; inset: 0; overflow: hidden; background: #ddd0ba;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  overflow-anchor: none;
}
#board {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  overflow-anchor: none;
}

.topbar {
  position: absolute; top: 0; left: 0; right: 0;
  min-height: calc(56px + env(safe-area-inset-top));
  height: auto;
  padding: calc(env(safe-area-inset-top) + 4px) max(env(safe-area-inset-left), 8px) 4px max(env(safe-area-inset-right), 8px);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap;
  background: var(--glass);
  -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
  box-shadow: 0 1px 0 rgba(70, 50, 25, 0.08);
  z-index: 2;
}
.topbar .iconbtn {
  width: 48px; height: 48px;
  background: transparent; box-shadow: none;
}
.topbar .iconbtn.on { color: var(--acc); background: rgba(201, 118, 79, 0.16); }
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
}
.topbar .stat.glass {
  background: none; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.stat {
  display: flex; align-items: center; gap: 8px; padding: 0;
  font-weight: 600; font-variant-numeric: tabular-nums; font-size: 17px;
}
.stat .dot { color: var(--sub); }
.tools { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar .lockbtn {
  min-width: 48px; min-height: 48px; padding: 0 14px; border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.topbar .lockbtn.on {
  color: var(--acc); background: rgba(201, 118, 79, 0.16); box-shadow: none;
}

#previewFloat {
  position: absolute; top: calc(env(safe-area-inset-top) + 64px); right: 14px;
  width: clamp(160px, 24vw, 260px);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
  touch-action: none; cursor: grab; z-index: 3;
}
#previewFloat img { width: 100%; display: block; }
#previewClose {
  position: absolute; top: 4px; right: 4px; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(30, 20, 10, 0.55); color: #fff; font-size: 22px; line-height: 1;
  display: grid; place-items: center;
}

#trayWrap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  min-height: calc(88px + env(safe-area-inset-bottom));
  max-height: calc(200px + env(safe-area-inset-bottom));
  padding: 8px max(env(safe-area-inset-left), 10px) env(safe-area-inset-bottom) max(env(safe-area-inset-right), 10px);
  background: var(--glass);
  -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
  box-shadow: 0 -4px 20px rgba(70, 50, 25, 0.12);
  z-index: 2;
  transition: max-height .32s ease, height .32s ease, background .28s ease, border-radius .28s ease;
}
#trayWrap.expanded {
  height: min(52dvh, 560px);
  max-height: min(52dvh, 560px);
  background: var(--paper);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 32px rgba(80, 60, 35, 0.16);
}
#trayChrome {
  display: flex; align-items: center; gap: 8px;
  flex: 0 0 auto; min-height: 48px;
}
#trayWrap.expanded #trayChrome {
  flex-direction: column; align-items: stretch; gap: 4px;
}
#trayChrome .trayGrabber { display: none; }
#trayWrap.expanded #trayChrome .trayGrabber {
  display: block; order: -2; margin: 6px auto 2px;
}
#chips { display: flex; gap: 8px; padding: 2px 4px 8px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
#chips::-webkit-scrollbar { display: none; }
#trayWrap.expanded #chips { flex: 0 0 auto; width: 100%; padding-bottom: 6px; }
.chip {
  min-height: 48px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; font-size: 17px;
  background: rgba(255, 253, 247, 0.9); color: var(--sub);
  box-shadow: inset 0 0 0 1.5px var(--line);
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.chip.sel { color: #fff; background: var(--acc); box-shadow: none; }
.chip.cchip { width: 48px; height: 48px; min-height: 48px; padding: 0; }
.chip.cchip.sel { box-shadow: 0 0 0 3px var(--acc); }
#trayShelfBtn {
  flex: 0 0 auto;
  width: 48px; height: 48px; min-width: 48px; min-height: 48px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: var(--ink);
}
#trayShelfBtn .traychev { width: 22px; height: 22px; }
#trayShelfBtn .trayShelfLbl { display: none; }
#trayWrap.expanded #trayShelfBtn {
  order: -1;
  width: auto; min-width: 48px; height: 48px; min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  align-self: center;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
#trayWrap.expanded #trayShelfBtn .traychev { transform: rotate(180deg); }
#trayWrap.expanded #trayShelfBtn .trayShelfLbl {
  display: inline;
  font-weight: 600; font-size: 17px; line-height: 1;
}
#tray {
  display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  touch-action: pan-x; min-height: 80px; align-items: center; padding: 2px 4px 6px;
  scrollbar-width: none;
  overflow-anchor: none;
}
#tray::-webkit-scrollbar { display: none; }
#trayWrap.expanded #tray {
  display: grid;
  grid-template-columns: repeat(auto-fill, 80px);
  justify-content: start;
  align-content: start;
  align-items: start;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  padding: 2px 4px 10px;
}
.thumb {
  flex: 0 0 80px; width: 80px; height: 80px; position: relative;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.thumb.lifting { transform: scale(1.08); z-index: 3; touch-action: none; }
.tcanvas { width: 100%; height: 100%; display: block; }

/* ---------- sheets ---------- */
.modal {
  position: fixed; inset: 0; z-index: 40;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--dim);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
.card {
  position: relative;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 32px rgba(80, 60, 35, 0.16);
  padding: 0 0 calc(env(safe-area-inset-bottom) + 20px);
  width: 100%;
  max-width: 640px;
  min-height: 0;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  animation: sheetIn 400ms ease-out;
}
@keyframes sheetIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.grabber {
  width: 36px; height: 5px; border-radius: 999px;
  background: var(--line);
  margin: 8px auto 0;
}
.sheethd {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 4px 16px 8px;
}
.sheethd h2 {
  margin: 0;
  font-size: 17px; font-weight: 600; color: var(--ink);
  text-align: center;
}
.donebtn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  min-height: 44px; min-width: 44px; padding: 0 12px;
  font-size: 17px; font-weight: 600; color: var(--acc);
}
.sheetcard { display: flex; flex-direction: column; gap: 14px; }
.sheetcard > *,
.setcard > * { flex-shrink: 0; }
.sheetcard #sheetImg,
.sheetcard #sheetCap,
.sheetcard .sizes,
.sheetcard .group,
.sheetcard .sheetbtns { margin-left: 16px; margin-right: 16px; }
#sheetImg {
  width: calc(100% - 32px);
  aspect-ratio: 16 / 10;
  max-height: none;
  object-fit: cover;
  border-radius: 14px;
  background: var(--line);
}
#sheetCap { font-weight: 700; font-size: 22px; letter-spacing: -0.2px; }
.sizes {
  display: flex; flex-direction: column;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
}
.sizebtn {
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  min-height: 52px; padding: 8px 16px;
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.sizebtn:last-child { border-bottom: none; }
.sizebtn b { font-size: 17px; font-weight: 600; }
.sizebtn small { color: var(--sub); font-size: 15px; }
.sizebtn i { font-style: normal; color: var(--acc); font-size: 15px; font-weight: 600; margin-left: auto; }
.sizebtn.sel { background: rgba(201, 118, 79, 0.12); }
.group {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
}
.switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 0 16px;
  font-size: 17px; font-weight: 400;
}
.group .switch + .switch { border-top: 1px solid var(--line); }
.switch input { display: none; }
.switch i {
  width: 51px; height: 31px; border-radius: 999px; background: var(--line); position: relative;
  transition: background .18s ease; flex: 0 0 auto;
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(60, 40, 20, 0.3); transition: left .18s ease;
}
.switch input:checked + i { background: var(--acc); }
.switch input:checked + i::after { left: 22px; }
.navrow {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 52px; padding: 0 16px;
  font-size: 17px; text-align: left;
}
.navtrail { display: flex; align-items: center; gap: 6px; color: var(--sub); font-size: 17px; }
.chev { font-size: 22px; line-height: 1; color: var(--sub); font-weight: 400; }
.radiorow {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 52px; padding: 0 16px;
  font-size: 17px; text-align: left;
}
.radiorow + .radiorow { border-top: 1px solid var(--line); }
.radiorow .check { color: var(--acc); font-size: 17px; font-weight: 600; visibility: hidden; }
.radiorow.sel .check { visibility: visible; }
.sheetbtns { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.primary {
  width: 100%; min-height: 50px;
  background: var(--acc); color: #fff; font-weight: 600; font-size: 17px;
  padding: 0 26px; border-radius: 14px;
  box-shadow: 0 4px 14px rgba(201, 118, 79, 0.4);
  transition: transform .12s ease;
}
.primary:active { transform: scale(0.98); }
.secondary {
  width: 100%; min-height: 50px;
  color: var(--ink); font-weight: 600; font-size: 17px;
  padding: 0 18px; border-radius: 14px;
  background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.setcard { display: flex; flex-direction: column; gap: 16px; }
.setcard .group,
.setcard .statsrow,
.setcard .bgrid { margin-left: 16px; margin-right: 16px; }
.setcard h2 { margin: 0; color: var(--ink); }

/* ---------- action sheet ---------- */
.modal.actionsheet {
  z-index: 45;
  align-items: flex-end;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.aswrap {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 8px;
  animation: sheetIn 400ms ease-out;
  touch-action: pan-y;
}
.asgroup {
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
}
.asmsg {
  padding: 14px 16px 12px;
  font-size: 15px; font-weight: 400; color: var(--sub);
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.asdest {
  width: 100%; min-height: 56px;
  font-size: 20px; font-weight: 600; color: #c23b2e;
}
.ascancel {
  width: 100%; min-height: 56px;
  font-size: 20px; font-weight: 600;
  background: var(--card); border-radius: 14px; color: var(--acc);
}

#bgSheet { z-index: 45; }

/* ---------- awards ---------- */
.statsrow { display: flex; gap: 8px; }
.statsrow > div {
  flex: 1; display: flex; flex-direction: column; gap: 2px; align-items: center;
  background: var(--card); border-radius: 12px; padding: 14px 6px; text-align: center;
  box-shadow: inset 0 0 0 1px var(--line);
}
.statsrow b { font-size: 28px; font-weight: 700; }
.statsrow small { color: var(--sub); font-weight: 600; font-size: 13px; }
.bgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--card); border-radius: 12px; padding: 12px 6px; text-align: center;
  min-height: 88px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.badge i { font-style: normal; font-size: 1.7rem; line-height: 1.2; }
.badge span { font-size: 15px; font-weight: 600; color: var(--sub); }
.badge.off { opacity: 0.4; filter: none; }
#doneAwards { color: var(--acc-deep); font-weight: 600; }

/* ---------- completion ---------- */
#doneOverlay { position: fixed; inset: 0; z-index: 50; }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.donecard {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 34px); transform: translateX(-50%);
  background: rgba(255, 253, 247, 0.92);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-radius: 22px; box-shadow: var(--shadow);
  padding: 22px 30px; text-align: center; display: flex; flex-direction: column; gap: 6px;
  min-width: min(400px, 88vw);
  animation: rise .5s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes rise { from { transform: translate(-50%, 40px); opacity: 0; } }
.donecard em { font-style: normal; font-size: 28px; font-weight: 700; color: var(--acc-deep); }
.donecard p { font-weight: 600; font-size: 17px; }
.donecard small { color: var(--sub); font-weight: 600; font-size: 15px; }
.donecard .sheetbtns { justify-content: center; margin-top: 10px; flex-direction: row; }
.donecard .primary, .donecard .secondary { width: auto; min-width: 120px; min-height: 48px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .card, .aswrap { animation: none; transform: none; }
}
@media (min-width: 768px) {
  .sizes { display: grid; grid-template-columns: 1fr 1fr; }
  .sizebtn { min-height: 64px; }
  .sizes .sizebtn:nth-child(odd) { border-right: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .daily img { width: 38%; }
}
