/* gsd-loto: 宝くじ予想センター — 共通スタイル */

@import url('https://fonts.googleapis.com/css2?family=Zen+Old+Mincho:wght@500;700&family=Zen+Kaku+Gothic+New:wght@400;500;700;900&display=swap');

:root {
  --ink: #12172b;
  --surface: #1c2444;
  --surface-raised: #242c52;
  --washi: #f3efe4;
  --muted: #8b92b0;
  --gold: #d4a24c;
  --hanko: #c23b3b;
  --hanko-soft: rgba(194, 59, 59, 0.16);
  --gold-soft: rgba(212, 162, 76, 0.14);
  --line: rgba(243, 239, 228, 0.14);
  --radius: 14px;
  --max-w: 480px;
  --font-display: 'Zen Old Mincho', serif;
  --font-ui: 'Zen Kaku Gothic New', sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--washi);
  font-family: var(--font-ui);
  line-height: 1.7;
  -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: 28px;
}

.site-header .kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--gold);
  border: 1px solid var(--gold-soft);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 14px;
}

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

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

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

/* ---- ticket stub card: the signature element ---- */

.ticket {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 28px -18px rgba(0, 0, 0, 0.6);
  animation: ticket-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.ticket-head {
  padding: 18px 20px 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ticket-head h2 {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0;
  letter-spacing: 0.03em;
}

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

.ticket-row {
  padding: 0 20px 14px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ticket-row strong {
  color: var(--washi);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* perforation: dashed line with punched notches on both edges */
.perforation {
  position: relative;
  height: 0;
  border-top: 2px dashed var(--line);
  margin: 4px 0;
}

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

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

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

.section-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 10px;
  text-transform: uppercase;
}

/* ---- number balls ---- */

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

.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 4px;
  border-radius: 50%;
  background: var(--gold-soft);
  border: 1px solid rgba(212, 162, 76, 0.35);
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ball.bonus {
  background: var(--hanko-soft);
  border-color: rgba(194, 59, 59, 0.45);
  color: #e08787;
}

.ball.bonus::before {
  content: '';
}

.digits {
  display: flex;
  gap: 6px;
}

.digits .ball {
  border-radius: 8px;
  min-width: 30px;
}

.no-data {
  color: var(--muted);
  font-size: 13px;
}

/* ---- hit-rate list ---- */

.rates {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.rates li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.rates li:last-child { border-bottom: none; }

.rates .strategy { color: var(--muted); }
.rates .pct { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---- buttons & forms ---- */

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

.btn:hover { background: #d24747; }
.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(--gold);
  outline-offset: 2px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--washi);
}

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

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

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

.field input::placeholder { color: var(--muted); }

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

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

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

.status-msg.show { display: block; }
.status-msg.error { background: var(--hanko-soft); color: #f0a0a0; }
.status-msg.ok { background: var(--gold-soft); color: var(--gold); }

/* ---- seal / stamp micro-interaction ---- */

.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--hanko);
  color: var(--hanko);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  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(--muted);
  text-decoration: none;
}

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

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

.skeleton {
  height: 140px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-raised) 37%, var(--surface) 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%; }
}
