/* ===== 色と文字の設定（ここを変えると全体の見た目が変わる） ===== */
:root {
  --sea: #0e4f5c;        /* 久高の海の濃い青緑：メインの色 */
  --sea-light: #e3f1f1;  /* 薄い青緑：ボタンの背景など */
  --sand: #f7f4ee;       /* 砂浜の色：画面の背景 */
  --ink: #1d2b2e;        /* 文字の色 */
  --muted: #5f6f72;      /* 薄い文字の色 */
  --line: #d9e1e1;       /* 線の色 */
  --ok: #2f7a3d;         /* 成功の色 */
  --font: "Hiragino Sans", "Noto Sans JP", "Noto Sans TC", "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }
/* hidden が付いた要素は必ず隠す（display の指定より優先） */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--sand);
  line-height: 1.6;
  /* 下のタブに隠れないよう余白を取る */
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

/* ===== 上部のバー ===== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: var(--sea); color: #fff;
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: 0.02em; }
.lang select {
  font: inherit; font-size: 14px; color: #fff; background: transparent;
  border: 1px solid rgba(255,255,255,0.5); border-radius: 8px; padding: 4px 8px;
}
.lang select option { color: var(--ink); }

/* ===== 各画面 ===== */
main { max-width: 480px; margin: 0 auto; padding: 20px 16px; }
.screen { display: flex; flex-direction: column; gap: 14px; }
.note { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.note.ok { color: var(--ok); font-weight: 700; }

/* 会員証 */
.member-name { margin: 0; text-align: center; font-size: 18px; font-weight: 700; }
.qr-box {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; text-align: center;
}
.qr { display: flex; justify-content: center; }
.qr img, .qr svg { width: 220px; height: 220px; }
.qr-id { margin: 8px 0 0; font-size: 12px; color: var(--muted); word-break: break-all; }

.pay-box {
  background: #fff; border: 2px solid var(--sea); border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.pay-title { margin: 0; font-weight: 700; color: var(--sea); }
#pay-barcode { max-width: 100%; height: auto; }
.pay-number { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 18px; letter-spacing: 0.08em; }

/* ボタン */
.btn {
  display: block; width: 100%; text-align: center; text-decoration: none;
  font: inherit; font-size: 16px; font-weight: 700;
  padding: 14px 16px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--sea); color: var(--sea); background: #fff;
}
.btn.primary { background: var(--sea); color: #fff; }
.btn:focus-visible, .tabbar a:focus-visible, select:focus-visible { outline: 3px solid #f2b84b; outline-offset: 2px; }

/* 残高 */
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.stat-label { margin: 0; font-size: 13px; color: var(--muted); }
.stat-value { margin: 0; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-value.small { font-size: 24px; }
.unit { font-size: 16px; margin-left: 4px; }
.legal { margin: 8px 0 0; text-align: center; font-size: 13px; }
.legal a { color: var(--muted); }

/* ショップ */
.products { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.products li {
  display: flex; align-items: center; gap: 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-weight: 700;
}
.thumb { width: 48px; height: 48px; border-radius: 10px; background: var(--sea-light); flex-shrink: 0; }

/* お知らせ・クーポン */
.section-title { margin: 8px 0 0; font-size: 14px; color: var(--muted); font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.list li { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: none; }
.list small { display: block; color: var(--muted); }
.coupons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.coupons li {
  background: var(--sea-light); border: 1.5px dashed var(--sea); border-radius: 12px; padding: 12px 16px;
}
.coupons strong { display: block; font-size: 18px; color: var(--sea); }
.coupons small { color: var(--muted); }

/* ===== 下部のタブ ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
  text-align: center; padding: 14px 4px; font-size: 13px;
  color: var(--muted); text-decoration: none;
}
.tabbar a[aria-current="page"] { color: var(--sea); font-weight: 700; box-shadow: inset 0 3px 0 var(--sea); }

/* ===== オフラインのお知らせ ===== */
.offline-banner {
  margin: 0; padding: 10px 16px; text-align: center; font-size: 13px; font-weight: 700;
  background: #fbeedd; color: #8a4a0b; border-bottom: 1px solid #f0d6b5;
}
/* ===== ホーム画面への追加の案内 ===== */
.install-box {
  background: var(--sea-light); border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.install-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--sea); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
