/* マイページ / スタッフページ共通（モバイルファースト） */
:root {
  --navy: #0b101c;
  --navy-2: #141c30;
  --navy-3: #1d2842;
  --gold: #d9b45b;
  --gold-light: #f2e28a;
  --cyan: #58c6e2;
  --text: #eef2fa;
  --muted: #93a0ba;
  --red: #e0554f;
  --green: #2ecc71;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(88, 198, 226, 0.08), transparent),
    var(--navy);
  color: var(--text);
  font-family: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', sans-serif;
  min-height: 100vh;   /* フォールバック */
  min-height: 100svh;
  padding-bottom: env(safe-area-inset-bottom);
}

header.app {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--navy-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
}
header.app h1 { font-size: 18px; font-weight: 900; color: var(--gold); letter-spacing: 0.02em; white-space: nowrap; }
header.app h1 .sub { font-size: 12px; color: var(--muted); font-weight: 700; margin-left: 6px; }
@media (max-width: 430px) {
  header.app h1 { font-size: 16px; }
  header.app .badge { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn.small { font-size: 13px; padding: 8px 12px; white-space: nowrap; }
}

main.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.card {
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 {
  font-size: 13px;
  font-weight: 900;
  color: var(--cyan);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.card h2 .h-note { color: var(--muted); font-weight: 700; font-size: 11px; margin-left: 6px; }

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
}
input, select {
  width: 100%;
  min-height: 48px;
  background: var(--navy);
  border: 1px solid var(--navy-3);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* iOSズーム防止 */
  padding: 10px 14px;
}
input:focus, select:focus { outline: none; border-color: var(--cyan); }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 1.5px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--cyan); color: var(--navy); }
.btn.gold { border-color: var(--gold); color: var(--gold); }
.btn.gold.solid { background: var(--gold); color: var(--navy); }
.btn.ghost { border-color: var(--navy-3); color: var(--muted); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.small { width: auto; min-height: 44px; font-size: 14px; padding: 8px 16px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 140px; }

.msg { font-size: 13px; font-weight: 700; min-height: 1.3em; margin-top: 8px; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs .tab {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--navy-3);
  background: var(--navy-2);
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  border-radius: 10px;
  cursor: pointer;
}
.tabs .tab.active { border-color: var(--gold); color: var(--gold); }

/* ---- 残高ヒーロー ---- */
.hero {
  text-align: center;
  padding: 22px 16px;
  background:
    radial-gradient(360px 160px at 50% 0, rgba(217, 180, 91, 0.12), transparent),
    var(--navy-2);
  border: 1px solid rgba(217, 180, 91, 0.35);
}
.hero .who { font-size: 14px; font-weight: 900; color: var(--text); }
.hero .balance { font-size: 44px; font-weight: 900; color: var(--gold); line-height: 1.2; }
.hero .balance .unit { font-size: 18px; color: var(--gold-light); margin-left: 4px; }
.hero .meta { display: flex; justify-content: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.hero .meta span { font-size: 13px; font-weight: 700; color: var(--muted); }
.hero .meta b { color: var(--text); }

/* ---- リスト ---- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--navy);
  border: 1px solid var(--navy-3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}
.list-item .name { font-weight: 900; }
.list-item .sub { font-size: 12px; color: var(--muted); font-weight: 700; }
.list-item .pts { color: var(--cyan); font-weight: 900; white-space: nowrap; }
.list-empty { color: var(--muted); font-size: 13px; font-weight: 700; padding: 6px 2px; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  border-radius: 999px;
  padding: 2px 10px;
  background: var(--navy-3);
  color: var(--muted);
}

/* ---- 連携コード / QR ---- */
.code-display {
  text-align: center;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.35em;
  color: var(--gold-light);
  background: var(--navy);
  border: 1px dashed rgba(217, 180, 91, 0.5);
  border-radius: 12px;
  padding: 16px 8px 16px 20px;
  margin: 10px 0;
  user-select: all;
  -webkit-user-select: all;
}
.hint { font-size: 12px; color: var(--muted); font-weight: 700; line-height: 1.7; }
.hint code {
  background: var(--navy);
  border: 1px solid var(--navy-3);
  border-radius: 6px;
  padding: 1px 7px;
  color: var(--gold-light);
  font-family: inherit;
}

.qr-wrap { text-align: center; margin: 10px 0; }
.qr-wrap img {
  width: min(240px, 70vw);
  max-width: 100%;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}
.token-display {
  text-align: center;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--cyan);
  background: var(--navy);
  border: 1px solid var(--navy-3);
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
  user-select: all;
  -webkit-user-select: all;
  word-break: break-all;
}

/* ---- スタッフ: カメラ ---- */
.scanner {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--navy);
  border: 1px solid var(--navy-3);
}
.scanner video { display: block; width: 100%; max-height: 46svh; object-fit: cover; }
.scanner .scan-frame {
  position: absolute;
  inset: 12%;
  border: 2px solid rgba(217, 180, 91, 0.75);
  border-radius: 14px;
  pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(11, 16, 28, 0.35);
}

/* ---- スタッフ: 交換対象 ---- */
.member-box {
  border: 1px solid rgba(217, 180, 91, 0.4);
  border-radius: 12px;
  padding: 14px;
  background:
    radial-gradient(300px 120px at 50% 0, rgba(217, 180, 91, 0.1), transparent),
    var(--navy);
  margin-bottom: 12px;
  text-align: center;
}
.member-box .who { font-size: 17px; font-weight: 900; }
.member-box .bal { font-size: 30px; font-weight: 900; color: var(--gold); }
.member-box .bal .unit { font-size: 14px; color: var(--gold-light); }

.goods-grid { display: flex; flex-direction: column; gap: 8px; }
.goods-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  background: var(--navy);
  border: 1.5px solid var(--navy-3);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  text-align: left;
}
.goods-item .cost { color: var(--gold); white-space: nowrap; }
.goods-item .stock { font-size: 12px; color: var(--muted); font-weight: 700; }
.goods-item.selected { border-color: var(--gold); background: rgba(217, 180, 91, 0.08); }
.goods-item[disabled] { opacity: 0.4; cursor: not-allowed; }

.confirm-box {
  border: 1px solid var(--navy-3);
  border-radius: 12px;
  padding: 14px;
  background: var(--navy);
  margin-top: 12px;
}
.confirm-box .line { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; padding: 4px 0; }
.confirm-box .line b { color: var(--gold); }

table.simple { width: 100%; border-collapse: collapse; font-size: 13px; }
table.simple th, table.simple td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--navy-3); }
table.simple th { color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

[hidden] { display: none !important; }
