* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  min-height: 100%;
  background: #ffffff;
  color: #000;
  overflow-x: hidden;
  font-family: "Press Start 2P", monospace;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  position: relative;
}

/* ---------- sticker wall ---------- */
.wall {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sticker {
  position: absolute;
  top: -80px;
  font-family: "Press Start 2P", monospace;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  user-select: none;
  will-change: transform, opacity;
  animation: fall linear forwards;
}

@keyframes fall {
  0%   { transform: translateY(-10vh) rotate(var(--rot)) scale(var(--sc)); opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(115vh) rotate(var(--rot)) scale(var(--sc)); opacity: 0; }
}

/* ---------- stage / card ---------- */
.stage {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: center;
}

.card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 4px solid #000;
  box-shadow: 10px 10px 0 #000;
  padding: 44px 28px 26px;
  text-align: center;
  position: relative;
  animation: pop .5s cubic-bezier(.2,1.4,.4,1) both;
}

@keyframes pop {
  from { transform: translateY(24px) scale(.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ---------- avatar frame + crown ---------- */
.frame-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 34px auto 0;
}

.frame {
  position: relative;
  width: 100%;
  height: 100%;
  border: 4px solid #000;
  box-shadow: 6px 6px 0 #000;
  background: #fff;
  overflow: hidden;
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
}

.crown {
  position: absolute;
  top: -46px;
  left: 50%;
  transform: translateX(-50%) rotate(-8deg);
  z-index: 3;
  animation: bob 2.4s ease-in-out infinite;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,.18));
}

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

/* ---------- nick ---------- */
.nick {
  font-family: "VT323", "Press Start 2P", monospace;
  font-size: 64px;
  line-height: 1;
  letter-spacing: 2px;
  margin: 30px 0 18px;
  text-shadow: 4px 4px 0 rgba(0,0,0,.12);
}

/* ---------- bio ---------- */
.bio {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 6px;
  font-family: "VT323", monospace;
  font-size: 22px;
  line-height: 1.1;
  margin-bottom: 26px;
}

.bio span {
  border: 2px solid #000;
  padding: 3px 8px 5px;
  background: #fff;
  box-shadow: 2px 2px 0 #000;
}

.bio span::before { content: "▸ "; }

/* ---------- buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.btn {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  text-transform: uppercase;
  color: #000;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  padding: 12px 14px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .06s ease, background .06s ease, color .06s ease;
  display: inline-block;
}

.btn:hover { background: #000; color: #fff; }

.btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 #000;
}

/* ---------- stats ---------- */
.stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.stat {
  flex: 1;
  border: 3px solid #000;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stat b {
  font-family: "VT323", monospace;
  font-size: 28px;
  line-height: 1;
}

.stat small {
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  letter-spacing: .5px;
}

/* ---------- footer ---------- */
.foot {
  font-family: "VT323", monospace;
  font-size: 16px;
  color: #000;
  opacity: .7;
  border-top: 2px dashed #000;
  padding-top: 14px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 140%);
  background: #000;
  color: #fff;
  font-family: "VT323", monospace;
  font-size: 22px;
  padding: 10px 18px;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 rgba(0,0,0,.25);
  z-index: 10;
  transition: transform .3s cubic-bezier(.2,1.4,.4,1);
  pointer-events: none;
  white-space: nowrap;
}

.toast.show { transform: translate(-50%, 0); }

/* ---------- broken glass / crack overlay ---------- */
.crack {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  animation: crackFlash .5s steps(3) forwards;
}

@keyframes crackFlash {
  0%   { opacity: 1; }
  60%  { opacity: .85; }
  100% { opacity: 0; }
}

.crack-line {
  stroke: #000;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw .18s linear forwards;
}

.crack-line.thin { stroke-width: 1.5; }

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

/* ---------- popups ---------- */
.popup {
  position: fixed;
  z-index: 30;
  background: #fff;
  border: 4px solid #000;
  box-shadow: 8px 8px 0 #000;
  padding: 26px 22px 20px;
  min-width: 260px;
  max-width: 90vw;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: transform .38s cubic-bezier(.2,1.5,.35,1), opacity .25s ease;
}

.popup.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, 0);
}

.popup-left {
  top: 50%;
  left: 24px;
  transform: translate(-140%, -50%) rotate(-6deg);
}

.popup-right {
  top: 50%;
  right: 24px;
  transform: translate(140%, -50%) rotate(6deg);
}

.popup-bottom {
  bottom: 40px;
  left: 50%;
  transform: translate(-50%, 180%) rotate(2deg);
}

.pop-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 3px solid #000;
  background: #fff;
  color: #000;
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000;
  transition: transform .06s, box-shadow .06s, background .06s, color .06s;
}

.pop-close:hover { background: #000; color: #fff; }
.pop-close:active { transform: translate(2px, 2px); box-shadow: 0 0 0 #000; }

.pop-title {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
}

.pop-link {
  display: inline-block;
  font-family: "VT323", monospace;
  font-size: 34px;
  line-height: 1;
  color: #000;
  text-decoration: none;
  border-bottom: 3px solid #000;
  padding-bottom: 4px;
  transition: letter-spacing .2s;
}

.pop-link:hover { letter-spacing: 1px; }

.pop-hint {
  font-family: "VT323", monospace;
  font-size: 16px;
  opacity: .6;
  margin-top: 12px;
}

.pop-wallet {
  display: block;
  font-family: "VT323", monospace;
  font-size: 22px;
  word-break: break-all;
  border: 3px solid #000;
  padding: 10px 12px;
  margin-bottom: 14px;
  user-select: all;
  cursor: text;
  letter-spacing: .5px;
}

.btn-copy { font-size: 9px; }

/* screen shake on burst */
.shake { animation: shake .35s steps(2) 2; }

@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(-6px, 3px); }
  50%      { transform: translate(5px, -4px); }
  75%      { transform: translate(-3px, -2px); }
}

/* center burst flash */
.burst {
  position: fixed;
  z-index: 15;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #000;
  pointer-events: none;
  animation: burstOut .45s cubic-bezier(.2,.8,.3,1) forwards;
}

@keyframes burstOut {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: .9; }
  100% { transform: translate(-50%, -50%) scale(28); opacity: 0; }
}

/* ---------- responsive ---------- */
@media (max-width: 480px) {
  .card { padding: 36px 18px 20px; box-shadow: 7px 7px 0 #000; }
  .nick { font-size: 48px; margin: 24px 0 14px; }
  .frame-wrap { width: 140px; height: 140px; }
  .bio { font-size: 19px; }
  .btn { font-size: 9px; padding: 11px 11px; }

  .popup-left,
  .popup-right,
  .popup-bottom { left: 50%; right: auto; }
  .popup-left  { top: 24px; transform: translate(-50%, -180%) rotate(-4deg); }
  .popup-right { top: 24px; transform: translate(-50%, -180%) rotate(4deg); }
  .popup-bottom { bottom: 24px; transform: translate(-50%, 180%) rotate(2deg); }
  .popup.open { transform: translate(-50%, 0) rotate(0); }
  .popup { min-width: 0; width: 86vw; }
  .pop-link { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .sticker { animation-duration: 0s !important; opacity: 0 !important; }
  .crown { animation: none; }
  .card { animation: none; }
}
