/* Lexend, the latin subset of the Google variable font. One file covers the
   whole weight axis, so every 400–800 rule shares it. */
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/lexend.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: #173024;
  --green: #1b7a34;
  --green-deep: #14602a;
  --card: #fffdf8;
  --line: rgba(23, 48, 36, 0.08);
  --shadow: 0 12px 28px rgba(30, 60, 30, 0.18);
  --rail-width: clamp(196px, 18vw, 236px);
  /* Sampled from the logo, so the brand mark and the menu button match. */
  --brand-green: #084a23;
  font-family: "Lexend", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #8a9364;
  color: var(--ink);
}

/* While a shot or a look-around is being dragged the pointer is captured,
   so the cursor is set on the whole page, not just the course. */
body.is-aiming { cursor: crosshair; }
body.is-panning { cursor: grabbing; }

#game {
  position: fixed;
  inset: 0;
  /* The sky. The course pictures are transparent round the course, so
     whatever the camera does, open space is sky, never the page colour. */
  background: linear-gradient(#c6dfe8, #eaf4ee);
}

/* The course runs under the side panel; the camera keeps the play area to
   its right (js/main.js fullViewport). */
#ground-full, #ground, #course {
  position: absolute;
  top: 0;
  left: 0;
}
/* The course pictures (js/draw.js): the whole hole, and on top of it a
   sharper screen-sized one when zoomed in. Both are moved by transform. */
#ground-full, #ground {
  z-index: 0;
  pointer-events: none;
  transform-origin: 0 0;
}
#course {
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
  /* No scroll, pinch-zoom or long-press callout stealing a drag on a
     touchscreen: the browser leaves every gesture on the course to the game. */
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
/* Over the golfer a drag takes a shot; anywhere else it moves the view. */
#course.cursor-aim { cursor: crosshair; }
#course.cursor-grab { cursor: grab; }
#course.cursor-grabbing,
body.is-panning #course { cursor: grabbing; }
body.is-aiming #course { cursor: crosshair; }

.card {
  position: absolute;
  z-index: 2;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  box-shadow: var(--shadow);
  user-select: none;
}

/* Hole info floats over the course in the bottom-right corner. */
.hole-card {
  position: absolute;
  z-index: 4;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 12px;
  width: 248px;
  max-width: 40vw;
  margin: 0;
  padding: 14px 16px 12px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(23, 48, 36, 0.14);
  pointer-events: none;
  user-select: none;
}

/* Top-aligned, so the menu glyph starts on the same line as the logo. */
.rail-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px; /* breathing room before the clubs */
}

.brand-mark {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 84px;
  object-fit: contain;
  object-position: left center;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  user-select: none;
}

