:root {
  --bg: #0E0E16;
  --surface: #1B1A2E;
  --surface-2: #252340;
  --gold: #F5C451;
  --gold-bright: #FFD65C;
  --red: #FF4D5E;
  --text: #F7F5F0;
  --text-muted: #9C99B0;
  --border: rgba(245, 196, 81, 0.25);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 20px;
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
.page { min-height: 100vh; padding-bottom: 32px; }

.hero {
  text-align: center;
  padding: 32px 20px 24px;
  background: radial-gradient(circle at 50% 0%, rgba(245, 196, 81, 0.12), transparent 60%);
}
.hero-mascot {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: 0 8px 30px rgba(245, 196, 81, 0.15);
  background: var(--surface);
}
.hero-title {
  font-size: 26px; font-weight: 900;
  margin: 14px 0 6px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--gold-bright), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { font-size: 14px; color: var(--text-muted); margin: 0; }

.main { max-width: 520px; margin: 0 auto; padding: 0 16px; }
.section { margin-bottom: 28px; }
.section-title {
  font-size: 15px; font-weight: 700; color: var(--gold);
  margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: '';
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red);
}

.sticker-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.sticker-thumb {
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.sticker-thumb:hover { transform: translateY(-2px); }
.sticker-thumb.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 196, 81, 0.12), 0 10px 25px rgba(0,0,0,0.25);
}
.sticker-thumb img { width: 76px; height: 76px; object-fit: contain; display: block; margin: 0 auto; }
.sticker-label { font-size: 12px; color: var(--text-muted); display: block; margin-top: 6px; }

.caption-input-wrap { position: relative; }
.caption-input {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  color: var(--text); font-size: 16px; font-family: inherit;
  padding: 14px; resize: none; outline: none;
}
.caption-input:focus { border-color: var(--gold); }
.caption-count { position: absolute; right: 10px; bottom: 10px; font-size: 11px; color: var(--text-muted); }

.quick-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick-tag {
  background: rgba(245, 196, 81, 0.10); border: 1px solid var(--border); color: var(--text);
  padding: 8px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; transition: all .15s;
}
.quick-tag:hover { background: rgba(245, 196, 81, 0.20); border-color: var(--gold); }

.preview-frame { display: flex; justify-content: center; }
.card-inner {
  width: 100%; max-width: 360px; aspect-ratio: 3/4;
  background: linear-gradient(180deg, #1B1A2E 0%, #141320 100%);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  position: relative;
}
.card-inner::before {
  content: '';
  position: absolute; top: -60%; left: -20%; width: 140%; height: 100%;
  background: radial-gradient(circle, rgba(245, 196, 81, 0.08), transparent 60%);
  pointer-events: none;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px 10px; z-index: 1;
}
.card-badge { font-size: 13px; font-weight: 700; color: var(--gold); }
.card-tag { font-size: 11px; color: var(--text-muted); background: rgba(255,255,255,0.06); padding: 4px 8px; border-radius: 999px; }
.card-media { flex: 1; display: flex; align-items: center; justify-content: center; z-index: 1; }
.card-sticker { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 12px 24px rgba(0,0,0,0.25)); }
.card-caption { padding: 0 22px 18px; z-index: 1; }
.card-text {
  font-size: 22px; font-weight: 900; line-height: 1.35;
  text-align: center; color: var(--text); margin: 0;
  word-break: break-word;
}
.card-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 18px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-muted);
  z-index: 1;
}
.card-foot-left { display: flex; flex-direction: column; gap: 3px; }
.card-qr {
  width: 64px; height: 64px; flex: 0 0 64px;
  background: #fff; border-radius: 8px; padding: 4px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.card-qr img, .card-qr canvas { display: block; width: 56px !important; height: 56px !important; }

.actions { display: flex; gap: 10px; }
.btn {
  flex: 1; border: none; border-radius: 14px; padding: 15px; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: transform .1s, opacity .1s; font-family: inherit;
}
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--red)); color: #0E0E16;
}
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-copy { background: transparent; border: 1px solid var(--gold); color: var(--gold); margin-top: 12px; width: 100%; }
.btn:active { transform: scale(0.98); }

.result-block { margin-top: 18px; text-align: center; }
.result-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.result-img {
  width: 100%; max-width: 300px; border-radius: 14px; border: 1px solid var(--border);
  box-shadow: var(--shadow); display: block; margin: 0 auto;
}
.copy-feedback { color: var(--gold); font-size: 13px; margin-top: 8px; }

.gallery { background: rgba(255,255,255,0.02); border-radius: var(--radius); padding: 18px; }
.gallery-hint { font-size: 12px; color: var(--text-muted); margin: -8px 0 14px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gallery-item { text-align: center; }
.gallery-item img { width: 88px; height: 88px; object-fit: contain; display: block; margin: 0 auto; background: var(--surface); border-radius: 14px; padding: 6px; }
.gallery-item span { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }

.footer { text-align: center; padding: 20px; font-size: 12px; color: var(--text-muted); }

@media (max-width: 400px) {
  .hero-title { font-size: 22px; }
  .card-sticker { width: 72%; height: 72%; }
  .card-text { font-size: 20px; }
}
