/* "The clubhouse at dusk" as a theme (docs/DUSK-ROLLOUT-PLAN.md §1). A screen opts in with `dusk: true`; app.js then puts .dusk on the
   screen and data-dusk on <html>. Home predates this and keeps its own rules in home2.css; it only shares the tab bar and card classes. */

/* Tokens: every shared component (.input, .btn, .panel, .tee, .list …) reads these, so most of the app re-dresses itself. */
.screen.dusk {
  --paper: #0F2A1C; --surface: rgba(255, 255, 255, .08); --surface-2: rgba(255, 255, 255, .12);
  --ink: #FFFFFF; --ink-2: rgba(255, 255, 255, .78); --quiet: rgba(255, 255, 255, .62);
  --line: rgba(255, 255, 255, .14); --line-2: rgba(255, 255, 255, .22);
  --brass: #C9A14A; --brass-ink: #E2C27A; --brass-soft: rgba(201, 161, 74, .18);
  --good: #5DBB84; --bad: #E07A6E;
  color-scheme: dark; color: var(--ink);
  background: linear-gradient(#10281B, #13331F 40%, #0F2A1C); background-attachment: fixed;
  min-height: 100dvh; max-width: none; padding-left: 0; padding-right: 0;
}
.screen.dusk > .dusk-in { max-width: 560px; margin: 0 auto; padding: 0 var(--gutter); }
.screen.dusk h1, .screen.dusk h2, .screen.dusk h3 { color: var(--ink); }
.screen.dusk .topbar .title { font-size: 32px; font-weight: 400; font-variation-settings: "opsz" 144; }
.screen.dusk a { color: var(--brass-ink); }
.screen.dusk .quiet, .screen.dusk .hint { color: var(--quiet); }
.screen.dusk .section > h2 { font-size: 13px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--quiet); }
.screen.dusk .label { font-size: 13px; color: var(--quiet); letter-spacing: .1em; }

