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

.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: 15px;
}

.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;
}

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

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

/* === 日付選択 === */
.date-scroll {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background-color: #f4f4f4;
  border-radius: 6px;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

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

.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;
}

/* === 競馬場ボタン === */
#course-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}

#course-buttons .race-card {
  width: 80%;
  background: #3463ff;
  color: #fff;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  border: 2px solid #1b5bff;
  font-size: 16px;
}

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

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

/* === ウマ娘カード：グリッド表示 === */
#umamusume-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.uma-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 170px;
  height: 40px;
  padding: 5px 7px;
  background-color: #ffffff;
  border: 2px solid #f3f3f3;
  border-radius: 8px;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.05);
  font-family: "Segoe UI", sans-serif;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.uma-card:hover,
.uma-card.selected {
  transform: scale(1.03);
  border-color: #7b61ff;
  background-color: #f9f7ff;
}

.uma-card img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 5px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.uma-card-name {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

/* === ボタン === */
.green-button {
  background: linear-gradient(to bottom, #87ba30, #59ac01);
  border: 1px solid #4cae00;
  border-radius: 10px;
  color: white;
  font-weight: bold;
  margin: 16px 0;
  font-size: 16px;
  padding: 10px 24px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.green-button:hover {
  background: linear-gradient(to bottom, #76a92c, #4a9600);
}

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

.hidden {
  display: none !important;
}

/* === レース番号（グリッド） === */
#race-number-buttons {
  display: none;
  gap: 6px;
  margin-top: 8px;
  grid-template-columns: repeat(6, minmax(60px, 1fr));
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.race-no-btn.gray-button {
  text-align: center;
  font-weight: 600;
  margin-left: 0;
}

#all-races-btn.gray-button {
  margin-left: 0;
}

.race-no-btn.selected,
#all-races-btn.selected {
  background: #fdffb8;
  border-color: #3463ff;
  color: #111;
}

#search-preview #preview-uma img,
#result-summary #summary-uma img {
  width: 28px !important;
  height: 28px !important;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
  display: inline-block;
  vertical-align: middle;
}

#search-summary {
  border: 1px solid #ccc;
  background: #fafafa;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
}

#search-summary img {
  vertical-align: middle;
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
  margin-left: 6px;
}

#all-races-btn {
  grid-column: 1 / -1;
  padding: 10px 12px;
  font-weight: 700;
}

/* === 結果エリア === */
.result-block {
  background: #fff;
  padding: 1em;
  margin-top: 2em;
  border-radius: 8px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

.horse-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 20px;
  overflow: hidden;
  padding: 8px;
}

.course {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.horse-number-name {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.horse-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.bloodline {
  font-size: 0.95rem;
  color: #333;
}

/* 馬番スタイル */
.horse-number {
  font-size: 1.1rem;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 4px;
  color: white;
  text-align: center;
}

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

/* 枠色 */
.frame-1 {
  background-color: #fff;
  color: #000;
  border: 1px solid #999;
}

.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: #00c000;
  color: #fff;
}

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

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

/* 進捗バー */
.progress-bar {
  width: 100%;
  height: 10px;
  background: #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
  margin: 12px 0;
}

#progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #59ac01;
  transition: width .3s ease;
}

/* ==== 通知バナー ==== */
#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);
  white-space: pre-line; 
}

/* 時間帯クラス */
#notice-box.range-1 {
  background: #ff7a7a;
}

/* 特別レース登録馬期間 */
#notice-box.range-2 {
  background: #1e96ff;
}

/* 出走想定（特別以外）期間 */
#notice-box.range-3 {
  background: #1e96ff;
}

/* 出走確定期間 */
#notice-box.range-4 {
  background: #1e96ff;
}

/* 土曜確定データOK */
#notice-box.range-5 {
  background: #1e96ff;
}

/* 日曜（＆月曜開催注意） */

body {
  padding-top: 56px;
}

/* スマホ */
@media (max-width: 600px) {
  #course-buttons {
    justify-content: center;
  }

  #umamusume-list {
    justify-content: center;
    padding: 0 6px;
  }

  .uma-card {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 80px;
    height: auto;
    padding: 5px;
    text-align: center;
  }

  .uma-card img {
    width: 60px;
    height: 60px;
    margin: 3px 0;
  }

  .uma-card-name {
    font-size: 8px;
    margin-top: 2px;
    white-space: normal;
    line-height: 1.2;
  }

  #race-number-buttons {
    grid-template-columns: repeat(4, minmax(52px, 1fr));
  }
}