/* Graveyard Greens 1.1 — desktop-first course surface and compact HUD. */

[hidden] { display: none !important; }

.gg-shell {
  box-sizing: border-box;
  width: min(100%, 1600px);
  max-width: 1600px;
}

.gg-game {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 204, 204, 0.48);
  border-radius: 14px;
  background: #071719;
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.46), inset 0 0 0 1px rgba(115, 255, 220, 0.08);
}

.gg-loader {
  min-height: min(74vh, 820px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 36px;
  color: #c5ffff;
  background: radial-gradient(circle at 50% 38%, rgba(0, 204, 204, 0.15), transparent 52%), #071719;
  text-align: center;
}

.gg-loader__sigil {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid rgba(177, 255, 240, 0.7);
  border-radius: 50%;
  color: #98ffe7;
  font-size: 34px;
  animation: gg-pulse 1.4s ease-in-out infinite;
}

.gg-loader strong { font-size: 1.2rem; letter-spacing: 0.08em; text-transform: uppercase; }
.gg-loader span { color: #86b8b9; font-size: 0.9rem; }
.gg-loader progress { width: min(380px, 80%); accent-color: #00cccc; }

@keyframes gg-pulse {
  0%, 100% { transform: scale(0.94); opacity: 0.68; }
  50% { transform: scale(1.04); opacity: 1; }
}

/* The course owns the page: at a 1440×900 desktop viewport this resolves to
 * roughly 665px high, or 74vh, with no narrow form card beside it. */
.gg-layout {
  position: relative;
  display: block;
  min-height: clamp(520px, 74vh, 900px);
}

.gg-stage-wrap { min-width: 0; padding: 0; }

.gg-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: clamp(520px, 74vh, 900px);
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at 50% 18%, #365d58 0, #163230 44%, #071516 100%);
  cursor: url('/images/cursors/hover.cur') 11 0, url('/images/cursors/hover.png') 11 0, crosshair;
  touch-action: none;
}

.gg-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 12, 13, 0.12), transparent 26%, rgba(2, 8, 9, 0.28));
}

.gg-stage canvas { display: block; width: 100%; height: 100%; }

.gg-fallback {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 36px;
  background: rgba(4, 14, 15, 0.94);
  color: #e6ffff;
  text-align: center;
}

