/* ─── リセット & 基本 ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #9B1B2B;   /* 立命館レッド */
  --red-dark:   #7A1422;
  --red-light:  #C0394B;
  --bg:         #F5F5F5;
  --card-bg:    #FFFFFF;
  --text:       #1A1A1A;
  --text-muted: #666666;
  --border:     #E0E0E0;
  --radius:     12px;
  --shadow:     0 2px 8px rgba(0,0,0,.08);
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
               "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── ヘッダー ────────────────────────────────────── */
.header {
  background: var(--red);
  color: #fff;
  padding: 20px 16px 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.header-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-title { font-size: 1.3rem; font-weight: 700; letter-spacing: .04em; }
.header-sub   { font-size: .8rem; opacity: .85; margin-top: 2px; }

/* ─── メインコンテンツ ───────────────────────────── */
.main {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── カード ─────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ─── キャンパス選択 ─────────────────────────────── */
.campus-group {
  display: flex;
  gap: 10px;
}
.campus-item input[type="radio"] { display: none; }

.campus-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 18px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all .15s;
  min-width: 72px;
  text-align: center;
}
.campus-btn small {
  font-size: .65rem;
  font-weight: 400;
  margin-top: 1px;
}
.campus-item input:checked + .campus-btn {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}
.campus-btn.disabled { opacity: .45; cursor: not-allowed; }

/* ─── 曜日ボタン ─────────────────────────────────── */
.day-group {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.day-btn {
  padding: 10px 0;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.day-btn:active   { transform: scale(.95); }
.day-btn.selected {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

/* ─── セレクト ───────────────────────────────────── */
.select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--red); }

/* ─── ボタン ─────────────────────────────────────── */
.buttons-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: .02em;
}
.btn:active { transform: scale(.98); }
.btn-icon   { font-size: 1.1rem; }

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(155,27,43,.3);
}
.btn-primary:hover { background: var(--red-dark); }

.btn-secondary {
  background: #fff;
  color: var(--red);
  border: 2px solid var(--red);
}
.btn-secondary:hover { background: #FFF0F2; }

/* ─── ローディング ───────────────────────────────── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  color: var(--text-muted);
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── エラー ─────────────────────────────────────── */
.error-msg {
  background: #FFF0F2;
  border: 1px solid #F5C0C8;
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--red-dark);
  font-size: .9rem;
  text-align: center;
}

/* ─── 結果 ───────────────────────────────────────── */
.results-card { padding: 0; overflow: hidden; }

.results-header {
  padding: 14px 16px;
  background: var(--red);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}
.results-header h2 {
  font-size: 1rem;
  font-weight: 700;
}
.results-header .count {
  font-size: .85rem;
  opacity: .9;
  margin-top: 2px;
}

.results-list {
  list-style: none;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.results-list li {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.results-list li:last-child { border-bottom: none; }
.results-list li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4CAF50;
  flex-shrink: 0;
}

.no-rooms {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}

/* ─── ハンバーガーメニュー ─────────────────────── */
.header-logo {
  text-decoration: none;
  color: inherit;
  display: block;
}
.menu-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.menu-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background: #fff;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-top: 60px;
}
.menu-overlay.open .menu-panel {
  transform: translateX(0);
}
.menu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
}
.menu-list { list-style: none; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.menu-item:hover,
.menu-item.active {
  background: #FFF0F2;
  color: var(--red);
}
.menu-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* ─── フッター ───────────────────────────────────── */
.footer {
  margin-top: 8px;
  padding: 24px 16px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}
.footer-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .8rem;
}
.footer-nav a:hover { color: var(--red); text-decoration: underline; }
.footer-copy { font-size: .75rem; color: var(--text-muted); }

/* ─── コンテンツページ共通 ─────────────────────── */
.page-hero { border-top: 4px solid var(--red); }
.page-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.page-desc  { color: var(--text-muted); font-size: .9rem; line-height: 1.6; }
.coming-soon {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 0;
  font-size: .9rem;
  line-height: 1.9;
}
.form-embed { width: 100%; border: none; display: block; min-height: 600px; }
.form-card { padding: 0; overflow: hidden; }
.contact-note {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.7;
  text-align: center;
}

/* ─── プライバシーポリシー・利用規約 ─────────────── */
.policy-updated { font-size: .8rem; color: var(--text-muted); margin-bottom: 20px; }
.policy-body h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 24px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.policy-body h2:first-child { margin-top: 0; }
.policy-body p,
.policy-body li { font-size: .88rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 8px; }
.policy-body ul { padding-left: 1.4em; }
.policy-body a { color: var(--red); word-break: break-all; }

/* ─── 広告スペース ───────────────────────────────── */
.ad-slot {
  width: 100%;
  overflow: hidden;
  text-align: center;
}
.ad-slot:empty { display: none; }

/* ─── ユーティリティ ──────────────────────────────── */
.hidden { display: none !important; }

/* ─── デスクトップ補正 ────────────────────────────── */
@media (min-width: 640px) {
  .header { padding: 24px 32px; }
  .header-title { font-size: 1.5rem; }
  .main { padding: 24px 32px; gap: 16px; }
  .card { padding: 20px; }
  .btn  { font-size: 1.05rem; }
}
