:root {
  --ink: #2c261e;
  --muted: #756a5c;
  --paper: #fff8ec;
  --panel: rgba(255, 253, 247, 0.9);
  --gold: #ffc94f;
  --honey: #f4a43d;
  --leaf: #55b77a;
  --sky: #67bfd8;
  --rose: #ff7f9a;
  --violet: #8f7af4;
  --line: rgba(75, 50, 18, 0.14);
  --shadow: 0 18px 45px rgba(74, 43, 8, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans SC",
    Arial,
    sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 201, 79, 0.55), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(103, 191, 216, 0.34), transparent 30%),
    linear-gradient(135deg, #fff4d7 0%, #f2fbf0 51%, #fff1f5 100%);
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.game-shell {
  width: min(1380px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 8px;
  padding: 7px 12px;
  border: 1px solid rgba(244, 164, 61, 0.42);
  border-radius: 999px;
  color: #6b4300;
  font-size: 13px;
  font-weight: 900;
  background: rgba(255, 201, 79, 0.42);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(36px, 5.6vw, 68px);
  line-height: 0.98;
  letter-spacing: 0;
}

.ca-tag {
  display: inline-flex;
  max-width: min(100%, 760px);
  margin-top: 14px;
  padding: 10px 14px;
  overflow-wrap: anywhere;
  border: 2px solid rgba(244, 164, 61, 0.72);
  border-radius: 8px;
  background: #fff;
  color: #5d3d04;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1.35;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(244, 164, 61, 0.24);
  transition:
    transform 0.16s ease,
    background 0.16s ease;
}

.ca-tag:hover {
  transform: translateY(-2px);
  background: #fff7df;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
}

.wallet-card,
.stage-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.wallet-card {
  display: grid;
  gap: 7px;
  min-width: 238px;
  padding: 12px 14px;
  background: #fff;
}

.wallet-card span,
.panel-heading span,
.coin-card span,
.token-grid span {
  color: #6b532f;
  font-size: 13px;
  font-weight: 900;
}

.wallet-card strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.wallet-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wallet-action {
  min-height: 34px;
  border-radius: 8px;
  background: var(--gold);
  color: #593900;
  font-size: 13px;
  font-weight: 1000;
  transition:
    transform 0.16s ease,
    background 0.16s ease;
}

.wallet-action.secondary {
  border: 1px solid var(--line);
  background: #fff7e2;
}

.wallet-action:hover {
  transform: translateY(-2px);
}

.wallet-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.95fr) minmax(360px, 1fr) minmax(330px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.stage-card {
  overflow: hidden;
  background: rgba(255, 253, 247, 0.82);
}

.stage-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 0;
}

.stage-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.stage-head h2 {
  margin-top: 4px;
  font-size: 48px;
  line-height: 1;
}

.stage-head strong {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--gold);
  color: #5d3d04;
}

.dog-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 470px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(103, 191, 216, 0.26) 0%, rgba(255, 248, 236, 0.92) 66%),
    #fffdf7;
}

