/* Layout: one white "cover panel" framed in blue with a solid offset shadow, set on a sky-blue field
   with white pinstripe bands, taken from the 1984 course cover. Single light look by design. */
:root {
  --sky: #36a9dd;        /* cover field */
  --sky-light: #8ccbea;  /* stripe band, pills */
  --sky-pale: #e2f2fa;   /* quiet fills */
  --blue: #1d86c8;       /* lettering, frame */
  --deep: #0e5689;       /* running text */
  --shadow: #1f78b4;     /* panel offset shadow */
  --paper: #ffffff;
  --ok: #1e8a4f;
  --bad: #d33a3a;
  /* Section colours */
  --sec-S: #d9573f;
  --sec-A: #d48c0e;
  --sec-T: #2c9457;
  --sec-B: #4b5cc4;
  --display: "Fraunces", "Souvenir", Georgia, serif;
  --body: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body {
  margin: 0; color: var(--deep); font-family: var(--body); font-size: 16px; line-height: 1.5;
  background:
    linear-gradient(to bottom, transparent 0 49px, var(--sky-light) 49px 78px, transparent 78px),
    var(--sky);
  min-height: 100vh;
}
.wrap { max-width: 1100px; margin: 0 auto; padding-block: 104px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.panel { background: var(--paper); border: 2px solid var(--blue); box-shadow: 12px 12px 0 var(--shadow);
  padding: 26px clamp(16px, 4vw, 36px) 30px; display: grid; gap: 20px; margin-right: 12px; }

h1, .outline { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 600;
  color: var(--deep); letter-spacing: .01em; line-height: 1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(34px, 6vw, 56px); }
h2 { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 24px; color: var(--blue); margin: 0; }
.pill { display: inline-block; background: var(--sky-light); color: #fff; border-radius: 999px;
  font-family: var(--display); font-variation-settings: "SOFT" 100; font-size: clamp(16px, 2.6vw, 22px); padding: 2px 20px 4px;
  font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.dots { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-width: 70ch; font-size: 15px; }
.dots li { position: relative; padding-left: 20px; }
.dots li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 10px; height: 10px; border-radius: 50%; background: var(--sky); }
.label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); font-weight: 700; }
.muted { color: #4d7a9c; font-size: 14px; margin: 0; }
.error { color: var(--bad); font-weight: 700; margin: 0; }

.settings { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: end; border-top: 2px solid var(--sky-light); border-bottom: 2px solid var(--sky-light); padding-block: 14px; }
.field { display: grid; gap: 5px; }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.seg button { font: 600 14px var(--body); border: 1.5px solid var(--sky-light); background: #fff; color: var(--deep); padding: 6px 13px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--sky); border-color: var(--sky); color: #fff; }
select, input[type="text"] { font: 600 15px var(--body); padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--sky-light); background: #fff; color: var(--deep); }
input[type="text"] { border-radius: 10px; padding: 10px 14px; font-size: 18px; width: 100%; max-width: 320px; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px 18px; }
label.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--sky); width: 16px; height: 16px; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--deep); outline-offset: 2px; }

.status { display: flex; flex-wrap: wrap; gap: 8px 30px; align-items: baseline; }
.stat { display: grid; }
.stat b { font-family: var(--display); font-variation-settings: "SOFT" 100; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--deep); }

.sheet { border: 2px solid var(--sky-light); background: #fff; padding: 12px 8px; position: relative; overflow: hidden; min-height: 170px; }
.score { position: relative; }
.score.veiled { visibility: hidden; }
.score svg { display: block; }
.cursor { position: absolute; border-radius: 6px; background: rgba(54,169,221,.18); border: 2px solid var(--sky);
  transition: left .16s ease, top .16s ease, background-color .12s, border-color .12s; pointer-events: none; }
.cursor.ok { background: rgba(30,138,79,.2); border-color: var(--ok); }
.cursor.bad { background: rgba(211,58,58,.2); border-color: var(--bad); animation: shake .28s; }
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-5px) } 75% { transform: translateX(5px) } }
.tag { position: absolute; transform: translateX(-50%); font: 700 15px var(--body); color: var(--ok); pointer-events: none; }
.tag.missed { color: var(--bad); }
.tag.plain { color: var(--deep); }
.mark { position: absolute; transform: translateX(-50%); font: 700 14px var(--body); color: var(--blue); pointer-events: none; white-space: nowrap; }

.veil { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; padding: 16px;
  background: repeating-linear-gradient(to bottom, #fff 0 22px, var(--sky-pale) 22px 24px); }
.veil p { margin: 0; color: var(--deep); font-size: 15px; }
.count { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 96px; line-height: 1; color: var(--sky); -webkit-text-stroke: 2px var(--blue); }

.btn { font: 700 15px var(--body); padding: 10px 18px; border-radius: 999px; border: 2px solid var(--blue); background: #fff; color: var(--blue); cursor: pointer; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.big { font-family: var(--display); font-variation-settings: "SOFT" 100; font-size: 24px; font-weight: 600; padding: 10px 36px 12px;
  background: var(--sky); border-color: var(--sky); color: #fff; box-shadow: 5px 5px 0 var(--shadow); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger.armed { background: var(--bad); color: #fff; }
/* Round icon button; .music gets a slanted line through it when muted */
.btn.icon { width: 46px; height: 46px; padding: 0; font-size: 22px; line-height: 1; display: inline-grid; place-items: center; position: relative; }
.btn.music[aria-pressed="false"] { color: var(--sky-light); border-color: var(--sky-light); }
.btn.music[aria-pressed="false"]::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 3px; border-radius: 2px;
  background: var(--bad); transform: translate(-50%, -50%) rotate(-45deg); }
.btn:disabled { opacity: .55; cursor: default; }

.pad { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.keys { display: flex; flex-wrap: wrap; gap: 8px; }
.key { width: 64px; height: 62px; border-radius: 14px; border: 2px solid var(--sky-light); background: #fff; color: var(--deep);
  cursor: pointer; display: grid; place-items: center; align-content: center; gap: 3px; line-height: 1; }
.key span { font-family: var(--display); font-variation-settings: "SOFT" 100; font-size: 26px; font-weight: 600; color: var(--blue); }
.key small { font: 400 12px var(--body); color: var(--deep); }
.key:hover { background: var(--sky-pale); }
.key:active { transform: translateY(1px); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Sections */
.secs { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-btn { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--c); background: #fff; color: var(--c);
  font: 700 26px var(--display); font-variation-settings: "SOFT" 100; cursor: pointer; }
.sec-btn[aria-pressed="true"] { background: var(--c); color: #fff; }
.sec-S { --c: var(--sec-S); } .sec-A { --c: var(--sec-A); } .sec-T { --c: var(--sec-T); } .sec-B { --c: var(--sec-B); }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--c); border-radius: 999px; padding: 3px 4px 3px 12px;
  font-weight: 700; color: var(--deep); background: #fff; }
.chip button { border: 0; background: transparent; color: var(--bad); font: 700 16px var(--body); cursor: pointer; padding: 0 6px; border-radius: 50%; }
.secbadge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; font: 700 13px var(--body); }

.result { border: 2px solid var(--ok); background: #eef8f1; padding: 14px 18px; }
.result strong { font-family: var(--display); font-variation-settings: "SOFT" 100; font-size: 22px; color: var(--ok); }
@media (max-width: 520px) { .key { width: 54px; height: 56px; } .panel { margin-right: 8px; box-shadow: 8px 8px 0 var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .cursor { transition: none; animation: none !important; } }
