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

:root {
  --mario-red: #e52521;
  --mario-blue: #049cd8;
  --mario-yellow: #fbd000;
  --mario-green: #43b047;
  --mario-brown: #8b4513;
  --solana-purple: #9945ff;
  --solana-teal: #14f195;
  --bg-dark: #1a0f0a;
  --office-glow: #ff6b2c;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg-dark);
  color: #fff;
}

.sky {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #5c94fc 0%, #8ec8ff 45%, #c8e6ff 100%);
  z-index: 0;
}

.cloud {
  position: absolute;
  background: #fff;
  border-radius: 50px;
  opacity: 0.9;
  animation: drift 28s linear infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.c1 { width: 120px; height: 40px; top: 12%; left: -10%; }
.c1::before { width: 50px; height: 50px; top: -25px; left: 15px; }
.c1::after { width: 60px; height: 60px; top: -30px; left: 50px; }

.c2 { width: 90px; height: 32px; top: 22%; left: 70%; animation-delay: -8s; }
.c2::before { width: 40px; height: 40px; top: -20px; left: 10px; }
.c2::after { width: 45px; height: 45px; top: -22px; left: 38px; }

.c3 { width: 100px; height: 36px; top: 8%; left: 40%; animation-delay: -14s; }
.c3::before { width: 44px; height: 44px; top: -22px; left: 12px; }
.c3::after { width: 50px; height: 50px; top: -26px; left: 42px; }

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 200px)); }
}

.top-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-family: Inter, sans-serif;
  transition: transform 0.15s, background 0.15s;
}

.icon-btn:hover {
  transform: scale(1.08);
  background: rgba(0, 0, 0, 0.65);
}

.scene {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 4rem;
}

.office-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(26, 15, 10, 0.3) 40%, rgba(26, 15, 10, 0.85) 75%),
    linear-gradient(135deg, #2d1810 0%, #4a2818 50%, #1a0f0a 100%);
  overflow: hidden;
}

.window {
  position: absolute;
  top: 8%;
  left: 4%;
  width: 18%;
  min-width: 100px;
  aspect-ratio: 1;
  border: 6px solid var(--mario-brown);
  background: linear-gradient(180deg, #87ceeb, #ffd89b);
  box-shadow: inset 0 0 30px rgba(255, 200, 100, 0.5);
}

.castle {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 35%;
  background: var(--mario-red);
  clip-path: polygon(0 100%, 0 40%, 15% 40%, 15% 0, 35% 0, 35% 40%, 50% 40%, 50% 0, 65% 0, 65% 40%, 85% 40%, 85% 0, 100% 0, 100% 100%);
}

.poster {
  position: absolute;
  background: #f5f0e6;
  color: #222;
  padding: 0.5rem;
  font-size: 0.55rem;
  font-weight: 700;
  border: 3px solid #333;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.poster-left {
  top: 18%;
  left: 28%;
  transform: rotate(-2deg);
}

.poster-center {
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: min(280px, 40vw);
  text-align: center;
}

.poster-center h3 {
  font-family: "Press Start 2P", monospace;
  font-size: 0.45rem;
  margin-bottom: 0.4rem;
  color: var(--mario-red);
}

.mini-chart {
  height: 40px;
  margin: 0.3rem 0;
  background: repeating-linear-gradient(
    90deg,
    var(--solana-purple) 0 8px,
    transparent 8px 12px
  );
  opacity: 0.6;
}

.desk {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38%;
  background: linear-gradient(180deg, #6b3a1f, #4a2818);
  border-top: 8px solid var(--office-glow);
  box-shadow: 0 -20px 60px rgba(255, 107, 44, 0.35);
}

.desk::before {
  content: "MARIOBOT • SOLANA COMMAND CENTER";
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.35rem, 1.2vw, 0.5rem);
  color: var(--mario-yellow);
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
}

.monitor {
  position: absolute;
  bottom: 42%;
  background: #0a0a0a;
  border: 4px solid #333;
  border-radius: 4px;
  padding: 0.4rem;
  box-shadow: 0 0 20px rgba(20, 241, 149, 0.2);
}

.m-left {
  left: 8%;
  width: min(220px, 28vw);
  font-family: "Courier New", monospace;
  font-size: clamp(0.45rem, 1.2vw, 0.65rem);
  color: var(--solana-teal);
}

.m-left pre {
  white-space: pre-wrap;
  line-height: 1.4;
}

.m-right {
  right: 8%;
  width: min(200px, 26vw);
  height: 80px;
}

.chart-label {
  font-size: 0.5rem;
  color: #888;
  margin-bottom: 0.25rem;
}

.fake-chart {
  height: 50px;
  background: linear-gradient(180deg, transparent 60%, var(--solana-purple) 60%),
    repeating-linear-gradient(90deg, var(--solana-teal) 0 6px, transparent 6px 10px);
  opacity: 0.7;
  animation: chart-pulse 2s ease-in-out infinite;
}

@keyframes chart-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}

