:root {
  color-scheme: light;
  --polaris-green: #00843d;
  --blue: #3387f7;
  --ink: #30343a;
  --deep-green: #10231a;
  --soft-green: #b4e0bf;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--deep-green); color: #f4f7f4; font-family: Arial, Helvetica, sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar { display: none; }
.mobile-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.brand-mark {
  width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px;
  background: var(--polaris-green); color: #fff; font-size: 16px;
}
.demo-badge { padding: 6px 10px; border-radius: 999px; background: rgba(0,132,61,.1); color: var(--polaris-green); font-size: 10px; letter-spacing: .08em; }
.setup { min-height: 100vh; display: flex; align-items: center; padding: 50px clamp(32px, 7vw, 112px); background: var(--deep-green); color: #f4f7f4; }
.home-layout {
  position: relative; width: min(1320px, 100%); min-height: 690px; margin: 0 auto; padding: 60px 0 72px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .98fr); gap: clamp(40px, 7vw, 100px); align-items: center;
}
.home-copy { max-width: 620px; }
.home-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 28px; color: #b4e0bf; font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.home-kicker .brand-mark { background: var(--soft-green); color: var(--deep-green); }
.kicker-divider { opacity: .55; }
.home-copy h1 { margin: 0 0 22px; max-width: 640px; font-size: clamp(45px, 6vw, 76px); line-height: 1.02; letter-spacing: -.055em; font-weight: 600; }
.narrow-title, .narrow-description { display: none; }
.home-description { max-width: 440px; margin: 0 0 32px; color: #b5c8ba; font-size: 17px; line-height: 1.6; }
.setup-controls { max-width: 520px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 8px; color: #d7e3d9; font-size: 12px; font-weight: 600; }
.field select {
  width: 100%; height: 50px; padding: 0 14px; border: 1px solid rgba(235,246,238,.22); border-radius: 9px;
  color: #f4f7f4; background: #1b3325; font-size: 14px; outline-color: var(--soft-green);
}
.field select option { color: #17221a; background: #fff; }
.action-button { min-height: 48px; border: 0; border-radius: 9px; font-size: 14px; font-weight: 600; }
.start-button { grid-column: 1; display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--soft-green); color: #12301e; }
.start-button:hover { background: #c4ebcd; }
.reset-button { grid-column: 2; justify-self: start; padding: 0 14px; background: transparent; color: #b5c8ba; }
.reset-button:hover { color: #fff; }
.home-visual { display: grid; justify-items: center; align-content: center; min-width: 0; }
.hero-rink {
  position: relative; width: min(100%, 590px); aspect-ratio: 1.58; border: 2px solid rgba(220,245,226,.62);
  border-radius: 999px; transform: rotate(-20deg); background: radial-gradient(ellipse at 55% 45%, rgba(60,117,76,.38), rgba(16,35,26,0) 70%);
}
.hero-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: rgba(220,245,226,.48); }
.hero-center { position: absolute; top: 50%; left: 50%; width: 90px; height: 90px; border: 1px solid rgba(220,245,226,.5); border-radius: 50%; transform: translate(-50%,-50%); }
.hero-point { position: absolute; width: 15px; height: 15px; border-radius: 50%; background: var(--soft-green); box-shadow: 0 0 24px rgba(180,224,191,.65); }
.point-one { left: 16%; top: 22%; }.point-two { left: 16%; top: 72%; }.point-three { left: 39%; top: 8%; }.point-four { left: 53%; top: 75%; }.point-five { left: 77%; top: 18%; }.point-six { left: 85%; top: 68%; }
.visual-caption { margin: 30px 0 0; color: #92a99a; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-align: center; }
.visual-caption span { color: #d4e6d8; }
.home-footnote { position: absolute; right: 0; bottom: 20px; left: 0; display: flex; justify-content: space-between; color: #92a99a; font-size: 11px; }
.home-footnote span:first-child { color: #d4e6d8; }

.rink-stage { display: none; padding: 42px 4.1vw 30px; overflow: hidden; background: #fff; color: var(--ink); }
.rink-stage.is-active { display: block; }
.rink-viewport { width: min(100%, 1650px); margin: 0 auto; position: relative; }
.rink-art { display: block; width: 100%; height: auto; overflow: visible; }
.rink-border { fill: #fff; stroke: #30343a; stroke-width: 3.5; }
.rink-markings { fill: none; stroke: #85898d; stroke-width: 2.5; }
.rink-center-line, .rink-blue-line, .rink-goal-line { stroke: #85898d; stroke-width: 3; }
.rink-circle { stroke: #85898d; stroke-width: 2.5; }
.rink-crease { fill: none; stroke: #85898d; stroke-width: 2.5; }
.rink-label { fill: #62676f; stroke: none; font-size: 18px; font-weight: 700; text-anchor: middle; }

.markers { position: absolute; left: 2.375%; right: 2.375%; top: 4.058%; bottom: 4.058%; pointer-events: none; }
.marker {
  position: absolute; transform: translate(-50%, -50%); width: clamp(34px, 2.6vw, 42px); height: clamp(34px, 2.6vw, 42px);
  display: grid; place-items: center; border: 1px solid #30343a; border-radius: 50%; pointer-events: auto;
  background: #fff; color: #30343a; font-size: clamp(15px, 1.1vw, 18px); font-weight: 700; box-shadow: none;
  transition: transform .14s ease, box-shadow .14s ease;
}
.marker:hover, .marker.selected { z-index: 4; transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 0 3px rgba(48,52,58,.15); }
.marker.has-reading { background: #fff; color: #30343a; }
.marker.has-reading:hover, .marker.has-reading.selected { box-shadow: 0 0 0 3px rgba(48,52,58,.15); }
.marker .value { font-size: .87em; }

.point-editor {
  position: absolute; z-index: 6; width: 280px; padding: 12px;
  background: #f8f8f8; border: 1px solid #d1d4d7; border-radius: 9px; box-shadow: 0 3px 13px rgba(0,0,0,.15);
}
.point-editor::after { content: ""; position: absolute; width: 16px; height: 16px; background: #f8f8f8; }
.point-editor[data-side="right"]::after { left: -9px; top: calc(var(--arrow-offset) - 8px); border-left: 1px solid #d1d4d7; border-bottom: 1px solid #d1d4d7; transform: rotate(45deg); }
.point-editor[data-side="left"]::after { right: -9px; top: calc(var(--arrow-offset) - 8px); border-right: 1px solid #d1d4d7; border-top: 1px solid #d1d4d7; transform: rotate(45deg); }
.point-editor[data-side="above"]::after { bottom: -9px; left: calc(var(--arrow-offset) - 8px); border-right: 1px solid #d1d4d7; border-bottom: 1px solid #d1d4d7; transform: rotate(45deg); }
.point-editor[data-side="below"]::after { top: -9px; left: calc(var(--arrow-offset) - 8px); border-left: 1px solid #d1d4d7; border-top: 1px solid #d1d4d7; transform: rotate(45deg); }
.editor-point { margin-bottom: 8px; font-size: 24px; }
.reading-entry { display: flex; height: 46px; align-items: center; border: 3px solid #c6e1ff; border-radius: 6px; background: white; }
.reading-entry input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 10px; font-size: 20px; }
.reading-entry span { padding: 0 10px; color: #7b8086; }
.editor-actions { display: flex; gap: 10px; margin-top: 10px; }
.editor-actions button { border: 0; border-radius: 24px; padding: 10px 17px; color: #fff; font-size: 16px; }
.save-button { background: var(--blue); }.clear-button { background: #85898d; }
.add-point { position: fixed; right: 3vw; bottom: 8vh; width: 84px; height: 84px; border: 0; border-radius: 50%; background: #40b250; color: #fff; font-size: 54px; line-height: 1; box-shadow: 0 2px 5px rgba(0,0,0,.15); }
.add-point:hover { background: #32a344; transform: scale(1.03); }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 12; transform: translate(-50%, 10px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 7px; background: #30343a; color: white; transition: .2s ease; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1100px) and (min-width: 781px) {
  .setup { padding-right: 5vw; padding-left: 5vw; }
  .home-layout { grid-template-columns: 1.08fr .92fr; gap: 38px; }
  .home-copy h1 { font-size: clamp(42px, 5.5vw, 62px); }
  .hero-point { width: 12px; height: 12px; }
  .rink-stage { padding: 32px 2vw 30px; }
}
@media (max-width: 780px) {
  body { background: #fff; color: var(--ink); }
  .topbar {
    height: 62px; display: flex; align-items: center; padding: 0 22px;
    background: #fff; color: var(--ink); border-bottom: 1px solid #e8ece9;
  }
  .mobile-brand { font-size: 15px; }
  .setup { min-height: 0; display: block; padding: 0; background: #fff; color: var(--ink); }
  .home-layout { width: min(100%, 420px); min-height: 0; display: flex; flex-direction: column; gap: 20px; padding: 30px 22px 24px; }
  .home-copy { position: relative; z-index: 1; width: 100%; max-width: none; }
  .home-kicker { margin-bottom: 12px; color: var(--polaris-green); font-size: 10px; letter-spacing: .12em; }
  .home-kicker .brand-mark, .wide-kicker { display: none; }
  .narrow-kicker { display: inline; }
  .home-copy h1 { margin-bottom: 10px; font-size: 36px; line-height: 1.04; letter-spacing: -.045em; color: #17221a; }
  .wide-title, .wide-description { display: none; }
  .narrow-title, .narrow-description { display: block; }
  .home-description { margin-bottom: 23px; color: #68746b; font-size: 14px; line-height: 1.5; }
  .setup-controls { max-width: none; grid-template-columns: 1fr; gap: 14px; }
  .field { gap: 7px; color: #68746b; font-size: 11px; letter-spacing: .04em; }
  .field select { height: 48px; border-color: #dfe5e1; background: #fff; color: #17221a; font-size: 14px; }
  .field select option { color: #17221a; background: #fff; }
  .start-button { min-height: 48px; grid-column: 1; margin-top: 4px; background: var(--polaris-green); color: #fff; }
  .start-button:hover { background: #006b32; }
  .reset-button { grid-column: 1; justify-self: center; min-height: 34px; color: #68746b; font-size: 12px; }
  .home-visual { position: absolute; z-index: 0; top: auto; right: 4%; bottom: 78px; width: 92%; min-height: 0; display: block; opacity: .16; pointer-events: none; }
  .hero-rink { width: 100%; aspect-ratio: 2.45; transform: none; border: 1px solid #b9d4c0; background: #eaf2ec; }
  .hero-line { width: 1px; background: #d2dfd5; }
  .hero-center { width: 48px; height: 48px; border-color: #b9d4c0; }
  .hero-point { width: 9px; height: 9px; background: var(--polaris-green); box-shadow: none; transition: left 7s ease-in-out, top 7s ease-in-out; }
  .visual-caption { display: none; }
  .home-footnote { position: static; margin: -8px 0 0; display: block; color: #68746b; font-size: 11px; line-height: 1.5; text-align: center; }
  .home-footnote span { display: block; }
  .home-footnote span:first-child { color: #17221a; }
  .rink-stage { padding: 24px 0 20px; overflow-x: auto; }
  .rink-viewport { width: 860px; max-width: none; margin: 0 14px; }
  .marker { width: 36px; height: 36px; font-size: 15px; }
  .point-editor { width: 220px; }
  .add-point { width: 64px; height: 64px; bottom: 28px; right: 18px; font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) { .hero-point { transition: none !important; } }
