:root {
  --font: 'Noto Sans JP', 'Inter', sans-serif;
  --cyan: #0BBFA0;
  --cyan-light: #2ECFB5;
  --cyan-bg: #E8FBF6;
  --pink: #FF6B9D;
  --orange: #FF9B6B;
  --black: #111;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #eee;
  --gray-300: #ddd;
  --gray-400: #999;
  --gray-500: #777;
  --gray-600: #555;
  --radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--black);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}
.app {
  width: 100%;
  max-width: 430px;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0,0,0,.06);
  position: relative;
}

/* ── Header ── */
.header {
  padding: 20px 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--gray-200);
  background: #fff;
  position: relative;
}
.logo { height: 52px; margin-bottom: 12px; }
.store-name {
  font-size: 18px; font-weight: 800;
  color: var(--cyan); letter-spacing: .06em;
}
.store-sub {
  font-size: 12px; color: var(--gray-400); margin-top: 2px;
}

/* ── Header right: login / user ── */
.header-right {
  position: absolute; top: 16px; right: 14px;
  display: flex; align-items: center; gap: 6px;
}
.header-login-btn {
  font-size: 12px; font-weight: 600; color: var(--cyan);
  background: none; border: 1.5px solid var(--cyan);
  border-radius: 8px; padding: 5px 12px;
  cursor: pointer; font-family: var(--font);
  transition: background .2s, color .2s;
}
.header-login-btn:hover { background: var(--cyan); color: #fff; }

.user-info { display: flex; align-items: center; gap: 6px; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-bg), #e8e0ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--cyan);
}
.logout-btn {
  font-size: 10px; color: var(--gray-400);
  background: none; border: 1px solid var(--gray-300);
  border-radius: 6px; padding: 3px 8px;
  cursor: pointer; font-family: var(--font); transition: color .2s;
}
.logout-btn:hover { color: var(--black); border-color: var(--gray-400); }

/* ── Appeal banner ── */
.banner {
  margin: 14px; padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan-bg) 0%, #f0e8ff 100%);
  display: flex; align-items: center; gap: 12px;
}
.banner-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-light));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.banner-icon svg { width: 24px; height: 24px; fill: #fff; }
.banner-text { font-size: 13px; color: #1a6b5a; font-weight: 600; line-height: 1.55; }
.banner-text small {
  font-weight: 400; font-size: 11px; color: var(--cyan);
  display: block; margin-top: 2px;
}

/* ── Balance bar ── */
.balance-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}
.balance-label { font-size: 12px; color: var(--gray-500); }
.balance-val { font-size: 17px; font-weight: 700; color: var(--cyan); }
.balance-login-hint {
  font-size: 12px; color: var(--gray-400); font-style: italic;
}

/* ── Section ── */
.section-title {
  padding: 18px 20px 8px; font-size: 13px; font-weight: 700;
  color: var(--gray-600); letter-spacing: .04em;
}

/* ── Card grid ── */
.grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 4px 14px 24px;
}
.card {
  background: #fff; border: 2px solid var(--gray-200);
  border-radius: var(--radius); padding: 18px 10px 14px;
  text-align: center; position: relative; cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.card:hover {
  border-color: var(--cyan);
  box-shadow: 0 4px 20px rgba(11,191,160,.12);
}
.card:active { transform: scale(.97); }
.card.selected {
  border-color: var(--cyan); background: var(--cyan-bg);
  box-shadow: 0 4px 20px rgba(11,191,160,.15);
}
.card .badge {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 3px 12px; border-radius: 10px;
  white-space: nowrap; letter-spacing: .02em;
}
.coin-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(145deg, #FFD700, #FFA500);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 4px;
  box-shadow: 0 2px 8px rgba(255,165,0,.25);
}
.coin-icon::after {
  content: 'C'; font-size: 16px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.coin-icon.large {
  width: 40px; height: 40px;
  background: linear-gradient(145deg, #FFD700, #FF8C00);
  box-shadow: 0 3px 12px rgba(255,140,0,.3);
}
.coin-icon.large::after { font-size: 18px; }
.coin-amount {
  font-size: 26px; font-weight: 800; color: var(--black);
  margin: 4px 0 1px; line-height: 1.1;
}
.coin-unit { font-size: 11px; color: var(--gray-500); margin-bottom: 4px; }
.bonus { font-size: 11px; color: var(--cyan); font-weight: 600; margin-bottom: 6px; }
.price-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-light));
  color: #fff; padding: 7px 22px; border-radius: 20px;
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
}

