/* === 全体レイアウト & 背景 === */
body {
  color: #1f1f1f;
  max-width: 960px;
  font-family: 'Helvetica Neue', sans-serif;
  margin: 0 auto;
  padding: 56px 16px 0 16px;
}

#notice-box {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #0077cc;
  color: #fff;
  text-align: center;
  padding: 12px;
  margin-bottom: 7px;
  font-weight: 700;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.container {
  max-width: 100%;
  width: 100%;
  padding: 10px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* === タイトルバナー === */
.title-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 8px;
}

.title-banner {
  display: inline-block;
  background: linear-gradient(135deg, #7b61ff, #6a50e5);
  color: white;
  padding: 12px 20px;
  border-radius: 4px;
  font-family: 'Segoe UI', sans-serif;
  transform: skew(-15deg);
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
  margin: 30px 0 20px;
}

.title-banner span {
  display: inline-block;
  transform: skew(15deg);
}

.title-en {
  font-size: 1em;
  font-weight: bold;
  margin-right: 12px;
}

.title-ja {
  font-size: 2em;
  font-weight: bold;
  opacity: 0.85;
}

.title-banner .title-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.manual-link {
  font-size: 0.9em;
  color: #007bff;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
}

.manual-link:hover {
  text-decoration: underline;
}

/* === 見出し === */
h1 {
  font-size: 2em;
  margin-bottom: 1.5rem;
  text-align: center;
}

h2 {
  font-size: 1.2em;
  margin-top: 2rem;
}

/* === テーブル表示 === */
table {
  border-collapse: collapse;
  margin-top: 1em;
}

th,
td {
  border: 1px solid #aaa;
  padding: 6px 10px;
}

th {
  background: #ddd;
}

/* === 入力フォーム系 === */
.form-group {
  margin-bottom: 1em;
}

.search-btn {
  background-color: #28a745;
  color: white;
  font-weight: bold;
  border: none;
  padding: 1rem;
  margin-top: 2rem;
  width: 100%;
  font-size: 1.1em;
  cursor: pointer;
}

.button-group button {
  background-color: #777;
  color: #fff;
  border: none;
  margin-right: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

/* === 結果 & メッセージ表示 === */
.result-block {
  background: #fff;
  padding: 1em;
  margin-top: 2em;
  border-radius: 8px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

.error {
  color: red;
  margin-top: 1em;
}

.note {
  font-size: 0.9em;
  color: #aaa;
}

.center {
  text-align: center;
}

/* === 日付スクロールエリア === */
.date-scroll {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background-color: #f4f4f4;
  border-radius: 6px;
  gap: 12px;
  max-width: 100%;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#dateStrip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
}

.date-btn {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.95em;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border 0.2s;
}

.date-btn.active {
  border: 2px solid #007bff;
  font-weight: bold;
  background-color: #eef5ff;
}

.weekday {
  font-size: 0.75em;
  margin-left: 4px;
}

.weekday.sat {
  color: #007bff;
}

.weekday.sun {
  color: #e60033;
}

/* === レース選択エリア === */
.race-selector-area {
  padding: 8px 16px;
  border-radius: 6px;
  background-color: #fff;
}

.race-selector-area h4 {
  color: #fff;
  margin-bottom: 0.5rem;
}

#race-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

/* === 各競馬場ブロック === */
.race-group h3 {
  font-size: 0.95rem;
  color: #333;
  text-align: center;
  margin: 0 0 10px;
  letter-spacing: .2px;
}

.race-group h3 .meet-round,
.race-group h3 .meet-day {
  color: #6b6b6b;
  font-weight: 500;
  margin: 0 6px;
  font-size: 0.9rem;
}

.race-group h3 .meet-place {
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0 4px;
  color: #222;
}

/* === レース番号ボタン群 === */
.race-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
}

.race-card {
  background: #3463ff;
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  border: 2px solid #1b5bff;
  min-width: 50px;
  transition: all 0.2s ease;
}

.race-card:hover {
  background: #fafafa;
  color: #111;
}

.race-card.selected {
  background: #fdffb8;
  color: #111;
  border-color: #3463ff;
}

.race-info-box {
  margin-top: 1rem;
  padding: 0.8rem;
  background-color: #f6f6f6;
  border-left: 6px solid #3463ff;
  font-size: 1em;
  color: #333;
  border-radius: 6px;
}

/* === ボタンスタイル === */
.green-button {
  background: linear-gradient(to bottom, #87ba30, #59ac01);
  border: 1px solid #4cae00;
  border-radius: 10px;
  color: white;
  font-weight: bold;
  margin: 16px;
  font-size: 16px;
  padding: 10px 24px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #d8ffb2, 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease-in-out;
}

.green-button:hover {
  background: linear-gradient(to bottom, #b8f454, #5cab00);
  box-shadow: inset 0 1px 0 #e4ffc1, 0 3px 8px rgba(0, 0, 0, 0.4);
}

.green-button:active {
  background: linear-gradient(to bottom, #64c000, #a4e33b);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transform: translateY(1px);
}

.gray-button {
  background-color: #eee;
  border: 1px solid #ccc;
  color: #333;
  padding: 6px 12px;
  margin-left: 8px;
  cursor: pointer;
  border-radius: 4px;
}

/* === 馬カード === */
.horse-card {
  display: flex;
  align-items: flex-start;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 20px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.horse-number {
  width: 40px;
  height: 40px;
  line-height: 40px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 18px;
  text-align: center;
  margin-right: 10px;
}

.frame-1 {
  background-color: #fff;
  color: #000;
}

.frame-2 {
  background-color: #000;
  color: #fff;
}

.frame-3 {
  background-color: #f00000;
  color: #fff;
}

.frame-4 {
  background-color: #0000ff;
  color: #fff;
}

.frame-5 {
  background-color: #ffff00;
  color: #000;
}

.frame-6 {
  background-color: #00ff00;
  color: #fff;
}

.frame-7 {
  background-color: #ff8000;
  color: #fff;
}

.frame-8 {
  background-color: #ffb3ff;
  color: #000;
}

.horse-number.neutral {
  background-color: #f2f2f2;
  color: #666;
  border: 1px solid #ddd;
}

.horse-main {
  padding: 12px;
  flex: 1;
}

.frame-color-bar {
  width: 8px;
  min-width: 8px;
}

.horse-img .uma-image,
.uma-img,
.uma-card img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  margin: 0 10px;
}

.horse-info {
  flex-grow: 1;
  padding: 4px;
}

.horse-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.horse-detail {
  font-size: 14px;
  margin: 4px 0;
}

.gene {
  display: inline-block;
  padding: 0 6px;
  margin-right: 2px;
  border-radius: 4px;
  line-height: 1.2;
  font-weight: bold;
}

.gene-fu {
  background: #cbe0ff;
}

.gene-bo {
  background: #ffe3e3;
}

.range-1,
.range-2,
.range-3,
.range-4,
.range-5 {
  white-space: pre-line;
}

/* === スマホ用調整 === */
@media (max-width: 600px) {
  .date-scroll {
    max-width: 100%;
    gap: 8px;
  }

  .title-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }

  .manual-link {
    margin-top: -10px;
  }

  #dateStrip {
    gap: 8px;
    overflow-x: auto;
    min-width: 0;
  }

  #race-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 8px;
    margin-top: 12px;
  }

  .race-group h3 {
    font-size: 12px;
    margin: 0 0 6px;
  }

  .race-group h3 .meet-round,
  .race-group h3 .meet-day {
    font-size: 11px;
    margin: 0 4px;
  }

  .race-group h3 .meet-place {
    font-size: 14px;
    margin: 0 2px;
  }

  .race-buttons {
    gap: 4px;
    align-items: stretch;
  }

  .race-card {
    padding: 3px 0;
    font-size: 12px;
    border-radius: 6px;
    line-height: 1.5;
    min-width: auto;
  }

  .date-btn {
    padding: 2px 8px;
    font-size: 12px;
  }

  .race-info-box {
    font-size: 0.95em;
    padding: 0.6rem;
  }
}

@media (max-width: 360px) {

  .race-group h3 .meet-round,
  .race-group h3 .meet-day {
    display: none;
  }
}