/* 宝くじ予想センター — 明るいチケット半券モチーフ、種別ごとのブランドカラー */

@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@500;700;800;900&family=Zen+Kaku+Gothic+New:wght@400;500;700;900&display=swap');

:root {
  /* ---- システム全体のトークン ---- */
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #22192e;
  --ink-soft: #746c82;
  --line: #ece7dd;
  --brand: #bf3f24;
  --brand-tint: #fae4de;
  --ok: #178350;
  --ok-tint: #e1f3ea;
  --err: #c62e3e;
  --err-tint: #fbe2e4;
  --radius: 18px;
  --max-w: 520px;
  --font-display: 'M PLUS Rounded 1c', sans-serif;
  --font-ui: 'Zen Kaku Gothic New', sans-serif;
  --shadow-card: 0 2px 4px rgba(34, 25, 46, 0.04), 0 14px 28px -16px rgba(34, 25, 46, 0.16);

  /* ---- 種別ブランドカラー（塗り色＋淡色ティント） ---- */
  --c-loto7: #a85e12;
  --c-loto7-tint: #fbeedc;
  --c-loto6: #2d63d9;
  --c-loto6-tint: #e3ecff;
  --c-mini: #c62e3e;
  --c-mini-tint: #fbe2e4;
  --c-num4: #7c4ddb;
  --c-num4-tint: #eee6fa;
  --c-num3: #178350;
  --c-num3-tint: #e1f3ea;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px 18px 64px;
}

/* ---- ヘッダー ---- */

.site-header {
  text-align: center;
  margin-bottom: 26px;
}

.site-header .kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--brand);
  background: var(--brand-tint);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 14px;
}

.site-header h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 27px;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}

.site-header p {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0;
}

a { color: var(--brand); }

/* ---- チケット半券カード：シグネチャー要素 ---- */

.ticket {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: ticket-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ticket:nth-child(2) { animation-delay: 0.05s; }
.ticket:nth-child(3) { animation-delay: 0.1s; }
.ticket:nth-child(4) { animation-delay: 0.15s; }
.ticket:nth-child(5) { animation-delay: 0.2s; }

@keyframes ticket-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* 種別ごとのカラーをこのカード配下の --type / --type-tint に流し込む */
.ticket[data-type="loto7"] { --type: var(--c-loto7); --type-tint: var(--c-loto7-tint); }
.ticket[data-type="loto6"] { --type: var(--c-loto6); --type-tint: var(--c-loto6-tint); }
.ticket[data-type="mini"]  { --type: var(--c-mini);  --type-tint: var(--c-mini-tint); }
.ticket[data-type="num4"]  { --type: var(--c-num4);  --type-tint: var(--c-num4-tint); }
.ticket[data-type="num3"]  { --type: var(--c-num3);  --type-tint: var(--c-num3-tint); }

.ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 20px 0;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--type);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.type-badge .type-badge-mark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.9;
  flex: none;
}

.type-badge-jp {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
}

.ticket-top .round {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---- 抽選日ヒーロー ---- */

.draw-hero {
  padding: 14px 20px 18px;
}

.draw-countdown {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--type);
  background: var(--type-tint);
  border-radius: 999px;
  padding: 3px 11px;
  margin-bottom: 8px;
}

.draw-date {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 8vw, 34px);
  color: var(--ink);
  line-height: 1.15;
}

.draw-date .draw-date-wd {
  font-size: 0.55em;
  font-weight: 700;
  color: var(--type);
  margin-left: 4px;
}

/* perforation: ミシン目（点線＋両端の丸い穴） */
.perforation {
  position: relative;
  height: 0;
  border-top: 2px dashed var(--line);
  margin: 2px 0;
}

.perforation::before,
.perforation::after {
  content: '';
  position: absolute;
  top: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
}

.perforation::before { left: -9px; }
.perforation::after { right: -9px; }

.ticket-body {
  padding: 16px 20px 20px;
}

.section-label {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.section-label .section-date { font-variant-numeric: tabular-nums; }

/* ---- 数字ボール ---- */

.balls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(44px, 12vw, 50px);
  height: clamp(44px, 12vw, 50px);
  border-radius: 50%;
  background: var(--type);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(15px, 4vw, 17px);
  box-shadow: 0 2px 5px -2px rgba(0, 0, 0, 0.28);
}

.ball.bonus {
  background: var(--surface);
  border: 2.5px solid var(--type);
  color: var(--type);
  box-shadow: none;
}

.digits .ball {
  border-radius: 12px;
}

.no-data {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0;
}

/* ---- 予想リスト（予想閲覧ページ） ---- */

.prediction-list { display: flex; flex-direction: column; gap: 14px; }

.prediction-row .strategy {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

/* ---- 的中率メーター ---- */

.meter-list { margin: 0; }

.meter { margin-bottom: 11px; }
.meter:last-child { margin-bottom: 0; }

.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  margin-bottom: 5px;
}

.meter-head .strategy { color: var(--ink-soft); }
.meter-head .pct {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.meter-track {
  height: 10px;
  border-radius: 999px;
  background: var(--type-tint);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--type);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.meter-empty {
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0;
}

/* ---- ボタン・フォーム ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 18px;
  border-radius: 12px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:hover { background: #a83a22; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-ghost {
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover { background: var(--bg); }

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 500;
}

.field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.field input::placeholder { color: #b7b0c2; }
.field input:focus { border-color: var(--brand); }

.otp-input {
  letter-spacing: 0.5em;
  text-align: center;
  font-size: 22px;
}

.hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: -6px;
  margin-bottom: 16px;
}

.status-msg {
  font-size: 13px;
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  display: none;
}

.status-msg.show { display: block; }
.status-msg.error { background: var(--err-tint); color: var(--err); }
.status-msg.ok { background: var(--ok-tint); color: var(--ok); }

/* ---- 認証済スタンプ ---- */

.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid var(--brand);
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  margin: 0 auto 18px;
  opacity: 0;
  transform: scale(1.6) rotate(-8deg);
}

.seal.stamp {
  animation: stamp-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

@keyframes stamp-in {
  0% { opacity: 0; transform: scale(1.8) rotate(-8deg); }
  60% { opacity: 1; transform: scale(0.94) rotate(-8deg); }
  100% { opacity: 1; transform: scale(1) rotate(-8deg); }
}

.center { text-align: center; }

nav.back-link {
  display: block;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}

nav.back-link:hover { color: var(--ink); }

footer.site-footer {
  text-align: center;
  margin-top: 36px;
  font-size: 12px;
  color: var(--ink-soft);
}

.skeleton {
  height: 168px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #efece4 25%, #f8f6f0 37%, #efece4 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  margin-bottom: 20px;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
