:root {
  --ink: #10231f;
  --deep: #071f1c;
  --green: #0b4939;
  --mint: #7dd7a9;
  --cream: #f2eee2;
  --paper: #faf8f1;
  --line: rgba(16, 35, 31, .16);
  --gold: #d6a948;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: "Noto Sans JP", sans-serif; min-height: 100vh; }
button, input { font: inherit; }
button { color: inherit; }
.grain { position: fixed; inset: 0; pointer-events: none; opacity: .22; z-index: 20; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E"); }
.topbar { height: 74px; display: flex; align-items: center; border-bottom: 1px solid var(--line); padding: 0 5vw; gap: 42px; background: rgba(242,238,226,.92); position: relative; z-index: 10; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { font-family: "Shippori Mincho", serif; font-weight: 800; font-size: 29px; letter-spacing: -.08em; }
.brand-en { font-size: 9px; letter-spacing: .28em; font-weight: 900; }
.meet { display: flex; align-items: center; gap: 9px; font-size: 12px; letter-spacing: .06em; }
.meet strong { border-left: 1px solid var(--line); padding-left: 14px; margin-left: 5px; }
.live-dot { width: 7px; height: 7px; background: #d64d3f; border-radius: 50%; box-shadow: 0 0 0 4px rgba(214,77,63,.12); animation: pulse 1.8s infinite; }
.wallet { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.wallet-amount { display: flex; align-items: center; gap: 15px; }
.wallet-amount > span { font-size: 10px; color: #53645f; }
.wallet strong { font-family: "Shippori Mincho"; font-size: 20px; }
.wallet small { font-family: inherit; font-size: 9px; letter-spacing: .1em; }
.share-button { display: flex; align-items: center; gap: 5px; min-height: 31px; padding: 0 10px; border: 1px solid var(--line); border-radius: 2px; background: transparent; cursor: pointer; transition: .18s ease; }
.share-button span { font-size: 13px; }
.share-button b { font-size: 9px; letter-spacing: .08em; }
.share-button:hover { color: white; border-color: var(--ink); background: var(--ink); }
main { width: min(1440px, 92vw); margin: 0 auto; }
.hero { min-height: 146px; display: flex; align-items: flex-end; justify-content: space-between; padding: 28px 0 26px; }
.eyebrow { margin: 0 0 3px; color: #557168; font-weight: 700; letter-spacing: .18em; font-size: 10px; }
h1 { font-family: "Shippori Mincho"; font-size: clamp(33px, 4vw, 52px); line-height: 1; letter-spacing: .06em; margin: 0; }
h1 span { font-family: inherit; display: inline-block; transform: translateY(-5px); font-size: 12px; background: var(--gold); color: white; border-radius: 2px; padding: 5px 7px; letter-spacing: .08em; }
.subcopy { margin: 10px 0 0; font-size: 11px; letter-spacing: .12em; color: #60716b; }
.weather { display: flex; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.weather div { padding: 12px 23px; border-right: 1px solid var(--line); display: grid; gap: 4px; min-width: 104px; }
.weather div:last-child { border: 0; }
.weather span { font-size: 9px; color: #788781; }
.weather strong { font-size: 13px; }
.weather .good { color: #17754f; font-family: "Shippori Mincho"; }
.race-shell { display: grid; grid-template-columns: minmax(0, 1fr) 340px; background: var(--deep); box-shadow: 0 22px 60px rgba(7,31,28,.18); }
.race-stage { min-height: 540px; position: relative; overflow: hidden; background: #123d38; }
#race-canvas { display: block; width: 100%; height: 540px; }
.stage-top { position: absolute; left: 22px; right: 22px; top: 20px; display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.lap-chip { padding: 10px 13px; min-width: 112px; color: white; background: rgba(3,20,18,.68); backdrop-filter: blur(8px); border-left: 2px solid var(--mint); display: flex; flex-direction: column; gap: 2px; }
.lap-chip span { font-size: 9px; letter-spacing: .15em; color: #a9c6bc; }
.lap-chip strong { font-family: "Shippori Mincho"; font-size: 19px; letter-spacing: .05em; }
.icon-button { pointer-events: auto; border: 1px solid rgba(255,255,255,.3); background: rgba(3,20,18,.45); color: white; border-radius: 50%; width: 38px; height: 38px; cursor: pointer; }
.icon-button.muted { opacity: .45; text-decoration: line-through; }
.ticker { position: absolute; bottom: 0; left: 0; right: 0; min-height: 53px; display: flex; align-items: center; gap: 15px; padding: 10px 22px; color: white; background: rgba(3,20,18,.86); backdrop-filter: blur(8px); }
.ticker span { flex: 0 0 auto; font-size: 9px; font-weight: 900; color: var(--deep); background: var(--mint); padding: 4px 7px; }
.ticker p { font-family: "Shippori Mincho"; margin: 0; font-size: 13px; letter-spacing: .04em; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font: 800 130px/1 "Shippori Mincho"; color: white; text-shadow: 0 8px 40px #04251f; z-index: 4; }
.hidden { display: none !important; }
.result-card { position: absolute; z-index: 6; width: min(390px, 80%); left: 50%; top: 50%; transform: translate(-50%,-53%); color: var(--ink); background: rgba(250,248,241,.96); backdrop-filter: blur(10px); padding: 27px; box-shadow: 0 20px 80px rgba(0,0,0,.35); }
.result-card > p { margin: 0 0 17px; font-size: 10px; font-weight: 900; letter-spacing: .25em; color: #697873; }
.podium-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.podium-row span { font: 800 22px "Shippori Mincho"; }
.podium-row b { font-size: 13px; }
.podium-row em { font-style: normal; color: #5b6b66; font-size: 11px; }
.result-card button { width: 100%; margin-top: 14px; padding: 12px; border: 0; background: var(--green); color: white; cursor: pointer; font-weight: 700; }
.bet-panel { background: var(--paper); padding: 25px 24px 20px; display: flex; flex-direction: column; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.panel-heading p, .section-title span { color: #72817c; font-weight: 700; font-size: 9px; letter-spacing: .16em; margin: 0 0 3px; }
.panel-heading h2, .section-title h2 { font-family: "Shippori Mincho"; font-size: 18px; margin: 0; }
.panel-heading > span { background: #d9f0e3; color: #176943; border-radius: 20px; padding: 4px 8px; font-size: 9px; font-weight: 700; }
.racer-list { display: grid; gap: 7px; }
.racer { --racer: #4b8d55; display: grid; grid-template-columns: 28px 37px 1fr auto; align-items: center; gap: 8px; padding: 9px; border: 1px solid rgba(16,35,31,.11); cursor: pointer; background: transparent; text-align: left; transition: .18s ease; }
.racer:hover { transform: translateX(2px); border-color: var(--green); }
.racer.selected { border-color: var(--green); background: #e7efe8; box-shadow: inset 3px 0 var(--green); }
.racer:disabled { cursor: default; opacity: .62; transform: none; }
.lane { width: 25px; height: 25px; display: grid; place-items: center; font: 800 12px "Shippori Mincho"; background: var(--lane); color: var(--laneText, white); }
.racer-ball, .mini-marimo { position: relative; display: block; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #88b979 0 4%, var(--racer) 30%, #174a30 73%, #092b21); box-shadow: inset -5px -5px 9px rgba(0,0,0,.25), inset 4px 2px 6px rgba(255,255,255,.12); }
.racer-name { min-width: 0; }
.racer-name b { display: block; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.racer-name small { color: #79847f; font-size: 8px; }
.odds { font: 700 12px "Shippori Mincho"; }
.odds small { display: block; font: 500 7px "Noto Sans JP"; color: #89938f; }
.stake-area { margin-top: auto; padding-top: 18px; }
.stake-label { display: flex; justify-content: space-between; align-items: center; font-size: 10px; }
.stake-label strong { font-family: "Shippori Mincho"; font-size: 16px; }
input[type="range"] { appearance: none; width: 100%; height: 3px; margin: 17px 0 3px; background: linear-gradient(90deg, var(--green) var(--fill, 0%), #d6dbd6 var(--fill, 0%)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 17px; height: 17px; border: 4px solid var(--paper); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.stake-marks { display: flex; justify-content: space-between; color: #89938f; font-size: 7px; }
.start-button { margin-top: 16px; min-height: 50px; padding: 0 17px; display: flex; justify-content: space-between; align-items: center; border: 0; background: var(--green); color: white; font-weight: 700; font-size: 12px; cursor: pointer; transition: .2s; }
.start-button:not(:disabled):hover { background: #12634c; transform: translateY(-1px); }
.start-button:disabled { cursor: not-allowed; background: #bdc5c0; }
.start-button i { font-size: 19px; font-style: normal; }
.hint { min-height: 14px; text-align: center; margin: 8px 0 0; font-size: 8px; color: #83908b; }
.lower-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; margin: 28px 0 55px; }
.info-card { border-top: 2px solid var(--ink); padding: 17px 0 0; }
.section-title { margin-bottom: 14px; }
.ranking-row { display: grid; grid-template-columns: 25px 35px 1fr auto; align-items: center; gap: 10px; padding: 11px 8px; border-top: 1px solid var(--line); }
.ranking-row > strong { font-family: "Shippori Mincho"; }
.ranking-row div b { display: block; font-size: 11px; }
.ranking-row small { font-size: 8px; color: #76837f; }
.ranking-row em { font-size: 9px; font-style: normal; border: 1px solid var(--line); padding: 3px 7px; }
.mini-marimo { width: 30px; height: 30px; }
.mini-marimo.green { --racer: #477c4f; }.mini-marimo.lime { --racer: #78a852; }.mini-marimo.moss { --racer: #305f3a; }
.history-podium { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; padding: 10px 7px; border-top: 1px solid var(--line); }
.history-podium span { font: 800 18px "Shippori Mincho"; }.history-podium b { font-size: 11px; }.history-podium em { font-size: 9px; color: #798681; font-style: normal; }
.payout { display: flex; justify-content: space-between; margin-top: 10px; padding: 10px; color: white; background: var(--green); font-size: 10px; }
footer { background: var(--deep); color: #94aaa3; display: flex; justify-content: space-between; padding: 26px 5vw; font-size: 8px; letter-spacing: .12em; }
footer p { margin: 0; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(214,77,63,0); } }
@media (max-width: 900px) {
  .race-shell { grid-template-columns: 1fr; }
  .race-stage, #race-canvas { min-height: 450px; height: 450px; }
  .racer-list { grid-template-columns: 1fr 1fr; }
  .stake-area { margin-top: 20px; }
  .weather { display: none; }
}
@media (max-width: 580px) {
  .topbar { padding: 0 4vw; gap: 14px; }.meet > span:not(.live-dot) { display: none; }.wallet-amount > span { display: none; }
  .share-button { padding: 0 8px; }.share-button b { display: none; }
  main { width: 94vw; }.hero { min-height: 125px; }.race-stage, #race-canvas { min-height: 390px; height: 390px; }
  .bet-panel { padding: 20px 14px; }.racer-list { grid-template-columns: 1fr; }.racer { padding: 7px; }
  .lower-grid { grid-template-columns: 1fr; }.ticker p { font-size: 11px; }
  footer { display: block; line-height: 2; }
}