/* Three card weights, nothing else. */
.card-frost { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 20px; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.card-raised { background: #F4EFE4; color: #10241A; border: 0; border-left: 4px solid #C9A14A; border-radius: 18px; box-shadow: 0 14px 30px rgba(0, 0, 0, .4); }
.card-quiet { background: none; border: 0; border-top: 1px solid rgba(255, 255, 255, .14); border-radius: 0; color: #fff; }

/* Controls on dusk. */
.screen.dusk .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.screen.dusk .btn.primary { background: #F4EFE4; color: #10241A; border-color: #F4EFE4; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.screen.dusk .btn.brass { background: #C9A14A; color: #141008; border-color: #C9A14A; }
.screen.dusk .btn.ghost, .screen.dusk .btn.icon, .screen.dusk .btn.quietb { background: transparent; box-shadow: none; }
.screen.dusk .btn.ghost, .screen.dusk .btn.icon { border-color: transparent; }
.screen.dusk .btn.danger { color: var(--bad); }
.screen.dusk .input, .screen.dusk select.input, .screen.dusk textarea.input { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; border-radius: 14px; }
.screen.dusk .input::placeholder { color: rgba(255, 255, 255, .55); }
.screen.dusk .input:focus { border-color: #C9A14A; box-shadow: 0 0 0 3px rgba(201, 161, 74, .25); }
.screen.dusk select.input option { color: #10241A; }
.screen.dusk .panel { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.screen.dusk .panel.brass { background: rgba(201, 161, 74, .14); border-color: rgba(201, 161, 74, .5); }
.screen.dusk .seg { background: rgba(255, 255, 255, .1); }
.screen.dusk .seg button { color: rgba(255, 255, 255, .78); }
.screen.dusk .seg button[aria-pressed="true"], .screen.dusk .seg button.on, .screen.dusk .seg button[aria-checked="true"] { background: #F4EFE4; color: #10241A; }
.screen.dusk .switch { background: rgba(255, 255, 255, .25); }
.screen.dusk .list { border-top-color: var(--line); }
.screen.dusk .list > .item { border-bottom-color: var(--line); color: #fff; }
.screen.dusk .item .s { color: var(--quiet); }
.screen.dusk .flag { color: #E2C27A; background: transparent; border: 1px solid rgba(201, 161, 74, .6); font-size: 12px; }
.screen.dusk .rule { background: var(--line); }

/* Search: a frosted pill. */
.screen.dusk .input#q, .screen.dusk .search { border-radius: 999px; padding-left: 46px; min-height: 48px;
  background: rgba(255, 255, 255, .1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.6' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px center; }

/* Tab bar on a dusk screen: dark glass, white icons, brass for where you are, a cream Play disc. */
html[data-dusk] .tabbar { background-color: #12301F; border-top-color: rgba(255, 255, 255, .18);
  /* deep green contours across the whole bar (Luke, 2026-10-20): the lit terraces, the lines over them, a shade so the icons stay clear */
  background-image: linear-gradient(180deg, rgba(8, 28, 18, .18), rgba(8, 28, 18, .42)),
    var(--ground-lines, none), var(--ground-terr, none), linear-gradient(180deg, #1B4029, #0F2A1C);
  background-size: auto, 124% auto, 124% auto, auto; background-repeat: no-repeat; background-position: 0 0, center 38%, center 38%, 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 -6px 18px rgba(0, 0, 0, .25); }
html[data-dusk] .tabbar a { color: rgba(255, 255, 255, .78); text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
html[data-dusk] .tabbar a[aria-current="page"] { color: #C9A14A; }
html[data-dusk] .tabbar a.play span { color: rgba(255, 255, 255, .62); }
html[data-dusk] .tabbar a.play .disc { background: #F4EFE4; border-color: #0F2A1C; }
html[data-dusk] .tabbar a.play .disc .ico { color: #10281B; }
html[data-dusk] { background: #0F2A1C; }   /* the page behind the page is green too, so no light edge shows when a phone's bars slide or the screen is taller than the content */
html[data-dusk] body { background: #0F2A1C; }

/* Sheets and toasts. */
html[data-dusk] .sheet { background: #13331F; color: #fff; border-top: 1px solid rgba(255, 255, 255, .18); }
html[data-dusk] .sheet .handle { background: #F4EFE4; opacity: .7; }
html[data-dusk] .toast { background: #F4EFE4; color: #10241A; }

/* Screens that were never built around full-bleed bands ('pad'): same ground, the old gutters and column. */
.screen.dusk.dusk-pad { padding-left: var(--gutter); padding-right: var(--gutter); max-width: 560px; margin: 0 auto; }

/* Nothing below 13 px on a dusk screen (ui_audit). */
.screen.dusk .flag, .screen.dusk th, .screen.dusk .lab, .screen.dusk .card th, .screen.dusk .card td.lab, .screen.dusk .card th.lab { font-size: 13px; }

/* Sheets open outside the screen (on <body>), so they carry their own dusk controls. */
html[data-dusk] .sheet .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; }
html[data-dusk] .sheet .btn.primary { background: #F4EFE4; border-color: #F4EFE4; color: #10241A; }
html[data-dusk] .sheet .hint, html[data-dusk] .sheet .quiet { color: rgba(255, 255, 255, .62); }

/* Play tab: a real golf ball (Luke, 2026-10-12), rendered by tools/make_golf_ball.py: lit dimples, a small sun glint top-left,
   darker rim so it reads as a ball at 54 px. The play mark stays dark on top. */
.tabbar a.play .disc, html[data-dusk] .tabbar a.play .disc {
  border: 0; background: url(/img/brand/play-ball-108.webp) center / 100% 100% no-repeat;
  background-image: image-set(url(/img/brand/play-ball-54.webp) 1x, url(/img/brand/play-ball-108.webp) 2x, url(/img/brand/play-ball-162.webp) 3x);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .5), 0 0 0 3px #0F2A1C; }
.tabbar a.play .disc .ico, html[data-dusk] .tabbar a.play .disc .ico { color: #10281B; filter: drop-shadow(0 0 2px rgba(255, 255, 255, .9)); }

/* The ball rolls slowly forward after five seconds untouched (js/ball-roll.js draws it on this canvas); the play mark stays on top. */
.tabbar a.play .disc { position: relative; }
.tabbar a.play .disc .ball-roll { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; pointer-events: none; }
.tabbar a.play .disc .ico { position: relative; z-index: 1; }

/* ════ Black leather dashboard behind Post a score, the Handicap calculator and Friends (Luke, 2026-10-25): a thick leather rim holding the page, fields set
   into it as dark recessed wells, gold headings and labels, gold for the chosen option. ═══════════════════════════════════════════════════════ */
.screen.dusk .lx-panel, .screen.dusk .soc { position: relative; margin: 8px 0 0; padding: 20px 16px 18px; border-radius: 22px; color: #fff; background-color: #0A0A09;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .3)),
    url("/img/leather-grain.webp"),
    linear-gradient(180deg, #1B1A18, #0E0E0D);
  background-size: auto, 300px 300px, auto; background-repeat: no-repeat, repeat, no-repeat; background-position: 0 0; background-blend-mode: normal, overlay, normal;
  box-shadow: 0 10px 22px -8px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -2px 3px rgba(0, 0, 0, .5); }
.screen.dusk .lx-panel label, .screen.dusk .lx-panel h2, .screen.dusk .soc h2, .screen.dusk .soc label { color: #E6C98A; }
.screen.dusk .lx-panel .input, .screen.dusk .lx-panel select, .screen.dusk .lx-panel input[type="date"], .screen.dusk .soc .input {
  background-color: #070A09; background-image: linear-gradient(180deg, #121614, #070A09); color: #fff; border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .85), 0 1px 0 rgba(255, 255, 255, .08); }
.screen.dusk .lx-panel .input::placeholder, .screen.dusk .soc .input::placeholder { color: rgba(255, 255, 255, .45); }
.screen.dusk .lx-panel .pill, .screen.dusk .lx-panel .btn:not(.primary), .screen.dusk .soc .btn:not(.primary) { background-color: #0A0A09; background-image: linear-gradient(180deg, #232220, #0E0E0D); color: #F3E4BD; border: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .1); }
.screen.dusk .lx-panel .pill[aria-pressed="true"] { background-image: linear-gradient(#F0D9A0, #D9B86C); color: #10281B; box-shadow: 0 2px 6px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .5); }
.screen.dusk .lx-panel .btn.primary, .screen.dusk .soc .btn.primary { background-image: linear-gradient(#F0D9A0, #D9B86C); background-color: #D9B86C; color: #10281B; border: 0; box-shadow: 0 2px 6px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .5); }
.screen.dusk .lx-panel table.card { background: #070A09; border-radius: 12px; box-shadow: inset 0 2px 8px rgba(0, 0, 0, .85); }
.screen.dusk .lx-panel table.card th { background: none; color: #E6C98A; }
.screen.dusk .lx-panel table.card td, .screen.dusk .lx-panel table.card td.lab { background: none; color: #fff; }
.screen.dusk .lx-panel .hint, .screen.dusk .soc .hint, .screen.dusk .lx-panel p { color: rgba(255, 255, 255, .85); }
.screen.dusk .soc .panel { background: #070A09; border: 0; box-shadow: inset 0 2px 8px rgba(0, 0, 0, .85); color: #fff; }
.screen.dusk .soc .soc-sec + .soc-sec { margin-top: 18px; }

/* the green contours sit right at the back of Post a score, the Handicap calculator and Friends (Luke, 2026-10-25), as behind the tab bar and Home */
.screen.dusk:has(.lx-panel), .screen.dusk:has(.soc) {
  background: var(--ground-lines, none) center top / 124% auto repeat-y, var(--ground-terr, none) center top / 124% auto repeat-y, linear-gradient(180deg, #1B4029, #0F2A1C); }

/* black-contour edging along the top and the bottom of the leather panel on Post a score, the Handicap calculator and Friends (Luke, 2026-10-25), the same
   recessed strip of course contours as on the Courses dashboard and the Stats sections */
.screen.dusk .lx-panel, .screen.dusk .soc { padding-top: 38px; padding-bottom: 34px; overflow: hidden; }
.screen.dusk .lx-panel::before, .screen.dusk .lx-panel::after, .screen.dusk .soc::before, .screen.dusk .soc::after { content: ""; position: absolute; left: 0; right: 0; height: 22px; pointer-events: none; z-index: 0;
  background-color: #2A302D; background-image: linear-gradient(118deg, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, 0) 45%), var(--ground-dark, none), linear-gradient(180deg, #38403C 0%, #1C211F 100%);
  background-size: auto, 100% auto, auto; background-repeat: no-repeat, repeat-y, no-repeat; background-position: 0 0, center top, 0 0; }
.screen.dusk .lx-panel::before, .screen.dusk .soc::before { top: 0; box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .1); }
.screen.dusk .lx-panel::after, .screen.dusk .soc::after { bottom: 0; box-shadow: inset 0 3px 6px rgba(0, 0, 0, .8), 0 -1px 0 rgba(255, 255, 255, .1); }
.screen.dusk .lx-panel > *, .screen.dusk .soc > * { position: relative; z-index: 1; }