.speech-bubble {
  position: absolute;
  z-index: 5;
  top: 24px;
  left: 20px;
  max-width: calc(100% - 40px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #574633;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(76, 44, 9, 0.12);
}

.dog-photo-wrap {
  position: relative;
  z-index: 2;
  width: min(78%, 350px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 8px solid #fff;
  border-radius: 32px;
  box-shadow: 0 24px 45px rgba(113, 77, 22, 0.28);
  transform-origin: 50% 85%;
}

.dog-photo-wrap.is-happy {
  animation: wiggle 0.7s ease;
}

.dog-photo-wrap.is-battle {
  animation: bounce 0.9s ease;
}

.dog-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floating-chip {
  position: absolute;
  z-index: 3;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #6b4300;
  font-size: 13px;
  font-weight: 1000;
  box-shadow: 0 12px 24px rgba(82, 53, 10, 0.12);
}

.chip-a {
  right: 24px;
  top: 110px;
}

.chip-b {
  left: 28px;
  bottom: 118px;
}

.stage-floor {
  position: absolute;
  right: -10%;
  bottom: -86px;
  left: -10%;
  height: 190px;
  border-radius: 50% 50% 0 0;
  background: rgba(255, 201, 79, 0.45);
}

.hero-copy {
  margin: 0;
  padding: 16px 18px 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.claim-nft-action {
  display: block;
  width: calc(100% - 36px);
  min-height: 52px;
  margin: 16px 18px 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffcf55, #f4a43d);
  color: #4f3100;
  font-size: 18px;
  font-weight: 1000;
  box-shadow: 0 14px 28px rgba(244, 164, 61, 0.28);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.claim-nft-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(244, 164, 61, 0.34);
}

.control-stack,
.side-stack {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.stat-list {
  display: grid;
  gap: 13px;
}

.stat-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #594932;
  font-size: 14px;
  font-weight: 900;
}

.stat-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(77, 52, 21, 0.09);
}

.stat-bar span {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

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

.game-action,
.wide-action,
.tiny-action,
.arena-card {
  border-radius: 8px;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.game-action:hover,
.wide-action:hover,
.tiny-action:hover,
.arena-card:hover {
  transform: translateY(-2px);
}

.game-action {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 13px;
  border: 1px solid rgba(77, 52, 21, 0.12);
  background: #fff;
  text-align: left;
}

.game-action span {
  font-size: 17px;
  font-weight: 1000;
}

.game-action small,
.arena-card small,
.quest-item small,
.quest-progress {
  color: var(--muted);
  line-height: 1.45;
}

.game-action:disabled,
.arena-card:disabled,
.wide-action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.rush-board {
  position: relative;
  height: 210px;
  overflow: hidden;
  border: 1px dashed rgba(75, 50, 18, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 201, 79, 0.2), rgba(103, 191, 216, 0.18)),
    #fff;
}

.bone-target {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 74px;
  height: 44px;
  border-radius: 999px;
  background: var(--gold);
  color: #654100;
  font-size: 12px;
  font-weight: 1000;
  transform: translate(-50%, -50%);
  box-shadow: 0 10px 22px rgba(244, 164, 61, 0.24);
}

.rush-board p {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.wide-action,
.tiny-action {
  background: var(--gold);
  color: #593900;
  font-weight: 1000;
}

.wide-action {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
}

.tiny-action {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.tiny-action.danger {
  background: #ffe1e7;
  color: #8a2842;
}

.coin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  padding: 15px;
  border-radius: 8px;
  background: var(--gold);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.05);
}

.coin-card strong {
  font-size: 32px;
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.token-grid div,
.quest-item,
.arena-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.token-grid div {
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 11px;
}

.token-grid strong {
  font-size: 16px;
}

.token-copy {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.quest-list,
.arena-list {
  display: grid;
  gap: 9px;
}

.quest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
}

.quest-item > div {
  display: grid;
  gap: 3px;
}

.quest-item.is-complete {
  background: #f1fbf4;
  border-color: rgba(85, 183, 122, 0.35);
}

.arena-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  width: 100%;
  min-height: 62px;
  padding: 11px 12px;
  text-align: left;
}

.arena-name {
  font-weight: 1000;
}

.arena-power {
  color: #6b4300;
}

.arena-reward {
  grid-column: 1 / -1;
}

.event-log {
  display: grid;
  gap: 8px;
  max-height: 220px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.event-log li {
  padding: 10px 11px;
  border: 1px solid rgba(77, 52, 21, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #594932;
  font-size: 13px;
  line-height: 1.5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(33, 24, 12, 0.48);
}

.modal-backdrop.is-open {
  display: grid;
}

.mint-modal {
  position: relative;
  width: min(440px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf7;
  box-shadow: 0 24px 60px rgba(33, 24, 12, 0.32);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fff2d2;
  color: #6b4300;
  font-size: 24px;
  line-height: 1;
}

.mint-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid rgba(244, 164, 61, 0.36);
  border-radius: 8px;
  background: #fff;
}

.mint-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.mint-copy {
  display: grid;
  gap: 4px;
}

.mint-copy strong {
  font-size: 18px;
}

.mint-copy span,
.mint-note,
.mint-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.mint-note {
  margin: 12px 0;
}

.mint-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ghost-mint-action {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #593900;
  font-weight: 1000;
}

.mint-status {
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  24% {
    transform: rotate(-4deg) translateY(-5px);
  }
  48% {
    transform: rotate(4deg) translateY(-9px);
  }
  70% {
    transform: rotate(-2deg) translateY(-4px);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  34% {
    transform: translateY(-14px) scale(1.04);
  }
  66% {
    transform: translateY(6px) scale(0.98);
  }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr 1fr;
  }

  .stage-card {
    grid-column: 1 / -1;
  }

  .dog-stage {
    min-height: 430px;
  }
}

@media (max-width: 740px) {
  .game-shell {
    width: min(100% - 18px, 1380px);
    padding-top: 10px;
  }

  .topbar,
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: stretch;
  }

  h1 {
    font-size: 38px;
  }

  .wallet-card,
  .stage-card,
  .panel {
    border-radius: 8px;
  }

  .dog-stage {
    min-height: 380px;
  }

  .action-grid,
  .token-grid {
    grid-template-columns: 1fr;
  }
}
