:root {
  --purple: #6C2EB5;
  --orange: #F5821F;
  --orange-dark: #E8461D;
  --text-gray: #6b6b6b;
  --bg: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  display: flex;
  align-items: center;
  padding: 16px 20px;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #1a1a1a;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 32px 100px;
  text-align: center;
  overflow: hidden;
}

.qr-frame {
  position: relative;
  width: min(260px, 70vw, 40vh);
  height: min(260px, 70vw, 40vh);
  border: 6px solid var(--orange);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 24px;
  background: #fff;
  overflow: visible;
}

.plus-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--orange);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plus-btn:hover { background: var(--orange-dark); }
.plus-btn[hidden] { display: none; }

.qr-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 14px;
}

.qr-canvas[hidden] {
  display: none;
}

.qr-canvas img,
.qr-canvas canvas {
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
}

.member-bar {
  position: absolute;
  left: 50%;
  bottom: -16px;
  transform: translateX(-50%);
  background: var(--orange-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: 0;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title {
  font-size: 22px;
  font-weight: 800;
  margin: 8px 0 12px;
  letter-spacing: 0.5px;
}

.desc {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.5;
  margin: 6px 0;
  max-width: 320px;
}

.bottom-btn {
  position: fixed;
  left: 50%;
  bottom: calc(32px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: 70%;
  border: none;
  border-radius: 0;
  background: var(--purple);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 16px 0;
  cursor: pointer;
}

.bottom-btn:hover { background: #5a2596; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 800;
}

.modal label {
  display: block;
  font-size: 13px;
  color: var(--text-gray);
  margin-bottom: 6px;
}

.modal input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 20px;
}

.modal input:focus {
  outline: none;
  border-color: var(--orange);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  padding: 12px 0;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.modal-btn.cancel {
  background: #f0f0f0;
  color: #333;
}

.modal-btn.confirm {
  background: var(--purple);
  color: #fff;
}
