/* =========================================================
   STAMP QUEST — MOBILE-FIRST UI WITH CLEAN VECTOR SVG ICONS
   Inspired by bold, playful mobile collection apps.
   Neo-brutalist styling with springy, tactile micro-interactions.
   ========================================================= */

:root {
  --yellow: #ffd21f;
  --yellow-soft: #fff1a8;
  --green: #3dcc45;
  --green-dark: #087b36;
  --pink: #ff4f86;
  --purple: #7b61ff;
  --cream: #fffdf7;
  --ink: #111111;
  --muted: #656565;
  --line: #111111;
  --shadow: 6px 6px 0 var(--ink);
  --soft-shadow: 3px 3px 0 var(--ink);
  --radius: 22px;
  --nav-height: 76px;
  --spring-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth-easing: cubic-bezier(0.25, 1, 0.5, 1);
}

* { box-sizing: border-box; }

[hidden], img[hidden] {
  display: none !important;
}

html { width: 100%; min-height: 100%; scroll-behavior: smooth; }

body {
  width: 100%; min-height: 100dvh; margin: 0;
  background: var(--yellow);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
  animation: pageFadeIn 0.4s var(--smooth-easing);
}

button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

/* ---------------------------------------------------------
   KEYFRAME ANIMATIONS
   --------------------------------------------------------- */

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(-2deg); }
}

