*{box-sizing:border-box}

body {
  margin: 0;
  background-color: var(--canvas, #fbf9ff);
  background-image: 
    radial-gradient(at 0% 0%, rgba(119, 4, 250, 0.09) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(203, 5, 150, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(245, 54, 110, 0.07) 0px, transparent 60%);
  background-attachment: fixed;
  color: var(--ink, #110926);
  font: 15px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

main {
  max-width: 660px;
  margin: auto;
  padding: 24px 22px calc(100px + env(safe-area-inset-bottom));
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -1.2px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.brand:hover {
  opacity: 0.9;
}

.brand-logo-img {
  height: 34px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  display: block;
}

.brand-dot {
  font-size: 14px;
  vertical-align: super;
  margin-left: 3px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tag, .eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 850;
  text-transform: uppercase;
}

.tag {
  padding: 6px 12px;
  border-radius: var(--radius-full, 9999px);
  background: linear-gradient(135deg, rgba(119, 4, 250, 0.12), rgba(245, 54, 110, 0.12));
  color: var(--brand-purple, #7704FA);
  border: 1px solid rgba(203, 5, 150, 0.25);
  box-shadow: 0 2px 8px rgba(119, 4, 250, 0.08);
}

.eyebrow {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 3px;
}

h1 {
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: -1.5px;
  margin: 10px 0 16px;
  font-weight: 800;
  color: var(--ink, #110926);
}

h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 8px 0;
  font-weight: 750;
  color: var(--ink, #110926);
}

p {
  color: var(--muted, #6e6488);
  margin: 10px 0 20px;
}

a {
  color: var(--brand-purple, #7704FA);
  text-decoration-color: rgba(119, 4, 250, 0.35);
  transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
  color: var(--brand-magenta, #CB0596);
  text-decoration-color: var(--brand-pink, #F5366E);
}

button, .button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  border-radius: var(--radius-sm, 12px);
  padding: 11px 20px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

button {
  border: 0;
}

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

.primary, .button {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(119, 4, 250, 0.35);
  position: relative;
  overflow: hidden;
}

.primary:hover:not(:disabled), .button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(203, 5, 150, 0.45);
}

.primary:active:not(:disabled), .button:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 10px rgba(119, 4, 250, 0.3);
}

.secondary {
  background: var(--accent-soft, #f4ecff);
  color: var(--brand-purple, #7704FA);
  border: 1px solid var(--line, #ecdffc);
  box-shadow: 0 2px 6px rgba(119, 4, 250, 0.04);
}

.secondary:hover:not(:disabled) {
  background: var(--accent-soft-hover, #ede0fd);
  border-color: rgba(119, 4, 250, 0.35);
  color: #5d02c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(119, 4, 250, 0.1);
}

.secondary:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.full {
  width: 100%;
  justify-content: space-between;
}

.card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line, #ecdffc);
  border-radius: var(--radius, 20px);
  padding: 24px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(119, 4, 250, 0.06));
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  border-color: rgba(119, 4, 250, 0.24);
  box-shadow: var(--shadow-md, 0 8px 24px -4px rgba(119, 4, 250, 0.12));
}

.card.subtle {
  background: transparent;
  border-color: var(--line, #ecdffc);
  box-shadow: none;
}

.hidden {
  display: none !important;
}

/* Hero Gate / Welcome Card */
.hero-gate-card {
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 38px 24px;
  border: 1px solid rgba(119, 4, 250, 0.2);
  box-shadow: 0 16px 40px -12px rgba(119, 4, 250, 0.18);
}

.hero-gate-card::before {
  content: "";
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 160px;
  background: radial-gradient(circle, rgba(119, 4, 250, 0.2) 0%, rgba(245, 54, 110, 0.12) 50%, transparent 80%);
  pointer-events: none;
  border-radius: 50%;
}

.brand-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
}

.hero-emblem {
  width: 72px;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(119, 4, 250, 0.35));
  animation: puloopFloat 4s ease-in-out infinite;
}

@keyframes puloopFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-7px); }
}

label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin: 16px 0 7px;
  color: var(--ink, #110926);
}

input:not([type=checkbox]):not([type=radio]) {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1.5px solid var(--line, #ecdffc);
  background: #ffffff;
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:not([type=checkbox]):not([type=radio]):focus {
  border-color: var(--brand-purple, #7704FA);
  box-shadow: 0 0 0 3px rgba(119, 4, 250, 0.16);
  outline: none;
}

.input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line, #ecdffc);
  border-radius: 12px;
  padding-left: 14px;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap input {
  border: 0 !important;
  box-shadow: none !important;
}

.input-wrap:focus-within {
  border-color: var(--brand-purple, #7704FA);
  box-shadow: 0 0 0 3px rgba(119, 4, 250, 0.16);
}

.input-wrap.has-error {
  border-color: var(--danger, #e02448) !important;
  box-shadow: 0 0 0 3px rgba(224, 36, 72, 0.14) !important;
}

.input-wrap.has-success {
  border-color: var(--success, #129a58) !important;
  box-shadow: 0 0 0 3px rgba(18, 154, 88, 0.14) !important;
}

small {
  display: block;
  font-size: 11.5px;
  color: var(--muted, #6e6488);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 500;
  margin: 17px 0;
}

.check input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--brand-purple, #7704FA);
  margin-top: 1px;
}

.compact {
  font-size: 11px;
  margin: 0;
}

.input-wrap + small {
  margin-top: 6px;
}

.muted {
  color: var(--muted, #6e6488);
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.row.tight {
  margin-top: 8px;
}

.identity {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 24px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line, #ecdffc);
  box-shadow: 0 2px 10px rgba(119, 4, 250, 0.05);
}

.avatar {
  height: 44px;
  width: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(119, 4, 250, 0.12), rgba(245, 54, 110, 0.12));
  border: 1.5px solid rgba(119, 4, 250, 0.22);
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(119, 4, 250, 0.1);
  flex-shrink: 0;
}

.avatar img {
  max-width: 26px;
  height: auto;
}

.identity small {
  font-size: 9.5px;
  letter-spacing: 1.2px;
  font-weight: 750;
  color: var(--muted, #6e6488);
}

.identity strong {
  font-size: 17px;
  display: block;
  color: var(--ink, #110926);
}

.pill {
  padding: 5px 11px;
  border-radius: var(--radius-full, 9999px);
  background: var(--accent-soft, #f4ecff);
  color: var(--brand-purple, #7704FA);
  font-size: 10.5px;
  font-weight: 750;
  margin-left: auto;
  border: 1px solid rgba(119, 4, 250, 0.15);
}

.pill-success {
  background: var(--success-soft, #eafaf1);
  color: var(--success, #129a58);
  border-color: rgba(18, 154, 88, 0.25);
  font-weight: 750;
}

.pill-grace {
  background: var(--warning-soft, #fffbeb);
  color: #b75e00;
  border-color: rgba(245, 158, 11, 0.3);
  font-weight: 750;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stats .card {
  padding: 20px;
  margin-bottom: 0;
  background: linear-gradient(145deg, #ffffff 0%, #faf5ff 100%);
  border: 1px solid rgba(119, 4, 250, 0.14);
}

.stats strong {
  font-size: 32px;
  display: block;
  letter-spacing: -1px;
  margin-top: 6px;
  font-weight: 850;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats span {
  font-size: 10.5px;
  color: var(--muted, #6e6488);
}

.stats small {
  font-size: 9.5px;
  letter-spacing: 1.2px;
  font-weight: 750;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.play-score {
  text-align: center;
  margin: 20px 0 8px;
}

.play-score small {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.play-score strong {
  display: block;
  font-size: 64px;
  font-weight: 850;
  letter-spacing: -3px;
  line-height: 1.15;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.play-score strong.score-bump {
  transform: scale(1.08);
}

.play-score span {
  font-size: 12.5px;
  color: var(--muted, #6e6488);
  font-weight: 550;
}

/* Enhanced Tap Target Button & Breathing Ring */
.tap-target {
  position: relative;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #faf3ff 60%, #eed6ff 100%);
  border: 8px solid #ffffff;
  outline: 4px solid var(--line-strong, #d8c2f8);
  margin: 28px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 14px 35px -8px rgba(119, 4, 250, 0.28),
    0 4px 15px rgba(245, 54, 110, 0.18),
    inset 0 -6px 14px rgba(119, 4, 250, 0.12),
    inset 0 4px 8px rgba(255, 255, 255, 0.9);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, outline-color 0.2s ease;
  overflow: visible;
}

.tap-target:not(:disabled):hover {
  outline-color: var(--brand-purple, #7704FA);
  box-shadow: 
    0 18px 45px -8px rgba(119, 4, 250, 0.38),
    0 6px 20px rgba(245, 54, 110, 0.25),
    inset 0 -6px 14px rgba(119, 4, 250, 0.15);
}

.tap-target:not(:disabled):active, .tap-target.tapped {
  transform: scale(0.93);
  outline-color: var(--brand-pink, #F5366E);
  box-shadow: 
    0 8px 20px -4px rgba(119, 4, 250, 0.25),
    inset 0 4px 12px rgba(119, 4, 250, 0.2);
}

.tap-glow-ring {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(119, 4, 250, 0.22) 0%, rgba(203, 5, 150, 0.15) 45%, rgba(245, 54, 110, 0.08) 65%, transparent 75%);
  z-index: 0;
  pointer-events: none;
  animation: puloopPulseRing 3.5s ease-in-out infinite;
}

@keyframes puloopPulseRing {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

.tap-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.tap-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.tap-emblem-img {
  width: 62px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(119, 4, 250, 0.3));
  transition: transform 0.12s ease;
}

.tap-target:active .tap-emblem-img {
  transform: scale(0.92);
}

.tap-infinity-symbol {
  position: absolute;
  font-size: 88px;
  line-height: 1;
  font-weight: 700;
  color: rgba(119, 4, 250, 0.12);
  pointer-events: none;
  z-index: -1;
}

.tap-inner small {
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 1.5px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 8px;
}

/* Floating +LP Tap Score Indicator */
.floating-tap-score {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
  background: linear-gradient(135deg, #7704FA 0%, #CB0596 60%, #F5366E 100%);
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(119, 4, 250, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  animation: floatUpAndFade 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transform-origin: center;
}

@keyframes floatUpAndFade {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5) rotate(var(--rot, 0deg));
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -20px) scale(1.15) rotate(var(--rot, 0deg));
  }
  70% {
    opacity: 0.9;
    transform: translate(-50%, -55px) scale(1) rotate(var(--rot, 0deg));
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -85px) scale(0.8) rotate(var(--rot, 0deg));
  }
}

/* Tap Sparkle Particles */
.tap-particle {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  box-shadow: 0 0 8px currentColor;
  animation: particleBurst 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes particleBurst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.4);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) scale(0.2);
  }
}

/* Ripple wave inside button */
.tap-ripple {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, rgba(245, 54, 110, 0.4) 0%, rgba(119, 4, 250, 0.2) 60%, transparent 80%);
  pointer-events: none;
  animation: rippleExpand 0.55s ease-out forwards;
  width: 180px;
  height: 180px;
}

@keyframes rippleExpand {
  to {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

.energy {
  margin: 22px 8px;
}

.energy > div {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
}

.energy progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  display: block;
  margin: 9px 0;
  border: 0;
  background: var(--accent-soft, #f4ecff);
}

.energy progress::-webkit-progress-bar {
  background: var(--accent-soft, #f4ecff);
  border-radius: 999px;
}

.energy progress::-webkit-progress-value {
  background: var(--brand-gradient-h);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.energy progress::-moz-progress-bar {
  background: var(--brand-gradient-h);
  border-radius: 999px;
}

.energy small {
  font-size: 11px;
}

.center {
  text-align: center;
}

.upgrade-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line, #ecdffc);
}

.upgrade-row:first-child {
  border: 0;
}

.upgrade-row strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink, #110926);
}

.upgrade-row button {
  font-size: 11.5px;
  padding: 8px 14px;
  min-height: 38px;
  white-space: nowrap;
}

/* ENHANCED MILESTONE ROWS & ANIMATIONS */
.milestone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 14px;
  border-radius: 14px;
  background: #faf6ff;
  border: 1px solid var(--line, #ecdffc);
  margin-bottom: 10px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: milestoneSlideIn 0.4s ease-out backwards;
  animation-delay: var(--delay, 0ms);
}

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

.milestone-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(119, 4, 250, 0.1);
  border-color: rgba(119, 4, 250, 0.3);
}

.milestone-row.reached {
  background: linear-gradient(135deg, rgba(18, 154, 88, 0.05) 0%, rgba(119, 4, 250, 0.05) 100%);
  border-color: rgba(18, 154, 88, 0.3);
}

.milestone-row.next-target {
  background: linear-gradient(135deg, rgba(119, 4, 250, 0.08) 0%, rgba(203, 5, 150, 0.08) 100%);
  border-color: var(--brand-purple, #7704FA);
  box-shadow: 0 4px 18px rgba(119, 4, 250, 0.15);
  position: relative;
}

.milestone-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.milestone-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.milestone-badge-icon.reached {
  background: linear-gradient(135deg, #129a58, #0f8048);
  color: white;
  box-shadow: 0 2px 10px rgba(18, 154, 88, 0.35);
}

.milestone-badge-icon.target {
  background: var(--brand-gradient);
  color: white;
  box-shadow: 0 2px 12px rgba(119, 4, 250, 0.4);
  animation: targetPulse 2s infinite ease-in-out;
}

@keyframes targetPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.milestone-badge-icon.locked {
  background: #f0e6fc;
  color: #9f8bbd;
  border: 1px solid var(--line, #ecdffc);
}

.milestone-details {
  flex: 1;
  min-width: 0;
}

.milestone-details strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink, #110926);
  margin-bottom: 2px;
}

.milestone-details small {
  font-size: 11px;
  color: var(--muted, #6e6488);
  line-height: 1.3;
}

.milestone-progress-track {
  height: 6px;
  background: rgba(119, 4, 250, 0.1);
  border-radius: 999px;
  margin-top: 6px;
  overflow: hidden;
}

.milestone-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--brand-gradient-h);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.milestone-reward-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 750;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft, #f4ecff);
  color: var(--brand-purple, #7704FA);
  border: 1px solid rgba(119, 4, 250, 0.18);
  white-space: nowrap;
  flex-shrink: 0;
}

.milestone-reward-pill.reached {
  background: var(--success-soft, #eafaf1);
  color: var(--success, #129a58);
  border-color: rgba(18, 154, 88, 0.25);
}

.milestone-target-tag {
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--brand-gradient);
  color: white;
  margin-left: 6px;
  vertical-align: middle;
  display: inline-block;
}

/* Home Milestone Hero Card */
#home-milestone .milestone-fill {
  background: var(--brand-gradient-h);
}

.streak {
  display: flex;
  gap: 6px;
  justify-content: space-between;
  margin: 20px 0;
}

.streak span {
  font-size: 10.5px;
  font-weight: 700;
  flex: 1;
  text-align: center;
  padding: 12px 2px;
  background: var(--accent-soft, #f4ecff);
  color: var(--muted, #6e6488);
  border-radius: 10px;
  border: 1px solid var(--line, #ecdffc);
  transition: all 0.25s ease;
}

.streak span.done {
  background: var(--brand-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(119, 4, 250, 0.3);
  transform: scale(1.02);
}

.card-choice {
  background: var(--accent-soft, #f4ecff);
  color: var(--ink, #110926);
  border: 1.5px solid var(--line, #ecdffc);
  flex: 1;
  font-size: 12px;
  border-radius: 12px;
  padding: 12px;
  transition: all 0.2s ease;
}

.card-choice.selected {
  background: var(--brand-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(119, 4, 250, 0.35);
}

.gems-card > strong {
  display: block;
  font-size: 60px;
  letter-spacing: -2px;
  font-weight: 850;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gems-card .row {
  justify-content: space-between;
  font-size: 11.5px;
}

.legal {
  white-space: pre-wrap;
  font: inherit;
}

footer {
  text-align: center;
  font-size: 11.5px;
  margin: 36px 0 20px;
}

.footer-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.footer-brand img {
  opacity: 0.85;
  transition: opacity 0.2s;
}

.footer-brand img:hover {
  opacity: 1;
}

footer p {
  margin: 10px;
}

nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 660px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line, #ecdffc);
  display: flex;
  justify-content: space-around;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(119, 4, 250, 0.06);
}

nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  color: var(--muted, #6e6488);
  font-size: 10px;
  font-weight: 650;
  padding: 6px 12px;
  min-width: 54px;
  min-height: 48px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

nav button span {
  font-size: 20px;
  line-height: 1.1;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

nav button.active {
  color: var(--brand-purple, #7704FA);
  background: linear-gradient(135deg, rgba(119, 4, 250, 0.1), rgba(203, 5, 150, 0.08));
  font-weight: 800;
}

nav button.active span {
  transform: scale(1.15);
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#notice:not(:empty) {
  position: sticky;
  top: 10px;
  padding: 12px 18px;
  background: var(--brand-gradient);
  color: white;
  border-radius: 14px;
  z-index: 200;
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(119, 4, 250, 0.35);
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--brand-purple, #7704FA);
  outline-offset: 3px;
}

#reward-history div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line, #ecdffc);
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}

/* Enhanced Form & Availability Status Styles */
.availability-status {
  margin-top: 6px;
  font-size: 12px;
  transition: color .2s;
  font-weight: 600;
}

.availability-status.available {
  color: var(--success, #129a58);
  font-weight: 700;
}

.availability-status.unavailable {
  color: var(--danger, #e02448);
  font-weight: 700;
}

.availability-status.invalid {
  color: var(--danger, #e02448);
}

.availability-status.error {
  color: #b75e00;
  font-weight: 700;
}

.availability-status.checking {
  color: var(--muted, #6e6488);
}

/* Username Card */
.username-hero-card {
  border-left: 5px solid var(--brand-purple, #7704FA);
  background: linear-gradient(135deg, #ffffff 0%, #faf6ff 100%);
}

.hero-name {
  font-size: 26px;
  font-weight: 850;
  margin: 4px 0 2px;
  letter-spacing: -0.5px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.small-note {
  font-size: 12px;
  margin: 4px 0 14px;
}

.compact-btn {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 12px;
}

/* Next Action Card */
.next-action-card {
  background: linear-gradient(135deg, #240348 0%, #5704b3 50%, #b80588 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 30px rgba(119, 4, 250, 0.35);
  position: relative;
  overflow: hidden;
}

.next-action-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(245, 54, 110, 0.35) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.next-action-card h2 {
  color: white;
  font-size: 22px;
  margin: 4px 0 6px;
}

.next-action-card p {
  color: #ebdff7;
  margin: 0 0 16px;
  font-size: 13.5px;
}

.next-action-badge {
  font-size: 9px;
  letter-spacing: 1.8px;
  font-weight: 850;
  color: #f7b2db;
  margin-bottom: 4px;
}

.next-action-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.next-action-card button.primary {
  background: #ffffff;
  color: var(--brand-purple, #7704FA);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.next-action-card button.primary:hover {
  background: #fbf5ff;
  color: #5d02c7;
  transform: translateY(-2px);
}

.reward-tag {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Today's Tasks Component - Mobile First & Fully Responsive */
.tasks-card {
  position: relative;
  overflow: hidden;
}

.tasks-card .section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tasks-card .progress-wrap {
  margin: 14px 0 16px;
  background: rgba(119, 4, 250, 0.04);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line, #ecdffc);
}

.progress-track {
  height: 8px;
  background: var(--accent-soft, #f4ecff);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: var(--brand-gradient-h);
  border-radius: 999px;
  transition: width .4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.task-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #faf6ff;
  border: 1.5px solid var(--line, #ecdffc);
  transition: all .22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.task-item:hover {
  border-color: rgba(119, 4, 250, 0.35);
  box-shadow: 0 4px 16px rgba(119, 4, 250, 0.08);
}

.task-item.done {
  background: linear-gradient(135deg, rgba(18, 154, 88, 0.04) 0%, rgba(119, 4, 250, 0.03) 100%);
  border-color: rgba(18, 154, 88, 0.3);
}

.task-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.task-icon {
  font-size: 20px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--line, #ecdffc);
  box-shadow: 0 2px 6px rgba(119, 4, 250, 0.05);
  flex-shrink: 0;
}

.task-item.done .task-icon {
  background: var(--success-soft, #eafaf1);
  border-color: rgba(18, 154, 88, 0.25);
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.task-content strong {
  font-size: 14px;
  font-weight: 750;
  color: var(--ink, #110926);
  line-height: 1.25;
}

.task-content small {
  font-size: 11.5px;
  color: var(--muted, #6e6488);
  line-height: 1.3;
  display: block;
}

.task-reward {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-purple, #7704FA);
  background: var(--accent-soft, #f4ecff);
  border: 1px solid rgba(119, 4, 250, 0.18);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.task-item.done .task-reward {
  background: var(--success-soft, #eafaf1);
  color: var(--success, #129a58);
  border-color: rgba(18, 154, 88, 0.25);
}

.task-item-action {
  width: 100%;
}

.task-item-action button {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-item.done .task-item-action button {
  background: var(--accent-soft, #f4ecff);
  color: var(--muted, #6e6488);
  border-color: var(--line, #ecdffc);
  opacity: 0.75;
}

/* Tablet & Desktop Layout */
@media (min-width: 520px) {
  .task-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    gap: 14px;
  }
  .task-item-header {
    flex: 1;
    min-width: 0;
  }
  .task-title-group {
    justify-content: flex-start;
    gap: 10px;
  }
  .task-item-action {
    width: auto;
    flex-shrink: 0;
  }
  .task-item-action button {
    width: auto;
    min-width: 125px;
    min-height: 38px;
  }
}

.status-chip {
  font-size: 12px;
  color: var(--muted, #6e6488);
  padding: 6px 12px;
  background: var(--accent-soft, #f4ecff);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
}

.status-chip.done {
  background: var(--success-soft, #eafaf1);
  color: var(--success, #129a58);
  font-weight: 700;
}

/* Recognition Badges Grid */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 10px;
  border-radius: 16px;
  border: 1px solid var(--line, #ecdffc);
  background: #ffffff;
  transition: all .2s ease;
}

.badge-item.unlocked {
  border-color: var(--brand-purple, #7704FA);
  background: linear-gradient(145deg, #ffffff 0%, #faf5ff 100%);
  box-shadow: 0 4px 14px rgba(119, 4, 250, 0.12);
}

.badge-item.unlocked .badge-icon {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-item.locked {
  opacity: .55;
  background: #faf8fd;
}

.badge-item .badge-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.badge-item strong {
  font-size: 12.5px;
  line-height: 1.25;
  margin-bottom: 3px;
  color: var(--ink, #110926);
}

.badge-item small {
  font-size: 10.5px;
  color: var(--muted, #6e6488);
  line-height: 1.2;
}

.badge-item .badge-status {
  font-size: 9.5px;
  font-weight: 800;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-item.unlocked .badge-status {
  background: var(--success-soft, #eafaf1);
  color: var(--success, #129a58);
}

.badge-item.locked .badge-status {
  background: var(--line, #ecdffc);
  color: var(--muted, #6e6488);
}

textarea {
  width: 100%;
  font: inherit;
  padding: 12px;
  border: 1.5px solid var(--line, #ecdffc);
  border-radius: 12px;
  resize: vertical;
  background: #ffffff;
}

textarea:focus-visible {
  outline: 3px solid var(--brand-purple, #7704FA);
  outline-offset: 3px;
}

#creator-form button, #poll-form button {
  margin-top: 14px;
}

#poll-results progress {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  accent-color: var(--brand-purple, #7704FA);
}

#poll-results p {
  margin: 8px 0;
}

#daily-reset {
  font-size: 12px;
  color: var(--muted, #6e6488);
  margin: 4px 0 10px;
}

#daily-rewards {
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 14px;
  background: var(--accent-soft, #f4ecff);
  border-radius: 12px;
  border: 1px solid var(--line, #ecdffc);
  color: var(--ink, #110926);
  font-weight: 550;
  word-break: break-word;
}

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

@media(max-width: 480px) {
  main {
    padding: 16px 14px calc(80px + env(safe-area-inset-bottom));
  }
  h1 {
    font-size: 28px;
    letter-spacing: -1px;
  }
  .card {
    padding: 18px 14px;
    border-radius: 16px;
  }
  .tasks-card .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .task-item {
    padding: 12px;
    gap: 10px;
  }
  .task-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
    border-radius: 10px;
  }
  .task-content strong {
    font-size: 13.5px;
  }
  .task-content small {
    font-size: 11px;
  }
  .task-reward {
    font-size: 10.5px;
    padding: 3px 7px;
  }
  .task-item-action button {
    min-height: 40px;
    font-size: 12px;
  }
}

@media(max-width: 360px) {
  main {
    padding: 14px 10px 90px;
  }
  h1 {
    font-size: 26px;
  }
  .card {
    padding: 16px 12px;
  }
  .tap-target {
    width: 200px;
    height: 200px;
  }
  .tap-emblem-img {
    width: 50px;
  }
  .tap-infinity-symbol {
    font-size: 70px;
  }
  .badge-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stats {
    grid-template-columns: 1fr;
  }
}