.gg-fallback strong { color: #ff9f9f; font-size: 1.2rem; }
.gg-fallback span { max-width: 38rem; color: #a8c5c4; }
.gg-fallback .gg-button { width: auto; margin-top: 8px; text-decoration: none; }

.gg-aim-overlay { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 120ms ease; }
.gg-aim-overlay.is-visible { opacity: 1; }
.gg-aim-overlay__line {
  position: absolute;
  left: var(--gg-aim-x, 50%); top: var(--gg-aim-y, 50%);
  width: 3px; height: 120px;
  transform-origin: 50% 100%;
  background: linear-gradient(transparent, #9effdc);
  box-shadow: 0 0 12px rgba(158, 255, 220, 0.76);
}
.gg-aim-overlay__line::before {
  content: "";
  position: absolute;
  left: 50%; top: -6px;
  width: 12px; height: 12px;
  border-top: 2px solid #9effdc;
  border-left: 2px solid #9effdc;
  transform: translateX(-50%) rotate(45deg);
}

.gg-toast {
  position: absolute;
  z-index: 7;
  left: 50%; bottom: 24px;
  max-width: calc(100% - 40px);
  padding: 9px 15px;
  border: 1px solid rgba(158, 255, 220, 0.62);
  border-radius: 999px;
  background: rgba(3, 16, 17, 0.88);
  color: #d7fff4;
  font-size: 0.86rem;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}
.gg-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Compact glass HUD: the course remains visible underneath and all controls
 * remain reachable without reserving a sidebar column. */
.gg-sidebar {
  position: absolute;
  z-index: 5;
  top: 18px; left: 18px; right: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
  padding: 12px 14px;
  border: 1px solid rgba(127, 255, 224, 0.32);
  border-radius: 11px;
  background: linear-gradient(110deg, rgba(3, 18, 19, 0.88), rgba(4, 27, 27, 0.74));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.gg-sidebar > * { pointer-events: auto; }

.gg-sidebar__heading { flex: 1 1 220px; min-width: 190px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gg-kicker { display: block; color: #75b5ae; font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase; }
.gg-sidebar h2 { margin: 3px 0 0; color: #e0ffff; font-size: clamp(1rem, 1.4vw, 1.28rem); line-height: 1.1; }
.gg-hole-number { flex: 0 0 auto; padding: 4px 8px; border: 1px solid rgba(0, 204, 204, 0.46); border-radius: 999px; color: #99e7dc; font-size: 0.76rem; }

.gg-score-row, .gg-round-stats { display: grid; grid-template-columns: repeat(3, minmax(54px, 1fr)); gap: 6px; }
.gg-score-row { flex: 0 1 248px; }
.gg-round-stats { flex: 0 1 250px; }
.gg-score-row > div, .gg-round-stats > div { display: grid; gap: 2px; padding: 7px 8px; border: 1px solid rgba(0, 204, 204, 0.25); border-radius: 6px; background: rgba(0, 0, 0, 0.26); text-align: center; }
.gg-score-row span, .gg-round-stats span { color: #79a9a5; font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; }
.gg-score-row strong, .gg-round-stats strong { color: #d8fff7; font-size: 1.08rem; }

.gg-name-field { flex: 0 1 212px; display: grid; gap: 4px; color: #b6d8d3; font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; }
.gg-name-field input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid rgba(0, 204, 204, 0.44); border-radius: 5px; background: #061112; color: #f1ffff; font: inherit; letter-spacing: normal; text-transform: none; }
.gg-name-field input:focus { outline: 2px solid #00cccc; outline-offset: 1px; }

.gg-button {
  width: auto;
  min-height: 37px;
  padding: 8px 13px;
  border: 1px solid rgba(109, 255, 222, 0.56);
  border-radius: 5px;
  background: rgba(0, 111, 111, 0.42);
  color: #d8fffa;
  font: inherit;
  font-size: 0.8rem;
  cursor: url('/images/cursors/hover.cur') 11 0, url('/images/cursors/hover.png') 11 0, pointer;
}
.gg-button:hover { background: rgba(0, 171, 161, 0.48); }
.gg-button:focus-visible { outline: 2px solid #b4fff1; outline-offset: 2px; }
.gg-button--primary { border-color: #00dddd; background: linear-gradient(135deg, #007c79, #005455); color: #fff; }
.gg-button--primary:hover { background: linear-gradient(135deg, #00a39b, #00716f); }

.gg-controls { flex: 1 1 240px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; padding-top: 2px; }
.gg-control-line { display: flex; justify-content: space-between; color: #a6cac6; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; }
.gg-control-line output { color: #d9fff4; }
.gg-controls input[type="range"] { width: 100%; accent-color: #00cccc; }
.gg-control-note { grid-column: 1 / -1; margin: 0; color: #8cb5b0; font-size: 0.7rem; line-height: 1.3; }

.gg-status { flex: 1 1 250px; min-height: 2.4em; margin: 2px 0 0; color: #a9d3cd; font-size: 0.76rem; line-height: 1.35; }
.gg-status.is-good { color: #9fffd2; }
.gg-status.is-bad { color: #ffaaa2; }

.gg-stage-hint { min-height: 1.25em; padding: 8px 5px 0; color: #83acaa; font-size: 0.78rem; }

.gg-divider { margin: 24px 0 16px; border: 0; border-top: 1px solid rgba(0, 204, 204, 0.25); }
.gg-shell .leaderboard h2 { margin-top: 0; color: #aefefe; }
.gg-shell #lbTable { width: 100%; border: 1px solid #008b8b; border-collapse: collapse; background: rgba(2, 16, 17, 0.72); }
.gg-shell #lbTable th, .gg-shell #lbTable td { padding: 8px 9px; border: 1px solid rgba(0, 139, 139, 0.64); text-align: left; }
.gg-shell #lbTable th { background: rgba(0, 204, 204, 0.14); color: #aefefe; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; }
.gg-shell #lbTable td { color: #c5e5e0; font-size: 0.82rem; }
.gg-shell #lbTable .empty-cell { color: #789795; font-style: italic; text-align: center; }

@media (max-width: 900px) {
  .gg-stage { height: clamp(450px, 66vh, 680px); }
}

@media (max-width: 620px) {
  .gg-layout { display: flex; flex-direction: column; min-height: 0; }
  .gg-stage { height: clamp(400px, 62vh, 580px); min-height: 400px; }
  .gg-sidebar {
    position: relative;
    top: auto; left: auto; right: auto;
    border-radius: 0;
    border-width: 1px 0 0;
    background: linear-gradient(180deg, rgba(0, 204, 204, 0.09), rgba(5, 19, 20, 0.98));
    pointer-events: auto;
  }
  .gg-sidebar > * { pointer-events: auto; }
  .gg-name-field { flex-basis: 190px; }
  .gg-button { flex: 1 1 160px; }
  .gg-controls { flex-basis: 100%; }
  .gg-status { flex-basis: 100%; }
}

/* The 874×402 iPhone landscape viewport remains playable: collapse the
 * stage to the visible height instead of invoking a full-page portrait gate. */
@media (max-height: 560px) and (orientation: landscape) {
  /* Keep the normal shell, but reclaim the short landscape viewport for the
   * course. The standard header remains recognizable without pushing the
   * entire play surface below an iPhone landscape fold. */
  header { padding: 8px 16px 5px; }
  header img { width: 82px; margin: -10px auto; }
  header h1 { margin-top: 4px; font-size: 1.65em; }
  .gg-shell { margin-top: 2px; padding: 16px; }
  .gg-shell .back-link { margin-bottom: 16px; }
  .gg-stage { height: min(72vh, 560px); min-height: 260px; }
  .gg-sidebar { top: 8px; left: 8px; right: 8px; gap: 6px 10px; padding: 8px 10px; }
  .gg-sidebar h2 { font-size: 0.96rem; }
  .gg-kicker { font-size: 0.58rem; }
  .gg-score-row strong, .gg-round-stats strong { font-size: 0.92rem; }
  .gg-name-field input { padding: 5px 7px; }
  .gg-button { min-height: 30px; padding: 6px 9px; font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gg-loader__sigil { animation: none; }
  .gg-toast { transition: none; }
}