.pipe {
  position: absolute;
  bottom: 35%;
  right: 6%;
  width: 50px;
  height: 70px;
  background: var(--mario-green);
  border: 4px solid #2d8a30;
  border-radius: 4px 4px 0 0;
}

.pipe::before {
  content: "";
  position: absolute;
  top: -12px;
  left: -6px;
  right: -6px;
  height: 16px;
  background: var(--mario-green);
  border: 4px solid #2d8a30;
  border-radius: 4px;
}

.block {
  position: absolute;
  bottom: 55%;
  right: 14%;
  width: 44px;
  height: 44px;
  background: var(--mario-yellow);
  border: 4px solid #c9a600;
  display: grid;
  place-items: center;
  font-family: "Press Start 2P", monospace;
  font-size: 1.2rem;
  color: #8b6914;
  animation: block-bounce 1.2s ease-in-out infinite;
}

@keyframes block-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero {
  position: relative;
  z-index: 10;
  text-align: center;
  width: min(520px, 92vw);
}

.title {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1.4rem, 6vw, 2.8rem);
  color: var(--mario-yellow);
  text-shadow:
    4px 4px 0 var(--mario-red),
    6px 6px 0 #000;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  animation: title-glow 2s ease-in-out infinite;
}

@keyframes title-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

.bot-stage {
  position: relative;
  height: 220px;
  margin: 0 auto 1.5rem;
}

.bot-shadow {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 20px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  animation: shadow-pulse 0.6s ease-in-out infinite;
}

@keyframes shadow-pulse {
  0%, 100% { transform: translateX(-50%) scaleX(1); }
  50% { transform: translateX(-50%) scaleX(0.85); }
}

/* Dancing MarioBot — CSS character */
.mariobot {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: 100px;
  height: 160px;
}

.mariobot.dancer {
  animation: dance-body 0.6s ease-in-out infinite;
}

@keyframes dance-body {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-2deg); }
  25% { transform: translateX(-50%) translateY(-12px) rotate(2deg); }
  50% { transform: translateX(-50%) translateY(-4px) rotate(-1deg); }
  75% { transform: translateX(-50%) translateY(-16px) rotate(3deg); }
}

.bot-cap {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 36px;
  background: var(--mario-red);
  border-radius: 36px 36px 8px 8px;
  border: 3px solid #b81c18;
  z-index: 5;
}

.bot-cap::after {
  content: "";
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 12px;
  background: var(--mario-red);
  border-radius: 4px;
  border: 3px solid #b81c18;
}

.bot-face {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 52px;
  background: #f5c99a;
  border-radius: 12px;
  border: 3px solid #d4a574;
  z-index: 4;
}

.eye {
  position: absolute;
  top: 14px;
  width: 10px;
  height: 14px;
  background: #222;
  border-radius: 50%;
}

.eye.left { left: 14px; }
.eye.right { right: 14px; }

.stache {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 14px;
  background: #3d2314;
  border-radius: 0 0 20px 20px;
}

.bot-body {
  position: absolute;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 48px;
  background: #888;
  border: 3px solid #666;
  border-radius: 8px;
  z-index: 3;
}

.bot-body .btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--mario-red);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--mario-red);
}

.overall {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 20px;
  background: var(--mario-blue);
  border: 2px solid #037aa8;
  border-radius: 4px;
}

.arm {
  position: absolute;
  top: 88px;
  width: 18px;
  height: 44px;
  background: #888;
  border: 2px solid #666;
  border-radius: 8px;
  transform-origin: top center;
}

