/* ================= Vチケット =================
   クラブカラー: ネイビー #0B1F3A × オレンジ #F68B1F */

:root {
  --navy: #0B1F3A;
  --navy-2: #14315C;
  --navy-dk: #071426;
  --orange: #F68B1F;
  --orange-dk: #E07100;
  --bg: #EFF2F7;
  --card: #FFFFFF;
  --text: #1A2333;
  --text-2: #6B7688;
  --line: #E3E8F0;
  --green: #16A34A;
  --red: #DC2626;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(11, 31, 58, .08);
  --num: 'Oswald', -apple-system, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, select { font-family: inherit; font-size: 16px; }
.hidden { display: none !important; }

/* ---------- ヘッダー ---------- */
.header {
  background: linear-gradient(135deg, var(--navy-dk) 0%, var(--navy) 55%, var(--navy-2) 100%);
  color: #fff;
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top);
  box-shadow: 0 2px 12px rgba(7, 20, 38, .35);
}
.header::after {
  content: ''; display: block; height: 3px;
  background: linear-gradient(90deg, var(--orange), #FFB25E 60%, transparent);
}
.header-inner { max-width: 560px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-family: var(--num); font-size: 19px; font-weight: 600; letter-spacing: .04em; }
.brand-sub { font-size: 10.5px; color: #9FB0C8; letter-spacing: .02em; }

/* ---------- メイン ---------- */
.view {
  max-width: 560px; margin: 0 auto;
  padding: 14px 14px calc(84px + env(safe-area-inset-bottom));
  animation: fadein .18s ease;
}
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.section-label {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  letter-spacing: .1em; margin: 18px 4px 8px;
}
.name-change {
  font-size: 11px; font-weight: 700; color: var(--navy-2);
  background: #E8EEF7; padding: 3px 10px; border-radius: 99px; margin-left: 6px;
}

/* ---------- NEXT MATCH ヒーロー ---------- */
.hero {
  display: block; width: 100%; text-align: left;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border-radius: var(--radius);
  color: #fff; padding: 18px 18px 16px;
  margin-bottom: 6px;
  position: relative; overflow: hidden;
  box-shadow: 0 6px 20px rgba(11, 31, 58, .25);
  transition: transform .12s ease;
}
.hero:active { transform: scale(.985); }
.hero-chip {
  font-size: 11px; font-weight: 700;
  background: var(--orange); color: #fff;
  padding: 2px 10px; border-radius: 99px;
}
.hero::before {
  content: ''; position: absolute; right: -30px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 139, 31, .25), transparent 70%);
}
.hero-label { font-family: var(--num); font-size: 11px; letter-spacing: .22em; color: var(--orange); font-weight: 600; }
.hero-teams { font-size: 21px; font-weight: 700; margin: 6px 0 2px; }
.hero-teams .vs { font-family: var(--num); color: #8FA3BF; font-size: 15px; margin: 0 6px; }
.hero-meta { font-size: 12.5px; color: #B9C6D9; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-date { font-family: var(--num); font-weight: 600; font-size: 15px; color: #fff; }
.hero-count { position: absolute; right: 16px; bottom: 14px; text-align: right; }
.hero-count .n { font-family: var(--num); font-size: 22px; font-weight: 700; color: var(--orange); line-height: 1.15; }
.hero-count .u { font-size: 10.5px; color: #B9C6D9; }

/* ---------- 試合カード ---------- */
.match-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
  border: 1px solid transparent;
}
.match-card:active { transform: scale(.985); }
.match-card.mine { border-color: rgba(246, 139, 31, .45); }
.match-body { display: flex; align-items: stretch; width: 100%; text-align: left; padding: 0; }

.date-block {
  flex: none; width: 76px;
  background: linear-gradient(180deg, #F6F8FB, #EDF1F7);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px 6px; gap: 1px;
}
.date-block .m { font-family: var(--num); font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .08em; }
.date-block .d { font-family: var(--num); font-size: 27px; font-weight: 600; color: var(--navy); line-height: 1.05; }
.date-block .w { font-size: 11px; font-weight: 700; }
.date-block .w.sat { color: #2563EB; }
.date-block .w.sun { color: var(--red); }
.date-block .w.wd { color: var(--text-2); }

.match-info { flex: 1; padding: 12px 14px 10px; min-width: 0; }
.comp-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  color: var(--navy-2); background: #E8EEF7;
  padding: 2px 8px; border-radius: 99px; letter-spacing: .03em;
  margin-bottom: 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.teams { font-size: 16.5px; font-weight: 700; line-height: 1.25; }
.teams .vs { font-family: var(--num); font-size: 12px; color: var(--text-2); margin: 0 5px; }
.match-meta { font-size: 12px; color: var(--text-2); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.match-meta .ko { font-family: var(--num); font-weight: 600; color: var(--text); }

/* 申込状況の行（残り枚数は一般には見せない） */
.ticket-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px 11px; border-top: 1px dashed var(--line);
}
.apply-info { font-size: 12px; font-weight: 700; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apply-info .n { font-family: var(--num); font-size: 15px; color: var(--orange-dk); }
.apply-info .names { color: var(--text-2); font-weight: 600; }
.apply-info.none { color: var(--text-2); font-weight: 600; }
.status-chip {
  margin-left: auto; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 99px; flex: none;
}
.status-chip.applied { background: rgba(246, 139, 31, .14); color: var(--orange-dk); }
.status-chip.fixed { background: rgba(22, 163, 74, .13); color: var(--green); }
.status-chip.busy { background: #EDF0F5; color: var(--text-2); }
.status-chip.cta { background: var(--navy); color: #fff; }

.empty-note { text-align: center; color: var(--text-2); font-size: 13.5px; padding: 40px 0; line-height: 1.9; }

/* ---------- マイチケット ---------- */
.ticket-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 12px; overflow: hidden; position: relative;
}
.ticket-card .tc-head {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; padding: 11px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.tc-head .t-date { font-family: var(--num); font-weight: 600; font-size: 14px; letter-spacing: .04em; }
.tc-status { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.tc-status.fixed { background: var(--orange); color: #fff; }
.tc-status.pending { background: rgba(255, 255, 255, .16); color: #CBD6E4; }
.tc-status.lost { background: rgba(255, 255, 255, .1); color: #8FA3BF; }
.tc-body { padding: 13px 16px; display: flex; justify-content: space-between; align-items: center; }
.tc-body .t-teams { font-size: 15.5px; font-weight: 700; }
.tc-body .t-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.tc-count { text-align: center; flex: none; padding-left: 12px; border-left: 1px dashed var(--line); }
.tc-count .n { font-family: var(--num); font-size: 26px; font-weight: 600; color: var(--navy); line-height: 1; }
.tc-count .u { font-size: 10px; color: var(--text-2); }

/* ---------- タブバー ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; justify-content: center; gap: 6px;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; max-width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 0 3px; border-radius: 12px;
  color: #9AA5B5; font-size: 10.5px; font-weight: 700;
  transition: color .15s;
}
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--navy); }
.tab.active svg { color: var(--orange-dk); }

/* ---------- ボトムシート ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(7, 20, 38, .5);
  animation: fadein .18s ease;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  max-width: 560px; margin: 0 auto;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  animation: slideup .22s cubic-bezier(.3, 1.1, .4, 1);
  /* dvh はChromiumのスクリーンショット取得をハングさせる既知問題があるため vh を使う */
  max-height: 86vh; overflow-y: auto;
}
@keyframes slideup { from { transform: translateY(60px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 2px auto 12px; }
.sheet-title { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.sheet-sub { font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; }

.field-label { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 14px 0 6px; }
.select-wrap { position: relative; }
.select-wrap select {
  width: 100%; appearance: none; -webkit-appearance: none;
  padding: 13px 40px 13px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: #FAFBFD; font-weight: 600;
}
.select-wrap::after {
  content: ''; position: absolute; right: 16px; top: 50%;
  width: 8px; height: 8px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.free-name { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #FAFBFD; font-weight: 600; margin-top: 8px; }

.count-btns { display: flex; gap: 8px; }
.count-btn {
  flex: 1; padding: 14px 0; border-radius: 12px;
  border: 1.5px solid var(--line); background: #FAFBFD;
  font-family: var(--num); font-size: 20px; font-weight: 600; color: var(--text);
  transition: all .12s;
}
.count-btn.sel { background: var(--navy); border-color: var(--navy); color: #fff; transform: scale(1.04); }
.count-btn:active { transform: scale(.96); }

.primary-btn {
  width: 100%; margin-top: 18px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dk));
  color: #fff; font-size: 16px; font-weight: 700;
  padding: 15px; border-radius: 14px;
  box-shadow: 0 4px 14px rgba(246, 139, 31, .35);
  transition: transform .12s, opacity .12s;
}
.primary-btn:active { transform: scale(.98); }
.primary-btn:disabled { opacity: .5; }
.ghost-btn {
  width: 100%; margin-top: 10px; padding: 13px;
  border-radius: 14px; border: 1.5px solid var(--line);
  color: var(--red); font-size: 14px; font-weight: 700;
}
.sheet-note { font-size: 11.5px; color: var(--text-2); text-align: center; margin-top: 12px; line-height: 1.7; }

/* ---------- 管理画面 ---------- */
.admin-login { text-align: center; padding: 30px 10px; }
.admin-login h2 { font-size: 17px; margin-bottom: 6px; }
.admin-login p { font-size: 12.5px; color: var(--text-2); margin-bottom: 18px; }
.pass-input {
  width: 200px; text-align: center; letter-spacing: .3em;
  font-family: var(--num); font-size: 22px; font-weight: 600;
  padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
}
.admin-login .primary-btn { max-width: 240px; margin: 16px auto 0; display: block; }

.admin-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.admin-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 14px; text-align: left; }
.admin-head .ah-date { font-family: var(--num); font-weight: 600; font-size: 14px; color: var(--navy); flex: none; }
.admin-head .ah-title { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remain-pill { flex: none; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.remain-pill.ok { background: rgba(246, 139, 31, .14); color: var(--orange-dk); }
.remain-pill.zero { background: rgba(22, 163, 74, .13); color: var(--green); }
.remain-pill.over { background: rgba(220, 38, 38, .1); color: var(--red); }
.admin-body { border-top: 1px solid var(--line); padding: 4px 14px 12px; }
.app-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.app-row:last-of-type { border-bottom: none; }
.app-name { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; }
.app-name .req { font-size: 11px; color: var(--text-2); font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button {
  width: 30px; height: 30px; border-radius: 8px; background: #EDF0F5;
  font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1;
}
.stepper .cnt { font-family: var(--num); font-weight: 600; width: 26px; text-align: center; font-size: 16px; }
.alloc-btn { font-size: 11px; font-weight: 700; padding: 6px 10px; border-radius: 8px; flex: none; }
.alloc-btn.fix { background: var(--navy); color: #fff; }
.alloc-btn.unfix { background: #EDF0F5; color: var(--text-2); }
.admin-actions { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.admin-actions button {
  flex: 1; min-width: 130px; padding: 12px; border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow);
  font-size: 13px; font-weight: 700; color: var(--navy);
}
.warn-note { font-size: 11.5px; color: var(--red); font-weight: 700; padding: 6px 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input {
  width: 100%; padding: 12px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #FAFBFD; font-weight: 600;
}

/* ---------- スケルトン・トースト ---------- */
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, #E8ECF2 25%, #F3F6FA 50%, #E8ECF2 75%); background-size: 200% 100%; animation: sk 1.2s infinite; height: 110px; margin-bottom: 12px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 40;
  background: var(--navy-dk); color: #fff;
  font-size: 13.5px; font-weight: 600;
  padding: 12px 20px; border-radius: 99px;
  box-shadow: 0 6px 18px rgba(7, 20, 38, .35);
  animation: toastin .25s ease; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.err { background: var(--red); }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 600px) {
  .view { padding-top: 20px; }
}