@keyframes stampPop {
  0% { opacity: 0; transform: scale(0.7) translateY(15px); }
  70% { transform: scale(1.05) translateY(-3px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: var(--soft-shadow); }
  50% { box-shadow: 0 0 14px rgba(61, 204, 69, 0.6), var(--soft-shadow); }
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalBoxPop {
  from { opacity: 0; transform: translateY(30px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

@keyframes cameraFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes celebrateStamp {
  0% { transform: scale(1); }
  30% { transform: scale(1.08) rotate(-2deg); }
  60% { transform: scale(0.96) rotate(2deg); }
  80% { transform: scale(1.03) rotate(-1deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes toastSlideUp {
  0% { opacity: 0; transform: translate(-50%, 25px) scale(0.92); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------------------------------------------------------
   LAYOUT CONTAINERS & TOPBAR
   --------------------------------------------------------- */

.topbar, .page, .bottom, .home, .auth {
  width: min(100%, 430px);
  margin-inline: auto;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  min-height: 66px;
  padding: 14px 18px;
  background: var(--cream);
  border-bottom: 3px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}

.brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; letter-spacing: -.3px;
}

.brand-icon {
  color: var(--ink);
}

.nav-link {
  font-size: 14px; font-weight: 800; text-decoration: none;
  transition: opacity 0.2s ease;
}

.nav-link:hover { opacity: 0.75; }

#userName { font-size: 13px; font-weight: 700; }

.page {
  min-height: calc(100dvh - 66px);
  padding: 16px 14px calc(var(--nav-height) + 28px + env(safe-area-inset-bottom));
  background: var(--cream);
}

.card {
  width: 100%; margin: 0 0 14px; padding: 18px;
  background: #fff; border: 3px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  animation: cardEntrance 0.45s var(--spring-easing) both;
  transition: transform 0.2s var(--spring-easing), box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.card h1, .card h2, .card p { overflow-wrap: anywhere; }
.card h2 { margin: 0 0 13px; font-size: 20px; line-height: 1.15; }

/* ---------------------------------------------------------
   BUTTONS & SVG ALIGNMENTS
   --------------------------------------------------------- */

.btn {
  width: 100%; min-height: 52px; margin: 10px 0 0; padding: 13px 18px;
  border: 3px solid var(--line); border-radius: 15px;
  background: var(--green); color: #fff; font-weight: 850;
  text-decoration: none; text-align: center; cursor: pointer;
  box-shadow: var(--soft-shadow);
  transition: transform 0.15s var(--spring-easing), box-shadow 0.15s ease, background-color 0.2s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
}

.btn svg { display: block; flex-shrink: 0; }

.btn:hover {
  background: #2fbf39;
  transform: translateY(-3px);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.secondary { background: #fff; color: var(--ink); }
.btn.secondary:hover { background: #f5f5f5; }
.btn.danger { background: #ffe4ec; color: #c90045; }
.btn.danger:hover { background: #ffd0de; }

.btn.pulse-ready {
  animation: pulseGlow 2s infinite var(--smooth-easing);
}

/* ---------------------------------------------------------
   QUEST CARD & DECORATIVE BADGE
   --------------------------------------------------------- */

.quest-card {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #e8ffec 0%, #fff 72%);
}

.quest-card::after {
  content: ""; position: absolute; top: 12px; right: 16px; width: 44px; height: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233dcc45' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat; opacity: 0.25;
  transition: transform 0.6s var(--spring-easing);
}

.quest-card:hover::after {
  transform: rotate(30deg) scale(1.15);
  opacity: 0.4;
}

.quest-card small {
  color: var(--green-dark); font-size: 11px; font-weight: 900; letter-spacing: 1.6px;
}

.quest-card h1 { margin: 7px 58px 7px 0; font-size: 28px; line-height: 1.08; }
.quest-card p { margin: 0; color: #343434; }

.status-pill {
  display: inline-flex; margin-top: 13px; padding: 7px 12px;
  border: 2px solid #117d3b; border-radius: 999px;
  background: #caffd2; color: #075e2a; font-size: 12px; font-weight: 850;
  animation: cardEntrance 0.3s var(--spring-easing);
}

/* ---------------------------------------------------------
   CAPTURE & PHOTO UPLOAD
   --------------------------------------------------------- */

.capture-choice { display: grid; gap: 11px; }

.camera-launch {
  min-height: 155px; padding: 22px 15px;
  border: 3px solid var(--line); border-radius: 18px;
  background: #fff7dc; color: var(--ink); box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer; text-align: center;
  transition: transform 0.2s var(--spring-easing), box-shadow 0.2s ease, background-color 0.2s ease;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.camera-launch:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 6px 6px 0 var(--ink);
  background: #fff2c4;
}

.camera-launch:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.camera-launch .icon {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px; color: var(--ink);
  transition: transform 0.3s var(--spring-easing);
}

.camera-launch:hover .icon {
  transform: scale(1.18) rotate(-6deg);
}

.camera-launch strong, .camera-launch span { display: block; }
.camera-launch span { margin-top: 3px; color: #707070; font-size: 12px; }

.or { margin: 1px 0; color: #777; font-size: 11px; font-weight: 900; text-align: center; }

.photo-box {
  min-height: 92px; padding: 14px;
  border: 3px dashed #555; border-radius: 17px; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; text-align: center;
  transition: transform 0.2s var(--spring-easing), border-color 0.2s ease, background-color 0.2s ease;
}

.photo-box:hover {
  transform: translateY(-2px);
  border-color: var(--green-dark);
  background: #f7fff8;
}

.photo-box span {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); transition: transform 0.2s var(--spring-easing);
}

.photo-box:hover span { transform: scale(1.2); }
.photo-box small { color: #777; }

.preview {
  display: block; width: 100%; max-height: 360px; margin-top: 14px;
  object-fit: contain; border: 3px solid var(--line); border-radius: 16px; background: #eee;
  animation: cardEntrance 0.35s var(--spring-easing);
}

#stampCanvas {
  display: block; width: 100%; height: auto; aspect-ratio: 1;
  border: 3px solid var(--line); border-radius: 16px; background: #fff;
  transition: transform 0.3s var(--spring-easing), box-shadow 0.3s ease;
}

#stampCanvas.celebrate {
  animation: celebrateStamp 0.6s var(--spring-easing);
}

/* ---------------------------------------------------------
   HELP BUTTON
   --------------------------------------------------------- */

.help-btn {
  width: 100%; min-height: 52px; margin: 0 0 14px; padding: 10px 14px;
  border: 3px solid var(--line); border-radius: 16px; background: #fff;
  color: var(--ink); font-weight: 850; cursor: pointer; box-shadow: var(--soft-shadow);
  transition: transform 0.15s var(--spring-easing), box-shadow 0.15s ease, background-color 0.2s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}

.help-btn:hover {
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 var(--ink);
  background: #fffbe6;
}

.help-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------------------------------------------------------
   BOTTOM NAVIGATION BAR
   --------------------------------------------------------- */

.bottom {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 50;
  min-height: var(--nav-height); padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  background: var(--cream); border: 3px solid var(--line); border-bottom: 0;
  border-radius: 22px 22px 0 0; box-shadow: 0 -4px 0 var(--ink);
  display: flex; gap: 5px;
}

.bottom a {
  flex: 1; min-width: 0; color: #707070; text-decoration: none; text-align: center;
  padding: 6px 3px; border-radius: 14px;
  transition: transform 0.2s var(--spring-easing), background-color 0.2s ease, color 0.2s ease;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.bottom a svg { display: block; margin: 0 auto; stroke: currentColor; }
.bottom a span { display: block; margin-top: 2px; font-size: 11px; font-weight: 750; }

.bottom a:hover {
  transform: translateY(-2px);
  color: var(--ink);
}

.bottom a:active { transform: scale(0.92); }

.bottom a.active {
  background: var(--yellow); color: var(--ink); font-weight: 900;
  box-shadow: inset 0 0 0 2px var(--line);
  transform: translateY(-3px);
}

/* ---------------------------------------------------------
   STAMPS GRID & COLLECTION
   --------------------------------------------------------- */

.stamp-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px;
}

.stamp {
  min-width: 0; padding: 7px; background: #fff;
  border: 3px solid var(--line); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  animation: stampPop 0.45s var(--spring-easing) both;
  transition: transform 0.2s var(--spring-easing), box-shadow 0.2s ease;
}

.stamp:hover {
  transform: translateY(-4px) rotate(1deg) scale(1.02);
  box-shadow: 7px 7px 0 var(--ink);
}

.stamp:active {
  transform: translate(2px, 2px) scale(0.98);
  box-shadow: 2px 2px 0 var(--ink);
}

.stamp-frame {
  position: relative; overflow: hidden; aspect-ratio: 1; padding: 6px;
  background: #ffe66e; border: 3px solid var(--line);
  clip-path: polygon(0 7%,4% 7%,4% 0,10% 0,10% 7%,16% 7%,16% 0,22% 0,22% 7%,28% 7%,28% 0,34% 0,34% 7%,40% 7%,40% 0,46% 0,46% 7%,52% 7%,52% 0,58% 0,58% 7%,64% 7%,64% 0,70% 0,70% 7%,76% 7%,76% 0,82% 0,82% 7%,88% 7%,88% 0,94% 0,94% 7%,100% 7%,100% 93%,96% 93%,96% 100%,90% 100%,90% 93%,84% 93%,84% 100%,78% 100%,78% 93%,72% 93%,72% 100%,66% 100%,66% 93%,60% 93%,60% 100%,54% 100%,54% 93%,48% 93%,48% 100%,42% 100%,42% 93%,36% 93%,36% 100%,30% 100%,30% 93%,24% 93%,24% 100%,18% 100%,18% 93%,12% 93%,12% 100%,6% 100%,6% 93%,0 93%);
  transition: transform 0.3s ease;
}

.stamp:hover .stamp-frame img { transform: scale(1.05); }

.stamp-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 8px;
  transition: transform 0.3s var(--smooth-easing);
}

.stamp-date { display: block; padding: 7px 3px 2px; font-size: 11px; font-weight: 850; }

/* ---------------------------------------------------------
   PROFILE PAGE & AVATAR
   --------------------------------------------------------- */

.profile { text-align: center; }

.avatar-wrap { position: relative; width: 100px; height: 100px; margin: 2px auto 12px; }

.avatar, .avatar-image {
  width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center; object-fit: cover;
  background: #ffe66e; border: 4px solid var(--line); box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.3s var(--spring-easing);
}

.avatar-button {
  position: relative;
  width: 112px;
  height: 112px;
  padding: 0;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
  overflow: visible;
  transition: transform 0.2s var(--spring-easing), box-shadow 0.2s ease;
}

.avatar-button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 8px 8px 0 var(--ink);
}

.avatar-button:active {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--ink);
}

.avatar-button .avatar,
.avatar-button .avatar-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.avatar-button .avatar {
  display: grid; place-items: center; background: #e9f7e8; color: var(--ink);
}

.avatar-button .avatar-image {
  display: block; object-fit: cover; animation: pageFadeIn 0.3s ease;
}

.avatar-camera {
  position: absolute; right: -5px; bottom: -5px; width: 38px; height: 38px;
  display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 50%;
  background: #ffd21f; box-shadow: 3px 3px 0 var(--ink); color: var(--ink);
  transition: transform 0.2s var(--spring-easing);
}

.avatar-button:hover .avatar-camera {
  transform: scale(1.2) rotate(12deg);
}

.stats { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 18px; padding-top: 16px; border-top: 3px solid var(--line); }
.stats > div { min-width: 0; }
.stats b, .stats small { display: block; }
.stats b { font-size: 21px; transition: transform 0.3s var(--spring-easing); }

.stats div:hover b { transform: scale(1.2); color: var(--green-dark); }
.stats small { margin-top: 2px; color: #666; font-size: 11px; font-weight: 700; }

.profile-menu { overflow: hidden; padding: 0; }

.profile-action {
  width: 100%; min-height: 57px; padding: 12px 15px; border: 0; border-bottom: 2px solid #ddd;
  background: #fff; color: var(--ink); display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; font-weight: 750;
  transition: background-color 0.2s ease, padding-left 0.2s ease;
}

.profile-action svg { stroke: currentColor; flex-shrink: 0; }

.profile-action:hover {
  background: #fffbe6;
  padding-left: 20px;
}

.profile-action:last-child { border-bottom: 0; }
.profile-action .arrow {
  margin-left: auto; font-size: 24px; transition: transform 0.2s var(--spring-easing);
}

.profile-action:hover .arrow { transform: translateX(4px); }

.profile-page {
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}

.upload-profile-card { display: grid; gap: 16px; }

.upload-profile-copy { display: flex; align-items: center; gap: 14px; }
.upload-profile-copy h2 { margin: 0 0 5px; font-size: 20px; }
.upload-profile-copy p { margin: 0; color: #5f655f; line-height: 1.45; font-size: 14px; }

.upload-profile-icon {
  width: 52px; height: 52px; flex: 0 0 52px;
  display: grid; place-items: center;
  border: 3px solid var(--ink); border-radius: 14px;
  background: #ffdf3f; box-shadow: 4px 4px 0 var(--ink); color: var(--ink);
  transition: transform 0.3s var(--spring-easing);
}

.upload-profile-card:hover .upload-profile-icon {
  transform: rotate(-10deg) scale(1.1);
}

.full-btn { width: 100%; }

.text-button {
  border: 0; background: transparent; color: #c62828;
  font: inherit; font-weight: 800; padding: 5px 8px; cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.text-button:hover { opacity: 0.8; transform: translateY(-1px); }

/* ---------------------------------------------------------
   MODALS & TOAST NOTIFICATIONS
   --------------------------------------------------------- */

.modal[hidden] { display: none !important; }

.modal {
  position: fixed; inset: 0; z-index: 100; padding: 12px;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
  animation: modalFadeIn 0.25s ease-out;
  backdrop-filter: blur(2px);
}

.modal-box {
  width: min(100%,430px); max-height: 90dvh; overflow: auto; padding: 22px;
  background: var(--cream); border: 3px solid var(--line); border-radius: 24px 24px 14px 14px;
  box-shadow: 6px 6px 0 #000; position: relative;
  animation: modalBoxPop 0.35s var(--spring-easing);
}

.close {
  position: absolute; top: 9px; right: 10px; width: 40px; height: 40px;
  border: 3px solid var(--line); border-radius: 12px; background: #fff;
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
  transition: transform 0.15s var(--spring-easing), background-color 0.2s ease;
}

.close:hover {
  transform: scale(1.1) rotate(90deg);
  background: #ffe6e6;
}

.close:active { transform: scale(0.9); }

.modal-box li { margin: 12px 0; }
.note { padding: 12px; border: 2px solid var(--line); border-radius: 13px; background: #fff2a8; color: #444; font-size: 13px; }

.detail-stamp {
  width: min(100%,330px); margin: 0 auto 18px; display: block;
  border: 3px solid var(--line); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink);
  animation: stampPop 0.4s var(--spring-easing);
}

.detail-description { padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff1a8; color: #333; }

.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 20px);
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px;
  border: 3px solid var(--ink); border-radius: 14px; background: #fff;
  box-shadow: 4px 4px 0 var(--ink); font-weight: 850; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--spring-easing);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  animation: toastSlideUp 0.35s var(--spring-easing);
}

/* ---------------------------------------------------------
   FULLSCREEN CAMERA MODAL
   --------------------------------------------------------- */

.camera-modal {
  position: fixed; inset: 0; z-index: 200; background: #000; display: none;
  width: 100vw; height: 100dvh; overflow: hidden;
}

.camera-modal.open {
  display: block; animation: modalFadeIn 0.3s ease;
}

.camera-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.camera-top, .camera-bottom { position: absolute; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; }
.camera-top { top: 0; padding: max(16px,env(safe-area-inset-top)) 18px 18px; background: linear-gradient(#0009,transparent); }
.camera-bottom { bottom: 0; padding: 18px 20px max(20px,env(safe-area-inset-bottom)); background: linear-gradient(transparent,#000d); }

.camera-round {
  width: 50px; height: 50px; border: 3px solid #fff; border-radius: 50%;
  background: #111b; color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: transform 0.2s var(--spring-easing), background-color 0.2s ease;
}

.camera-round:hover { transform: scale(1.12); background: rgba(255,255,255,0.3); }
.camera-round:active { transform: scale(0.9); }

.capture-button {
  width: 78px; height: 78px; border: 5px solid #fff; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px #fff5; cursor: pointer;
  transition: transform 0.2s var(--spring-easing), box-shadow 0.2s ease;
}

.capture-button:hover { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(255,255,255,0.6); }
.capture-button:active { transform: scale(0.88); }

.camera-label { color: #fff; font-size: 12px; font-weight: 900; text-align: center; margin-top: 5px; }

.camera-flash-overlay {
  position: absolute; inset: 0; z-index: 10; background: #fff;
  opacity: 0; pointer-events: none;
}

.camera-flash-overlay.active { animation: cameraFlash 0.35s ease-out; }

/* ---------------------------------------------------------
   AUTH & LANDING PAGES
   --------------------------------------------------------- */

.home, .auth { min-height: 100dvh; padding: 32px 18px; background: var(--cream); }
.home { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }

.logo {
  width:84px; height:84px; margin-bottom:12px; border:3px solid var(--line);
  border-radius:25px; background:var(--yellow); display:grid; place-items:center;
  color: var(--ink); box-shadow:5px 5px 0 var(--ink);
  animation: logoFloat 3.5s ease-in-out infinite;
}

.home h1 { margin:0; font-size:40px; line-height:1.05; letter-spacing:-1px; }
.home p, .auth > p { color:#666; }
.auth { padding-top:28px; }
.auth h1 { margin:35px 0 6px; font-size:32px; }

.auth input {
  width:100%; min-height:52px; margin:7px 0; padding:13px 15px;
  border:3px solid var(--line); border-radius:14px; background:#fff; outline:none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.auth input:focus {
  border-color:var(--green-dark); box-shadow:4px 4px 0 var(--yellow);
  transform: translateY(-2px);
}

.auth.shake { animation: shakeError 0.4s ease; }

.back {
  text-decoration:none; font-weight:800; transition: transform 0.2s ease;
  display: inline-flex; align-items: center; gap: 4px;
}

.back:hover { transform: translateX(-4px); }

.text-link { display:block; margin-top:14px; text-align:center; transition: opacity 0.2s ease; }
.text-link:hover { opacity: 0.8; }

/* ---------------------------------------------------------
   RESPONSIVE ADJUSTMENTS & ACCESSIBILITY
   --------------------------------------------------------- */

@media (max-width: 360px) {
  .page { padding-left:11px; padding-right:11px; }
  .card { padding:15px; border-radius:18px; }
  .quest-card h1 { font-size:25px; }
  .stamp-grid { gap:9px; }
  .stamp { padding:6px; }
  .bottom { width:100%; border-radius:18px 18px 0 0; }
  .avatar-button { width: 96px; height: 96px; }
  .upload-profile-copy p { font-size: 13px; }
}

@media (min-width: 431px) {
  body { background: var(--yellow); }
  .topbar, .page, .home, .auth { box-shadow: 0 0 0 2px var(--line); }
  .bottom { box-shadow: 0 -4px 0 var(--ink), 0 0 0 2px var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
