:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #dce4ed;
  --accent: #2563eb;
  --focus: #0f766e;
  --shadow: 0 16px 46px #0f172a0c;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
a { color: #1d4ed8; }
a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.frame { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.bar { background: var(--surface); border-block-end: 1px solid var(--line); }
.bar-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.logo { font-size: 1.16rem; font-weight: 800; letter-spacing: -.04em; color: var(--ink); text-decoration: none; }
.logo span { color: var(--accent); margin-inline-end: 5px; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; }
nav a { color: var(--muted); text-decoration: none; font-weight: 650; font-size: .88rem; }
nav a:hover { text-decoration: underline; }
.intro { margin: 31px 0 23px; }
h1 { font-size: clamp(2.1rem, 5vw, 3.65rem); letter-spacing: -.064em; line-height: 1.05; margin: 0 0 12px; }
.intro p { margin: 0; color: var(--muted); max-width: 70ch; }
.tool { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.wheel-card, .controls { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 25px; min-width: 0; }
.wheel-card { text-align: center; background: radial-gradient(circle at 50% 44%, #e8f2ff, white 75%); }
.visual { width: min(100%, 365px); aspect-ratio: 1; position: relative; margin: 10px auto 0; isolation: isolate; }
canvas { width: 100%; height: 100%; display: block; clip-path: circle(49.5%); }
.pointer { position: absolute; z-index: 1; width: 29px; height: 31px; top: -5px; left: calc(50% - 14.5px); background: var(--ink); clip-path: polygon(0 0,100% 0,50% 100%); }
button { font: inherit; min-height: 40px; cursor: pointer; background: white; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-weight: 650; padding: 6px 11px; }
button:hover:enabled { border-color: var(--accent); }
button:disabled { cursor: default; opacity: .55; }
.spin { position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 22%; min-width: 64px; aspect-ratio: 1; border-radius: 50%; border: 3px solid #fff; background: #15233c; color: #fff; font-weight: 800; box-shadow: 0 0 0 3px #ffffff66, 0 5px 15px #0f172a56; }
.result { font-size: 1.21rem; font-weight: 800; margin: 14px 0 9px; overflow-wrap: anywhere; }
.notice { min-height: 1.5em; margin: 6px 0 0; color: var(--muted); font-size: .86rem; }
.stage-actions, .examples { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.wheel-card .stage-actions { justify-content: center; }
.controls label { font-weight: 740; }
.controls h2 { margin: 16px 0 6px; font-size: 1rem; }
.controls h2:first-child { margin-top: 0; }
.hint { margin: 4px 0 9px; color: var(--muted); font-size: .87rem; }
textarea { width: 100%; border: 1px solid #bccadd; border-radius: 12px; padding: 10px; font: inherit; color: var(--ink); resize: vertical; background: #f9fbff; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
[data-history] { margin: 0; padding-left: 24px; max-height: 126px; overflow: auto; color: var(--muted); overflow-wrap: anywhere; }
.guide { max-width: 70ch; padding: 24px 0 42px; }
.guide h2 { margin-top: 27px; line-height: 1.2; }
.footer { border-block-start: 1px solid var(--line); border-block-end: 0; }
.skip { position: absolute; top: -100px; left: 12px; z-index: 9; background: #fff; padding: 8px; }
.skip:focus { top: 8px; }
.wheel-card:fullscreen { display: flex; flex-direction: column; justify-content: center; border-radius: 0; }
.wheel-card:fullscreen .visual { width: min(66vh, 85vw); }
@media (max-width: 690px) {
  .tool { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .wheel-card, .controls { padding: 15px; }
  .visual { width: min(100%, 310px); }
  .bar-inner { padding-block: 9px; }
}
