:root {
  color-scheme: light;
  font-family: Inter, "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --ink: #132323;
  --muted: #657373;
  --line: #d8e2e0;
  --paper: #ffffff;
  --bg: #f5f7f7;
  --teal: #0b5f68;
  --teal-2: #14818b;
  --gold: #c89322;
  --red: #b84444;
  --green: #257257;
  --shadow: 0 14px 38px rgba(20, 36, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: linear-gradient(110deg, #083f47, #0f6f74 55%, #a8791a);
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 148px;
  padding: 28px clamp(18px, 4vw, 56px);
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 8px;
  opacity: 0.8;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.1;
}

.status-pill {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  min-width: 96px;
  padding: 9px 14px;
  text-align: center;
}

main {
  margin: -32px auto 0;
  max-width: 1180px;
  padding: 0 18px 48px;
}

.control-band,
.metric,
.race-card {
  background: var(--paper);
  box-shadow: var(--shadow);
}

.control-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.controls {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 1.1fr 1fr auto;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  background: #f9fbfb;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 11px;
  width: 100%;
}

.primary-button {
  background: var(--teal);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 0 22px;
}

.primary-button:hover {
  background: var(--teal-2);
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 16px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  font-size: 24px;
  margin-top: 5px;
}

.notice {
  background: #fff7e3;
  border: 1px solid #ecd28f;
  border-radius: 8px;
  color: #62450a;
  line-height: 1.7;
  margin-top: 16px;
  padding: 14px 16px;
}

.race-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.race-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.race-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px;
}

.race-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.race-head h2 {
  font-size: 19px;
}

.race-decision {
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

.race-decision.bet {
  background: #dff3ea;
  color: var(--green);
}

.race-decision.skip {
  background: #f5e4e4;
  color: var(--red);
}

.boat-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(6, 1fr);
  background: var(--line);
}

.boat {
  background: #fff;
  min-width: 0;
  padding: 12px;
}

.boat .lane {
  align-items: center;
  border-radius: 50%;
  display: inline-flex;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  margin-bottom: 8px;
  width: 30px;
}

.lane-1 { background: #f4f4f4; color: #111; border: 1px solid #d7d7d7; }
.lane-2 { background: #2e2e2e; color: #fff; }
.lane-3 { background: #d44747; color: #fff; }
.lane-4 { background: #3177c9; color: #fff; }
.lane-5 { background: #e3c545; color: #302000; }
.lane-6 { background: #4a9c54; color: #fff; }

.boat strong {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.boat small {
  color: var(--muted);
  display: block;
  line-height: 1.5;
  margin-top: 6px;
}

.score-bar {
  background: #e8eeee;
  border-radius: 999px;
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
}

.score-bar i {
  background: var(--teal-2);
  display: block;
  height: 100%;
}

.ticket-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.ticket {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 110px 1fr auto auto;
  padding: 12px;
}

.ticket-type {
  color: var(--teal);
  font-weight: 900;
}

.combo {
  font-size: 18px;
  font-weight: 900;
}

.ev {
  color: var(--muted);
  font-size: 13px;
}

.stake {
  color: var(--gold);
  font-size: 18px;
  font-weight: 900;
}

.empty-state {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.7;
  padding: 24px;
  text-align: center;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .controls,
  .summary-grid,
  .boat-grid,
  .ticket {
    grid-template-columns: 1fr;
  }

  .race-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}
