:root {
  --lime: #ccff00;
  --lime-soft: rgba(236, 255, 170, 0.82);
  --glass: rgba(12, 12, 8, 0.86);
  color: #ffe9f3;
  background: #160409;
  font-family: "Trebuchet MS", Verdana, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* Letterbox gutters: decorative side panels (right one mirrored), purely visual. */
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  width: 50vw;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(22, 4, 9, 0.1), rgba(22, 4, 9, 0.45)),
    url("/assets/side-hearts.webp") left center / auto 100% repeat-x;
}

body::before { left: 0; }
body::after { right: 0; transform: scaleX(-1); }

[data-contract-stage] {
  position: relative;
  z-index: 1;
  width: min(100vw, calc(100vh * var(--stage-ratio)));
  aspect-ratio: var(--stage-ratio);
  overflow: hidden;
  background: #2b0a14;
  box-shadow: 0 0 48px 14px rgba(10, 1, 5, 0.85);
  user-select: none;
  -webkit-user-select: none;
}

[data-contract-id] {
  position: absolute;
  margin: 0;
}

[data-contract-id][hidden] {
  display: none !important;
}

img[data-contract-id] {
  object-fit: fill;
  pointer-events: auto;
}

img[data-contract-id="scene-background"] {
  object-fit: cover;
  pointer-events: none;
}

img[data-contract-id="base-inu"],
img[data-contract-id="top-inu"] {
  object-fit: contain;
  filter: drop-shadow(0 0.4rem 0.5rem rgba(24, 2, 10, 0.55));
}

[data-contract-id="top-inu"] {
  cursor: grab;
  touch-action: none;
  transition: filter 120ms ease, transform 120ms ease;
}

[data-contract-id="top-inu"]:hover {
  filter: brightness(1.12) drop-shadow(0 0.5rem 0.7rem rgba(24, 2, 10, 0.55));
  transform: scale(1.04) translateY(-2px);
}

[data-contract-id="top-inu"]:focus-visible {
  outline: 3px solid #ff7ab8;
  outline-offset: 2px;
}

.dragging-active,
.dragging-active [data-contract-id="top-inu"] {
  cursor: grabbing;
}

.dragging {
  cursor: grabbing !important;
  transform: scale(1.06) rotate(-2.5deg);
  animation: inu-wobble 260ms ease-in-out infinite alternate;
  z-index: 60;
}

.lift {
  transform: translateY(-6px) scale(1.04);
}

.attract {
  animation: inu-attract 1.6s ease-in-out 2;
}

.pop {
  animation: inu-pop 300ms cubic-bezier(0.2, 1.6, 0.4, 1);
}

.squash {
  animation: inu-squash 430ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.pair-flash {
  animation: pair-flash 650ms ease-out;
}

.bounce {
  animation: inu-bounce 520ms ease-in-out;
}

.inu-unit {
  position: absolute;
  margin: 0;
  pointer-events: none;
}

.inu-unit img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.4rem 0.5rem rgba(24, 2, 10, 0.55));
}

.inu-unit.pair-top {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.inu-unit.pair-top:hover {
  filter: brightness(1.1);
}

[data-contract-id="cta-plaque"] {
  border: 1px solid rgba(204, 255, 0, 0.85);
  border-radius: 12px;
  background: var(--glass);
  box-shadow:
    0 0 12px rgba(204, 255, 0, 0.35),
    inset 0 0 18px rgba(204, 255, 0, 0.08);
}

[data-contract-id="cta-title"] {
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.14em;
  font-size: 2.1vh;
  color: var(--lime);
  text-shadow: 0 0 8px rgba(204, 255, 0, 0.85), 0 0 22px rgba(204, 255, 0, 0.4);
}

[data-contract-id="cta-subtext"] {
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 1.7vh;
  letter-spacing: 0.08em;
  color: var(--lime-soft);
}

.cta-pulse {
  animation: cta-pulse 1.1s ease-in-out infinite;
}

[data-contract-id="feedback"] {
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.18em;
  font-size: 2.4vh;
  color: #ccff00;
  text-shadow: 0 0 10px rgba(204, 255, 0, 0.85), 0 0 26px rgba(204, 255, 0, 0.4);
}

[data-contract-id="hud-supply"],
[data-contract-id="hud-risk"] {
  display: grid;
  place-items: center;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
  font-size: 2vh;
  letter-spacing: 0.12em;
  color: var(--lime);
  text-shadow: 0 0 8px rgba(204, 255, 0, 0.5);
  background: var(--glass);
  border: 1px solid rgba(204, 255, 0, 0.5);
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(204, 255, 0, 0.2);
}

button[data-contract-id="mute-audio"] {
  min-width: 24px;
  min-height: 24px;
  border: 1px solid rgba(204, 255, 0, 0.75);
  border-radius: 999px;
  background: var(--glass);
  color: var(--lime);
  padding: 0 0.6vh;
  font-size: 1.25vh;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
}

button[data-contract-id="mute-audio"]:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

button[data-contract-id="mute-audio"][aria-pressed="true"] {
  color: rgba(236, 255, 170, 0.5);
  border-color: rgba(204, 255, 0, 0.3);
}

.fx-flash {
  position: absolute;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: radial-gradient(circle at 50% 60%, rgba(255, 158, 207, 0.65), rgba(255, 95, 162, 0.2) 55%, transparent 75%);
  animation: fx-flash 380ms ease-out;
}

.fx-sign {
  position: absolute;
  left: 33%;
  top: 0;
  width: 34%;
  height: 26%;
  z-index: 89;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, rgba(255, 95, 162, 0.5), transparent 65%);
  animation: sign-flicker 820ms steps(2, jump-none);
}

