/* screens.css — UI helpers (.ui-), title (.tt-), hub (.hub-), wardrobe (.wd-) */
body[data-screen="title"] #sea { opacity: 0; }
/* title key art: the new cover picture (cover-bg-new), full height and centred, never stretched; a portrait page
   (9:16 or taller) is covered edge to edge; a wider window shows a dimmed copy of it beside the picture */
body[data-screen="title"] #app { background: url("assets/cover-bg-new.webp") center top / auto 100% no-repeat,
  linear-gradient(rgba(8, 40, 70, 0.6), rgba(8, 40, 70, 0.6)), url("assets/cover-bg-new.webp") center / cover no-repeat, #1d4f5e; }

@keyframes uiSquash { 0% { transform: scale(1); } 35% { transform: scale(0.88, 0.8); } 70% { transform: scale(1.07, 1.1); } 100% { transform: scale(1); } }
.ui-squash { animation: uiSquash 0.26s ease-out; }
/* elements with words squash / grow only their picture, never their text (keeps letters sharp) */
.ui-tile.ui-squash, .ui-gold.ui-squash { animation: none; }
.ui-tile.ui-squash .ui-tile-icon, .ui-gold.ui-squash img { animation: uiSquash 0.26s ease-out; }
.ui-bicon { width: 28px; height: 28px; object-fit: contain; pointer-events: none; }
.ui-blabel { white-space: nowrap; }

.ui-tile { position: relative; width: 68px; height: 84px; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.ui-tile-icon { width: 56px; height: 56px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 3px 0 rgba(29,43,107,.5));
  transition: transform .12s cubic-bezier(.3,1.6,.5,1); }
.ui-tile:hover .ui-tile-icon, .ui-tile.focus .ui-tile-icon { transform: scale(1.14); }
.ui-tile-label { font-size: 14px; line-height: 18px; margin-top: 2px; white-space: nowrap; pointer-events: none; }
.ui-badge { position: absolute; top: -2px; right: 0; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--magenta); color: #fff; border: 3px solid var(--navy); font-size: 14px; font-weight: 900; line-height: 18px; text-align: center; }

.ui-inner { position: relative; width: 100%; height: 100%; }
.ui-col { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 8px; }
.ui-row { display: flex; gap: 12px; justify-content: center; }
.ui-msg { font-size: 20px; font-weight: 900; text-align: center; line-height: 1.3; flex: 1; display: flex; align-items: center; }

/* centred with auto margins (never translate(-50%), which can leave the text on half a pixel); enters by sliding */
.ui-toast { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; top: 64px; z-index: 80; max-width: 340px; padding: 8px 18px; border-radius: 24px; background: var(--magenta);
  border: 3px solid var(--navy); font-size: 16px; text-align: center; -webkit-text-stroke: 3px var(--navy); transform: translateY(-30px); opacity: 0;
  transition: transform .3s cubic-bezier(.3,1.6,.5,1), opacity .25s; pointer-events: none; display: block; }
.ui-toast.in { transform: none; opacity: 1; }
/* the banner slams down from above and leaves upward: moved and faded, never scaled or tilted */
.ui-banner { position: absolute; left: 0; right: 0; top: 100px; z-index: 80; text-align: center; font-size: 46px; pointer-events: none; display: block;
  -webkit-text-stroke: 8px var(--navy); transform: translateY(-90px); opacity: 0; transition: transform .28s cubic-bezier(.3,1.6,.5,1), opacity .15s; }
.ui-banner.in { transform: none; opacity: 1; }
.ui-banner.out { transform: translateY(-40px); opacity: 0; transition: transform .25s, opacity .25s; }

.ui-gold { position: absolute; left: 10px; top: 10px; height: 40px; min-width: 84px; padding: 0 14px 0 6px; display: flex; align-items: center; gap: 6px; z-index: 5;
  background: var(--cream); border: 3px solid var(--navy); border-radius: 22px; cursor: pointer; box-shadow: 0 3px 0 rgba(29,43,107,.5); }
.ui-gold img { width: 28px; height: 28px; object-fit: contain; }
.ui-gold span { font-size: 20px; line-height: 24px; font-weight: 900; color: var(--navy); -webkit-text-stroke: 0; text-shadow: none; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }

.ui-back { position: absolute; left: 10px; top: 10px; width: 48px; height: 48px; padding: 0; border-radius: 50%; background: var(--yellow); border: 4px solid var(--navy);
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 5; box-shadow: 0 3px 0 rgba(29,43,107,.5); outline: none;
  transition: transform .12s cubic-bezier(.3,1.6,.5,1); }
.ui-back:hover, .ui-back.focus { transform: scale(1.08); }
.ui-header { position: absolute; left: 66px; width: 264px; top: 14px; text-align: center; font-size: 26px; line-height: 1.1; z-index: 4; pointer-events: none; }

.ui-speech { position: absolute; z-index: 6; padding: 10px 14px; background: var(--cream); border: 4px solid var(--navy); border-radius: 20px; font-size: 16px; font-weight: 900;
  line-height: 1.3; text-align: center; color: var(--navy); box-shadow: 0 3px 0 rgba(29,43,107,.45); pointer-events: none; white-space: pre-line; }
.ui-speech::after { content: ""; position: absolute; bottom: -14px; width: 18px; height: 18px; background: var(--cream); border-right: 4px solid var(--navy); border-bottom: 4px solid var(--navy); transform: rotate(45deg); }
.ui-speech.tail-left::after { left: 26px; }
.ui-speech.tail-right::after { right: 26px; }

