/* ============================================================
   客が見る画面の共通スタイル。LP と同じ色・書体・すりガラス
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper:  #fefefc;
  --ink:    #1c1a1b;
  --muted:  #6b6466;
  --faint:  #a29b9e;
  --line:   rgba(28, 26, 27, 0.1);
  --red:    #9f1111;
  --hot:    #e0352b;
  --plum:   #663661;
  --lilac:  #d9b8dc;
  --sky:    #bcdce8;
  --ok:     #2e6b3a;
  --glass:        rgba(255, 255, 255, 0.6);
  --glass-edge:   rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 24px 60px -28px rgba(60, 30, 55, 0.32);
  --radius: 24px;
  --mincho: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --gothic: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Yu Gothic", "Noto Sans JP", sans-serif;
  --ease:   cubic-bezier(0.22, 0.61, 0.36, 1);
}

html { height: 100%; }
body {
  min-height: 100%;
  font-family: var(--gothic);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* 背景：色のにじみ */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--paper); }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.blob.b1 { width: 60vmax; height: 60vmax; left: -22vmax; top: -18vmax; background: var(--sky); }
.blob.b2 { width: 50vmax; height: 50vmax; right: -18vmax; top: 24vh; background: var(--lilac); }
.blob.b3 { width: 40vmax; height: 40vmax; left: 8vw; bottom: -22vmax; background: #a7709f; opacity: 0.26; }

.page { width: 100%; max-width: 480px; margin: 0 auto; padding: 14px 16px 48px; }

/* ヘッダ */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 8px; border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-edge); box-shadow: 0 10px 30px -18px rgba(60, 30, 55, 0.35);
  font-family: var(--mincho); font-weight: 800; font-size: 13px; text-decoration: none; min-width: 0;
}
.brand img { width: 26px; height: 26px; flex-shrink: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* すりガラスのカード */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--glass-edge); border-radius: var(--radius); box-shadow: var(--glass-shadow);
}
.card { padding: 22px 20px; margin-top: 14px; }
.card h2 { font-family: var(--mincho); font-weight: 800; font-size: 20px; line-height: 1.3; }
.sub { font-size: 13px; color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.2em; color: var(--red); }

/* 墨の札（残高など） */
.ink {
  position: relative; overflow: hidden; padding: 24px 22px; margin-top: 14px;
  border-radius: var(--radius); background: var(--ink); color: #f4efe6; box-shadow: var(--glass-shadow);
}
.ink::before {
  content: ""; position: absolute; right: -30%; top: -40%; width: 90%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 53, 43, 0.45), transparent 65%); filter: blur(10px);
}
.ink > * { position: relative; }

/* 入力とボタン */
.input {
  width: 100%; padding: 14px 18px; border: 1px solid var(--glass-edge); border-radius: 999px;
  background: rgba(255, 255, 255, 0.85); outline: none; font-size: 17px; transition: box-shadow 0.3s;
}
.input:focus { box-shadow: 0 0 0 3px rgba(159, 17, 17, 0.2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border: 1px solid var(--glass-edge); border-radius: 999px;
  background: rgba(255, 255, 255, 0.75); color: var(--ink); cursor: pointer;
  font-family: var(--mincho); font-weight: 800; font-size: 15px; letter-spacing: 0.08em; text-decoration: none;
  box-shadow: var(--glass-shadow); transition: transform 0.3s var(--ease), background 0.3s, opacity 0.3s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.solid { background: var(--red); color: #fff; border-color: transparent; box-shadow: 0 18px 40px -18px rgba(159, 17, 17, 0.7); }
.btn.solid:hover { background: #b8191a; }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn.block { width: 100%; }
.btn.small { padding: 9px 14px; font-size: 13px; }
.msg { min-height: 18px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.msg.err { color: var(--red); }
.msg.ok { color: var(--ok); }

/* 見出しの書体 */
.h1 { font-family: var(--mincho); font-weight: 800; font-size: clamp(26px, 7vw, 34px); line-height: 1.25; text-wrap: balance; }

/* 札（ランクなど） */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  background: rgba(28, 26, 27, 0.06); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted);
}
.chip.live { background: rgba(159, 17, 17, 0.1); color: var(--red); }
.chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--hot); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* タブ */
.tabs { display: flex; gap: 6px; margin-top: 16px; }
.tabs button {
  flex: 1; padding: 10px 6px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* 一覧 */
.list { list-style: none; }
.list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list li:last-child { border-bottom: none; }
.list .t { font-size: 14px; font-weight: 600; }
.list .s { font-size: 12px; color: var(--faint); grid-column: 1; }
.list .amt { font-family: var(--mincho); font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; grid-row: span 2; text-align: right; }
.list .amt.minus { color: var(--muted); }
.list .amt.plus { color: var(--ok); }
.list .amt.bribe { color: var(--red); }
.empty { padding: 22px 0; text-align: center; color: var(--muted); font-size: 14px; }

/* 印（相・位） */
.seal {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--red); border-radius: 4px;
  color: var(--red); font-family: var(--mincho); font-weight: 800; font-size: 18px; transform: rotate(-6deg); flex-shrink: 0;
}
.seal.kaizan { border-color: var(--hot); color: var(--hot); background: var(--ink); font-size: 13px; line-height: 1.1; text-align: center; }
.seal.mu { border-color: var(--faint); color: var(--faint); }

/* 全画面のシート（QR・カード） */
.sheet {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px; background: rgba(254, 254, 252, 0.96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.sheet .close { position: absolute; top: 14px; right: 14px; }
.qrbox { width: min(78vw, 320px); padding: 18px; background: #fff; border-radius: 20px; box-shadow: var(--glass-shadow); }
.qrbox svg { width: 100%; height: auto; display: block; }
.code { font-family: var(--mincho); font-weight: 800; font-size: 26px; letter-spacing: 0.22em; }

/* 浮かび上がり */
.rise { animation: rise 0.7s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
