/* 競馬AI — ログイン / トップ共通（モック準拠・緑基調） */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;800&display=swap");

:root {
  --brand: #1b5e3b;
  --brand-dark: #0f3d26;
  --brand-soft: #e8f5ee;
  --brand-mint: #b8e0c8;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --shadow: 0 8px 28px rgba(15, 61, 38, 0.08);
  --radius: 14px;
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }

/* モック準拠ヘッダー（競馬AI / 今週のレース / 過去… / お問い合わせ / ログイン） */
.app-nav {
  background: var(--brand-dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.app-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 14px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px 18px;
}
.app-nav-brand {
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: 0.03em;
  color: #fff;
  padding: 14px 0 12px;
  border-bottom: 3px solid transparent;
  flex: 0 0 auto;
}
.app-nav-brand.is-active,
.app-nav-brand:hover {
  border-bottom-color: #4ade80;
}
.app-nav-main {
  display: none;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
}
.app-nav-link {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 14px 10px 12px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.app-nav-link:hover,
.app-nav-link.is-active {
  color: #fff;
  border-bottom-color: #4ade80;
}
.app-nav-right {
  display: none;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex: 0 0 auto;
}
.app-nav-util {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  white-space: nowrap;
}
.app-nav-util:hover,
.app-nav-util.is-active {
  color: #fff;
  text-decoration: underline;
}
.app-nav-user {
  font-size: 0.78rem;
  color: #bbf7d0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-nav-burger {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #fff;
  padding: 8px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.app-nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}
.app-nav-drawer {
  display: flex;
  flex-direction: column;
  background: #0c3320;
  padding: 8px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.app-nav-drawer .app-nav-link {
  padding: 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.app-nav-drawer-auth {
  margin-top: 8px;
  padding: 8px;
}
.app-nav-user-block {
  font-size: 0.82rem;
  color: #bbf7d0;
  margin-bottom: 8px;
}
@media (min-width: 860px) {
  .app-nav-main,
  .app-nav-right {
    display: flex;
  }
  .app-nav-burger,
  .app-nav-drawer {
    display: none !important;
  }
}

/* 旧簡易ヘッダー互換 */
.app-header {
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 14px 48px;
}

.date-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.date-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.date-chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.day-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 4px 0 14px;
  color: var(--text);
}

.shobu-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--danger);
  padding: 14px 14px 8px;
  margin-bottom: 18px;
}
.shobu-card h2 {
  margin: 0 0 10px;
  font-size: 0.98rem;
  font-weight: 800;
}
.shobu-card h2 .count {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.shobu-list { display: grid; gap: 8px; }
@media (min-width: 860px) {
  .shobu-list { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

.shobu-item {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.shobu-item:hover { border-color: var(--brand-mint); }
.shobu-item.is-hot { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.shobu-item .row1 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.shobu-item .name { font-weight: 800; font-size: 0.92rem; }
.shobu-item .meta { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.ai-badge {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ai-badge.A { color: #b91c1c; }
.ai-badge.B { color: #c2410c; }
.ai-badge.C { color: #0f766e; }
.ai-badge.D { color: #64748b; }
.ai-badge.\- { color: var(--muted); }

.track-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 0 10px;
  padding-bottom: 2px;
}
.track-tab {
  flex: 0 0 auto;
  border: 0;
  background: #e5e7eb;
  color: #374151;
  border-radius: 10px 10px 0 0;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.track-tab.is-active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 -1px 0 #fff;
}

.tracks-pc {
  display: none;
}
@media (min-width: 860px) {
  .tracks-pc {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .tracks-sp { display: none; }
  .track-tabs { display: none; }
}

.track-col {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.track-col h3 {
  margin: 0;
  padding: 12px 14px;
  background: var(--brand);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}

.race-row {
  display: grid;
  grid-template-columns: 22px 40px 1fr auto 18px;
  gap: 6px;
  align-items: center;
  padding: 10px 12px 10px 8px;
  border-top: 1px solid var(--line);
  color: inherit;
}
.race-row.is-past { opacity: 0.45; }
.race-row:hover { background: #f9fafb; }
.race-num {
  width: 40px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.82rem;
}
.race-main .title {
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.race-main .sub {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 2px;
}
.badge-shobu {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.4;
}
/* レース番号左の縦積みバッジ（一目で確定が分かる） */
.badge-ai-kaku {
  width: 22px;
  height: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: #0f3d26;
  color: #bbf7d0;
  border-radius: 5px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.35);
}
.badge-ai-kaku span {
  display: block;
  font-size: 0.58rem;
}
.badge-ai-kaku span:last-child {
  font-size: 0.68rem;
  color: #fff;
}
.badge-ai-kaku.is-empty {
  background: transparent;
  box-shadow: none;
  visibility: hidden;
}
.chev { color: #9ca3af; font-size: 0.9rem; }

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border-radius: var(--radius);
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #eef7f1 0%, var(--bg) 42%, #e8ecef 100%);
}
.login-hero {
  text-align: center;
  padding: 48px 16px 20px;
}
.login-hero h1 {
  margin: 0;
  color: var(--brand);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.login-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.login-card {
  width: min(420px, calc(100% - 32px));
  margin: 0 auto;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px 24px 22px;
}
.login-card h2 {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 800;
}
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fff;
}
.field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(27, 94, 59, 0.12); }
.field .ico { color: #9ca3af; width: 1.1rem; text-align: center; flex: 0 0 auto; }
.field input {
  border: 0;
  outline: 0;
  width: 100%;
  font-size: 0.95rem;
  background: transparent;
}
.login-opts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 16px;
  font-size: 0.85rem;
  color: #4b5563;
}
.btn-login {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  padding: 13px 16px;
  cursor: pointer;
}
.btn-login:hover { filter: brightness(1.05); }
.login-links {
  text-align: center;
  margin-top: 14px;
  font-size: 0.82rem;
  color: #9ca3af;
}
.login-footer {
  margin-top: auto;
  text-align: center;
  color: #9ca3af;
  font-size: 0.78rem;
  padding: 28px 12px;
}

.err-banner {
  background: var(--danger-soft);
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.88rem;
}
