/* LIFF予約カレンダー。モバイル前提のシンプルなライトテーマ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: #f5f6f8;
  color: #222;
  -webkit-text-size-adjust: 100%;
}

.app-header {
  background: #06c755;
  color: #fff;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
}
.app-header h1 { font-size: 17px; font-weight: 700; }

#screen { padding: 12px 12px calc(env(safe-area-inset-bottom) + 24px); max-width: 480px; margin: 0 auto; }
.loading, .hint { color: #888; text-align: center; padding: 24px 8px; font-size: 14px; }

/* カレンダー */
.cal-nav { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; }
.cal-title { font-size: 16px; font-weight: 700; }
.btn-nav {
  border: none; background: #fff; border-radius: 8px; width: 40px; height: 36px;
  font-size: 20px; color: #06c755; box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  background: #fff; border-radius: 12px; padding: 10px 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.cal-cell { text-align: center; }
.cal-weekday { font-size: 11px; color: #999; padding: 2px 0 6px; }
.cal-day {
  position: relative; border: none; background: none; border-radius: 10px;
  height: 44px; font-size: 15px; color: #222; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.wd-0 .day-num, .cal-weekday.wd-0 { color: #e05252; }
.wd-6 .day-num, .cal-weekday.wd-6 { color: #4a7fd6; }
.cal-day.today { outline: 2px solid #06c75566; outline-offset: -2px; }
.cal-day.has-booking { background: #e6f9ee; font-weight: 700; }
.cal-day.selected { background: #06c755; }
.cal-day.selected .day-num { color: #fff; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: #06c755; }
.cal-day.selected .dot { background: #fff; }

.total-note { color: #999; font-size: 12px; text-align: center; padding-top: 12px; }

/* 予約カード */
#day-detail { padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.card {
  background: #fff; border-radius: 12px; padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex; flex-direction: column; gap: 8px;
}
.card-court { font-weight: 700; font-size: 15px; }
.card-time { font-size: 14px; color: #555; }
.badge { font-size: 12px; border-radius: 6px; padding: 5px 8px; width: fit-content; line-height: 1.5; }
.badge-free { background: #e6f9ee; color: #067a3a; }
.badge-expired { background: #fdeaea; color: #c03030; width: auto; }
.badge-unknown { background: #f0f0f0; color: #777; width: auto; }

/* ボタン */
.btn {
  border: 1px solid #ddd; background: #fff; color: #333;
  border-radius: 8px; padding: 10px 14px; font-size: 14px; font-weight: 600;
}
.btn:disabled { opacity: .5; }
.btn-primary { background: #06c755; border-color: #06c755; color: #fff; }
.btn-danger { background: #fff; border-color: #e05252; color: #e05252; }

/* モーダル */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 10;
}
.modal {
  background: #fff; border-radius: 14px; padding: 20px; width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 10px;
}
.modal h2 { font-size: 16px; }
.modal .note { font-size: 13px; color: #555; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

/* メッセージ画面 (401/403/エラー) */
.message-box {
  background: #fff; border-radius: 12px; padding: 20px; margin-top: 12px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.message-box h2 { font-size: 16px; }
.message-box p { font-size: 13px; color: #555; line-height: 1.6; }
code.user-id {
  display: block; background: #f5f6f8; border-radius: 8px; padding: 10px;
  font-size: 13px; word-break: break-all; user-select: all;
}

.toast {
  position: fixed; bottom: calc(env(safe-area-inset-bottom) + 20px); left: 50%;
  transform: translateX(-50%);
  background: #333; color: #fff; font-size: 13px;
  padding: 10px 16px; border-radius: 20px; z-index: 20; white-space: nowrap;
}
