:root {
  color-scheme: dark;
  font-family: Impact, "Arial Black", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  background: #0a0f1f;
  color: #f8fafc;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 18% 10%, rgba(239, 68, 68, 0.26), transparent 26rem),
    radial-gradient(circle at 82% 18%, rgba(14, 165, 233, 0.3), transparent 25rem),
    linear-gradient(135deg, #080c12 0%, #172033 52%, #08111f 100%);
  overflow-x: hidden;
}

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

.shell {
  width: min(1120px, calc(100vw - 32px));
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 18px 0;
}

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

.brand {
  margin: 0 0 4px;
  color: #fbbf24;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 64px);
  line-height: 0.95;
  color: #f8fafc;
  text-shadow: 0 3px 0 #111827, 0 0 28px rgba(59, 130, 246, 0.4);
}

.coffee,
.primary {
  border-radius: 999px;
  background: linear-gradient(135deg, #facc15, #f97316);
  color: #111827;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(250, 204, 21, 0.25);
}

.coffee {
  min-height: 44px;
  padding: 0 18px;
  white-space: nowrap;
}

.primary {
  min-height: 50px;
  padding: 0 28px;
}

.stage {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background: #102337;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  touch-action: none;
}

.overlay,
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}

.overlay {
  position: absolute;
  background: rgba(2, 6, 23, 0.56);
}

.hidden {
  display: none;
}

.panel,
.modalPanel {
  width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(9, 14, 25, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.panel {
  display: grid;
  gap: 14px;
  padding: 26px;
  text-align: center;
}

.panel p {
  color: #cbd5e1;
  line-height: 1.7;
}

.danger {
  color: #fca5a5;
}

footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: #cbd5e1;
  font-size: 14px;
}

.modal {
  z-index: 20;
}

.modalPanel {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 22px;
  text-align: center;
  width: min(760px, 100%);
}

.payGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.payGrid figure {
  display: grid;
  gap: 8px;
  margin: 0;
}

.payGrid img {
  width: 100%;
  max-height: 56dvh;
  object-fit: contain;
  justify-self: center;
  border-radius: 8px;
  background: #fff;
}

.payGrid figcaption {
  color: #e2e8f0;
  font-size: 13px;
}

.close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 24px;
  line-height: 1;
}

.fineprint {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .shell {
    width: 100vw;
    padding: 10px;
    gap: 10px;
  }

  .topbar {
    align-items: center;
  }

  h1 {
    font-size: 34px;
  }

  .coffee {
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  canvas {
    min-height: calc(100dvh - 142px);
  }

  footer {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .payGrid img {
    max-height: 42dvh;
  }
}
