:root {
  --bg: #0d0d0f;
  --card: #17171b;
  --card2: #1f1f25;
  --line: #2b2b33;
  --text: #f4f4f6;
  --sub: #a0a0ab;
  --accent: #ff5a1f;
  --accent2: #ff8a3d;
  --ok: #9be34a;
  --warn: #ffc53d;
  --ng: #ff5470;
  --radius: 16px;
  --font: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  --num: "Oswald", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: var(--accent2); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* layout */
.app { max-width: 520px; margin: 0 auto; padding: 16px 16px 96px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 14px; }
.brand { font-family: var(--num); font-weight: 700; letter-spacing: .06em; font-size: 18px; }
.brand b { color: var(--accent); }
.hello { color: var(--sub); font-size: 13px; }
h2 { font-size: 18px; margin: 22px 0 10px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
.muted { color: var(--sub); font-size: 13px; }
.small { font-size: 12px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.hero { background: linear-gradient(135deg, #ff5a1f 0%, #c9200e 100%); border: 0; color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero .label { font-size: 13px; opacity: .9; }
.hero .big { font-family: var(--num); font-size: 48px; font-weight: 700; line-height: 1.1; margin: 4px 0; }
.hero .big small { font-size: 18px; margin-left: 4px; }
.hero .yen { font-size: 13px; opacity: .9; }

.progress { height: 10px; background: var(--card2); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .4s; }
.dots { display: flex; gap: 8px; margin: 10px 0; }
.dots span { flex: 1; height: 36px; border-radius: 10px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--sub); }
.dots span.on { background: var(--ok); color: #0d0d0f; font-weight: 700; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 700; background: var(--accent); color: #fff; cursor: pointer; width: 100%; font-size: 15px; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn.sm { width: auto; padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.ng { background: var(--ng); }
.btn.ok { background: var(--ok); color: #111; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
label { display: block; font-size: 13px; color: var(--sub); margin: 12px 0 6px; }
input, select, textarea { width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 16px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.check input { width: 20px; height: 20px; }

/* tabs (category chips) */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }

/* item cards */
.items { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.item .img { aspect-ratio: 4/3; background: var(--card2); display: flex; align-items: center; justify-content: center; color: var(--sub); }
.item .img img { width: 100%; height: 100%; object-fit: cover; }
.item .img svg { width: 36px; height: 36px; opacity: .7; }
.item .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.item .name { font-size: 13px; line-height: 1.4; font-weight: 700; }
.item .price { font-family: var(--num); font-size: 18px; }
.item .price small { font-size: 12px; color: var(--sub); font-family: var(--font); }
.tag { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 99px; font-weight: 700; }
.tag.ok { background: rgba(155,227,74,.15); color: var(--ok); }
.tag.part { background: rgba(255,197,61,.15); color: var(--warn); }
.tag.ng { background: rgba(255,84,112,.15); color: var(--ng); }
.tag.gray { background: var(--card2); color: var(--sub); }
.tag.acc { background: rgba(255,90,31,.15); color: var(--accent2); }

/* list */
.list { display: flex; flex-direction: column; }
.li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .t { font-size: 14px; }
.li .s { font-size: 12px; color: var(--sub); margin-top: 2px; }
.plus { color: var(--ok); font-family: var(--num); font-size: 17px; white-space: nowrap; }
.minus { color: var(--ng); font-family: var(--num); font-size: 17px; white-space: nowrap; }

/* photos */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos .ph { position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; background: var(--card2); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: rgba(0,0,0,.65); padding: 2px 6px; border-radius: 6px; }
.photos .ph.rej img { opacity: .3; }
.upload { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer; }
.upload.done { border-color: var(--ok); }
.preview { width: 100%; border-radius: 12px; margin-top: 10px; max-height: 340px; object-fit: cover; }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(13,13,15,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.nav .in { display: flex; width: 100%; max-width: 520px; }
.nav button { flex: 1; background: none; border: 0; padding: 10px 0 9px; color: var(--sub); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; cursor: pointer; }
.nav button svg { width: 22px; height: 22px; }
.nav button.on { color: var(--accent); }

/* sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 12px; }
.calc { background: var(--card2); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.calc .li { padding: 6px 0; border-bottom: 0; }
.calc .tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; }

/* toast */
.toast { width: max-content; position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 50; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.err { background: var(--ng); color: #fff; }

/* login */
.login { max-width: 380px; margin: 0 auto; padding: 12vh 20px 40px; }
.login .logo { font-family: var(--num); font-size: 34px; font-weight: 700; letter-spacing: .04em; line-height: 1.1; }
.login .logo b { color: var(--accent); display: block; }
.login p { color: var(--sub); font-size: 14px; }

.empty { text-align: center; color: var(--sub); padding: 30px 0; font-size: 14px; }

/* ---------- admin ---------- */
.admin { max-width: 1100px; margin: 0 auto; padding: 16px 16px 60px; }
.admin .chips { position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 5; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; margin-left: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.stat .n { font-family: var(--num); font-size: 30px; }
.tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--sub); font-weight: 400; font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl input, .tbl select { padding: 8px; font-size: 14px; min-width: 70px; }
.tbl .num { text-align: right; font-family: var(--num); white-space: nowrap; }
.req { display: grid; grid-template-columns: 1fr; gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.gymgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.gymgrid .ph { position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; background: var(--card2); cursor: pointer; }
.gymgrid .ph img { width: 100%; height: 100%; object-fit: cover; }
.gymgrid .ph span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: rgba(0,0,0,.7); padding: 2px 6px; border-radius: 6px; }
.gymgrid .ph.rej img { opacity: .25; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 12px; }
.lightbox img { max-width: 100%; max-height: 78vh; border-radius: 12px; }
.tbl .check input, .check input { width: 20px; min-width: 0; height: 20px; padding: 0; flex: none; }
.tag { line-height: 1.4; }

/* ---------- 背景写真（Unsplash） ---------- */
:root {
  --ph-staff: url("https://images.unsplash.com/photo-1605296867304-46d5465a13f1?auto=format&fit=crop&w=1200&q=70");
  --ph-plate: url("https://images.unsplash.com/photo-1709315859957-3b3583bf364c?auto=format&fit=crop&w=1000&q=70");
  --ph-admin: url("https://images.unsplash.com/photo-1754475118668-64ac3f3b2559?auto=format&fit=crop&w=1200&q=70");
  --ph-bar: url("https://images.unsplash.com/photo-1706029831385-1c89922848eb?auto=format&fit=crop&w=1600&q=70");
}
body { background: var(--bg); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(13,13,15,.30) 0%, rgba(13,13,15,.62) 45%, rgba(13,13,15,.86) 100%),
    var(--ph-staff) center 30% / cover no-repeat;
}
body.adminp::before {
  background:
    linear-gradient(90deg, rgba(13,13,15,1) 0%, rgba(13,13,15,.85) 40%, rgba(13,13,15,.25) 75%, rgba(13,13,15,.35) 100%),
    var(--ph-admin) right top / auto 100% no-repeat, #0d0d0f;
}
body.is-login::before {
  background:
    linear-gradient(180deg, rgba(13,13,15,.15) 0%, rgba(13,13,15,.55) 45%, rgba(13,13,15,.95) 100%),
    var(--ph-staff) center 30% / cover no-repeat;
}
body.adminp.is-login::before {
  background:
    linear-gradient(90deg, rgba(13,13,15,1) 0%, rgba(13,13,15,.7) 40%, rgba(13,13,15,.05) 75%, rgba(13,13,15,.2) 100%),
    var(--ph-admin) right top / auto 100% no-repeat, #0d0d0f;
}
body.is-login .login { padding-top: 34vh; }
body.adminp.is-login .login { padding-top: 16vh; margin-left: max(20px, 8vw); }
.login .logo { text-shadow: 0 4px 24px rgba(0,0,0,.6); }
.photo-credit { position: fixed; right: 10px; bottom: 6px; font-size: 10px; color: rgba(255,255,255,.35); z-index: 1; }
.photo-credit a { color: inherit; text-decoration: none; }

/* ガラス風カード */
.card, .item { background: rgba(23,23,27,.66); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-color: rgba(255,255,255,.08); }
.item .img { background: rgba(255,255,255,.04); }
.chip { background: rgba(31,31,37,.75); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.admin .chips { background: transparent; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.calc, .dots span { background: rgba(255,255,255,.06); }
.dots span.on { background: var(--ok); }
input, select, textarea { background: rgba(31,31,37,.85); }

/* ポイントカード：バーベル写真＋オレンジ */
.hero {
  background:
    linear-gradient(135deg, rgba(255,90,31,.93) 0%, rgba(201,32,14,.80) 55%, rgba(80,10,5,.55) 100%),
    var(--ph-plate) center / cover no-repeat;
  box-shadow: 0 12px 40px rgba(255,90,31,.25);
}
.hero::after { display: none; }

/* 管理画面ダッシュボードのバナー */
.banner {
  border-radius: var(--radius); padding: 26px 22px; margin-bottom: 14px; position: relative; overflow: hidden;
  background:
    linear-gradient(90deg, rgba(13,13,15,.92) 0%, rgba(13,13,15,.55) 60%, rgba(255,90,31,.25) 100%),
    var(--ph-bar) center 60% / cover no-repeat;
  border: 1px solid rgba(255,255,255,.08);
}
.banner .t { font-family: var(--num); font-size: 28px; font-weight: 700; letter-spacing: .04em; line-height: 1.1; }
.banner .t b { color: var(--accent); }
.banner .s { color: var(--sub); margin-top: 6px; font-size: 14px; }

/* スタッフ画面：交換メニューの上のバナー */
.shop-banner {
  border-radius: var(--radius); padding: 18px 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: flex-end;
  background:
    linear-gradient(90deg, rgba(13,13,15,.9) 0%, rgba(13,13,15,.45) 100%),
    var(--ph-bar) center / cover no-repeat;
  border: 1px solid rgba(255,255,255,.08); min-height: 110px;
}
.nav { background: rgba(13,13,15,.82); }
