*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --rakuten-red: #bf0000;
  --rakuten-red-dark: #9d0000;
  --bg: #f7f7f8;
  --card: #ffffff;
  --text: #1f1f1f;
  --sub: #6b7280;
  --line: #e5e7eb;
  --soft: #fff5f5;
  --success: #0f766e;
  --danger: #dc2626;
}

html { -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ═══════════════════════════════════════════
   Verify Card — Rakuten Style
   ═══════════════════════════════════════════ */
.verify-card {
  position: relative; z-index: 1;
  width: 400px; max-width: 90vw;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 44px 28px 36px;
  box-shadow: 0 6px 20px rgba(16,24,40,.06);
  text-align: center;
  transition: border-color .5s, box-shadow .5s;
}
.verify-card.success {
  border-color: var(--success);
  box-shadow: 0 0 30px rgba(15,118,110,.12), 0 6px 20px rgba(16,24,40,.06);
}

.shield-icon {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  background: var(--soft);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.shield-icon svg { width: 32px; height: 32px; }
.shield-fill { fill: var(--rakuten-red); transition: fill .4s; }
.success .shield-fill { fill: var(--success); }

.verify-card h1 {
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: 6px; color: var(--text);
}
.verify-card .subtitle {
  font-size: .82rem; color: var(--sub);
  margin-bottom: 26px; line-height: 1.7;
}

.verify-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 36px;
  background: var(--rakuten-red);
  color: #fff;
  border: none; border-radius: 14px;
  font-size: .9rem; font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 10px 24px rgba(191,0,0,.22);
  margin-bottom: 20px;
}
.verify-btn:hover { background: var(--rakuten-red-dark); }
.verify-btn:active { transform: scale(.97); }
.verify-btn svg { width: 18px; height: 18px; }

.verify-progress { display: none; }

.progress-wrap {
  position: relative;
  width: 96px; height: 96px;
  margin: 0 auto 20px;
}
.progress-ring { transform: rotate(-90deg); }
.progress-ring__bg { stroke: var(--line); }
.progress-ring__bar {
  stroke: var(--rakuten-red);
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  transition: stroke .4s;
}
.success .progress-ring__bar { stroke: var(--success); }
.progress-wrap .center-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 700; color: var(--text);
}

.steps { text-align: left; margin-bottom: 16px; padding: 0 4px; }
.step {
  display: flex; align-items: center; gap: 10px;
  font-size: .78rem; color: var(--sub);
  padding: 5px 0;
  opacity: .4;
  transition: all .3s ease;
}
.step.active { opacity: 1; color: var(--text); }
.step.done   { opacity: 1; color: var(--success); }
.step-dot {
  width: 16px; height: 16px; flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  transition: all .3s ease;
}
.step.active .step-dot { border-color: var(--rakuten-red); background: var(--soft); }
.step.done .step-dot   { border-color: var(--success); background: var(--success); }
.step.done .step-dot::after { content: '✓'; font-size: .6rem; color: #fff; font-weight: 700; }

.result-msg {
  display: none;
  font-size: .9rem; font-weight: 600; color: var(--success);
  margin-top: 4px;
}
.success .result-msg { display: block; }

/* ═══════════════════════════════════════════
   Blocked Page
   ═══════════════════════════════════════════ */
#blocked-page {
  display: none;
  position: relative; z-index: 1;
  width: 400px; max-width: 90vw;
  background: var(--card);
  border: 1px solid rgba(220,38,38,.3);
  border-radius: 16px;
  padding: 44px 28px 36px;
  box-shadow: 0 0 30px rgba(220,38,38,.08), 0 6px 20px rgba(16,24,40,.06);
  text-align: center;
  animation: fadeUp .5s ease-out;
}
#blocked-page .blocked-icon {
  width: 56px; height: 56px; margin: 0 auto 18px;
  background: #fef2f2;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
#blocked-page h1 { font-size: 1.15rem; color: var(--danger); margin-bottom: 8px; font-weight: 700; }
#blocked-page p { font-size: .82rem; color: var(--sub); line-height: 1.7; }
#blocked-page .blocked-detail {
  margin-top: 18px; padding: 12px 16px; border-radius: 12px;
  background: #fef2f2; font-size: .72rem; color: var(--danger);
  border: 1px solid rgba(220,38,38,.15);
}

