/* BOSS WORK - progress.css : gallery, achievement toasts, grade stamp + week strip (js/progress.js) */

/* ---------- achievement toast (top centre, never takes input) ---------- */
#pg-toasts { position: absolute; left: 0; right: 0; top: 14px; z-index: 90; display: flex; justify-content: center; pointer-events: none; }
html:not(.portrait) #stage:has(#hud:not(.hidden)) #pg-toasts { top: 84px; }   /* under the HUD bar, never on top of the clock */
.pg-toast { display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 8px; max-width: 420px; background: var(--cream, #fff7f0); color: var(--ink-a, #3a2433);
  border: 3px solid var(--ink-a, #3a2433); border-radius: 999px; box-shadow: 0 4px 0 var(--ink-a, #3a2433); animation: pg-in .32s cubic-bezier(.2,.9,.3,1.25) both; }
.pg-toast.out { animation: pg-out .26s ease-in both; }
.pg-toast .pg-badge { width: 44px; height: 50px; flex: none; }
.pg-toast .tx { display: flex; flex-direction: column; min-width: 0; }
.pg-toast small { font: 900 11px/1.1 var(--font-cute); letter-spacing: .2em; text-transform: uppercase; color: #a0708a; }
.pg-toast b { font: 900 21px/1.15 var(--font-cute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes pg-in { from { transform: translateY(-80px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pg-out { to { transform: translateY(-70px); opacity: 0; } }

/* ---------- badge: drawn medal + an icon in the middle ---------- */
.pg-badge { position: relative; display: inline-block; width: 64px; height: 72px; }
.pg-badge .pg-medal { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pg-badge .pg-bico { position: absolute; left: 30%; top: 18%; width: 40%; height: 36%; }
.pg-badge .pg-bico svg { width: 100%; height: 100%; display: block; }

/* ---------- grade stamp + week strip (shift summary / ending card) ---------- */
.pg-stamp { position: absolute; right: 26px; top: 20px; width: 92px; height: 92px; border-radius: 50%; border: 5px solid currentColor; display: flex; flex-direction: column;
  align-items: center; justify-content: center; transform: rotate(-12deg); color: #1f9a62; background: rgba(255,255,255,.55); animation: pg-stamp .45s .35s cubic-bezier(.3,1.6,.5,1) both; pointer-events: none; }
.pg-stamp small { font: 900 11px/1 var(--font-cute); letter-spacing: .22em; text-transform: uppercase; }
.pg-stamp b { font: 400 52px/0.95 var(--font-display, var(--font-cute)); }
.pg-stamp.gS { color: #d08a00; background: #fff6c8; } .pg-stamp.gA { color: #1f9a62; } .pg-stamp.gB { color: #2d7fc0; } .pg-stamp.gC { color: #d6455e; }
@keyframes pg-stamp { from { transform: rotate(-12deg) scale(2.4); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }
.pg-week { display: flex; gap: 8px; justify-content: center; }
.pg-wday { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 54px; border: 2px solid var(--ink-a, #3a2433); border-radius: 12px;
  background: #fff; color: #a0708a; }
.pg-wday small { font: 900 11px/1 var(--font-cute); letter-spacing: .14em; }
.pg-wday b { font: 900 24px/1.1 var(--font-cute); color: #c8b6c4; }
.pg-wday.cur { box-shadow: 0 3px 0 var(--ink-a, #3a2433); transform: translateY(-3px); background: var(--butter, #ffe9a3); }
.pg-wday.gS b { color: #d08a00; } .pg-wday.gA b { color: #1f9a62; } .pg-wday.gB b { color: #2d7fc0; } .pg-wday.gC b { color: #d6455e; }

/* ---------- title menu entry ---------- */
.tt-menu .pg-galbtn small { margin-left: 8px; }

/* ---------- gallery ---------- */
.pg-gal { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; padding: 22px 34px 24px; gap: 14px; color: var(--ink-a, #3a2433);
  background-color: #fff0f4; background-image: var(--gingham); animation: pg-fade .25s ease-out both; }
@keyframes pg-fade { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }
.pg-head { display: flex; align-items: center; gap: 22px; flex: none; }
.pg-head h2 { margin: 0; font: 400 46px/1 var(--font-display, var(--font-cute)); color: #fff; -webkit-text-stroke: 3px var(--ink-a, #3a2433); paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink-a, #3a2433); letter-spacing: .05em; text-transform: uppercase; }
.pg-tabs { display: flex; gap: 10px; flex: 1; min-width: 0; }
.pg-tabs button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 16px; min-width: 0; cursor: pointer; font: 900 20px/1.1 var(--font-cute);
  color: var(--ink-a, #3a2433); background: var(--cream, #fff7f0); border: 3px solid var(--ink-a, #3a2433); border-radius: 14px; box-shadow: 0 3px 0 var(--ink-a, #3a2433); }
.pg-tabs button small { font: 800 12px/1 var(--font-cute); color: #a0708a; white-space: nowrap; }
.pg-tabs button.on { background: var(--pink, #ff9fc2); transform: translateY(-2px); }
.pg-tabs button:focus-visible, .pg-tile:focus-visible, .pg-x:focus-visible { outline: 4px solid #ff4f86; outline-offset: 3px; }
.pg-x { position: relative; flex: none; width: 54px; height: 54px; cursor: pointer; border: 3px solid var(--ink-a, #3a2433); border-radius: 50%; background: var(--cream, #fff7f0); box-shadow: 0 3px 0 var(--ink-a, #3a2433); }
.pg-x i { position: absolute; left: 12px; top: 22px; width: 24px; height: 5px; border-radius: 3px; background: var(--ink-a, #3a2433); transform: rotate(45deg); }
.pg-x i + i { transform: rotate(-45deg); }
.pg-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; display: grid; gap: 12px; align-content: start; padding: 6px 6px 12px; overscroll-behavior: contain; }
.pg-body.pg-games { grid-template-columns: repeat(6, 1fr); }
.pg-body.pg-bosses { grid-template-columns: repeat(3, 1fr); }
.pg-body.pg-awards { grid-template-columns: repeat(3, 1fr); }

.pg-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; padding: 10px 8px; text-align: center;
  font-family: var(--font-cute); color: var(--ink-a, #3a2433); background: #fff; border: 3px solid var(--ink-a, #3a2433); border-radius: 16px; box-shadow: 0 4px 0 var(--ink-a, #3a2433); }
button.pg-tile:not([disabled]) { cursor: pointer; }
button.pg-tile:not([disabled]):hover { transform: translateY(-3px) rotate(-1deg); background-color: #fff7fb; }
.pg-tile.locked { background: #e6dcea; border-color: #8a7a88; box-shadow: 0 4px 0 #8a7a88; color: #8a7a88; }
.pg-cmd { font: 900 22px/1.05 var(--font-cute); letter-spacing: .02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-st { font: 800 12px/1.2 var(--font-cute); color: #7a5a70; white-space: nowrap; }
.pg-ww { padding: 28px 8px 8px; justify-content: flex-start; background: linear-gradient(var(--tag, #bfe4ff) 0 22px, #fff 22px); }
.pg-ww.locked { background: #e6dcea; }
.pg-tag { position: absolute; left: 0; right: 0; top: 3px; font: 900 11px/1 var(--font-cute); letter-spacing: .2em; text-transform: uppercase; }
.pg-ctl, .pg-lock { width: 40px; height: 40px; flex: none; }
.pg-ctl svg, .pg-lock svg, .pg-bico svg { width: 100%; height: 100%; display: block; }
.pg-lock { width: 46px; height: 46px; opacity: .8; }
.pg-bs { min-height: 210px; padding: 36px 12px 12px; justify-content: flex-start; }
.pg-bs .pg-cmd { font-size: 26px; }
.pg-day { position: absolute; left: 12px; top: 10px; font: 900 14px/1 var(--font-cute); letter-spacing: .18em; color: #a0708a; }
.pg-grade { position: absolute; right: 10px; top: 8px; width: 42px; height: 42px; border-radius: 50%; border: 3px solid currentColor; display: flex; align-items: center; justify-content: center;
  font: 900 24px/1 var(--font-cute); transform: rotate(-10deg); background: #fff; }
.pg-grade.gS { color: #d08a00; background: #fff6c8; } .pg-grade.gA { color: #1f9a62; } .pg-grade.gB { color: #2d7fc0; } .pg-grade.gC { color: #d6455e; }
.pg-aw { flex-direction: row; justify-content: flex-start; gap: 12px; text-align: left; padding: 10px 14px; min-height: 96px; }
.pg-aw .pg-badge { flex: none; width: 56px; height: 63px; }
.pg-awt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pg-awt b { font: 900 18px/1.1 var(--font-cute); }
.pg-awt span { font: 700 13px/1.25 var(--font-cute); color: #7a5a70; }
.pg-aw.locked .pg-awt b, .pg-aw.locked .pg-awt span { color: #8a7a88; }

/* screenshot thumbnail (assets/thumbs, tools/thumbs.mjs): 16:9, rounded, inked outline like the tiles */
.pg-thumb { position: relative; display: block; flex: none; width: 100cqw; height: 56.25cqw; margin-bottom: 4px; overflow: hidden; border: 2px solid var(--ink-a, #3a2433);
  border-radius: 10px; background: #f3e8f0; }
.pg-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; user-select: none; }
.pg-thumb.locked { border-color: #8a7a88; background: #4a3c48; }
.pg-thumb.locked img { filter: blur(7px) brightness(.5) saturate(.35); transform: scale(1.15); }   /* a silhouette: shapes and colour, no details */
.pg-thumb.locked.noimg { background: #e6dcea; }
.pg-thumb .pg-lock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 34%; max-width: 64px; height: auto; aspect-ratio: 1; opacity: .95;
  border-radius: 50%; background: rgba(255,247,240,.82); padding: 6px; box-sizing: border-box; }
.pg-thumb .pg-fbico { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 40%; height: 70%; }
.pg-thumb .pg-fbico svg { width: 100%; height: 100%; display: block; }
.pg-ww, .pg-bs { container-type: inline-size; }   /* the picture is sized from the tile width (cqw): aspect-ratio alone is not counted when the grid sizes its rows */
.pg-ww > *, .pg-bs > * { flex-shrink: 0; }
.pg-bs .pg-thumb { width: 78cqw; height: 43.875cqw; border-width: 3px; border-radius: 12px; }

/* ---------- portrait (720 wide, tall) ---------- */
html.portrait .pg-gal { padding: 40px 22px 36px; gap: 18px; }
html.portrait .pg-head { flex-wrap: wrap; gap: 14px; }
html.portrait .pg-head h2 { font-size: 52px; flex: 1; }
html.portrait .pg-tabs { order: 3; flex: 1 0 100%; }
html.portrait .pg-tabs button { flex: 1; font-size: 22px; padding: 10px 12px; }
html.portrait .pg-x { width: 64px; height: 64px; }
html.portrait .pg-x i { left: 15px; top: 26px; width: 28px; }
html.portrait .pg-body.pg-games { grid-template-columns: repeat(3, 1fr); }
html.portrait .pg-body.pg-bosses { grid-template-columns: repeat(2, 1fr); }
html.portrait .pg-body.pg-awards { grid-template-columns: 1fr; }
html.portrait .pg-ww { padding-bottom: 12px; }
html.portrait .pg-bs .pg-thumb { width: 92cqw; height: 51.75cqw; }
html.portrait .pg-cmd { font-size: 26px; }
html.portrait .pg-st { font-size: 15px; }
html.portrait .pg-awt b { font-size: 22px; } html.portrait .pg-awt span { font-size: 16px; }
html.portrait .pg-aw .pg-badge { width: 64px; height: 72px; }
html.portrait .sm-wrap .pg-stamp { right: 8px; top: 8px; width: 76px; height: 76px; } html.portrait .sm-wrap .pg-stamp b { font-size: 42px; }   /* small corner stamp on the narrow portrait card */
html.portrait #pg-toasts { top: 30px; }
html.portrait .pg-toast b { font-size: 24px; }
@media (prefers-reduced-motion: reduce) { .pg-toast, .pg-toast.out, .pg-stamp, .pg-gal { animation-duration: .01s; } }
