/* 競艇AI予想サイト スタイル (モバイルファースト) */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  background: #0e1420;
  color: #e8ecf3;
  line-height: 1.6;
}
a { color: #7fb5ff; text-decoration: none; }
main { max-width: 900px; margin: 0 auto; padding: 12px; }

.site-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #16203a; border-bottom: 2px solid #2a3c66;
}
.site-title { font-weight: bold; font-size: 17px; color: #fff; }
.site-head nav a { margin-left: 14px; font-size: 14px; }
.site-foot { padding: 16px; font-size: 11px; color: #7a8499; text-align: center; }

.date-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 4px; font-size: 15px;
}
.notice { background: #1a2438; padding: 14px; border-radius: 8px; color: #aab4c8; }
.err { color: #ff8080; }

/* 場ごとのカード */
.venue { margin-bottom: 18px; }
.venue h2 { font-size: 16px; margin: 10px 2px 6px; }
.venue-sub { font-size: 12px; color: #8fa0c0; font-weight: normal; margin-left: 8px; }
.race-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 6px; }
.race-card {
  position: relative; display: flex; flex-direction: column;
  background: #1a2438; border: 1px solid #2a3c66; border-radius: 8px;
  padding: 8px; color: #e8ecf3; font-size: 12px;
}
.race-card .rno { font-weight: bold; font-size: 14px; color: #ffd76a; }
.race-card .close { color: #8fa0c0; font-size: 11px; }
.race-card .pick { font-size: 15px; font-weight: bold; letter-spacing: 1px; }
.race-card .stars { color: #ffd76a; font-size: 11px; }
.race-card.hit { border-color: #35c46a; box-shadow: 0 0 6px #35c46a55; }
.race-card .badge {
  position: absolute; top: 6px; right: 6px; font-size: 10px;
  background: #444; color: #fff; border-radius: 4px; padding: 1px 5px;
}
.race-card.hit .badge { background: #2f9e57; }
.race-card.miss .badge { background: #555; }
.race-card .badge.live { background: #b3382f; }

/* レース詳細 */
.race-head h1 { font-size: 20px; margin: 8px 0 2px; }
.race-head h1 small { font-size: 12px; color: #8fa0c0; font-weight: normal; margin-left: 8px; }
.race-sub { color: #8fa0c0; font-size: 13px; margin: 0 0 8px; }
.back { font-size: 13px; }
.nav-rno { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.nav-rno a {
  min-width: 30px; text-align: center; padding: 3px 0; border-radius: 5px;
  background: #1a2438; border: 1px solid #2a3c66; font-size: 13px;
}
.nav-rno a.cur { background: #2a3c66; color: #fff; font-weight: bold; }

.panel { background: #16203a; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.panel h2 { font-size: 15px; margin: 0 0 8px; color: #ffd76a; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.pred-meta { font-size: 12px; color: #8fa0c0; margin: 4px 0 8px; }
.stars { color: #ffd76a; }

.btn {
  background: #2a5fc4; color: #fff; border: none; border-radius: 6px;
  padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.btn:disabled { opacity: .5; }

/* 買い目 */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ticket {
  display: flex; align-items: center; gap: 8px;
  background: #1a2438; border: 1px solid #2a3c66; border-radius: 8px; padding: 8px 10px;
}
.ticket .mark { font-size: 11px; color: #ffd76a; }
.ticket .combo { font-size: 18px; font-weight: bold; letter-spacing: 2px; flex: 1; }
.ticket .prob { font-size: 12px; color: #8fa0c0; }
.ticket-hit { border-color: #35c46a; box-shadow: 0 0 8px #35c46a66; }
.comment {
  margin-top: 10px; padding: 10px 12px; background: #101828;
  border-left: 3px solid #ffd76a; border-radius: 4px; font-size: 14px;
}

/* 1着確率バー */
.prob-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.prob-row .bar { flex: 1; height: 14px; background: #101828; border-radius: 7px; overflow: hidden; }
.prob-row .fill { height: 100%; border-radius: 7px; }
.prob-row .pct { width: 42px; text-align: right; font-size: 12px; color: #aab4c8; }

/* 艇番カラー(公式カラー) */
.b1, .b2, .b3, .b4, .b5, .b6 {
  display: inline-block; width: 22px; height: 22px; line-height: 22px;
  text-align: center; border-radius: 4px; font-weight: bold; font-size: 13px;
}
.b1 { background: #f5f5f5; color: #111; }
.b2 { background: #111; color: #fff; border: 1px solid #555; }
.b3 { background: #d33; color: #fff; }
.b4 { background: #2864c8; color: #fff; }
.b5 { background: #e8c410; color: #111; }
.b6 { background: #2f9e57; color: #fff; }
.f1 { background: #cfd6e4; } .f2 { background: #6a7488; } .f3 { background: #d33; }
.f4 { background: #2864c8; } .f5 { background: #e8c410; } .f6 { background: #2f9e57; }

/* テーブル */
.table-wrap { overflow-x: auto; }
.entry-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.entry-table th, .entry-table td { padding: 6px 8px; border-bottom: 1px solid #223050; text-align: center; }
.entry-table th { color: #8fa0c0; font-weight: normal; font-size: 11px; }
.entry-table .name { text-align: left; }
.entry-table .name small { display: block; color: #8fa0c0; font-size: 10px; }
.parts-row td { color: #ffb35c; font-size: 12px; text-align: left; }
.klass { padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: bold; }
.k-a1 { background: #c43a3a; } .k-a2 { background: #c47e2a; }
.k-b1 { background: #2a5fc4; } .k-b2 { background: #555; }

/* 結果 */
.result-panel { border: 1px solid #2f9e5766; }
.result-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.kimarite { color: #ffd76a; font-size: 13px; }
.payout { font-size: 14px; font-weight: bold; }
.badge.ok { background: #2f9e57; color: #fff; border-radius: 4px; padding: 2px 8px; font-size: 12px; }
.badge.ng { background: #555; color: #fff; border-radius: 4px; padding: 2px 8px; font-size: 12px; }
.warn { color: #ff8080; }

/* 実績 */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tile { background: #16203a; border-radius: 10px; padding: 14px; text-align: center; }
.tile .num { display: block; font-size: 26px; font-weight: bold; color: #ffd76a; }
.tile.good .num { color: #35c46a; }
.tile .label { font-size: 11px; color: #8fa0c0; }

/* 合言葉ページ */
.gate-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.gate-form { background: #16203a; padding: 28px; border-radius: 12px; text-align: center; }
.gate-form input { padding: 10px; border-radius: 6px; border: 1px solid #2a3c66; background: #0e1420; color: #fff; font-size: 16px; }
.gate-form button { margin-left: 6px; padding: 10px 18px; border-radius: 6px; border: none; background: #2a5fc4; color: #fff; font-size: 15px; }

/* お気に入り選手 */
.fav-star {
  background: none; border: none; cursor: pointer; padding: 0 4px;
  font-size: 17px; color: #55628a; vertical-align: middle; line-height: 1;
}
.fav-star.on { color: #ffd76a; }
.fav-star:disabled { opacity: .5; }
.fav-notice { border-left: 3px solid #ffd76a; margin-bottom: 12px; }
.fav-notice .fav-runs a { display: inline-block; margin: 2px 10px 0 0; font-weight: bold; }
.fav-row td { background: #ffd76a12; }
.race-card .fav-mark { position: absolute; right: 5px; bottom: 5px; font-size: 12px; }
.race-card.has-fav:not(.hit):not(.miss) { border-color: #ffd76a88; }
.user-link { color: #ffd76a; }
.gate-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.btn.danger { background: #b3382f; padding: 4px 10px; font-size: 12px; }

/* 管理画面 */
.admin-form label { display: block; margin-bottom: 10px; font-size: 14px; }
.admin-form input[type=number] { width: 90px; padding: 5px; border-radius: 5px; border: 1px solid #2a3c66; background: #0e1420; color: #fff; }
.admin-form input[type=text], .admin-form select, .inline-form input {
  padding: 5px 8px; border-radius: 5px; border: 1px solid #2a3c66; background: #0e1420; color: #fff; font-size: 14px;
}
.admin-form .hint { color: #8fa0c0; font-size: 12px; margin-left: 8px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.admin-table th, .admin-table td { padding: 6px 8px; border-bottom: 1px solid #223050; text-align: center; }
.admin-table th { color: #8fa0c0; font-weight: normal; font-size: 11px; }
.rule-box { border: 1px solid #2a3c66; border-radius: 8px; margin: 10px 0; padding: 10px 12px; }
.rule-box legend { color: #ffd76a; font-size: 13px; padding: 0 6px; }
.rule-add summary { cursor: pointer; color: #7fb5ff; font-size: 14px; }

@media (max-width: 480px) {
  .race-grid { grid-template-columns: repeat(3, 1fr); }
  .site-head nav a { margin-left: 10px; font-size: 13px; }
}