/* ═══════════════════════════════════════════
   Page Content (Rakuten Exchange UI)
   ═══════════════════════════════════════════ */
#page-content {
  display: none;
  position: relative; z-index: 1;
}
#page-content.show {
  display: block;
  animation: fadeUp .5s ease-out;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── App Shell ── */
.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

.topbar {
  background: var(--rakuten-red);
  color: #fff;
  padding: 16px 18px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.topbar .brand { font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.topbar .sub { margin-top: 4px; font-size: 12px; color: rgba(255,255,255,.86); }

.wrap { padding: 14px; }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(16,24,40,.06);
  border: 1px solid rgba(0,0,0,.04);
  margin-bottom: 14px;
}

/* ── Balance ── */
.balance {
  background: linear-gradient(135deg, #d70000 0%, #bf0000 100%);
  color: #fff;
  padding: 18px;
}
.balance .label { font-size: 13px; opacity: .92; }
.balance .points {
  margin-top: 10px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .5px;
}
.balance .points span { font-size: 16px; font-weight: 600; margin-left: 4px; }
.meta {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  gap: 10px;
  font-size: 12px;
  color: rgba(255,255,255,.92);
}

/* ── Section Title ── */
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* ── Exchange Grid ── */
.exchange-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.exchange-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  cursor: pointer;
  transition: .18s ease;
}
.exchange-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.05);
  border-color: #f2b1b1;
}
.exchange-item.active {
  border: 2px solid var(--rakuten-red);
  background: var(--soft);
  padding: 13px;
}
.exchange-item .icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: #fff0f0;
  color: var(--rakuten-red);
  display: inline-flex;
  align-items: center; justify-content: center;
  font-weight: 700;
  margin-bottom: 10px;
}
.exchange-item .title { font-size: 14px; font-weight: 700; }
.exchange-item .desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--sub);
}

/* ── Rate Box ── */
.rate-box {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}
.rate-row:last-child { margin-bottom: 0; }
.big {
  font-size: 18px;
  font-weight: 800;
  color: var(--rakuten-red);
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--sub);
  line-height: 1.5;
}

/* ── Input ── */
.input-box { margin-top: 14px; }
.label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}
.input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.input-wrap input {
  flex: 1;
  border: none;
  padding: 15px 14px;
  font-size: 18px;
  outline: none;
  background: transparent;
}
.input-wrap .unit {
  padding: 0 14px;
  font-size: 14px;
  color: var(--sub);
  border-left: 1px solid var(--line);
  height: 50px;
  display: flex;
  align-items: center;
  background: #fafafa;
}

/* ── Quick Actions ── */
.quick-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.chip {
  border: 1px solid #f2c2c2;
  color: var(--rakuten-red);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
}

/* ── Summary ── */
.summary {
  background: #fffafa;
  border: 1px dashed #f0b5b5;
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
}
.summary .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}
.summary .row:last-child {
  margin-bottom: 0;
  padding-top: 10px;
  border-top: 1px solid #f3d6d6;
  font-weight: 800;
}

/* ── Notice ── */
.notice {
  font-size: 12px;
  color: var(--sub);
  line-height: 1.65;
  padding-left: 18px;
  margin: 0;
}

/* ── Sticky Actions ── */
.actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, rgba(247,247,248,1), rgba(247,247,248,.92));
  padding: 12px 14px 18px;
}
.btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}
.btn-primary {
  background: var(--rakuten-red);
  color: #fff;
  box-shadow: 0 10px 24px rgba(191,0,0,.22);
}
.btn-primary:hover { background: var(--rakuten-red-dark); }

.foot-note {
  text-align: center;
  font-size: 11px;
  color: var(--sub);
  margin-top: 10px;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #ecfdf5;
  color: var(--success);
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════
   Responsive — Small phones
   ═══════════════════════════════════════════ */
@media (max-width: 380px) {
  .balance .points { font-size: 28px; }
  .exchange-item .icon { width: 36px; height: 36px; }
  .exchange-item .title { font-size: 13px; }
  .exchange-item .desc { font-size: 11px; }
  .verify-card { padding: 36px 20px 28px; }
  .verify-card h1 { font-size: 1.05rem; }
  .verify-btn { padding: 12px 28px; font-size: .85rem; }
  #blocked-page { padding: 36px 20px 28px; }
}
