@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800;900&display=swap');
:root{--bg:#f2f1e9;--ink:#17282b;--muted:#768077;--green:#c5f26e;--line:#dce0d3}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px 'Noto Sans KR',sans-serif}a{color:inherit;text-decoration:none}button,input,select{font:inherit}button,select{cursor:pointer}button{border:1px solid var(--line);border-radius:9px;background:#fffef8;color:var(--ink);padding:12px 16px;min-height:44px;font-weight:600}button:hover:not(:disabled){filter:brightness(.96)}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid #88a956;outline-offset:3px}input,select{border:1px solid var(--line);border-radius:7px;padding:10px;background:#fffef8;color:var(--ink);min-height:44px}button,input{touch-action:manipulation}[hidden]{display:none!important}.site-nav{max-width:1260px;margin:auto;height:66px;display:flex;align-items:center;justify-content:space-between;padding:0 28px;border-bottom:1px solid var(--line);font-size:11px;letter-spacing:1px}.site-nav b{color:#6b8b45}main{max-width:1260px;margin:auto;padding:36px 28px}.hero{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:32px}.eyebrow{font-size:10px;letter-spacing:2.2px;color:#7b8d70;font-weight:700;margin:0 0 12px}.hero h1{font-size:42px;letter-spacing:-2px;line-height:1.3;margin:0;font-weight:900}.hero h1 em{font-style:normal;color:#4d6a3e}.hero h1 em span{color:#91ab5d;margin-left:8px}.hero p:not(.eyebrow){font-size:14px;color:#747f71;margin:12px 0 0}.hero-tag{font-size:10px;font-weight:700;letter-spacing:1.5px;border:1px solid #d2dcc4;border-radius:50px;padding:15px 21px;background:#e8eedc;white-space:nowrap}.hero-tag small{display:block;color:#78866b;font-size:10px;font-weight:400;letter-spacing:0;margin:7px 0 0 12px}.dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#74964b;margin-right:5px}.game-grid{display:grid;grid-template-columns:290px minmax(0,1fr);align-items:start;gap:24px}.setup-panel{background:#fffdf7;border:1px solid #dee0d3;border-radius:16px;padding:24px;box-shadow:0 5px 24px #24361b05}.panel-title{display:flex;align-items:center;gap:9px}.panel-title h2{font-size:16px;letter-spacing:-.6px;margin:0}.step-tag{background:#e9efdc;border-radius:6px;padding:6px;font-size:10px;color:#6e8651}.panel-title>span:last-child{margin-left:auto;font-size:10px;color:#829273}.muted{font-size:11px;color:#8a9184;line-height:1.9;margin:16px 0 20px}fieldset{border:0;padding:0;margin:0;min-width:0}.count-label{display:flex;align-items:center;justify-content:space-between;font-size:11px;font-weight:600;padding-bottom:16px;border-bottom:1px solid #e9eade;margin-bottom:16px}.count-label select{width:70px;padding:8px}.name-inputs{display:grid;gap:9px}.name-row{display:flex;align-items:center;gap:10px}.name-row label{display:flex;align-items:center;justify-content:center;width:29px;height:29px;border-radius:50%;background:var(--ball);color:#12252a;font-size:11px;font-weight:800;box-shadow:inset -3px -4px 6px #0002,inset 2px 2px 5px #fff8;flex-shrink:0}.name-row input{width:100%;min-width:0;font-size:13px}.primary{display:flex;justify-content:space-between;align-items:center;gap:10px;background:var(--green);border-color:var(--green);font-size:13px;font-weight:800;color:#253b20}.setup-panel .primary{width:100%;margin-top:10px}.error{color:#b8524e;font-size:11px;line-height:1.7;min-height:16px;margin:10px 0}.save-note{font-size:9px;color:#9a9e91;line-height:1.7;margin:12px 0 24px}.how-to{border-top:1px dashed #e0e2d5;padding-top:20px;font-size:11px}.how-to>b{font-size:12px}.how-to p{color:#8c9484;display:flex;align-items:center;gap:8px;margin:12px 0}.how-to p span{display:inline-grid;place-items:center;width:17px;height:17px;border:1px solid #dfe3d4;border-radius:50%;font-size:9px}.track-key{display:flex;flex-wrap:wrap;gap:8px;padding-top:14px;font-size:9px;color:#98a28c}.race-panel{min-width:0;background:#fffdf7;border:1px solid #d7ddcd;border-radius:16px;overflow:hidden;box-shadow:0 8px 36px #21321e0b}.race-header{display:flex;align-items:center;justify-content:space-between;padding:17px 22px;background:#17272d;color:#edf4e6;gap:12px}.race-header strong{font-size:12px;font-weight:600}.live-dot{display:inline-block;width:6px;height:6px;background:#a6bb8a;border-radius:50%;margin-right:8px}.live-dot.running{background:#c5f26e;box-shadow:0 0 10px #c5f266}.race-clock{display:flex;gap:7px;align-items:baseline;font-variant-numeric:tabular-nums}.race-clock>span{font-size:20px;font-weight:700}.race-clock>small{font-size:8px;color:#91a19d}.race-clock>b{font-size:10px;font-weight:400;margin-left:15px;color:#a9bbb0}.stage{height:660px;position:relative;background:#101c22;overflow:hidden}canvas{display:block;width:100%;height:100%}.stage-label{position:absolute;top:16px;left:20px;right:20px;display:flex;justify-content:space-between;color:#9dbaa0;font-size:9px;letter-spacing:1px;pointer-events:none}.stage-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:none;background:linear-gradient(transparent,#101c2299 35%,#101c22dd 65%,transparent);color:#eef9e5;text-align:center;padding:20px}.stage-overlay>span{font-size:10px;letter-spacing:4px;color:#b4d080}.stage-overlay>strong{font-size:38px;letter-spacing:-1.8px;margin:13px 0}.stage-overlay>p{font-size:12px;color:#96ad9b;margin:0;line-height:1.8}.stage-overlay.countdown>strong{font-size:110px;font-variant-numeric:tabular-nums}.race-controls{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:14px 18px;border-bottom:1px solid #e9ecdf}.race-controls button{font-size:11px;padding:8px 12px}.race-controls label{font-size:10px;color:#829075;display:flex;align-items:center;gap:5px}.race-controls select{font-size:11px;padding:8px}.follow-label{margin-left:auto}.standings-head{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:20px 22px 10px}.standings-head h2{font-size:13px;margin:0}.standings-head>span{font-size:9px;color:#9a9e91}.standings{display:grid;grid-template-columns:1fr 1fr;gap:7px 20px;padding:0 22px;margin:0;list-style:none}.standings li{display:flex;align-items:center;gap:9px;font-size:11px;min-width:0;padding:8px 0;border-bottom:1px solid #edf0e4}.place{width:14px;color:#9aab8d;font-size:10px}.ball-dot{width:10px;height:10px;flex-shrink:0;border-radius:50%;background:var(--ball)}.participant-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.race-progress{width:42px;height:3px;background:#e4e8db;border-radius:3px;overflow:hidden}.race-progress i{display:block;height:100%;background:#89a660}.standing-time{font-size:9px;color:#7a8b6c;min-width:40px;text-align:right;font-variant-numeric:tabular-nums}.race-notice{margin:13px 22px 18px;min-height:14px;font-size:10px;line-height:1.7;color:#859377}.result-link{margin:16px 22px 0;font-size:12px;background:#eef4e2}.guide{margin-top:28px;border-top:1px solid #dce2d2;padding:18px 0;font-size:12px;color:#84917d}.guide summary{cursor:pointer;min-height:36px}.guide p{max-width:850px;line-height:1.9;font-size:11px}.ad-label{text-align:center;color:#a7afa0;font-size:8px;letter-spacing:2px;margin:25px 0 8px}.ad-container{min-height:90px;max-width:970px;margin:auto;overflow:hidden}footer{max-width:1204px;margin:20px auto;padding:24px 0;border-top:1px solid #dce2d2;display:flex;justify-content:space-between;font-size:10px;color:#8b9683}
dialog{width:calc(100% - 28px);max-width:480px;max-height:calc(100dvh - 28px);overflow:auto;border:1px solid #d5e3bd;border-radius:18px;background:#fcfcf1;color:var(--ink);padding:32px;box-shadow:0 25px 90px #0005;text-align:center}dialog::backdrop{background:#0d191fd9;backdrop-filter:blur(6px)}body:has(dialog[open]){overflow:hidden}.close-result{position:absolute;right:12px;top:12px;border:0;background:transparent;font-size:24px;width:44px;padding:0}.winner-orb{width:76px;height:76px;border-radius:50%;background:var(--ball);margin:24px auto 18px;display:grid;place-items:center;font-size:30px;font-weight:900;box-shadow:inset -9px -12px 20px #0002,inset 5px 6px 10px #fff9,0 10px 30px #0001;color:#182925}.winner-label{font-size:10px;font-weight:600;color:#7f995e;letter-spacing:2px}dialog h2{font-size:30px;overflow-wrap:anywhere;margin:8px 0;line-height:1.4}#winnerTime{color:#98a088;font-size:11px;margin:0 0 20px}.results{list-style:none;padding:0;margin:0 0 22px;text-align:left}.results li{display:flex;gap:12px;align-items:center;border-bottom:1px solid #e1e6d3;padding:11px 0;font-size:12px}.results li strong{flex:1;overflow-wrap:anywhere}.results li>span:last-child{font-size:10px;color:#94a080;white-space:nowrap}.result-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.result-actions .primary{grid-column:1/-1;justify-content:center}.result-actions button{font-size:11px}#copyStatus{font-size:10px;line-height:1.7;color:#839073;margin:16px 0 0}#copyFallback{width:100%;height:140px;font:12px sans-serif;margin-top:12px}
@media(max-width:950px){.game-grid{grid-template-columns:245px minmax(0,1fr);gap:16px}.setup-panel{padding:18px}.hero h1{font-size:35px}.stage{height:600px}.follow-label{margin-left:0}.race-controls{gap:6px;padding:12px}.standings{gap:5px 12px;padding:0 16px}.race-progress{display:none}}
@media(max-width:720px){.site-nav{height:50px;padding:0 16px;font-size:9px}main{padding:24px 12px}.hero{margin-bottom:22px;gap:10px}.hero h1{font-size:29px;letter-spacing:-1.6px}.hero h1 em{display:block}.hero p:not(.eyebrow){font-size:11px}.eyebrow{font-size:8px;letter-spacing:1.5px}.hero-tag{padding:10px;font-size:8px;letter-spacing:.5px}.hero-tag small{font-size:8px;margin-left:0}.game-grid{grid-template-columns:1fr;gap:16px}.setup-panel{padding:20px}.name-inputs{grid-template-columns:1fr 1fr;gap:10px}.name-row{gap:7px}.name-row input{font-size:12px;padding:9px}.name-row label{width:25px;height:25px;font-size:10px}.setup-panel .muted{font-size:11px;margin:12px 0 16px}.muted br{display:none}.how-to,.track-key{display:none}.save-note{margin:10px 0 0}.count-label{padding-bottom:12px;margin-bottom:12px}.stage{height:540px;height:min(70svh,620px);min-height:390px}.race-header{padding:14px}.race-header strong{font-size:11px}.race-clock>span{font-size:18px}.race-clock>b{margin-left:4px;font-size:9px}.race-controls{padding:10px;gap:6px}.race-controls button{font-size:10px;padding:8px}.race-controls label{font-size:9px}.race-controls select{font-size:10px;padding:6px}.standings-head{padding:16px 14px 8px}.standings-head>span{font-size:8px}.standings{padding:0 14px;gap:4px 12px}.standings li{gap:6px;font-size:10px}.standing-time{font-size:8px;min-width:32px}.race-notice{margin:12px 14px;font-size:9px}.stage-label{top:12px;left:12px;right:12px;font-size:8px}.stage-overlay>strong{font-size:32px}.stage-overlay>p{font-size:11px}.stage-overlay>span{font-size:9px}.setup-panel.locked{display:none}footer{margin:16px 12px;font-size:9px;gap:8px}dialog{padding:26px 20px}dialog h2{font-size:27px}.results li{font-size:11px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

/* Dense races: fixed monitor, numbered balls, and readable mobile rows. */
.race-monitor{position:absolute;z-index:2;right:12px;top:12px;width:124px;border:1px solid #536e65;border-radius:9px;background:#0d1d24ed;overflow:hidden;color:#e5efd9;box-shadow:0 4px 18px #0004}.race-monitor button{width:100%;display:flex;justify-content:space-between;padding:7px 9px;min-height:32px;border:0;border-radius:0;background:#233b3e;color:#e2efcf;font-size:11px}.race-monitor canvas{width:112px;height:152px;margin:0 auto;cursor:crosshair;touch-action:manipulation}.race-monitor p{font-size:10px;margin:4px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.race-monitor small{display:block;color:#9cae9d;font-size:8px;margin:4px 8px 7px}.stage-overlay{z-index:3}.stage-label{right:150px}.ball-dot{width:19px;height:19px;display:inline-grid;place-items:center;color:#17282b;font-size:9px;font-weight:800}.place{flex-shrink:0}.name-inputs{max-height:460px;overflow-y:auto;padding:3px}.race-controls select{max-width:180px}.standings{max-height:430px;overflow-y:auto}.results{max-height:45dvh;overflow-y:auto}.results li strong{min-width:0}.setup-panel .primary{position:relative}.stage-overlay>strong{max-width:100%;overflow-wrap:anywhere}
@media(max-width:720px){.race-monitor{right:8px;top:8px;width:100px}.race-monitor canvas{width:96px;height:130px}.race-monitor button{font-size:10px;min-height:34px}.race-monitor small{font-size:8px}.stage-label{right:116px;letter-spacing:0}.race-header{flex-wrap:wrap;gap:6px;padding:10px 12px}.race-header strong{font-size:11px}.race-clock>b{white-space:nowrap}.name-inputs{max-height:330px}.name-row input{font-size:16px;padding:8px 6px}.standings{grid-template-columns:1fr;max-height:350px}.standings li{font-size:13px;padding:9px 0}.standing-time{font-size:11px;min-width:52px}.standings-head{align-items:flex-start;flex-wrap:wrap}.standings-head>span{font-size:10px}.race-controls label{font-size:11px}.race-controls select{font-size:12px;max-width:175px}.hero-tag{white-space:normal;min-width:80px}.race-progress{display:block;width:48px}.follow-label{width:100%}.results li{font-size:12px}.results li>span:last-child{font-size:11px}.guide summary{line-height:1.8}.race-notice{font-size:11px}}
@media(max-width:480px){.name-inputs{grid-template-columns:1fr}}
@media(max-width:360px){.hero h1{font-size:26px}.hero{align-items:flex-start}.race-clock{width:100%;justify-content:flex-end}.race-controls button{font-size:11px}.hero-tag{font-size:8px;padding:8px}.results li{gap:7px}}

/* Keep touch controls aligned instead of wrapping according to text width. */
button,select{-webkit-appearance:none;appearance:none;line-height:1.4;touch-action:manipulation}
button{text-align:center;word-break:keep-all}
select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23485e50' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:36px!important}
button:active:not(:disabled){transform:translateY(1px)}
@media(max-width:720px){
 .race-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px 10px;padding:16px 12px;background:#f6f7ed;align-items:stretch}
 .race-controls button{width:100%;min-width:0;min-height:50px;padding:12px 8px;font-size:14px;font-weight:700;border-radius:12px;white-space:nowrap;box-shadow:0 2px 0 #17282b0a}
 #pauseButton:not(:disabled){background:#c5f26e;border-color:#afdb59;color:#24381d}
 .race-controls button:disabled{opacity:1;background:#e9ece3;color:#8a9384;border-color:#dde2d5;box-shadow:none}
 .race-controls label{display:flex;flex-direction:column;align-items:stretch;gap:7px;min-width:0;font-size:11px;font-weight:600;color:#67745e}
 .race-controls .follow-label{width:auto;margin:0}
 .race-controls select{width:100%;min-width:0;max-width:none;min-height:48px;border-radius:10px;padding:11px 10px;font-size:16px;font-weight:500;color:#263a2c;background-color:#fffef8;text-overflow:ellipsis}
 .setup-panel .primary{min-height:54px;justify-content:center;padding:14px 35px;font-size:15px;border-radius:12px;box-shadow:0 3px 0 #adc85d66}
 #startButton>span{position:absolute;right:16px;font-size:19px;line-height:1}
 .count-label select{min-height:48px;width:84px;font-size:16px;border-radius:10px}
 .race-monitor button{min-height:44px;padding:10px 9px;font-size:12px;align-items:center}
 .race-monitor button>span{font-size:18px;line-height:1}
 .result-actions{gap:10px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .result-actions button{min-height:50px;min-width:0;padding:12px 8px;font-size:14px;border-radius:12px;line-height:1.5}
 .result-actions .primary{min-height:54px;font-size:15px}
 .result-link{display:block;width:calc(100% - 28px);min-height:50px;margin:16px 14px 0;font-size:14px;border-radius:12px}
 .close-result{min-height:44px;height:44px;display:grid;place-items:center;font-size:26px;line-height:1}
}
