/* FAIRWAY's look, the clubhouse at dusk: dark forest green panels with a fresh green rim and a hard shadow under them, pale block
   buttons that lift and press in, green for what you choose, yellow for what matters. Rubik throughout (bold italic for the big words).
   One type scale: 14, 17, 24, 52 px. */
@font-face { font-family: 'Rubik'; src: url(rubik.woff2) format('woff2'); font-weight: 300 900; font-style: normal; font-display: block; }
@font-face { font-family: 'Rubik'; src: url(rubik-italic.woff2) format('woff2'); font-weight: 300 900; font-style: italic; font-display: block; }
:root {
  --ink: #07100b; --deep0: #2b4a37; --deep1: #1c3427; --deep2: #13251b; --deep3: #0b1610;
  --lime0: #dcf8c4; --lime1: #b4e78f; --lime2: #8fd36b; --lime3: #5a9e38;
  --gold0: #fff1a6; --gold1: #ffd21f; --gold2: #e5a90e; --gold3: #8a5a00;
  --ivory0: #fbfdf7; --ivory1: #ebf1e3; --ivory2: #d3dccb; --warm: #4c5a4a;
  --mint: #b9e6a0; --mint2: #79c457; --coral: #ffb3a1; --coral2: #f0705a; --red1: #d4483f; --red2: #a7302b;
  --cream: #f1f3ef; --dim: #a9b8ab;
  --fs: 14px; --f: 17px; --fl: 24px; --fx: 52px;
  --font: 'Rubik', system-ui, sans-serif;
  --o15: 1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink), 0 1.5px 0 var(--ink), 0 -1.5px 0 var(--ink), 1px 1px 0 var(--ink), -1px 1px 0 var(--ink), 1px -1px 0 var(--ink), -1px -1px 0 var(--ink);
  --o25: 2.5px 0 0 var(--ink), -2.5px 0 0 var(--ink), 0 2.5px 0 var(--ink), 0 -2.5px 0 var(--ink), 1.8px 1.8px 0 var(--ink), -1.8px 1.8px 0 var(--ink), 1.8px -1.8px 0 var(--ink), -1.8px -1.8px 0 var(--ink);
}
* { box-sizing: border-box; }
.fw { font: 400 var(--f)/1.3 var(--font); color: var(--cream); -webkit-font-smoothing: antialiased; }
.fw .hide { display: none !important; }

/* ---- panels: rounded, deep teal with a fine weave, a gold rim inside the dark outline, a hard shadow under; they rise in */
.fw .panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 360px; max-width: min(92vw, 580px); max-height: 92vh; overflow: auto;
  padding: 24px 26px 20px; border-radius: 20px; border: 3px solid var(--ink);
  background: radial-gradient(120% 70% at 20% -10%, rgba(255, 255, 255, .12), transparent 60%), repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 7px),
    linear-gradient(170deg, var(--deep0), var(--deep1) 35%, var(--deep2) 75%, var(--deep3));
  box-shadow: inset 0 0 0 2px rgba(143, 211, 107, .7), inset 0 0 0 4px rgba(7, 16, 11, .6), inset 0 -8px 0 rgba(0, 0, 0, .18), 0 7px 0 var(--ink), 0 22px 40px rgba(0, 0, 0, .4);
  animation: fwRise .38s cubic-bezier(.2, 1.35, .4, 1) both; scrollbar-width: none; }