.quake-light {
  animation: quake-light 420ms ease-in-out;
}

.quake-heavy {
  animation: quake-heavy 620ms ease-in-out;
}

/* Front desk: Robinhood Chain neon sign (pons launchpad) + room key tag (CA). Fixed UI, outside the contract state loop. */
.launch-desk {
  position: absolute;
  left: 1.5%;
  top: 2.5%;
  width: 24%;
  z-index: 50;
  display: grid;
  gap: 1.1vh;
}

.launch-desk {
  transition: opacity 420ms ease, transform 420ms cubic-bezier(0.22, 1.2, 0.36, 1);
}

.intro-pending .launch-desk {
  opacity: 0;
  transform: translateY(-4.5vh);
}

.launch-pons {
  justify-self: start;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 1.2vh;
  row-gap: 0.25vh;
  padding: 1vh 1.5vh;
  border: 1px solid rgba(204, 255, 0, 0.85);
  border-radius: 12px;
  background: rgba(12, 12, 8, 0.88);
  box-shadow: 0 0 12px rgba(204, 255, 0, 0.35), inset 0 0 18px rgba(204, 255, 0, 0.08);
  color: #ccff00;
  text-decoration: none;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.launch-pons:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(204, 255, 0, 0.75), inset 0 0 24px rgba(204, 255, 0, 0.18);
}

/* Robinhood feather as a lime neon tube. */
.launch-feather {
  grid-row: 1 / 3;
  height: 4.6vh;
  width: auto;
  filter: drop-shadow(0 0 3px rgba(204, 255, 0, 0.9)) drop-shadow(0 0 10px rgba(204, 255, 0, 0.5));
  animation: feather-buzz 5s steps(1, end) infinite;
}

.launch-chain {
  font-size: 1.3vh;
  font-weight: 900;
  letter-spacing: 0.32em;
  color: rgba(236, 255, 170, 0.85);
}

.launch-pons-title {
  font-size: 2.15vh;
  font-weight: 900;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(204, 255, 0, 0.85), 0 0 20px rgba(204, 255, 0, 0.4);
}

.launch-ca {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 0.2vh;
  width: max-content;
  min-width: 58%;
  min-height: 24px;
  padding: 0.9vh 1.4vh 0.9vh 4.6vh;
  border: 1px solid rgba(204, 255, 0, 0.6);
  border-radius: 999px 10px 10px 999px;
  background: var(--glass);
  box-shadow: 0 0 10px rgba(204, 255, 0, 0.2);
  color: var(--lime-soft);
  font-family: Consolas, "Courier New", monospace;
  text-align: left;
  cursor: pointer;
  transform: rotate(-2deg);
  transform-origin: 1.6vh 50%;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

/* Key-ring hole of the tag. */
.launch-ca::before {
  content: "";
  position: absolute;
  left: 1.1vh;
  top: 50%;
  width: 2vh;
  height: 2vh;
  border: 2px solid var(--lime);
  border-radius: 50%;
  background: #0c0c08;
  box-shadow: 0 0 6px rgba(204, 255, 0, 0.6);
  transform: translateY(-50%);
}

.launch-ca:hover {
  transform: rotate(3deg);
  box-shadow: 0 0 16px rgba(204, 255, 0, 0.45);
}

.launch-ca-label {
  font-size: 1.3vh;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--lime);
}

.launch-ca-value {
  font-size: 1.9vh;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.launch-ca-flash .launch-ca-value {
  color: #fff;
  text-shadow: 0 0 8px rgba(204, 255, 0, 0.95), 0 0 18px rgba(204, 255, 0, 0.6);
}

.launch-pons:focus-visible,
.launch-ca:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

@keyframes feather-buzz {
  0%, 62%, 66%, 70%, 100% { opacity: 1; }
  64%, 68% { opacity: 0.35; }
}

@keyframes inu-wobble {
  from { transform: scale(1.06) rotate(-3.5deg); }
  to { transform: scale(1.06) rotate(2.5deg); }
}

@keyframes inu-attract {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-5px) rotate(-2deg); }
  60% { transform: translateY(-2px) rotate(1.5deg); }
}

