/* ============ Glooplings: accounts, claims, collection, character pages ============ */
/* Builds on styles.css (same colours, fonts, buttons, nav, space background). */

.subpage { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--space); }
.subpage > .space { flex: 1; padding: calc(110px + env(safe-area-inset-top, 0px)) 16px 64px; }
.subpage .footer { padding-top: 2rem; }
.wrap { max-width: 1100px; margin: 0 auto; }
.center { text-align: center; }

.demo-flag {
  position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 90;
  background: #ffd21a; color: #1d1147; font: 700 .8rem var(--font-body); padding: .35em .9em; border-radius: 99px;
  box-shadow: 0 4px 14px rgba(0,0,0,.3); white-space: nowrap; max-width: calc(100vw - 20px); overflow: hidden; text-overflow: ellipsis;
}

.nav__links a.is-current { opacity: 1; }
.nav__links a.is-current::after { transform: scaleX(1); }

/* ---------- panels & forms ---------- */
.panel {
  background: #fff; color: var(--ink); border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(10, 0, 40, .45), 0 0 0 4px rgba(255,255,255,.08);
  padding: clamp(1.4rem, 4vw, 2.4rem);
}
.auth { max-width: 460px; margin: 0 auto; }
.auth__logo { width: min(320px, 82%); margin: 0 auto 1rem; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); }
.auth h1 { font-size: clamp(1.6rem, 6vw, 2.1rem); text-align: center; color: var(--space-2); }
.auth__sub { text-align: center; color: var(--muted); margin: .5rem 0 1.4rem; }
.field { display: block; margin: 0 0 1rem; }
.field span { display: block; font-weight: 800; font-size: .92rem; margin: 0 0 .35rem; }
.field input {
  width: 100%; font: 600 1.05rem var(--font-body); color: var(--ink);
  padding: .8em 1em; border-radius: 16px; border: 2px solid #e0d8f5; background: #faf8ff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(139, 61, 255, .15); }
.auth .btn { width: 100%; }
.auth__row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: -.2rem 0 1.1rem; font-size: .95rem; }
.linkbtn { background: none; border: 0; padding: 0; font: 800 .95rem var(--font-body); color: var(--purple); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.or { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-weight: 800; font-size: .85rem; margin: 1.1rem 0; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: #eee8fb; border-radius: 2px; }
.btn--google { background: #fff; color: #2b2b2b; box-shadow: inset 0 0 0 2px #e0d8f5, 0 4px 0 #d9d0f0; }
.btn--google:active { box-shadow: inset 0 0 0 2px #cfc2f2, 0 1px 0 #d9d0f0; }
.btn--google svg { width: 22px; height: 22px; }
.btn--plain { background: #f2edff; color: var(--space-2); box-shadow: 0 4px 0 #d9d0f0; }
.btn--plain:active { box-shadow: 0 1px 0 #d9d0f0; }
.btn--yellow { background: linear-gradient(180deg, #ffe46b, var(--yellow)); color: var(--ink); box-shadow: 0 6px 0 #c99c00, 0 12px 24px rgba(255,210,26,.35), inset 0 2px 0 rgba(255,255,255,.6); }
.btn--yellow:active { box-shadow: 0 2px 0 #c99c00; }
.auth__guest { display: block; text-align: center; margin-top: 1.1rem; font-weight: 800; color: var(--muted); }
.msg { border-radius: 14px; padding: .8em 1em; margin: 0 0 1rem; font-weight: 700; font-size: .95rem; }
.msg--error { background: #ffe8f3; color: #a10d5b; }
.msg--ok { background: #e7fbe0; color: #2d6b17; }
.msg--info { background: #eaf5ff; color: #0d5a99; }
.note { font-size: .85rem; color: var(--muted); text-align: center; margin: 1rem 0 0; }

/* ---------- claim page ---------- */
.claim { max-width: 560px; margin: 0 auto; text-align: center; color: #fff; }
.claim h1 { font-size: clamp(2rem, 8vw, 3.2rem); text-shadow: 0 4px 0 rgba(0,0,0,.25); }
.claim__lead { font-size: 1.15rem; opacity: .9; margin: .6rem auto 1.4rem; max-width: 30ch; }
.claim__stage { position: relative; width: min(340px, 82vw); aspect-ratio: 1; margin: 0 auto 1.2rem; display: grid; place-items: center; }
.claim__stage img { width: 88%; height: 88%; object-fit: contain; position: relative; z-index: 2; filter: drop-shadow(0 16px 20px rgba(0,0,0,.35)); }
.claim__glow { position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle, var(--glow, #ff3da5) 0%, transparent 65%); opacity: .55; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .8; } }
.claim__name { font: 700 2rem var(--font-fun); margin: 0; }
.claim__num { opacity: .7; font-weight: 800; letter-spacing: 1px; }
.claim__btns { display: grid; gap: .8rem; max-width: 380px; margin: 1.4rem auto 0; }
.claim__btns .btn { width: 100%; }
.claim .panel { text-align: left; margin-top: 1.4rem; }
.rarity-tag { display: inline-block; font: 600 .85rem var(--font-fun); letter-spacing: 1px; text-transform: uppercase; padding: .3em .9em; border-radius: 99px; margin: .5rem 0 0; }
.rarity-tag--common { background: rgba(255,255,255,.15); color: #fff; }
.rarity-tag--rare { background: linear-gradient(90deg, #ff3da5, #ffd21a); color: #fff; }
.rarity-tag--ultra { background: linear-gradient(90deg, #8b3dff, #26a4ff, #ff3da5); color: #fff; }

/* unlock animation */
.unlock { position: relative; width: min(360px, 86vw); aspect-ratio: 1; margin: 0 auto 1rem; display: grid; place-items: center; }
.unlock__shadow, .unlock__real { position: absolute; width: 84%; height: 84%; object-fit: contain; z-index: 2; }
.unlock__shadow { filter: brightness(0) drop-shadow(0 0 18px rgba(255,255,255,.7)); animation: jiggle .5s ease-in-out infinite; }
.unlock__real { opacity: 0; transform: scale(.4); }
.unlock__ring { position: absolute; inset: 0; border-radius: 50%; border: 4px dashed rgba(255,255,255,.4); animation: spin 6s linear infinite; }
.unlock__flash { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, #fff 0%, rgba(255,255,255,.8) 25%, transparent 60%); opacity: 0; z-index: 3; pointer-events: none; }
.unlock.is-charging .unlock__shadow { animation: jiggle .14s ease-in-out infinite; }
.unlock.is-open .unlock__shadow { display: none; }
.unlock.is-open .unlock__flash { animation: flash 1s ease-out forwards; }
.unlock.is-open .unlock__real { animation: popin .9s cubic-bezier(.2, 1.6, .4, 1) .15s forwards; }
.unlock.is-open .unlock__ring { border-color: rgba(255,210,26,.8); }
.unlock--rare.is-open { --burst: #ff3da5; }
.unlock--ultra.is-open .unlock__ring { border-style: dotted; border-width: 6px; border-color: #b78bff; }
@keyframes jiggle { 25% { transform: rotate(-4deg) scale(1.02); } 75% { transform: rotate(4deg) scale(.98); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flash { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes popin { to { opacity: 1; transform: scale(1); } }
.burst { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; border-radius: 50%; z-index: 4; pointer-events: none; animation: burst 1.1s ease-out forwards; }
@keyframes burst { from { transform: translate(-50%, -50%) scale(1); opacity: 1; } to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(.2); opacity: 0; } }

/* ---------- collection ---------- */
.col-head { display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; align-items: end; color: #fff; margin-bottom: 1.6rem; }
.col-head h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
.col-head p { margin: .4rem 0 0; opacity: .85; }
.progress { margin-top: 1rem; }
.progress__label { font: 700 1.25rem var(--font-fun); display: flex; justify-content: space-between; gap: 1rem; }
.progress__bar { height: 22px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; margin-top: .45rem; box-shadow: inset 0 2px 6px rgba(0,0,0,.3); }
.progress__fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--pink), var(--yellow), var(--green), var(--blue)); background-size: 300px 100%; transition: width 1.2s cubic-bezier(.2, .9, .3, 1.2); position: relative; }
.progress__fill::after { content: ""; position: absolute; inset: 3px 8px auto; height: 6px; border-radius: 6px; background: rgba(255,255,255,.5); }
.scan-btn { white-space: nowrap; }
.breakdown { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.breakdown span { background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.18); border-radius: 99px; padding: .3em .9em; font-weight: 800; font-size: .92rem; }
.col-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.slot {
  position: relative; border-radius: 22px; padding: .7rem .5rem .8rem; text-align: center; text-decoration: none;
  background: rgba(255,255,255,.07); border: 2px dashed rgba(255,255,255,.22); color: #fff;
  display: flex; flex-direction: column; align-items: center; min-width: 0;
}
.slot__num { position: absolute; top: .45rem; left: .6rem; font: 700 .8rem var(--font-fun); opacity: .7; }
.slot__img { width: 100%; aspect-ratio: 1; display: grid; place-items: center; position: relative; }
.slot__img img { width: 92%; height: 92%; object-fit: contain; }
.slot--locked .slot__img img { filter: brightness(0) opacity(.55); }
.slot--locked .slot__img::after { content: "?"; position: absolute; font: 700 2.4rem var(--font-fun); color: rgba(255,255,255,.85); text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.slot__name { font: 700 1.05rem var(--font-fun); margin-top: .25rem; }
.slot__state { font-size: .78rem; font-weight: 800; opacity: .7; }
.slot--got { background: #fff; color: var(--ink); border: 0; box-shadow: 0 8px 0 var(--tone, var(--blue)), 0 14px 26px rgba(0,0,0,.3); transition: transform .15s; }
.slot--got:hover { transform: translateY(-4px) rotate(-1deg); }
.slot--got .slot__state { color: var(--purple); opacity: 1; }
.slot--got.slot--rare { background: linear-gradient(160deg, #fff, #ffe3f3); }
.slot--got.slot--ultra { background: linear-gradient(160deg, #2b0f78, #8b3dff); color: #fff; }
.slot--got.slot--ultra .slot__state { color: #ffd21a; }
.slot__tag { font: 600 .68rem var(--font-fun); letter-spacing: 1px; text-transform: uppercase; color: var(--pink); }
.slot--new { animation: newpop 1s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes newpop { from { transform: scale(.5); } }

.achievements { margin-top: 2.4rem; color: #fff; }
.achievements h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 1rem; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.ach { display: flex; gap: .7rem; align-items: center; padding: .8rem 1rem; border-radius: 18px; background: rgba(255,255,255,.07); border: 1.5px solid rgba(255,255,255,.15); opacity: .55; }
.ach b { display: block; font: 700 1rem var(--font-fun); }
.ach small { opacity: .85; }
.ach__icon { font-size: 1.8rem; filter: grayscale(1); }
.ach.is-done { opacity: 1; background: rgba(255,210,26,.14); border-color: rgba(255,210,26,.55); }
.ach.is-done .ach__icon { filter: none; }

.guest-box { margin: 0 auto 1.8rem; max-width: 640px; text-align: center; }
.guest-box .btn { margin: .4rem; }

.complete { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(15, 4, 50, .82); padding: 16px; }
.complete__card { text-align: center; color: #fff; max-width: 520px; }
.complete__card h2 { font-size: clamp(2.2rem, 9vw, 3.6rem); }
.complete__ring { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; margin: 1.2rem 0; }
.complete__ring img { width: 54px; height: 54px; object-fit: contain; animation: bob 1.6s ease-in-out infinite; }

/* ---------- scanner ---------- */
.scanner { position: fixed; inset: 0; z-index: 85; background: rgba(10, 2, 35, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; color: #fff; }
.scanner h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); text-align: center; }
.scanner__view { position: relative; width: min(420px, 100%); aspect-ratio: 1; border-radius: 26px; overflow: hidden; background: #000; margin: 1rem 0; }
.scanner__view video { width: 100%; height: 100%; object-fit: cover; }
.scanner__frame { position: absolute; inset: 14%; border-radius: 22px; box-shadow: 0 0 0 999px rgba(10, 2, 35, .45); }
.scanner__frame::before, .scanner__frame::after { content: ""; position: absolute; inset: -4px; border-radius: 24px; border: 5px solid var(--yellow); clip-path: polygon(0 0, 30% 0, 30% 6%, 6% 6%, 6% 30%, 0 30%, 0 70%, 6% 70%, 6% 94%, 30% 94%, 30% 100%, 0 100%, 0 0, 100% 0, 100% 30%, 94% 30%, 94% 6%, 70% 6%, 70% 0, 100% 0, 100% 100%, 70% 100%, 70% 94%, 94% 94%, 94% 70%, 100% 70%); }
.scanner__line { position: absolute; left: 16%; right: 16%; height: 3px; background: var(--pink); box-shadow: 0 0 12px var(--pink); top: 20%; animation: scanline 2s ease-in-out infinite alternate; }
@keyframes scanline { to { top: 80%; } }
.scanner__msg { min-height: 3em; text-align: center; max-width: 420px; font-weight: 700; }
.scanner__msg.is-error { color: #ffb3d9; }
.scanner__actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }
.scanner__close { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; background: rgba(255,255,255,.15); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.6rem; cursor: pointer; }

/* ---------- character page ---------- */
.char { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem; align-items: start; color: #fff; }
.char__top { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.char h1 { font-size: clamp(2.4rem, 8vw, 4rem); }
.char__back { color: #fff; opacity: .8; font-weight: 800; text-decoration: none; display: inline-block; margin-bottom: 1rem; }
.stage {
  position: relative; border-radius: 32px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.18), transparent 60%), radial-gradient(circle at 50% 110%, var(--tone, #8b3dff), transparent 60%), rgba(255,255,255,.05);
  border: 2px solid rgba(255,255,255,.14); aspect-ratio: 1 / 1; display: grid; place-items: center;
}
.stage__floor { position: absolute; left: 18%; right: 18%; bottom: 9%; height: 7%; border-radius: 50%; background: rgba(0,0,0,.35); filter: blur(6px); }
.stage svg { position: relative; width: 82%; height: auto; overflow: visible; margin-top: -4%; cursor: grab; }
.stage__bubble {
  position: absolute; top: 5%; left: 50%; transform: translateX(-50%) scale(.6); opacity: 0; z-index: 5;
  background: #fff; color: var(--ink); font: 700 1.05rem var(--font-fun); padding: .45em 1em; border-radius: 18px; white-space: nowrap;
  transition: transform .25s cubic-bezier(.2, 1.6, .4, 1), opacity .2s; pointer-events: none;
}
.stage__bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: #fff; }
.stage__bubble.is-on { transform: translateX(-50%) scale(1); opacity: 1; }
.stage__mute { position: absolute; top: 12px; right: 12px; z-index: 6; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 1.3rem; cursor: pointer; }
.particle { position: absolute; z-index: 4; pointer-events: none; font-size: var(--s, 22px); line-height: 1; animation: floatup var(--t, 1.4s) ease-out forwards; will-change: transform, opacity; }
@keyframes floatup { from { transform: translate(-50%, -50%) scale(.4); opacity: 1; } 70% { opacity: 1; } to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(var(--r, 0deg)); opacity: 0; } }
.snack-fly { position: absolute; z-index: 5; font-size: 44px; line-height: 1; pointer-events: none; transform: translate(-50%, -50%); will-change: left, top, transform; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-top: 1rem; }
.actions .btn { padding: .75em .3em; font-size: 1.05rem; width: 100%; }
.actions .btn[aria-pressed="true"] { transform: translateY(4px); }
.act--tickle { background: linear-gradient(180deg, #ff8fd0, var(--pink)); }
.act--feed { background: linear-gradient(180deg, #ffb35c, var(--orange)); box-shadow: 0 6px 0 #c45f00; }
.act--pet { background: linear-gradient(180deg, #b48bff, var(--purple)); box-shadow: 0 6px 0 #5a1fb8; }
.act--bounce { background: linear-gradient(180deg, #7fe35a, var(--green)); box-shadow: 0 6px 0 #34901a; }
.snacks { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin-top: .8rem; padding: .9rem; border-radius: 22px; background: rgba(255,255,255,.08); }
.snacks button { display: flex; flex-direction: column; align-items: center; gap: .2rem; background: #fff; color: var(--ink); border: 0; border-radius: 16px; padding: .6rem .4rem; font: 700 .95rem var(--font-fun); cursor: pointer; position: relative; box-shadow: 0 4px 0 #d9d0f0; }
.snacks button span { font-size: 2rem; }
.snacks button.is-fav::after { content: "♥ Fave"; position: absolute; top: -8px; right: -4px; background: var(--pink); color: #fff; font-size: .68rem; padding: .15em .5em; border-radius: 99px; }
.profile { background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.16); border-radius: 26px; padding: 1.3rem 1.4rem; }
.profile h2 { font-size: 1.5rem; margin-bottom: .6rem; }
.profile dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; }
.profile dt { font-weight: 800; opacity: .75; }
.profile dd { margin: 0; font-weight: 700; }
.meter { display: inline-block; width: 110px; height: 10px; border-radius: 9px; background: rgba(255,255,255,.18); vertical-align: middle; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--pink)); border-radius: inherit; }
.tips { font-size: .92rem; opacity: .8; margin: 1rem 0 0; }
.locked-char { text-align: center; max-width: 520px; margin: 0 auto; color: #fff; }
.locked-char img { width: min(300px, 70vw); margin: 1rem auto; filter: brightness(0) opacity(.5); }

@media (max-width: 960px) {
  .col-grid { grid-template-columns: repeat(4, 1fr); }
  .char { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .col-head { grid-template-columns: 1fr; }
  .col-grid { grid-template-columns: repeat(3, 1fr); gap: .6rem; }
  .slot { padding: .5rem .3rem .6rem; border-radius: 16px; }
  .slot__name { font-size: .92rem; }
  .slot__state { font-size: .68rem; }
  .slot--locked .slot__img::after { font-size: 1.8rem; }
  .actions .btn { font-size: .92rem; }
}
@media (max-width: 340px) {
  .col-grid { grid-template-columns: repeat(2, 1fr); }
  .actions { grid-template-columns: repeat(2, 1fr); }
}
.stage svg { transition: filter .4s; }
.stage.is-shining svg { filter: brightness(1.15) drop-shadow(0 0 22px rgba(255, 140, 210, .9)); }

/* ---------- privacy & terms pages ---------- */
.doc { max-width: 760px; margin: 0 auto; line-height: 1.6; }
.doc h1 { color: var(--space-2); font-size: clamp(1.8rem, 6vw, 2.4rem); }
.doc h2 { color: var(--space-2); font-size: 1.3rem; margin: 1.8rem 0 .5rem; }
.doc p, .doc ul { margin: 0 0 .9rem; }
.doc ul { padding-left: 1.3rem; }
.doc li { margin: .25rem 0; }
.doc a { color: #6a2ee8; font-weight: 700; }
.doc__date { color: var(--muted); font-size: .92rem; margin-top: .3rem !important; }
.doc__back { margin-top: 2rem !important; text-align: center; font-weight: 800; }
.footer__small a { color: inherit; text-decoration: underline; }

/* ---------- My Gloopship entry ---------- */
.col-head__btns { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: flex-end; }
.ship-btn { background: linear-gradient(180deg, #4fc1ff, #1d86d6); box-shadow: 0 6px 0 #0f5fa3, 0 12px 24px rgba(38,164,255,.35), inset 0 2px 0 rgba(255,255,255,.5); font-size: 1.2rem; animation: shipPulse 2.6s ease-in-out infinite; }
.ship-btn:active { box-shadow: 0 2px 0 #0f5fa3; }
@keyframes shipPulse { 50% { transform: translateY(-3px) scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .ship-btn { animation: none; } }
.claim__floor { margin: 1rem auto 0; max-width: 420px; padding: .9rem 1rem; border-radius: 20px; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.25); color: #fff; font-weight: 800; }
.claim__floor b { color: var(--yellow); font-family: var(--font-fun); font-size: 1.3rem; }
