:root {
  --pink: #ff5c93;
  --pink-d: #ff3d7f;
  --pink-l: #ffe1ec;
  --pink-xl: #fff6f9;
  --ink: #2b1f27;
  --sub: #8a7680;
  --line: #f3dbe5;
  --card: #fff;
  --win: #ff3d7f;
  --lose: #b9aeb4;
  --applied: #f5a623;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--pink-xl);
  color: var(--ink);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.boot { padding: 40vh 0; text-align: center; color: var(--sub); }

/* ---------- 枠 ---------- */
.shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 96px 1fr 96px; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: rgba(255, 246, 249, 0.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 18px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { background: none; border: 0; color: var(--pink-d); font-weight: 700; text-align: left; padding: 6px 0; }
.topbar .right { text-align: right; }
.page { padding: 16px; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1; max-width: 140px; background: none; border: 0; padding: 8px 0 10px;
  font-size: 12px; color: var(--sub); display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabs button .ti { font-size: 22px; filter: grayscale(1); opacity: 0.6; }
.tabs button.on { color: var(--pink-d); font-weight: 700; }
.tabs button.on .ti { filter: none; opacity: 1; }

/* ---------- 部品 ---------- */
.card {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 16px; margin: 0 0 10px; box-shadow: 0 2px 0 #ffe7ef;
}
button.card:active { transform: scale(0.99); }
.group { margin-bottom: 18px; }
.group h2, .h2 { font-size: 15px; color: var(--pink-d); margin: 6px 4px 8px; }
.gsub { font-size: 12px; color: var(--sub); margin-left: 8px; font-weight: 400; }
.ml { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ml b { font-size: 17px; }
.ms { font-size: 13px; color: var(--sub); }
.tag { font-size: 12px; background: var(--pink-l); color: var(--pink-d); border-radius: 999px; padding: 1px 10px; }
.badge { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; color: #fff; background: var(--applied); white-space: nowrap; }
.badge.win { background: var(--win); }
.badge.lose { background: var(--lose); }
.er { display: flex; align-items: center; gap: 8px; }
.et { font-weight: 700; }
.seat { display: inline-block; margin-top: 6px; font-weight: 700; border-radius: 10px; padding: 3px 10px; background: #f1eef0; }
.seat.a-1 { background: var(--pink); color: #fff; }
.seat.a-2 { background: #ffc2d6; }
.seat.a-3 { background: #ffd9e5; }
.seat.a-4, .seat.a-5, .seat.a-6 { background: #f6e9ee; }
.seatcard { display: flex; gap: 12px; align-items: center; }
.seatcard .no { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--pink-l); color: var(--pink-d); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.grow { flex: 1; min-width: 0; }
.mini-seat { display: flex; align-items: center; gap: 8px; }
.mini-seat .seat { margin-top: 4px; font-size: 13px; }
.memo { margin-top: 8px; padding: 8px 10px; background: var(--pink-xl); border-radius: 10px; white-space: pre-wrap; font-size: 14px; }
.info b { font-size: 17px; display: block; }

.copyrow { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l b" "v b"; padding: 8px 0; border-bottom: 1px dashed var(--line); gap: 0 8px; }
.copyrow:last-of-type { border-bottom: 0; }
.copyrow .cl { grid-area: l; font-size: 12px; color: var(--sub); }
.copyrow .cv { grid-area: v; font-size: 17px; font-weight: 700; word-break: break-all; }
.copyrow .cv.masked { letter-spacing: 2px; color: var(--sub); }
.copyrow .cb { grid-area: b; display: flex; gap: 6px; align-items: center; }

.btn { border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 700; background: #fff; border: 1px solid var(--line); }
.btn.big { width: 100%; padding: 15px; font-size: 17px; }
.btn.pink { background: var(--pink); color: #fff; border-color: var(--pink); }
.btn.ghost { background: transparent; }
.btn.danger { background: #e5484d; color: #fff; border-color: #e5484d; }
.btn:disabled { opacity: 0.5; }
.danger-text { color: #e5484d !important; }
.mini { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.mini.pink { background: var(--pink); color: #fff; border-color: var(--pink); }
.rowbtn { display: flex; justify-content: space-between; width: 100%; background: none; border: 0; padding: 12px 0; font-weight: 700; border-bottom: 1px solid var(--line); text-align: left; }
.rowbtn:last-child { border-bottom: 0; }
.rowbtn span { color: var(--sub); }

.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.gap > * { flex: 1; min-width: 0; }
.row.between { justify-content: space-between; gap: 10px; }
.mt { margin-top: 12px; }
.pad { padding: 4px 0 14px; }

.field { display: block; }
.flabel { display: block; font-size: 13px; color: var(--sub); margin: 0 0 4px 4px; font-weight: 700; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff;
  font-size: 16px; /* iPhoneで拡大されないように16px */
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-l); }
input[type="file"] { padding: 8px; }
.search { margin-bottom: 14px; }
.hint { color: var(--sub); }
.filters { margin: 12px 0; }
.filters select { padding: 8px 10px; font-size: 14px; }

.seg { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 10px; padding: 9px 4px; font-weight: 700; color: var(--sub); }
.seg button.on { background: var(--pink); color: #fff; }
.seg button.on.applied { background: var(--applied); }
.seg button.on.lose { background: var(--lose); }
.seg.small { padding: 2px; border-radius: 10px; }
.seg.small button { padding: 4px 10px; font-size: 12px; }

.empty { text-align: center; padding: 30px 10px; }
.note { font-size: 13px; color: var(--sub); }
.err { color: #e5484d; font-size: 14px; font-weight: 700; margin: 4px 0; }
.ver { text-align: center; font-size: 12px; color: var(--sub); }

.safe-box { background: var(--ink); color: #fff; border-radius: 18px; padding: 16px 18px; border: 0; box-shadow: none; }
.safe-box b { color: #ffb3cd; }
.safe-box p, .safe-box li { font-size: 14px; }
.safe-box ul { margin: 8px 0 0; padding-left: 20px; }
.safe-box .note { color: #d8c6cf; }

.install { margin: 12px 16px 0; background: #fff; border: 2px dashed var(--pink); border-radius: 16px; padding: 12px 14px; font-size: 14px; position: relative; }
.install p { margin: 4px 0 8px; color: var(--sub); }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 20;
  max-width: calc(100% - 32px); text-align: center;
}

/* ---------- ロック画面 ---------- */
.lockscreen { max-width: 420px; margin: 0 auto; padding: calc(40px + env(safe-area-inset-top)) 24px 40px; text-align: center; }
.lockscreen .appicon { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 6px 18px rgba(255, 92, 147, 0.3); }
.lockscreen h1 { margin: 12px 0 0; font-size: 26px; }
.lockscreen .sub { color: var(--sub); margin: 4px 0 20px; }
.lockscreen .lead { font-weight: 700; }
.lockscreen .safe-box { text-align: left; margin-bottom: 20px; }
.lockscreen .pass { text-align: center; font-size: 20px; letter-spacing: 4px; }
.lockscreen .or { color: var(--sub); font-size: 13px; margin: 12px 0 4px; }
.linkbtn { background: none; border: 0; color: var(--sub); text-decoration: underline; font-size: 13px; margin-top: 22px; padding: 8px; }
.forgot { text-align: left; margin-top: 22px; }
.inapp { text-align: left; background: #fff8e1; border: 2px solid #f5a623; border-radius: 16px; padding: 12px 14px; margin-bottom: 18px; font-size: 14px; }
.inapp p { margin: 6px 0 0; }
.inapp .small { font-size: 12px; color: var(--sub); }
