/* style.css — shared base look (SOZOPOP sticker style: cream plates, thick navy outlines, magenta / cyan / yellow).
   Module styles live in screens.css (title, hub, wardrobe, ui helpers), meta.css (collection, missions, photos), quiz.css. */
:root {
  --navy: #1d2b6b; --cream: #fff6e0; --magenta: #ff3d9a; --cyan: #19d3e6; --yellow: #ffd23f; --teal: #0b6f8a;
  --font: "Arial Rounded MT Bold", "Trebuchet MS", "PingFang TC", "Hiragino Maru Gothic ProN", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a4f6e; touch-action: manipulation;
  user-select: none; -webkit-user-select: none; }
#app { position: fixed; inset: 0; overflow: hidden; background: linear-gradient(#5fe0f0, #0b6f8a 60%, #08385a); }
#sea, #fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#fx { pointer-events: none; }
#ui { position: absolute; left: 0; top: 0; width: 396px; height: 704px; transform-origin: 0 0;
  font-family: var(--font); color: var(--navy); }
.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }
.modal { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 30, 70, 0.55); box-shadow: 0 0 0 2000px rgba(10, 30, 70, 0.55); }

/* text with a thick outline + hard drop shadow */
.outline { color: #fff; font-weight: 900; paint-order: stroke fill; -webkit-text-stroke: 5px var(--navy);
  text-shadow: 0 3px 0 var(--navy); letter-spacing: 0.5px; }
.outline-sm { color: #fff; font-weight: 900; paint-order: stroke fill; -webkit-text-stroke: 3.5px var(--navy);
  text-shadow: 0 2px 0 var(--navy); }

/* Panels and buttons are drawn in CSS as ONE picture each (layered backgrounds + shadows), never as a 9-slice
   border-image: the stage is scaled by a fractional transform, and a 9-slice's nine pieces then leave thin seams
   and the art's soft edge shows as a dark rim. Same look: candy-stripe frame, navy line, cream plate, star corners. */
:root { --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3.1 6.4 7 .9-5.1 4.9 1.3 7L12 17.6 5.7 21l1.3-7L1.9 9.1l7-.9z' fill='%23ffd23f' stroke='%231d2b6b' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.panel { border: 26px solid transparent; border-radius: 18px; padding: 8px; color: var(--navy);
  background:
    var(--star) left 2px top 2px / 20px 20px no-repeat, var(--star) right 2px top 2px / 20px 20px no-repeat,
    var(--star) left 2px bottom 2px / 20px 20px no-repeat, var(--star) right 2px bottom 2px / 20px 20px no-repeat,
    linear-gradient(var(--cream), var(--cream)) center / calc(100% - 30px) calc(100% - 30px) no-repeat,
    linear-gradient(var(--navy), var(--navy)) center / calc(100% - 22px) calc(100% - 22px) no-repeat,
    repeating-linear-gradient(135deg, var(--magenta) 0 7px, #fff 7px 10px, var(--cyan) 10px 17px, #fff 17px 20px);
  background-origin: border-box; background-clip: border-box;
  box-shadow: 0 0 0 3px var(--navy), 0 6px 0 3px rgba(10, 30, 70, 0.35); }
/* Sharp text: the button's plate is its ::before, and every grow / squash / pulse / glow moves only the plate.
   The label itself is never scaled or filtered, because a scaling animation makes the browser stretch a bitmap
   of the text, which blurs it until the animation ends. */
.btn { --b1: #fff08a; --b2: #ffd21f; --b3: #ffa412; --b4: rgba(200, 96, 0, 0.45);
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 48px; min-height: 48px; padding: 18px 38px; border: 4px solid transparent; border-radius: 26px; background: none;
  font-family: var(--font); font-weight: 900; font-size: 20px; color: #fff; cursor: pointer;
  paint-order: stroke fill; -webkit-text-stroke: 4px var(--navy); text-shadow: 0 2px 0 var(--navy); outline: none; }
.btn::before { content: ""; position: absolute; inset: -4px; z-index: -1; border: 4px solid var(--navy); border-radius: inherit; pointer-events: none;
  background: radial-gradient(ellipse 44% 30% at 50% 24%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 100%),
    linear-gradient(var(--b1), var(--b2) 58%, var(--b3));
  box-shadow: inset 0 -5px 0 var(--b4), inset 0 3px 0 rgba(255, 255, 255, 0.55), 0 0 0 3px var(--cream), 0 4px 0 3px var(--navy);
  transition: transform 0.12s cubic-bezier(.3,1.6,.5,1), filter 0.12s; }
.btn > * { margin: -10px 0; }
.btn:hover::before, .btn.focus::before { transform: scale(1.07); filter: brightness(1.1) drop-shadow(0 0 6px #fff8); }
.btn:active::before { transform: scale(0.93); }
.btn[disabled]::before, .btn.disabled::before { filter: grayscale(0.8) brightness(0.85); }
.btn[disabled], .btn.disabled { cursor: default; }
/* entrance / press / pulse on the plate only; the label fades in */
@keyframes plateIn { 0% { scale: 0.3; opacity: 0; } 70% { scale: 1.08; opacity: 1; } 100% { scale: 1; opacity: 1; } }
@keyframes plateSquash { 0% { scale: 1; } 35% { scale: 0.9 0.82; } 70% { scale: 1.07 1.1; } 100% { scale: 1; } }
/* endless pulses grow the plate's box (inset) instead of scaling it: nothing stays a GPU layer for ever,
   so the label beside it is never pulled into a stretched bitmap */
@keyframes platePulse { 0%, 100% { inset: -4px; } 50% { inset: -6px -10px; } }
@keyframes labelIn { 0%, 40% { opacity: 0; } 100% { opacity: 1; } }
/* entrances fill "backwards" only: once they end nothing is held on the element (no leftover layer) */
.btn.pop-in, .btn.ui-squash { animation: none; }
.btn.pop-in::before { animation: plateIn 0.32s cubic-bezier(.3,1.5,.5,1) backwards; animation-delay: var(--d, 0s); }
.btn.pop-in > * { animation: labelIn 0.32s ease-out backwards; animation-delay: var(--d, 0s); }
.btn.ui-squash::before { animation: plateSquash 0.26s ease-out; }
.btn.pop-in.ui-squash::before { animation: plateIn 0.32s cubic-bezier(.3,1.5,.5,1) backwards, plateSquash 0.26s ease-out; animation-delay: var(--d, 0s), 0s; }
.btn.glow::before { animation: platePulse 1s ease-in-out infinite; }
.btn.cyan { --b1: #a8f7ff; --b2: #33d8ec; --b3: #10a6c8; --b4: rgba(0, 90, 140, 0.4); }
.btn.magenta { --b1: #ffb3d6; --b2: #ff5fab; --b3: #e8307e; --b4: rgba(150, 0, 70, 0.4); }
[data-nav].focus { outline: 4px solid var(--yellow); outline-offset: 2px; border-radius: 14px; }

/* popIn / pulse move and fade instead of scaling, so text inside them never turns blurry while they play */
@keyframes popIn { 0% { transform: translateY(28px); opacity: 0; } 60% { transform: translateY(-6px); opacity: 1; } 82% { transform: translateY(2px); } 100% { transform: none; opacity: 1; } }
/* pulse brightens the letters (a colour change, painted in place) instead of fading the whole element */
@keyframes pulse { 0%, 100% { color: #e4ecff; } 50% { color: #ffffff; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.pop-in { animation: popIn 0.32s cubic-bezier(.3,1.5,.5,1) backwards; }