.game-rail {
  position: absolute;
  z-index: 4;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: var(--rail-width);
  padding: max(12px, env(safe-area-inset-top, 0px)) 14px max(10px, env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  /* No background at all: the course, its sprites and the sky run right
     under the panel. A faint light halo keeps the labels readable. */
  background: none;
  border-right: 0;
  box-shadow: none;
  text-shadow: 0 0 6px rgba(216, 233, 232, 0.9), 0 0 2px rgba(216, 233, 232, 0.95);
  scrollbar-width: thin;
}


.rail-kicker,
.minimap-label,
.bag-tab {
  margin: 0;
  color: #084a23; /* the logo's green */
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}









/* The now-playing card: course, hole and par, then three quiet numbers. */
.hole-card { grid-template-columns: minmax(0, 1fr); }
.hc-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.hc-title { flex: 1 1 auto; min-width: 0; }
.hc-title h1 {
  margin: 0;
  overflow: hidden;
  color: #64776a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hc-hole {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.hc-num { flex: 0 0 auto; color: var(--green); font-variant-numeric: tabular-nums; }
.hc-name {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* a long name wraps once, then trails off */
  overflow-wrap: anywhere;
}
.hc-par { margin: 1px 0 0; color: #64776a; font-size: 13px; font-weight: 600; }
.hc-head .eagle-badge { width: 30px; height: 30px; flex: 0 0 auto; }

.hc-stats { display: flex; gap: 18px; margin: 0; }
.hc-stat { display: flex; flex-direction: column-reverse; min-width: 0; }
.hc-stat[hidden] { display: none; }
.hc-stat dt { color: #64776a; font-size: 11px; font-weight: 600; white-space: nowrap; }
.hc-stat dd {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.hc-stat dd.is-under { color: var(--green); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: #4e7a5c;
}

.minimap {
  width: 100%;
  margin-top: auto;
  padding-top: 2px;
  flex: 0 0 auto;
  user-select: none;
}

#minimap {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 6px;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(23, 48, 36, 0.12);
  border-radius: 12px;
  background: #d8e9e8;
  box-shadow: 0 4px 14px rgba(30, 50, 20, 0.1);
  overflow: hidden;
}

.ghost, .primary, .club {
  font: inherit;
  cursor: pointer;
}

.ghost {
  border: 0;
  background: #e7f3ea;
  color: var(--green-deep);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}

.ghost:hover { background: #d8eedd; }
.random-again { width: 100%; margin-top: 10px; text-align: center; }

.menu-toggle {
  display: grid;
  place-items: start center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--brand-green);
  font: inherit;
  cursor: pointer;
}

.menu-toggle svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.8;
}

.menu-toggle:hover { color: #146b33; }

.golf-bag {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  padding: 2px 0;
  flex: 0 0 auto;
  user-select: none;
}

.bag-tab {
  padding-bottom: 2px;
}



#club-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.club {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #173024;
  text-align: center;
  cursor: pointer;
}

/* The sprites are square, so the tile is a square the artwork can fill. */
.club .club-icon {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  /* Selectable clubs: a grey rim, a shade thinner than the selected one's
     dark green. */
  border: 2px solid #8e9691;
  border-radius: 12px;
  /* Selectable clubs share the selected club's green fill; only the
     selected one adds the green rim and tick. */
  background: #e5f2df;
}

.club-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.club .n {
  max-width: 100%;
  overflow: hidden;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.club:hover:not(.is-selected):not(.is-disabled) .club-icon { background: #d6eacd; }

.club.is-selected .club-icon {
  border: 3px solid #2e8b3d;
  background: #e5f2df;
}

/* Green tick badge in the top-right corner of the selected club. */
.club.is-selected .club-icon::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2e8b3d no-repeat center / 56% 56%
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* A club you cannot hit from here fades back as a whole tile, label and
   all, with a pale border and a soft grey corner holding a small white X,
   so it recedes behind the clubs you can use. */
.club.is-disabled { cursor: not-allowed; opacity: 0.45; }

.club.is-disabled .club-icon {
  border-color: #a3a9a5;
  background: rgba(0, 0, 0, 0.06);
}

.club.is-disabled .club-icon img {
  filter: grayscale(0.65) opacity(0.6);
}

.club.is-disabled .club-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    no-repeat 89% 11% / 14% 14%
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E"),
    rgba(45, 50, 55, 0.55);
  /* Triangle in the top-right corner. The outer vertex is the tile corner,
     so the tile's border-radius rounds it cleanly. */
  clip-path: polygon(100% 0, 100% 52%, 48% 0);
  pointer-events: none;
}

.card-tools { display: none; }

.ghost.tiny {
  padding: 6px 10px;
  font-size: 13px;
}

.golfer-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.golfer-picker button.is-selected {
  background: var(--green);
  color: white;
}

.card-hint {
  display: none;
  position: static;
  max-width: none;
  padding: 9px 10px;
  border-radius: 9px;
  box-shadow: none;
}

.card-hint p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.card-hint.warn {
  display: block;
  background: #fff4f2;
  color: #8d2f26;
}

.modal {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(22, 40, 28, 0.4);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(480px, 100%);
  background: white;
  border-radius: 22px;
  padding: 26px 28px 22px;
  box-shadow: 0 24px 70px rgba(20, 40, 24, 0.28);
}

.modal-card h2 {
  margin: 4px 0 10px;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.modal-card p { margin: 0 0 10px; line-height: 1.45; }

.rules-list {
  margin: 0 0 18px;
  padding-left: 18px;
}

.rules-list li { margin: 0 0 8px; line-height: 1.4; }
.rules-list kbd {
  font-family: inherit;
  font-weight: 800;
  background: #eef5ef;
  border-radius: 5px;
  padding: 0 5px;
}

.result-name {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.result-name.good { color: var(--green); }
.result-name.even { color: #1d6a8a; }
.result-name.over { color: #9a6230; }

#done-score {
  font-size: 18px;
  margin-bottom: 18px;
}

.primary {
  width: 100%;
  border: 0;
  background: var(--green);
  color: white;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 16px;
}

.primary:hover { background: var(--green-deep); }

button:focus-visible {
  outline: 3px solid #1f7a45;
  outline-offset: 2px;
}

/* Short landscape (phones). Sized from the viewport, not the device. A
   narrower rail with the clubs three to a row keeps the tiles, and so the
   map under them, small enough that logo, clubs and map all fit in the
   height a phone browser leaves (about 330px). */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --rail-width: 156px; }
  .game-rail { gap: 6px; padding: 6px 10px; }
  .rail-top { gap: 8px; margin-bottom: 0; align-items: center; }
  .brand-mark { max-height: 40px; width: auto; object-fit: contain; object-position: left center; }
  .menu-toggle { width: 34px; height: 34px; border-radius: 10px; }
  .menu-toggle svg { width: 20px; height: 20px; }
  .bag-tab, .minimap-label { font-size: 10px; letter-spacing: 0.12em; }
  .golf-bag { gap: 4px; padding: 0; }
  .club { gap: 2px; }
  .club .club-icon { border-radius: 10px; }
  .club.is-selected .club-icon::after { width: 13px; height: 13px; }
  .hole-card { gap: 8px; width: auto; min-width: 180px; padding: 10px 12px 9px; }
  .hc-title h1 { font-size: 11px; }
  .hc-hole { font-size: 15px; gap: 5px; }
  .hc-par { font-size: 11px; }
  .hc-name { max-width: 160px; }
  .hc-head .eagle-badge { width: 24px; height: 24px; }
  .hc-stats { gap: 12px; }
  .hc-stat dd { font-size: 18px; }
  .hc-stat dt { font-size: 10px; }
  #club-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 6px; }
  .club .n { font-size: 10px; }
  .minimap { padding-top: 0; }
  #minimap { margin: 4px 0 0; border-radius: 10px; }
}

/* Very short (a phone with the browser bar and a banner showing): the club
   tiles shrink a little more so the map still fits. */
@media (orientation: landscape) and (max-height: 340px) {
  .brand-mark { max-height: 30px; }
  .club .n { font-size: 9px; }
}

body.is-portrait #game {
  filter: blur(16px);
  pointer-events: none;
}

#rotate-lock {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) 24px max(24px, env(safe-area-inset-bottom, 0px));
  background: rgba(20, 40, 24, 0.28);
}

#rotate-lock[hidden] { display: none; }

.rotate-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: #173024;
  text-align: center;
}

.rotate-stage {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
}

.rotate-phone {
  width: 64px;
  height: 96px;
  transform-origin: 50% 50%;
  animation: rotate-to-landscape 2.2s ease-in-out infinite;
}

.rotate-card p {
  margin: 0;
  font-size: clamp(22px, 6vw, 36px);
  font-weight: 700;
  color: #fffdf8;
  text-shadow: 0 2px 10px rgba(20, 40, 24, 0.35);
}

@keyframes rotate-to-landscape {
  0%, 18% { transform: rotate(0deg); }
  55%, 78% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

/* New-hole title: the hole's number, name and par, in the middle of the
   course, fading in and out over the flyover. Never takes a tap. */
.hole-intro {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: calc(var(--rail-width) + (100% - var(--rail-width)) / 2);
  transform: translate(-50%, -50%);
  max-width: min(80vw, 640px);
  text-align: center;
  pointer-events: none;
  user-select: none;
  opacity: 0;
}
.hole-intro[hidden] { display: none; }
.hole-intro p { margin: 0; }
.hi-hole {
  color: #ffffff;
  font-size: clamp(30px, 5.2vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-shadow: 0 2px 18px rgba(8, 40, 20, 0.45), 0 1px 3px rgba(8, 40, 20, 0.35);
}
.hi-num { color: #b9f0a5; }
.hi-par {
  margin-top: 6px !important;
  color: #ffffff;
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 700;
  text-shadow: 0 1px 10px rgba(8, 40, 20, 0.5);
}
.hole-intro.is-playing { animation: hole-intro 1.9s ease-out forwards; }
.hole-intro.is-leaving { animation: hole-intro-out 0.3s ease-out forwards; }
@keyframes hole-intro {
  0% { opacity: 0; transform: translate(-50%, -42%); }
  14% { opacity: 1; transform: translate(-50%, -50%); }
  70% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -54%); }
}
@keyframes hole-intro-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hole-intro.is-playing { animation-name: hole-intro-still; }
  @keyframes hole-intro-still { 0%, 100% { opacity: 0; } 12%, 72% { opacity: 1; } }
}

/* Which build is running, top centre of the course. Never takes a tap. */
.build-stamp {
  position: absolute;
  z-index: 6;
  top: max(6px, env(safe-area-inset-top, 0px));
  left: calc(var(--rail-width) + (100% - var(--rail-width)) / 2);
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* ---- now playing: floating text, right-aligned, no card ---- */
.hole-card {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  width: auto;
  max-width: min(46vw, 340px);
  padding: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  text-align: right;
  /* A soft light halo keeps the dark text readable over any grass. */
  text-shadow: 0 0 6px rgba(216, 233, 232, 0.9), 0 0 2px rgba(216, 233, 232, 0.95);
}
.hole-card .hc-course {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  color: #3f5446;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hole-card .hc-hole {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 7px;
  max-width: 100%;
  margin: 2px 0 8px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.hole-card .hc-num { flex: 0 0 auto; color: var(--green); font-weight: 800; font-variant-numeric: tabular-nums; }
.hole-card .hc-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
}
.hole-card .eagle-badge { width: 22px; height: 22px; align-self: center; flex: 0 0 auto; }
.hole-card .hc-stats { display: flex; justify-content: flex-end; gap: 18px; margin: 0; }
.hole-card .hc-stat { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.hole-card .hc-stat[hidden] { display: none; }
.hole-card .hc-stat dt {
  color: #3f5446;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hole-card .hc-stat dd {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.hole-card .hc-stat dd.is-under { color: var(--green); }
@media (max-height: 560px), (max-width: 760px) {
  .hole-card { min-width: 0; padding: 0; gap: 0; }
  .hole-card .hc-course { font-size: 10px; }
  .hole-card .hc-hole { font-size: 17px; margin-bottom: 5px; gap: 5px; }
  .hole-card .hc-name { max-width: none; }
  .hole-card .hc-stats { gap: 13px; }
  .hole-card .hc-stat dd { font-size: 20px; }
  .hole-card .hc-stat dt { font-size: 9px; }
}

/* Eagle Hunter mark above the course name: white outline only, no fill. */
.hole-card .eagle-badge { width: 34px; height: 34px; margin-bottom: 4px; align-self: flex-end; filter: drop-shadow(0 1px 1.5px rgba(20, 45, 28, 0.45)); }
.hole-card .eagle-badge .eagle-disc,
.hole-card .eagle-badge.is-earned .eagle-disc { fill: none; stroke: none; }
.hole-card .eagle-badge .eagle-ring,
.hole-card .eagle-badge.is-earned .eagle-ring { fill: none; stroke: #ffffff; stroke-width: 2.6; opacity: 1; }
.hole-card .eagle-badge .eagle-bird,
.hole-card .eagle-badge.is-earned .eagle-bird { fill: #ffffff; }
/* Labels a touch larger and heavier; each number centred under its label. */
.hole-card .hc-stat { align-items: center; }
.hole-card .hc-stat dt { font-size: 12px; font-weight: 900; }
@media (max-height: 560px), (max-width: 760px) {
  .hole-card .eagle-badge { width: 28px; height: 28px; }
  .hole-card .hc-stat dt { font-size: 10.5px; }
}

/* No panel background or blur. Text (labels, club names) and the logo
   carry a soft glow in the map's empty-area colour (#d8e9e8), so they read
   over the course; the club tiles and the map itself have none. */
.game-rail .rail-top {
  filter: drop-shadow(0 0 5px rgba(216, 233, 232, 0.9)) drop-shadow(0 0 2px rgba(216, 233, 232, 0.95));
}

/* Club names in small capitals, like the other panel labels. */
.club .n { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; font-size: 10px; }
@media (orientation: landscape) and (max-height: 520px) {
  .club .n { font-size: 9px; letter-spacing: 0.04em; }
}

/* Unavailable clubs: the tile's fill, icon and corner mark stay faded and
   see-through as before, but the rim and the label are at full strength.
   (The old 45% fade on the whole button is spread over the parts instead.) */
.club.is-disabled { opacity: 1; }
.club.is-disabled .club-icon { border-color: #a3a9a5; background: rgba(0, 0, 0, 0.027); }
.club.is-disabled .club-icon img { filter: grayscale(0.65) opacity(0.27); }
.club.is-disabled .club-icon::after { opacity: 0.45; }

/* Phones: a slightly bigger logo with a little more room before the clubs. */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --rail-width: 172px; }
  .brand-mark { max-height: 50px; }
  .rail-top { margin-bottom: 8px; }
}
@media (orientation: landscape) and (max-height: 340px) {
  .brand-mark { max-height: 36px; }
  .rail-top { margin-bottom: 5px; }
}

/* ---- controller ---- */
.pad-hints {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  margin: 0;
  display: none;
  color: #3f5446;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(216, 233, 232, 0.9), 0 0 2px rgba(216, 233, 232, 0.95);
}
.pad-hints b { color: #17331f; font-weight: 900; }
body.pad-active .pad-hints { display: block; }
body.menu-open .pad-hints { display: none; }
/* A clear focus ring when the D-pad moves through the menu. */
body.pad-active :focus { outline: 3px solid #2e8b3d; outline-offset: 2px; }
.pad-help { margin-top: 14px; }
.pad-help h3 { margin: 0 0 4px; font-size: 14px; }
.pad-help p { margin: 0 0 8px; font-size: 13px; line-height: 1.45; }
.pad-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.pad-mode span { font-weight: 700; margin-right: 4px; }
.pad-mode button {
  border: 1px solid rgba(23, 48, 36, 0.2); background: #fff; color: #17331f;
  border-radius: 999px; padding: 5px 11px; font: inherit; font-weight: 700; cursor: pointer;
}
.pad-mode button.is-selected { background: #2e8b3d; border-color: #2e8b3d; color: #fff; }

/* Collectible cards: tall pills (1 : 2.15) with a tier gradient behind them,
   in the spirit of football trading cards. Regular, Silver, Gold, Diamond. */
.tcard {
  --tc-ink: #1d3a27;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 6px;
  aspect-ratio: 1 / 2.15;
  padding: 22% 10% 26%;
  border-radius: 999px;
  background: linear-gradient(165deg, #f1f5ee 0%, #d5e0d1 45%, #b7c7b3 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55), 0 4px 12px rgba(20, 50, 30, 0.18);
  color: var(--tc-ink);
  text-align: center;
  box-sizing: border-box;
  overflow: visible;
}
.tcard.is-silver {
  background: linear-gradient(165deg, #fbfcfd 0%, #d9dee5 30%, #a7b0bc 52%, #e4e8ee 70%, #b9c1cb 100%);
  --tc-ink: #2d3540;
}
.tcard.is-gold {
  background: linear-gradient(165deg, #fff6d2 0%, #f1cf6a 30%, #c9951f 52%, #f6dc8c 72%, #d6a634 100%);
  --tc-ink: #4a3208;
}
.tcard.is-diamond {
  background: linear-gradient(165deg, #f2fdff 0%, #a9e9f7 25%, #c9b8ff 48%, #8edcf3 68%, #f4e9ff 85%, #9fe0f2 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8), 0 0 16px rgba(140, 200, 255, 0.55), 0 4px 12px rgba(20, 50, 80, 0.2);
  --tc-ink: #23305a;
}
.tcard-rarity { font-size: 9px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.8; }
.tcard-art { width: 78%; align-self: center; fill: currentColor; stroke: currentColor; }
.tcard-name { font-size: 12px; font-weight: 800; line-height: 1.15; }
.tcard-count {
  position: absolute;
  top: 6%;
  right: -4px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #12301e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.tcard-new {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 10px;
  background: #12301e;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tcard.is-locked {
  background: transparent;
  box-shadow: none;
  border: 2px dashed #c9d3c6;
  place-items: center;
  grid-template-rows: 1fr;
  padding: 0;
}
.tcard-q { font-size: 26px; font-weight: 700; color: #c9d3c6; }

.done-card { display: grid; justify-items: center; gap: 8px; margin: 4px 0 14px; }
.done-card .tcard { width: 92px; animation: card-in 0.5s cubic-bezier(.2, .9, .3, 1.3) both; }
.done-card-label { margin: 0; font-size: 13px; font-weight: 700; color: #5c7a6a; }
@keyframes card-in {
  from { transform: translateY(14px) rotate(-6deg) scale(0.8); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .done-card .tcard { animation: none; } }
@media (max-height: 500px) {
  .done-card { grid-template-columns: auto auto; align-items: center; margin: 0 0 8px; }
  .done-card .tcard { width: 58px; }
  .done-card .tcard-name { font-size: 10px; }
  .done-card .tcard-rarity { font-size: 8px; }
}

/* ---- brand logo (top left) and menu button (top right) ----
   The logo sits over the course, outside the rail, so it can run a little
   wider than the clubs. The rail starts below it. */
:root {
  --logo-w: calc(var(--rail-width) + 26px);
  --logo-h: calc(var(--logo-w) * 0.2765); /* the logo's own proportions */
  --logo-top: max(12px, env(safe-area-inset-top, 0px));
}
.brand-logo {
  position: absolute;
  z-index: 5;
  top: var(--logo-top);
  left: max(12px, env(safe-area-inset-left, 0px));
  width: var(--logo-w);
  height: auto;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 0 5px rgba(216, 233, 232, 0.9)) drop-shadow(0 0 2px rgba(216, 233, 232, 0.95));
}
.game-rail { padding-top: calc(var(--logo-top) + var(--logo-h) + 14px); }

#game > .menu-toggle {
  position: absolute;
  z-index: 5;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 14px;
  filter: drop-shadow(0 0 5px rgba(216, 233, 232, 0.9)) drop-shadow(0 0 2px rgba(216, 233, 232, 0.95));
}
#game > .menu-toggle svg { width: 38px; height: 38px; stroke-width: 2.6; }

@media (orientation: landscape) and (max-height: 520px) {
  :root { --logo-top: max(8px, env(safe-area-inset-top, 0px)); }
  .game-rail { padding-top: calc(var(--logo-top) + var(--logo-h) + 8px); }
  #game > .menu-toggle { width: 46px; height: 46px; }
  #game > .menu-toggle svg { width: 32px; height: 32px; }
}
@media (orientation: landscape) and (max-height: 340px) {
  :root { --logo-w: calc(var(--rail-width) + 8px); }
  .game-rail { padding-top: calc(var(--logo-top) + var(--logo-h) + 4px); }
}
