:root {
  --orange: #ff7a1a;
  --orange-d: #d95f00;
  --ink: #1f2430;
  --muted: #6b7280;
  --bg: #fff7ef;
  --card: #ffffff;
  --line: #f0e0d0;
  --gold: #f5b400;
  --race: #2563eb;
  --sumo: #b91c1c;
  --contest: #7c3aed;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--orange-d); }

/* ---------- ヘッダー ---------- */
.hero {
  background: linear-gradient(160deg, var(--orange) 0%, #ff9d4d 60%, #ffc27a 100%);
  color: #fff;
  padding: 28px 18px 18px;
  text-align: center;
}
.hero-kicker { margin: 0; letter-spacing: .2em; font-size: 12px; font-weight: 700; opacity: .9; }
.hero h1 { margin: 6px 0 14px; font-size: 32px; line-height: 1.25; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.12); }
.hero-info { margin: 0 auto 14px; max-width: 520px; text-align: left; background: rgba(255,255,255,.16); border-radius: var(--radius); padding: 10px 14px; }
.hero-info div { display: flex; gap: 12px; padding: 4px 0; }
.hero-info dt { flex: 0 0 3em; font-weight: 700; }
.hero-info dd { margin: 0; }
.hero-info .sub { font-size: 14px; opacity: .95; }
.hero-nav { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hero-nav a { color: #fff; text-decoration: none; padding: 6px 14px; border: 1.5px solid rgba(255,255,255,.7); border-radius: 999px; font-size: 14px; font-weight: 700; }

/* ---------- 共通 ---------- */
main { max-width: 880px; margin: 0 auto; padding: 14px 12px 40px; }
.card-section { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 14px 0; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card-section h2 { margin: 0 0 12px; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.tag { font-size: 12px; background: #fde68a; color: #7c5200; border-radius: 6px; padding: 1px 8px; }
.count { font-size: 14px; color: var(--muted); font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.btn { display: inline-block; border: 0; border-radius: 999px; padding: 12px 20px; font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; font-family: inherit; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--orange); color: #fff; width: 100%; }
.btn-luma { background: #fff; color: var(--orange-d); }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-ghost { background: #f3f4f6; color: var(--ink); }
.btn-danger { background: #dc2626; color: #fff; }

.timetable { list-style: none; padding: 0; margin: 0; }
.timetable li { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.timetable time { flex: 0 0 3.5em; font-weight: 700; color: var(--orange-d); font-variant-numeric: tabular-nums; }
.notes { margin: 0; padding-left: 1.2em; }

/* ---------- フォーム ---------- */
.field { display: block; margin: 0 0 14px; border: 0; padding: 0; }
.label { display: block; font-weight: 700; margin-bottom: 4px; }
.label em { font-style: normal; font-size: 12px; color: #fff; background: var(--orange); border-radius: 4px; padding: 0 6px; margin-left: 4px; }
.label small { font-size: 12px; color: var(--muted); margin-left: 4px; }
input[type=text], input[type=password], input[type=number], select {
  width: 100%; font-size: 16px; padding: 10px 12px; border: 1.5px solid #e5d5c5; border-radius: 10px; background: #fff; font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
input[type=file] { font-size: 14px; max-width: 100%; }
.checks { display: flex; gap: 8px; flex-wrap: wrap; }
.checks label { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1.5px solid #e5d5c5; border-radius: 999px; font-weight: 600; }
.checks input { width: 18px; height: 18px; accent-color: var(--orange); }
.photo-preview { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.photo-preview img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; }
.msg { min-height: 1.5em; margin: 10px 0 0; font-weight: 600; }
.msg-ok { color: #15803d; }
.msg-error { color: #dc2626; }

/* ---------- 参加者カード ---------- */
.entries-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.entry-card { background: #fffaf5; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.entry-photo { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #ffe9d6; }
.entry-photo-none { display: flex; align-items: center; justify-content: center; font-size: 44px; }
.entry-body { padding: 8px 10px 10px; }
.entry-name { margin: 0; font-weight: 800; word-break: break-word; }
.entry-robot { margin: 0; font-size: 13px; color: var(--orange-d); word-break: break-word; }
.entry-robot::before { content: "🤖 "; }
.entry-events { margin: 6px 0 0; display: flex; gap: 4px; flex-wrap: wrap; }
.ev { font-size: 11px; font-weight: 700; color: #fff; border-radius: 4px; padding: 0 6px; }
.ev-race { background: var(--race); }
.ev-sumo { background: var(--sumo); }
.ev-contest { background: var(--contest); }

/* ---------- レース ---------- */
.race-group { margin: 8px 0 8px; font-size: 17px; border-left: 4px solid var(--orange); padding-left: 8px; }
.rounds { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .rounds { grid-template-columns: repeat(3, 1fr); } }
.round { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fffaf5; }
.round h4 { margin: 0; padding: 8px 12px; background: #ffe9d6; font-size: 15px; }
.round-head, .runner { display: grid; grid-template-columns: 2.2em 1fr auto 3.6em; gap: 6px; align-items: center; padding: 6px 10px; }
.round-head { font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); }
.runners { list-style: none; margin: 0; padding: 0; }
.runner { border-bottom: 1px solid var(--line); }
.runner:last-child { border-bottom: 0; }
.runner .pos { font-weight: 800; color: var(--orange-d); text-align: center; }
.who { display: flex; flex-direction: column; min-width: 0; }
.who-name { font-weight: 700; overflow-wrap: anywhere; }
.who-robot { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.runner .time { font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; }
.runner .rank { font-weight: 800; text-align: right; white-space: nowrap; }
.runner .note { grid-column: 2 / -1; font-size: 12px; color: var(--muted); }
.runner.winner { background: linear-gradient(90deg, #fff4c2, #fffaf5); }
.runner.winner .rank { color: #a16207; }
.pending { padding: 14px; text-align: center; color: var(--muted); }

.updated { text-align: center; color: var(--muted); font-size: 12px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0 30px; }