@keyframes fwRise { 0% { transform: translate(-50%, -46%) scale(.92); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.fw .panel h2 { font: 700 var(--fl)/1.1 var(--font); margin: 0 0 14px; color: var(--cream); text-shadow: var(--o15), 0 3px 0 var(--ink); }
.fw .panel h2::after { content: ''; display: block; width: 46px; height: 4px; margin-top: 9px; background: var(--gold1); box-shadow: 0 2px 0 var(--ink); }
.fw .panel p { margin: 0 0 12px; color: var(--dim); }
.fw .sub { margin: 6px 0 16px; color: var(--dim); text-align: center; }
.fw .note { font-size: var(--fs); color: var(--dim); }

/* the name: bold italic, gold, a thin dark outline, a warm drop */
.fw .logo { display: flex; align-items: center; justify-content: center; gap: 12px; }
.fw .logo svg { width: 46px; height: 46px; filter: drop-shadow(0 3px 0 var(--ink)); }
.fw .logo h1 { margin: 0; font: italic 900 var(--fx)/1 var(--font); letter-spacing: .04em; color: var(--gold1); text-shadow: var(--o25), 0 4px 0 var(--gold3), 0 6px 0 var(--ink), 0 12px 18px rgba(0, 0, 0, .35); }

/* ---- buttons: square ivory blocks with a bevel and a dark base; they lift under the pointer and press in when clicked */
.fw .btn { display: flex; align-items: center; gap: 14px; width: 100%; margin: 9px 0; padding: 10px 14px 9px; border-radius: 0; border: 2px solid var(--ink); border-bottom-width: 6px;
  background: linear-gradient(var(--ivory0), var(--ivory1) 60%, var(--ivory2)); color: var(--ink); font: 600 var(--f)/1.15 var(--font); text-align: left; cursor: pointer;
  box-shadow: inset 0 2px 0 #fff, 0 3px 0 rgba(0, 0, 0, .22); transition: transform .14s cubic-bezier(.3, 1.6, .5, 1), filter .14s; }
.fw .btn:hover, .fw .btn:focus-visible { transform: translateY(-2px); filter: brightness(1.04); outline: none; box-shadow: inset 0 2px 0 #fff, 0 0 0 3px rgba(143, 211, 107, .6), 0 5px 0 rgba(0, 0, 0, .22); }
.fw .btn:active, .fw .btn.press { transform: translateY(4px); border-bottom-width: 2px; margin-bottom: 13px; }
.fw .btn.pri { background: linear-gradient(var(--lime0), var(--lime1) 45%, var(--lime2) 80%, var(--lime3)); }
.fw .btn.go { background: linear-gradient(var(--lime0), var(--lime1) 45%, var(--lime2) 80%, var(--lime3)); }
.fw .btn small { display: block; font: 400 var(--fs)/1.2 var(--font); color: var(--warm); margin-top: 2px; }
.fw .btn .ic { flex: 0 0 36px; height: 36px; display: grid; place-items: center; border: 2px solid var(--ink); background: linear-gradient(var(--deep0), var(--deep3)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .2); }
.fw .btn .ic svg { width: 22px; height: 22px; }
.fw .btns2 { display: flex; gap: 10px; }
.fw .btns2 .btn { flex: 1; }

/* ---- settings rows, choices, fields */
.fw .row { display: flex; gap: 10px; align-items: center; margin: 9px 0; }
.fw .row > label { flex: 0 0 140px; font-weight: 500; color: var(--cream); }
.fw .seg { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.fw .seg button { flex: 1 1 auto; padding: 7px 10px 6px; border-radius: 0; border: 2px solid var(--ink); border-bottom-width: 5px; background: linear-gradient(var(--ivory0), var(--ivory2)); color: var(--ink);
  font: 600 var(--fs) var(--font); cursor: pointer; white-space: nowrap; transition: transform .12s cubic-bezier(.3, 1.6, .5, 1); }
.fw .seg button:hover { transform: translateY(-1px); }
.fw .seg button.on { background: linear-gradient(var(--lime0), var(--lime2) 60%, var(--lime3)); transform: translateY(3px); border-bottom-width: 2px; }
.fw input[type=text] { flex: 1; min-width: 0; padding: 9px 12px 8px; border-radius: 0; border: 2px solid var(--ink); background: var(--ivory0); color: var(--ink); font: 500 var(--f) var(--font);
  box-shadow: inset 0 3px 0 rgba(10, 26, 36, .1); }
.fw .pl { display: flex; gap: 10px; align-items: center; margin: 7px 0; }
.fw .dot { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px; border: 2px solid var(--ink); cursor: pointer;
  box-shadow: inset -3px -4px 0 rgba(0, 0, 0, .18), inset 2px 2px 0 rgba(255, 255, 255, .55), 0 2px 0 var(--ink); }
.fw .x { flex: 0 0 auto; padding: 7px 10px 6px; border-radius: 0; border: 2px solid var(--ink); border-bottom-width: 5px; background: linear-gradient(var(--ivory0), var(--ivory2)); color: var(--red2); font: 600 var(--fs) var(--font); cursor: pointer; }
.fw .code-big { display: inline-block; font: italic 900 var(--fx)/1 var(--font); letter-spacing: .16em; color: var(--gold1); text-shadow: var(--o25), 0 5px 0 var(--ink); margin: 6px 0 10px; }

/* ---- the scorecard: score tiles, mint under par, ivory at par, coral over; the hole in play outlined in gold */
.fw table.card { border-collapse: separate; border-spacing: 4px; width: 100%; font: 600 var(--fs) var(--font); font-variant-numeric: tabular-nums; margin: -4px 0 6px; }
.fw table.card th { color: var(--gold1); font-weight: 600; font-size: var(--fs); padding: 2px 0 2px; }
.fw table.card th:first-child, .fw table.card td:first-child { text-align: left; white-space: nowrap; padding-right: 8px; }
.fw table.card td { text-align: center; height: 28px; min-width: 29px; color: var(--ink); background: rgba(255, 255, 255, .07); border: 2px solid transparent; }
.fw table.card td:first-child { background: none; color: var(--cream); font-size: var(--f); font-weight: 500; }
.fw table.card tr.par td { background: none; color: var(--dim); height: 20px; font-weight: 500; }
.fw table.card td.s { background: var(--ivory0); border-color: var(--ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .1); }
.fw table.card td.u { background: var(--mint); }
.fw table.card td.o { background: var(--coral); }
.fw table.card td.ace { background: linear-gradient(var(--gold0), var(--gold1)); }
.fw table.card td.cur { border-color: var(--gold1); box-shadow: 0 0 0 2px var(--ink); }
.fw table.card td.ip { color: var(--dim); background: rgba(255, 255, 255, .12); font-style: italic; }
.fw table.card td.t { background: linear-gradient(var(--gold0), var(--gold1)); border-color: var(--ink); white-space: nowrap; padding: 0 8px; font-size: var(--f); font-weight: 700; }
.fw table.card td .dot { display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -2px; cursor: default; box-shadow: inset -2px -3px 0 rgba(0, 0, 0, .18); }
.fw .next { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--dim); }
.fw .next b { color: var(--gold1); font-weight: 600; }

/* ---- final scores: a ribbon for the winner, places on struck medals */
.fw .ribbon { position: relative; margin: 0 -6px 14px; padding: 9px 20px 8px; text-align: center; background: linear-gradient(var(--red1), var(--red2)); border: 2px solid var(--ink);
  font: italic 800 var(--fl) var(--font); color: var(--cream); text-shadow: var(--o15), 0 3px 0 var(--ink); box-shadow: inset 0 0 0 2px var(--gold2), 0 5px 0 var(--ink); transform: rotate(-1deg); }
.fw .place { display: flex; align-items: center; gap: 12px; margin: 6px 0; padding: 4px 14px 4px 6px; background: rgba(0, 0, 0, .18); border: 2px solid rgba(255, 255, 255, .1); border-radius: 12px; font-weight: 500; }
.fw .place .medal { flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--ink); font: 700 var(--fs) var(--font); color: var(--ink);
  box-shadow: inset -3px -4px 0 rgba(0, 0, 0, .18), inset 2px 2px 0 rgba(255, 255, 255, .6), 0 2px 0 var(--ink); background: #c7d3d9; }
.fw .place.m1 .medal { background: radial-gradient(circle at 35% 30%, var(--gold0), var(--gold1) 50%, var(--gold2)); }
.fw .place.m2 .medal { background: radial-gradient(circle at 35% 30%, #ffffff, #c9d2da 55%, #93a1ad); }
.fw .place.m3 .medal { background: radial-gradient(circle at 35% 30%, #ffd2a8, #d9894a 55%, #a35b26); }
.fw .place b { margin-left: auto; font: 700 var(--fl) var(--font); color: var(--cream); }
.fw .place b small { font: 400 var(--fs) var(--font); margin-left: 8px; color: var(--gold1); }

/* ---- in play: the hole's badge, the players, the turn, the shot */
.fw .hudp { border-radius: 16px; border: 2px solid var(--ink); background: linear-gradient(170deg, rgba(43, 74, 55, .94), rgba(19, 37, 27, .95));
  box-shadow: inset 0 0 0 2px rgba(143, 211, 107, .7), 0 5px 0 var(--ink), 0 12px 24px rgba(0, 0, 0, .25); }
.fw #hole { position: fixed; left: 16px; top: 14px; display: flex; align-items: center; gap: 12px; padding: 7px 16px 7px 7px; }
.fw #hole .num { flex: 0 0 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--ink); background: radial-gradient(circle at 35% 30%, var(--gold0), var(--gold1) 50%, var(--gold2));
  font: italic 800 var(--fl) var(--font); color: var(--ink); box-shadow: inset 0 -4px 0 var(--gold3), 0 3px 0 var(--ink); }
.fw #hole .hn { font: italic 700 var(--fl)/1.05 var(--font); color: var(--cream); text-shadow: var(--o15), 0 2px 0 var(--ink); }
.fw #hole .chips { display: flex; gap: 6px; margin-top: 5px; }
.fw #hole .chip { padding: 1px 8px; border-radius: 8px; border: 2px solid var(--ink); background: var(--ivory1); color: var(--ink); font: 600 var(--fs) var(--font); }
.fw #hole .chip.st { background: var(--gold1); }
.fw #plist { position: fixed; right: 16px; top: 14px; min-width: 200px; padding: 7px; font: 500 var(--f) var(--font); }
.fw #plist .p { display: flex; align-items: center; gap: 10px; padding: 3px 8px; border-radius: 10px; color: var(--cream); }
.fw #plist .p .dot { width: 18px; height: 18px; flex-basis: 18px; cursor: default; box-shadow: inset -2px -3px 0 rgba(0, 0, 0, .18); }
.fw #plist .p b { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.fw #plist .p.act { background: var(--gold1); color: var(--ink); border: 2px solid var(--ink); padding: 1px 6px; }
.fw #plist .p.fin { opacity: .65; }
.fw #menuBtn { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); padding: 7px 16px 6px; border-radius: 0; border: 2px solid var(--ink); border-bottom-width: 5px;
  background: linear-gradient(var(--ivory0), var(--ivory2)); color: var(--ink); font: 600 var(--f) var(--font); cursor: pointer; box-shadow: inset 0 2px 0 #fff, 0 3px 0 rgba(0, 0, 0, .22); }
.fw #toast { position: fixed; left: 50%; top: 26%; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; pointer-events: none;
  font: italic 800 var(--fx)/1 var(--font); color: var(--gold1); text-shadow: var(--o25), 0 4px 0 var(--gold3), 0 6px 0 var(--ink), 0 14px 24px rgba(0, 0, 0, .35); }
.fw #toast.on { animation: fwToast .45s cubic-bezier(.2, 1.5, .4, 1) both; }
.fw #toast small { display: block; margin-top: 10px; font: 600 var(--fl) var(--font); font-style: normal; color: var(--cream); text-shadow: var(--o15), 0 3px 0 var(--ink); }
@keyframes fwToast { 0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.fw #bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: stretch; }
.fw #bar button { padding: 9px 20px 7px; border-radius: 0; border: 2px solid var(--ink); border-bottom-width: 6px; background: linear-gradient(var(--ivory0), var(--ivory2)); color: var(--ink); font: 600 var(--f) var(--font); cursor: pointer; }
.fw #bar button + button { border-left-width: 0; }
.fw #bar button.on { background: linear-gradient(var(--lime0), var(--lime2) 60%, var(--lime3)); transform: translateY(3px); border-bottom-width: 3px; }
.fw #bar .key { align-self: center; margin-left: 10px; padding: 1px 7px; border-radius: 6px; border: 2px solid var(--ink); background: var(--ivory1); color: var(--ink); font: 600 var(--fs) var(--font); }
.fw #meter { position: fixed; left: 50%; bottom: 82px; transform: translateX(-50%); width: min(60vw, 440px); height: 24px; border-radius: 12px; border: 2px solid var(--ink); background: linear-gradient(var(--deep3), var(--deep2));
  box-shadow: inset 0 0 0 2px rgba(143, 211, 107, .7), 0 4px 0 var(--ink); overflow: hidden; }
.fw #meter i { position: absolute; left: 3px; top: 3px; bottom: 3px; border-radius: 9px 0 0 9px; background: linear-gradient(90deg, var(--mint2), var(--gold1) 60%, var(--gold2) 80%, var(--coral2));
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .4); }
.fw #meter::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(10, 26, 36, .5) calc(10% - 2px) 10%); }
.fw #meterL { position: fixed; left: 50%; bottom: 114px; transform: translateX(-50%); font: italic 700 var(--fl) var(--font); color: var(--cream); text-shadow: var(--o15), 0 3px 0 var(--ink); }
.fw .flagtag { position: fixed; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 6px; padding: 2px 9px 2px 6px; border-radius: 10px; border: 2px solid var(--ink); background: var(--ivory0); color: var(--ink);
  font: 600 var(--fs) var(--font); box-shadow: 0 3px 0 var(--ink); }
.fw .flagtag::before { content: ''; width: 11px; height: 11px; background: var(--red1); clip-path: polygon(0 0, 100% 35%, 0 70%); }

/* ---- loading */
.fw #load { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(90% 70% at 50% 35%, var(--deep0), var(--deep2) 60%, #050c08); }
.fw #load::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .02) 0 2px, transparent 2px 7px); }
.fw #load .b { position: relative; width: 300px; height: 18px; border-radius: 10px; border: 2px solid var(--ink); background: var(--deep3); box-shadow: inset 0 0 0 2px rgba(143, 211, 107, .7), 0 4px 0 var(--ink); overflow: hidden; }
.fw #load .b i { position: absolute; left: 3px; top: 3px; bottom: 3px; border-radius: 6px; background: linear-gradient(var(--gold0), var(--gold2)); }
.fw #load .s { position: relative; color: var(--dim); }

/* the page */
html, body { margin: 0; height: 100%; background: #0b1610; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ov { pointer-events: none; }
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud #pad { pointer-events: auto; }
#panels .panel { z-index: 5; }
.fw .err { color: var(--coral); font-size: var(--fs); min-height: 1.2em; margin: 4px 0; }
.fw input.code { flex: 0 0 140px; text-transform: uppercase; letter-spacing: .3em; font-weight: 700; text-align: center; }
.fw .join { display: flex; gap: 10px; align-items: stretch; margin: 10px 0 4px; }
.fw .join .btn { margin: 0; width: auto; flex: 1; }
.fw .lob { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.fw .lob .code-big { margin: 0; }
.fw .count { font: italic 700 var(--fl) var(--font); color: var(--gold1); text-shadow: var(--o15), 0 3px 0 var(--ink); margin: 6px 0 2px; }
.fw .pl .nm { flex: 1; font-weight: 500; }
.fw .pl .tag { font-size: var(--fs); color: var(--dim); }
.fw .panel h2.sm { font-size: var(--f); margin: 16px 0 10px; }
.fw .panel h2.sm::after { width: 30px; height: 3px; margin-top: 6px; }
.fw #hole .chip.who { display: flex; align-items: center; gap: 6px; }
.fw #hole .chip.who .dot { width: 12px; height: 12px; flex-basis: 12px; border-width: 1.5px; box-shadow: none; cursor: default; }
.fw #hole .chip.low { background: var(--coral); }
.fw #skip { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 9px 20px 7px; border-radius: 0; border: 2px solid var(--ink); border-bottom-width: 6px;
  background: linear-gradient(var(--ivory0), var(--ivory2)); color: var(--ink); font: 600 var(--f) var(--font); cursor: pointer; box-shadow: inset 0 2px 0 #fff, 0 3px 0 rgba(0, 0, 0, .22); }
.fw #pad { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; text-align: center;
  border: 2px solid var(--ink); background: radial-gradient(circle at 40% 35%, var(--deep0), var(--deep2)); box-shadow: inset 0 0 0 2px rgba(143, 211, 107, .7), 0 4px 0 var(--ink); color: var(--cream); font: 600 var(--fs)/1.15 var(--font); touch-action: none; }
.fw .panel.still { animation: none; }
.fw #toast { opacity: 0; }
.fw #toast.on { opacity: 1; }
.fw #load .logo h1 { font-size: var(--fx); }
.fw .logo { margin-bottom: 2px; }
@media (max-width: 640px) { :root { --fs: 13px; --f: 15px; --fl: 20px; --fx: 38px; } .fw .panel { min-width: 0; width: 94vw; padding: 18px 16px 16px; } .fw .row > label { flex-basis: 104px; }
  .fw #plist { display: none; } .fw #meter { bottom: 128px; } .fw #meterL { bottom: 160px; } .fw #hole .num { flex-basis: 40px; height: 40px; } .fw table.card td { min-width: 22px; height: 24px; } }
/* (the page's policy allows no style attributes: these replace the ones the menus once set inline) */
.fw .note.narrow { max-width: 240px; margin: 0; }
.fw .gap { margin-top: 12px; }