@keyframes inu-pop {
  0% { transform: scale(0.3); opacity: 0.4; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes inu-squash {
  0% { transform: scale(0.2) rotate(-8deg); }
  55% { transform: scale(1.12) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes pair-flash {
  0% { filter: brightness(1); drop-shadow(0 0 0 rgba(255, 158, 207, 0)); }
  30% { filter: brightness(1.6) drop-shadow(0 0 18px rgba(255, 158, 207, 0.95)); }
  100% { filter: brightness(1); }
}

@keyframes inu-bounce {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-12px) scale(1.03); }
  70% { transform: translateY(0) scale(0.98); }
}

@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(204, 255, 0, 0.35), inset 0 0 18px rgba(204, 255, 0, 0.08); }
  50% { box-shadow: 0 0 28px rgba(204, 255, 0, 0.85), inset 0 0 26px rgba(204, 255, 0, 0.22); }
}

@keyframes fx-flash {
  0% { opacity: 0; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes sign-flicker {
  0% { opacity: 0; }
  20% { opacity: 1; }
  35% { opacity: 0.15; }
  50% { opacity: 1; }
  70% { opacity: 0.35; }
  100% { opacity: 0; }
}

@keyframes quake-light {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
}

@keyframes quake-heavy {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-6px, 3px); }
  30% { transform: translate(6px, -4px); }
  45% { transform: translate(-5px, -2px); }
  60% { transform: translate(5px, 3px); }
  80% { transform: translate(-3px, 1px); }
}

.intro-pending .intro-actor {
  opacity: 0;
}

.intro-veil {
  position: absolute;
  inset: 0;
  z-index: 95;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.6vh;
  background: radial-gradient(circle at 50% 45%, rgba(43, 10, 20, 0.94), rgba(16, 3, 8, 0.985));
  transition: opacity 380ms ease, transform 380ms ease;
}

.intro-veil.intro-veil-out {
  opacity: 0;
  transform: translateY(-5%);
  pointer-events: none;
}

.intro-loading {
  font-size: 3.6vh;
  font-weight: 900;
  letter-spacing: 0.32em;
  color: #ff9ecf;
  text-shadow: 0 0 10px rgba(255, 95, 162, 0.95), 0 0 32px rgba(255, 95, 162, 0.55);
  animation: intro-flicker 820ms steps(2, jump-none) infinite;
}

.intro-dots i {
  display: inline-block;
  font-style: normal;
  width: 0.6vh;
  height: 0.6vh;
  margin-left: 0.9vh;
  border-radius: 50%;
  background: #ff9ecf;
  box-shadow: 0 0 8px rgba(255, 95, 162, 0.9);
  animation: intro-dot 900ms ease-in-out infinite;
}

.intro-dots i:nth-child(2) { animation-delay: 150ms; }
.intro-dots i:nth-child(3) { animation-delay: 300ms; }

.intro-bar {
  width: 30vh;
  height: 0.7vh;
  border: 1px solid rgba(255, 95, 162, 0.55);
  border-radius: 999px;
  overflow: hidden;
}

.intro-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 95, 162, 0.5), #ff9ecf);
  box-shadow: 0 0 10px rgba(255, 95, 162, 0.8);
  animation: intro-fill 1s linear both;
}

.intro-drop {
  animation: intro-drop 520ms cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

.intro-dog-base {
  animation: intro-dog-base 620ms cubic-bezier(0.3, 0.7, 0.3, 1.15) both;
}

.intro-dog-top {
  animation: intro-dog-top 680ms cubic-bezier(0.3, 0.7, 0.3, 1.18) both;
}

@keyframes intro-flicker {
  0% { opacity: 1; }
  45% { opacity: 1; }
  50% { opacity: 0.55; }
  55% { opacity: 1; }
  78% { opacity: 0.75; }
  100% { opacity: 1; }
}

@keyframes intro-dot {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-0.7vh); }
}

@keyframes intro-fill {
  from { width: 4%; }
  to { width: 100%; }
}

@keyframes intro-drop {
  from { opacity: 0; transform: translateY(-4.5vh); }
  to { opacity: 1; transform: none; }
}

@keyframes intro-dog-base {
  0% { opacity: 0; transform: translateY(-58vh) scale(1.02, 0.9); }
  62% { opacity: 1; transform: translateY(0) scale(1.1, 0.86); }
  76% { transform: translateY(0) scale(0.96, 1.05); }
  90% { transform: translateY(0) scale(1.03, 0.99); }
  100% { opacity: 1; transform: none; }
}

@keyframes intro-dog-top {
  0% { opacity: 0; transform: translateY(-84vh) rotate(-7deg); }
  55% { opacity: 1; transform: translateY(0) rotate(2deg) scale(1.08, 0.9); }
  70% { transform: translateY(0) rotate(0deg) scale(0.95, 1.07); }
  85% { transform: translateY(0) rotate(0deg) scale(1.03, 0.98); }
  100% { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
