* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background: #f5f5f5;
  color: #333;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

h1 {
  font-size: 1.4rem;
}

/* Nav */
.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: 4px;
  text-decoration: none;
  color: #2563eb;
  font-size: 0.9rem;
  border: 1px solid #e5e7eb;
}

.nav-links a:hover {
  background: #eff6ff;
}

.nav-links a.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.date-form {
  display: flex;
  gap: 8px;
}

.date-form input[type="date"] {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}

.date-form button {
  padding: 6px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.date-form button:hover {
  background: #1d4ed8;
}

/* Calendar */
.calendar-nav {
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cal-label {
  font-weight: bold;
  font-size: 1rem;
}

.cal-arrow {
  text-decoration: none;
  color: #2563eb;
  font-size: 1.2rem;
  padding: 4px 10px;
}

.cal-arrow:hover {
  background: #eff6ff;
  border-radius: 4px;
}

table.calendar {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

table.calendar th {
  padding: 4px;
  text-align: center;
  color: #6b7280;
  font-weight: normal;
  border-bottom: 1px solid #e5e7eb;
}

table.calendar th:first-child {
  color: #dc2626;
}

table.calendar th:last-child {
  color: #2563eb;
}

table.calendar td.cal-day {
  padding: 4px;
  text-align: center;
  color: #9ca3af;
}

table.calendar td.cal-day.has-data {
  color: inherit;
}

table.calendar td.cal-day.has-data a {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  text-decoration: none;
  color: #1e40af;
  font-weight: bold;
  background: #dbeafe;
}

table.calendar td.cal-day.has-data a:hover {
  background: #2563eb;
  color: #fff;
}

table.calendar td.cal-day.has-data.selected a {
  background: #2563eb;
  color: #fff;
}

table.calendar td.cal-day.today {
  position: relative;
}

table.calendar td.cal-day.today::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  background: #dc2626;
  border-radius: 50%;
  margin: 0 auto;
}

/* Stats */
.stats-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats-card h2 {
  font-size: 1rem;
  margin-bottom: 12px;
}

tr.return-plus {
  background: #f0fdf4;
}

.return-rate-plus {
  color: #16a34a;
  font-weight: bold;
}

.return-rate-minus {
  color: #dc2626;
}

.race-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.race-card h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.venue {
  background: #1e40af;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.race-num {
  font-weight: bold;
}

.post-time {
  color: #666;
  font-size: 0.85rem;
}

.status {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.status-scheduled {
  background: #e5e7eb;
  color: #6b7280;
}
.status-odds_early {
  background: #dbeafe;
  color: #2563eb;
}
.status-odds_late {
  background: #fef3c7;
  color: #d97706;
}
.status-done {
  background: #d1fae5;
  color: #059669;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: #f9fafb;
}

th,
td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.center {
  text-align: center;
}
.right {
  text-align: right;
}

tr.drop-large {
  background: #fef2f2;
}
tr.drop-large td:last-child {
  color: #dc2626;
  font-weight: bold;
}

tr.drop {
  background: #fff7ed;
}
tr.drop td:last-child {
  color: #ea580c;
}

tr.rise-large {
  background: #f0fdf4;
}
tr.rise-large td:last-child {
  color: #16a34a;
  font-weight: bold;
}

tr.rise {
  background: #fefce8;
}
tr.rise td:last-child {
  color: #65a30d;
}

.no-data,
.no-results {
  text-align: center;
  color: #9ca3af;
  padding: 32px;
}

.winner-star {
  color: #b45309;
  margin-right: 2px;
}

tr.winner {
  background: #fef9e7;
}

tr.winner td {
  color: #92400e;
  font-weight: bold;
}
