@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700;900&display=swap');

:root {
  color-scheme: dark;
  --ink: #f4f7f3;
  --muted: #9ca9a2;
  --deep: #111714;
  --panel: #f8faf7;
  --panel-ink: #152019;
  --accent: #16bd6a;
  --accent-dark: #0e8b4a;
  --accent-soft: #d9f5e6;
  --friend: #7d6af5;
  --friend-soft: #e9e5ff;
  --line: rgba(255, 255, 255, 0.11);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--deep);
  color: var(--ink);
  font-family: 'Noto Sans SC', 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

.signboard {
  width: min(100%, 540px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 92% 4%, rgba(22, 189, 106, 0.16), transparent 32%),
    var(--deep);
}

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

.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #082e1b;
  font: 800 21px/1 'Manrope', sans-serif;
  box-shadow: 0 8px 20px rgba(22, 189, 106, 0.2);
}

.eyebrow, .mode-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font: 500 10px/1.2 'DM Mono', monospace;
  letter-spacing: 0.12em;
}

h1 { margin: 0; font-size: 16px; line-height: 1.3; letter-spacing: 0; }

.live-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #c4cec8;
  font-size: 11px;
  white-space: nowrap;
}

.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(22,189,106,.13); }

.switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}

.mode-button {
  min-height: 49px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr 1fr;
  column-gap: 9px;
  align-items: center;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  color: #adb8b0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.mode-button:active { transform: scale(.98); }
.mode-button.is-active { color: var(--panel-ink); background: var(--accent); }
.mode-button[data-mode-target="friend"].is-active { color: #17122d; background: var(--friend); }

.mode-icon {
  grid-row: 1 / span 2;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 8px;
  font: 700 16px/1 'Manrope', sans-serif;
}

.mode-button span:not(.mode-icon) { font-size: 14px; font-weight: 700; line-height: 1.2; }
.mode-button small { font-size: 10px; opacity: .7; line-height: 1.2; }

.display-panel {
  flex: 1;
  min-height: 0;
  padding: clamp(18px, 4vw, 28px);
  border-radius: 22px;
  color: var(--panel-ink);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0,0,0,.23);
  position: relative;
  overflow: hidden;
}

.display-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--accent);
}

.mode-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mode-heading h2 { margin: 5px 0 3px; font-size: clamp(22px, 6vw, 30px); line-height: 1.15; letter-spacing: 0; }
.mode-subtitle { margin: 0; color: #728077; font-size: 12px; line-height: 1.5; }

.mode-badge {
  flex: none;
  margin-top: 1px;
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
}

.qr-frame {
  width: min(100%, 370px);
  aspect-ratio: 1;
  margin: clamp(20px, 5vw, 34px) auto 24px;
  padding: clamp(13px, 3vw, 18px);
  border: 1px solid #e5ebe6;
  border-radius: 15px;
  background: #fff;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px rgba(25, 53, 38, .09);
}

.qr-glow { position: absolute; inset: 10%; border-radius: 50%; background: rgba(22,189,106,.07); filter: blur(32px); pointer-events: none; }
.qr-window { position: absolute; z-index: 1; inset: clamp(13px, 3vw, 18px); overflow: hidden; border-radius: 7px; background: #fff; }
.qr-image { position: absolute; max-width: none; height: auto; image-rendering: auto; }

/* These values expose the QR core from each original poster without editing the source image. */
.signboard[data-mode="payment"] .qr-image { width: 179%; left: -39.4%; top: -54.5%; }
.signboard[data-mode="friend"] .qr-image { width: 134%; left: -16.9%; top: -60.9%; }

.scan-corner { width: 17px; height: 17px; position: absolute; z-index: 2; border-color: var(--accent); border-style: solid; }
.corner-tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; border-radius: 5px 0 0; }
.corner-tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; border-radius: 0 5px 0 0; }
.corner-bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; border-radius: 0 0 0 5px; }
.corner-br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; border-radius: 0 0 5px; }

.identity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 13px;
  background: #eef3ef;
}

.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #1d2b23; color: #f0fff5; font: 700 15px/1 'Manrope', sans-serif; }
.identity-copy { display: grid; gap: 1px; min-width: 0; }
.identity-label { color: #7c8880; font-size: 10px; line-height: 1.2; }
.identity-copy strong { font: 700 15px/1.3 'DM Mono', monospace; letter-spacing: .01em; }

.hint-line { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 16px; color: #819087; font-size: 11px; }
.hint-icon { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; color: var(--accent-dark); background: var(--accent-soft); font-size: 11px; font-weight: 900; }

.bottom-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 3px; }
.footer-label { color: #9ca9a2; font-size: 11px; }
.quick-switch { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: #e4ebe6; background: rgba(255,255,255,.06); font-size: 11px; cursor: pointer; }
.quick-switch span:last-child { font-size: 17px; line-height: 10px; }
.quick-switch:active { transform: scale(.98); }

.signboard[data-mode="friend"] .display-panel::before { background: var(--friend); }
.signboard[data-mode="friend"] .mode-badge { color: #5b4bc8; background: var(--friend-soft); }
.signboard[data-mode="friend"] .qr-glow { background: rgba(125,106,245,.1); }
.signboard[data-mode="friend"] .scan-corner { border-color: var(--friend); }
.signboard[data-mode="friend"] .hint-icon { color: #5b4bc8; background: var(--friend-soft); }
.signboard[data-mode="friend"] .quick-switch { color: #ece9ff; }

@media (min-width: 600px) {
  body { display: grid; place-items: center; padding: 24px; }
  .signboard { min-height: min(900px, calc(100svh - 48px)); border: 1px solid rgba(255,255,255,.06); border-radius: 28px; }
}

@media (max-height: 690px) and (max-width: 599px) {
  .signboard { gap: 12px; }
  .display-panel { padding: 16px; }
  .qr-frame { margin-top: 14px; margin-bottom: 14px; }
  .hint-line { margin-top: 10px; }
}