.ui-how-title { font-size: 24px; }
.ui-how-step { display: flex; align-items: center; gap: 8px; width: 100%; background: rgba(255,255,255,.7); border-radius: 14px; padding: 4px 8px; min-height: 76px; position: relative; }
.ui-how-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--magenta); text-align: center; line-height: 28px; font-size: 16px; -webkit-text-stroke: 3px var(--navy); }
.ui-how-img { flex: none; width: 60px; height: 60px; object-fit: contain; }
.ui-how-img.sil { filter: brightness(0) opacity(.75); }
.ui-how-img.pick { filter: drop-shadow(0 0 0 #fff) saturate(1.1); outline: 3px dashed var(--magenta); outline-offset: 2px; border-radius: 10px; }
.ui-how-text { font-size: 15px; font-weight: 800; line-height: 1.25; flex: 1; word-break: auto-phrase; line-break: strict; text-wrap: pretty; }
.ui-speech, .qz-fact, .ui-msg, .ui-how-extra, .mis-text, .mis-foot, .qz-name, .ui-toast { word-break: auto-phrase; line-break: strict; text-wrap: pretty; }
.ui-how-extra { font-size: 14px; font-weight: 800; text-align: center; line-height: 1.3; color: var(--teal); }

/* title */
.tt-root { cursor: pointer; overflow: hidden; }
.tt-logo { position: absolute; left: 35px; top: 34px; width: 326px; height: 234px; object-fit: contain; pointer-events: none;
  animation: ttDrop .6s cubic-bezier(.3,1.5,.5,1) both, ttFloat 3.2s ease-in-out .6s infinite, ttShine 5s ease-in-out 1.5s infinite; }
@keyframes ttDrop { 0% { transform: translateY(-320px) scale(.8); opacity: 0; } 60% { transform: translateY(14px) scale(1.04); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes ttFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes ttShine { 0%, 80%, 100% { filter: brightness(1) drop-shadow(0 4px 0 rgba(29,43,107,.35)); } 90% { filter: brightness(1.45) drop-shadow(0 0 14px #fff); } }
.tt-prompt { position: absolute; left: 0; right: 0; top: 628px; width: fit-content; max-width: 348px; margin: 0 auto; text-align: center; font-size: 26px; pointer-events: none; animation: pulse 1.4s ease-in-out infinite;
  padding: 6px 22px; border-radius: 26px; background: rgba(12, 28, 70, 0.42); box-sizing: border-box; }
.tt-trophy { position: absolute; right: 10px; top: 10px; width: 48px; height: 48px; padding: 0; border-radius: 50%; background: rgba(29,43,107,.5); border: 2px solid rgba(255,246,224,.5);
  display: flex; align-items: center; justify-content: center; cursor: pointer; outline: none; transition: transform .12s cubic-bezier(.3,1.6,.5,1); }
.tt-trophy img { width: 34px; height: 34px; object-fit: contain; pointer-events: none; }
.tt-trophy:hover, .tt-trophy.focus { transform: scale(1.1); }
.tt-bub { position: absolute; bottom: -30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); background: rgba(255,255,255,.2); pointer-events: none; animation: ttRise linear infinite; }
@keyframes ttRise { 0% { transform: translateY(0) translateX(0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-760px) translateX(14px); opacity: 0; } }

.tt-intro { position: absolute; inset: 0; z-index: 100; background: #0e5f82; transition: opacity .35s; }
.tt-intro-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tt-intro-sub { position: absolute; left: 6%; right: 6%; bottom: 17%; text-align: center; font-size: 20px; line-height: 1.3; pointer-events: none; font-family: var(--font); font-weight: 900; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 5px var(--navy); text-shadow: 0 2px 0 var(--navy); }
body:has(.tt-intro) .tt-prompt { visibility: hidden; }
.tt-intro-skip { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: 7%; }

/* hub */
/* betel-stall style neon tube lettering on a dark signboard hung in the kelp lantern alley */
/* the board (::before) hangs tilted; the neon letters stay upright on whole pixels so they stay sharp */
.hub-sign { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; top: 66px; isolation: isolate; max-width: 330px; padding: 10px 24px 12px; white-space: nowrap;
  text-align: center; font-size: 30px; font-weight: 900; letter-spacing: 2px; color: #fff4fb; pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 8px var(--magenta), 0 0 16px var(--magenta), 0 0 26px var(--cyan); animation: hubFlicker 5s infinite; }
.hub-sign::before { content: ""; position: absolute; inset: 0; z-index: -1; transform: rotate(-2deg);
  background: rgba(20, 22, 70, 0.82); border: 4px solid var(--navy); border-radius: 18px;
  box-shadow: inset 0 0 0 3px var(--magenta), inset 0 0 14px rgba(255, 61, 154, .8), 0 0 18px rgba(255, 61, 154, .55), 0 4px 0 rgba(29,43,107,.6); }
/* the neon flickers by its colour (painted in place), not by fading the element */
@keyframes hubFlicker { 0%, 42%, 46%, 50%, 100% { color: #fff4fb; } 44% { color: #b98aa6; } 48% { color: #d8b0c6; } }
.hub-otto, .hub-granny { position: absolute; cursor: pointer; z-index: 2; }
.hub-otto { left: 6px; top: 150px; width: 190px; height: 240px; }
.hub-granny { right: 6px; top: 222px; width: 170px; height: 170px; }
.hub-otto canvas, .hub-granny canvas { width: 100%; height: 100%; display: block; }
.ui-gold.hub-gold { left: 66px; top: 14px; }
.hub-trophy { position: absolute; left: 10px; top: 10px; width: 48px; height: 48px; padding: 0; border-radius: 50%; background: var(--cream); border: 4px solid var(--navy);
  display: flex; align-items: center; justify-content: center; cursor: pointer; outline: none; box-shadow: 0 3px 0 rgba(29,43,107,.5); transition: transform .12s cubic-bezier(.3,1.6,.5,1); z-index: 5; }
.hub-trophy img { width: 32px; height: 32px; object-fit: contain; pointer-events: none; }
.hub-trophy:hover, .hub-trophy.focus { transform: scale(1.1); }
.hub-play, .hub-family, .hub-daily { position: absolute; left: 48px; width: 300px; z-index: 3; }
.hub-play { top: 394px; height: 70px; font-size: 30px; }
/* family + online duel: two medium buttons side by side (146 + 8 + 146 = the 300 px column) */
.hub-family, .hub-online { top: 474px; height: 58px; width: 146px; font-size: 19px; padding: 0 6px; }
.hub-online { position: absolute; left: 202px; z-index: 3; }
.hub-family .ui-blabel, .hub-online .ui-blabel { white-space: normal; text-align: center; line-height: 1.05; overflow-wrap: anywhere; }
.hub-oicon { position: absolute; left: -10px; top: -14px; width: 38px; height: 38px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 0 rgba(29,43,107,.5)); }
/* daily challenge: sunset-orange plate, today's pack icon, its name under the label, a tick once done */
.hub-daily { top: 542px; height: 60px; gap: 10px; padding: 4px 16px 4px 12px; --b1: #ffe6a8; --b2: #ffb347; --b3: #f0861c; --b4: rgba(150, 70, 0, 0.4); }
.hub-dicon { flex: none; width: 44px; height: 44px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 0 rgba(29,43,107,.5)); }
.hub-dcol { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.1; pointer-events: none; }
.hub-dcol .ui-blabel { font-size: 21px; line-height: 24px; white-space: nowrap; }
.hub-dsub { font-size: 14px; line-height: 18px; -webkit-text-stroke: 3px var(--navy); paint-order: stroke fill; white-space: nowrap; color: #fff6c9; }
.hub-dchk { position: absolute; right: -8px; top: -10px; width: 32px; height: 32px; border-radius: 50%; background: #3fe08a; border: 3px solid var(--navy);
  display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; -webkit-text-stroke: 0; text-shadow: 0 1px 0 var(--navy); pointer-events: none; }
/* participation streak chip: inside the plate's lower-right corner, under the label's line, clear of the pack name and the tick */
.hub-dstreak { position: absolute; right: 16px; bottom: 5px; height: 24px; min-width: 44px; padding: 0 8px 0 4px; border-radius: 12px; background: #fff6c9;
  border: 2.5px solid var(--navy); box-shadow: 0 2px 0 var(--navy); display: flex; align-items: center; gap: 2px; pointer-events: none; z-index: 1; }
.hub-dstreak svg { width: 17px; height: 17px; flex: none; }
.hub-dstreak b { font-size: 15px; line-height: 1; font-weight: 900; color: var(--navy); -webkit-text-stroke: 0; text-shadow: none; }
.hub-play.btn::before, .hub-play.btn.pop-in::before { animation: plateIn .32s cubic-bezier(.3,1.5,.5,1) backwards, platePulse 1.6s ease-in-out .5s infinite; animation-delay: var(--d, 0s), .5s; }
.hub-row { position: absolute; top: 614px; height: 84px; left: 0; right: 0; }
.hub-row .ui-tile { position: absolute; top: 0; }

/* wardrobe */
.wd-spot { position: absolute; left: 98px; top: 296px; width: 200px; height: 48px; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,246,224,.95), rgba(255,210,63,.6) 60%, transparent 72%); border: 3px solid rgba(255,246,224,.7); }
.wd-prev { position: absolute; left: 88px; top: 60px; width: 220px; height: 280px; pointer-events: none; }
.wd-prev canvas { width: 100%; height: 100%; display: block; }
.wd-grid { position: absolute; left: 0; right: 0; top: 338px; bottom: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 26px), transparent); mask-image: linear-gradient(#000 calc(100% - 26px), transparent); }
.wd-grid::-webkit-scrollbar { display: none; }
.wd-pad { position: absolute; left: 0; width: 1px; height: 30px; }
.wd-card { position: absolute; width: 170px; height: 160px; background: var(--cream); border: 4px solid var(--navy); border-radius: 18px; box-shadow: 0 4px 0 rgba(29,43,107,.5); }
.wd-card.on { border-color: var(--magenta); box-shadow: 0 0 0 3px var(--yellow), 0 4px 0 rgba(29,43,107,.5); }
.wd-card img.wd-sprite { position: absolute; left: 50%; top: 2px; width: 52px; height: 52px; margin-left: -26px; object-fit: contain; }
.wd-name { position: absolute; left: 6px; right: 6px; top: 53px; height: 36px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 14px; font-weight: 900; line-height: 17px; white-space: pre-line; overflow: hidden; }
.wd-btn { position: absolute; left: 8px; width: 146px; top: 101px; height: 46px; min-height: 44px; padding: 0 12px; border-radius: 22px; font-size: 16px; gap: 4px; }
.wd-btn > span { -webkit-text-stroke: 3px var(--navy); text-shadow: 0 1px 0 var(--navy); letter-spacing: 0.5px; font-variant-numeric: tabular-nums; }
.wd-btn img { width: 20px; height: 20px; object-fit: contain; }
.wd-btn.on::before { filter: grayscale(0.7) brightness(0.9); }
.wd-btn.locked::before { filter: grayscale(0.8) brightness(0.85); }