/* ── Purchase button ── */
.purchase-area { padding: 0 14px 10px; display: none; }
.purchase-area.show { display: block; }
.purchase-btn {
  width: 100%; padding: 16px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), #099d85);
  color: #fff; font-size: 16px; font-weight: 700;
  font-family: var(--font); cursor: pointer;
  transition: opacity .2s; letter-spacing: .04em;
}
.purchase-btn:hover { opacity: .9; }
.purchase-btn:active { opacity: .8; }
.purchase-summary {
  text-align: center; font-size: 12px;
  color: var(--gray-500); margin-bottom: 10px;
}
.purchase-summary strong { color: var(--black); font-weight: 700; }

/* ── Footer ── */
.footer {
  padding: 12px 20px 40px; text-align: center;
  border-top: 1px solid var(--gray-200);
}
.payment-methods {
  display: flex; justify-content: center; gap: 6px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.payment-methods span {
  font-size: 11px; color: var(--gray-500);
  background: var(--gray-100); padding: 5px 10px;
  border-radius: 6px; font-weight: 500;
}
.note { font-size: 11px; color: #bbb; line-height: 1.7; }

/* ════════════════════════════════════
   LOGIN MODAL (overlay)
   ════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
  justify-content: center; align-items: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal {
  background: #fff; border-radius: 20px;
  width: 100%; max-width: 390px;
  padding: 32px 28px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  position: relative;
  animation: modalIn .3s ease both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--gray-100);
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  font-size: 18px; color: var(--gray-500);
  transition: background .2s;
}
.modal-close:hover { background: var(--gray-200); }

.modal-logo { height: 40px; display: block; margin: 0 auto 14px; }
.modal-title {
  text-align: center; font-size: 17px; font-weight: 700;
  color: var(--black); margin-bottom: 4px;
}
.modal-desc {
  text-align: center; font-size: 12px; color: var(--gray-400);
  margin-bottom: 24px; line-height: 1.6;
}

.modal-form { display: flex; flex-direction: column; gap: 14px; }

.input-group { position: relative; }
.input-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--gray-600); margin-bottom: 6px;
}
.input-group input {
  width: 100%; padding: 14px 16px 14px 44px;
  border: 2px solid var(--gray-200); border-radius: 12px;
  font-size: 15px; font-family: var(--font);
  color: var(--black); background: #fff;
  transition: border-color .2s; outline: none;
}
.input-group input:focus { border-color: var(--cyan); }
.input-group input::placeholder { color: var(--gray-400); font-size: 13px; }
.input-icon {
  position: absolute; left: 14px; bottom: 13px;
  width: 20px; height: 20px; color: var(--gray-400);
}

.modal-login-btn {
  width: 100%; padding: 15px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), #099d85);
  color: #fff; font-size: 15px; font-weight: 700;
  font-family: var(--font); cursor: pointer;
  transition: opacity .2s; letter-spacing: .04em; margin-top: 4px;
}
.modal-login-btn:hover { opacity: .9; }
.modal-login-btn:active { opacity: .8; }

.modal-error {
  display: none; text-align: center; font-size: 12px;
  color: #e53e3e; background: #fff5f5;
  border: 1px solid #fed7d7; border-radius: 10px; padding: 10px;
}
.modal-error.show { display: block; }

.modal-note {
  text-align: center; font-size: 11px;
  color: var(--gray-400); margin-top: 16px; line-height: 1.6;
}

@media (max-width: 460px) {
  .app { max-width: 100%; box-shadow: none; }
}