.arm.left {
  left: 8px;
  animation: arm-swing-left 0.6s ease-in-out infinite;
}

.arm.right {
  right: 8px;
  animation: arm-swing-right 0.6s ease-in-out infinite;
}

@keyframes arm-swing-left {
  0%, 100% { transform: rotate(25deg); }
  50% { transform: rotate(-35deg); }
}

@keyframes arm-swing-right {
  0%, 100% { transform: rotate(-25deg); }
  50% { transform: rotate(35deg); }
}

.leg {
  position: absolute;
  bottom: 0;
  width: 22px;
  height: 36px;
  background: var(--mario-blue);
  border: 2px solid #037aa8;
  border-radius: 4px;
  transform-origin: top center;
}

.leg.left {
  left: 28px;
  animation: leg-kick-left 0.6s ease-in-out infinite;
}

.leg.right {
  right: 28px;
  animation: leg-kick-right 0.6s ease-in-out infinite;
}

@keyframes leg-kick-left {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(18deg); }
}

@keyframes leg-kick-right {
  0%, 100% { transform: rotate(8deg); }
  50% { transform: rotate(-18deg); }
}

.buy-btn {
  display: inline-block;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.7rem, 3.8vw, 0.95rem);
  line-height: 1.5;
  padding: 1.35rem 1.75rem;
  margin: 0.5rem 0 1.25rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: #1a0f0a;
  background: linear-gradient(180deg, var(--mario-yellow) 0%, #f5a800 45%, #e88a00 100%);
  box-shadow:
    0 6px 0 #b86e00,
    0 0 0 4px var(--mario-red),
    0 12px 32px rgba(251, 208, 0, 0.45);
  transition: transform 0.1s, box-shadow 0.1s;
  width: 100%;
  max-width: 420px;
  animation: buy-pulse 2s ease-in-out infinite;
}

.buy-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 9px 0 #b86e00,
    0 0 0 4px var(--mario-red),
    0 16px 40px rgba(251, 208, 0, 0.55);
}

.buy-btn:active {
  transform: translateY(3px) scale(0.98);
  box-shadow:
    0 3px 0 #b86e00,
    0 0 0 4px var(--mario-red),
    0 8px 20px rgba(251, 208, 0, 0.35);
}

@keyframes buy-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.wallet-panel {
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(153, 69, 255, 0.5);
  border-radius: 12px;
  padding: 1.25rem;
  backdrop-filter: blur(8px);
}

.wallet-btn {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.5rem, 2.5vw, 0.65rem);
  padding: 1rem 1.25rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--solana-purple), #7b2cbf);
  box-shadow: 0 4px 0 #4a1578, 0 8px 24px rgba(153, 69, 255, 0.4);
  transition: transform 0.1s, box-shadow 0.1s;
  width: 100%;
  max-width: 320px;
}

.wallet-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #4a1578, 0 12px 28px rgba(153, 69, 255, 0.5);
}

.wallet-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #4a1578;
}

.wallet-btn.connected {
  background: linear-gradient(135deg, var(--mario-green), #2d8a30);
  box-shadow: 0 4px 0 #1e5c20;
}

.wallet-status {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #aaa;
}

.wallet-details {
  margin-top: 1rem;
  text-align: left;
  font-size: 0.8rem;
}

.wallet-details.hidden {
  display: none;
}

.wallet-details p {
  margin-bottom: 0.5rem;
}

.wallet-details .label {
  color: var(--solana-teal);
  font-weight: 600;
  margin-right: 0.5rem;
}

.wallet-details code {
  font-size: 0.7rem;
  word-break: break-all;
  color: var(--mario-yellow);
}

.info-dialog {
  border: 3px solid var(--mario-yellow);
  border-radius: 12px;
  padding: 2rem;
  max-width: 420px;
  background: #1a1020;
  color: #eee;
}

.info-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.info-dialog h2 {
  font-family: "Press Start 2P", monospace;
  font-size: 0.9rem;
  color: var(--mario-yellow);
  margin-bottom: 1rem;
}

.info-dialog p {
  line-height: 1.6;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.info-dialog a {
  color: var(--solana-teal);
}

.dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 600px) {
  .poster-left,
  .window {
    display: none;
  }

  .m-left,
  .m-right {
    display: none;
  }

  .bot-stage {
    height: 180px;
  }
}
