:root {
  color-scheme: dark;
  --bg: #111511;
  --panel: #192019;
  --panel-2: #202920;
  --line: #435142;
  --text: #edf4e8;
  --muted: #aab7a4;
  --accent: #f2c14e;
  --accent-2: #69b578;
  --danger: #d97059;
  --water: #427aa1;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #263322 0, var(--bg) 46rem);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
input,
select {
  border: 1px solid var(--line);
  background: #121812;
  color: var(--text);
  border-radius: 8px;
  padding: .8rem .9rem;
}

button {
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.primary {
  background: var(--accent);
  color: #1f1806;
  border-color: #f7d67d;
}

.link-button,
.back-button {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
  padding-inline: 0;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1380px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 24px 0;
}

.menu-screen,
.panel-screen,
.game-screen {
  min-height: calc(100vh - 48px);
}

.menu-screen {
  display: grid;
  place-items: center;
  grid-template-columns: 1fr minmax(280px, 420px);
  gap: 48px;
}

.brand-block h1 {
  margin: 0;
  font-size: clamp(3.6rem, 10vw, 8rem);
  line-height: .9;
}

.eyebrow,
.muted {
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  font-size: .78rem;
}

.menu-actions,
.panel-screen,
.situation,
.map-panel,
.throw-panel,
.score-panel,
.chat-panel,
.chat-box {
  background: rgba(25, 32, 25, .88);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.menu-actions,
.menu-actions label {
  display: grid;
  gap: 12px;
}

.join-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.local-setup {
  display: grid;
  gap: 10px;
  border: 1px solid #313d31;
  border-radius: 8px;
  padding: 12px;
  background: rgba(18, 24, 18, .72);
}

.local-setup-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

.local-setup-head span {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.local-setup-head label {
  display: grid;
  grid-template-columns: auto 68px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.local-setup-head select {
  padding: .55rem .65rem;
}

.local-player-fields {
  display: grid;
  gap: 8px;
}

.local-player-fields label {
  display: grid;
  gap: 6px;
}

.audio-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #313d31;
  border-radius: 8px;
  padding: 10px;
  background: rgba(12, 18, 12, .72);
}

.audio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.audio-head h3,
.audio-head .eyebrow {
  margin: 0;
}

.audio-toggle {
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: #121812;
}

.audio-toggle.active {
  color: #1f1806;
  background: var(--accent);
  border-color: #f7d67d;
}

.audio-status {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.audio-sliders {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.audio-sliders label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.audio-sliders input {
  grid-column: 1 / -1;
}

.panel-heading,
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.room-code,
.turn-pill {
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  padding: .7rem 1rem;
  font-weight: 800;
}

.lobby-grid,
.game-grid,
.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 16px;
}

.game-grid {
  grid-template-columns: minmax(300px, 1.2fr) minmax(300px, .95fr) minmax(320px, .9fr);
  align-items: start;
}

.chat-panel {
  grid-column: span 2;
}

.score-panel {
  min-height: 220px;
}

h2,
h3 {
  margin: 0 0 12px;
}

.stats,
.conditions,
.disc-numbers,
.map-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
}

.stats span,
.conditions p,
.disc-numbers,
.map-key {
  margin: 0;
  background: #121812;
  border: 1px solid #313d31;
  border-radius: 8px;
  padding: .5rem .65rem;
}

.map-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.description {
  font-size: 1.05rem;
  line-height: 1.6;
}

.wind-widget {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(220px, 100%);
  margin: 14px 0;
  padding: 14px;
  background: #121812;
  border: 1px solid #313d31;
  border-radius: 8px;
}

.wind-speed {
  color: var(--accent);
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
}

.wind-speed span {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 800;
}

.wind-compass {
  position: relative;
  width: 112px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.wind-compass span {
  position: absolute;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 900;
}

.wind-compass .north {
  top: 0;
}

.wind-compass .east {
  right: 2px;
}

.wind-compass .south {
  bottom: 0;
}

.wind-compass .west {
  left: 2px;
}

.compass-ring {
  color: #6f8269;
  font-size: 5.2rem;
}

.wind-needle {
  position: absolute;
  color: var(--accent);
  font-size: 2rem;
  transform: rotate(var(--wind-deg));
  animation: windNeedle 1.6s ease-in-out infinite alternate;
}

.wind-caption {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
  text-align: center;
}

@keyframes windNeedle {
  from {
    transform: rotate(var(--wind-deg)) translateY(-1px);
  }

  to {
    transform: rotate(calc(var(--wind-deg) + 7deg)) translateY(1px);
  }
}

.throw-result {
  border-left: 4px solid var(--accent);
  margin-top: 14px;
  padding: 12px;
  background: #252715;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(28px, 1fr));
  gap: 4px;
  margin-bottom: 12px;
}

.map-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #3f4d3e;
  border-radius: 4px;
  font-weight: 900;
  background: #253123;
  min-width: 0;
}

.map-cell i {
  font-size: 1rem;
  line-height: 1;
}

.map-cell.fairway,
.map-cell.tee,
.map-cell.green {
  background: #486b3b;
}

.map-cell.rough {
  background: #5b6635;
}

.map-cell.woods {
  background: #233720;
}

.map-cell.water {
  background: var(--water);
}

.map-cell.ob {
  background: #5b2b24;
}

.map-cell.player {
  outline: 3px solid var(--accent);
}

.shot-list,
.advanced,
.disc-controls {
  display: grid;
  gap: 10px;
}

.disc-category-grid {
  display: grid;
  gap: 8px;
}

.disc-category {
  display: grid;
  gap: 6px;
  border: 1px solid #313d31;
  border-radius: 8px;
  padding: 10px;
  background: #121812;
}

.disc-category span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.disc-category.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(242, 193, 78, .32);
}

.disc-category.active span {
  color: var(--accent);
}

.arm-control {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #313d31;
  border-radius: 8px;
  background: #121812;
  padding: 8px;
}

.arm-control > span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.arm-control label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #344333;
  border-radius: 8px;
  background: #1d261d;
  font-weight: 800;
}

.arm-control input {
  accent-color: var(--accent);
  padding: 0;
}

.shot-choice {
  text-align: left;
  display: grid;
  gap: 4px;
  background: var(--panel-2);
}

.shot-choice span,
.score-list em,
.leaderboard-list em,
.player-list span {
  color: var(--muted);
  font-style: normal;
}

.advanced label,
.disc-controls label {
  display: grid;
  gap: 6px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

.throw-button {
  width: 100%;
  margin-top: 12px;
}

.throw-button.is-flying {
  color: #18150a;
  background: linear-gradient(90deg, #f2c14e, #f6e27f, #f2c14e);
  background-size: 220% 100%;
  cursor: wait;
  animation: flightPulse 1.1s linear infinite;
}

@keyframes flightPulse {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 220% 50%;
  }
}

.score-list,
.player-list,
.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.score-list li,
.player-list li,
.leaderboard-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #303a30;
  padding: 8px 0;
}

.chat-log {
  min-height: 180px;
  max-height: 320px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  margin-bottom: 12px;
}

.chat-log p {
  margin: 0;
  color: var(--text);
}

.chat-log span {
  color: var(--accent-2);
  font-weight: 700;
}

.chat-log .system {
  color: var(--muted);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
  margin-bottom: 20px;
}

th,
td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: center;
}

.warning {
  color: var(--danger);
}

.status-line {
  min-height: 1.4rem;
  color: var(--danger);
  margin: 0;
}

@media (max-width: 1020px) {
  .menu-screen,
  .lobby-grid,
  .game-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    grid-column: auto;
  }
}

body {
  background:
    linear-gradient(180deg, rgba(17, 21, 17, .78), rgba(17, 21, 17, .96)),
    radial-gradient(circle at 18% 0, rgba(105, 181, 120, .25), transparent 28rem),
    radial-gradient(circle at 100% 10%, rgba(242, 193, 78, .16), transparent 24rem),
    var(--bg);
}

.game-screen {
  padding-bottom: 18px;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px;
  background: rgba(14, 18, 14, .94);
  border: 1px solid #344333;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
}

.hole-heading h2 {
  margin-bottom: 0;
}

.hud-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hud-strip span,
.turn-pill {
  border: 1px solid #566650;
  color: var(--text);
  border-radius: 8px;
  padding: .62rem .75rem;
  background: linear-gradient(180deg, #1f291f, #121812);
  font-weight: 800;
}

.hud-strip strong {
  color: var(--accent);
}

.game-grid {
  grid-template-columns: minmax(340px, .95fr) minmax(340px, .9fr) minmax(360px, 430px);
  grid-template-areas:
    "situation map command"
    "score map command";
  gap: 14px;
}

.situation {
  grid-area: situation;
}

.map-panel {
  grid-area: map;
}

.command-panel {
  grid-area: command;
}

.score-panel {
  grid-area: score;
}

.situation,
.map-panel,
.command-panel,
.score-panel {
  background: linear-gradient(180deg, rgba(31, 41, 31, .94), rgba(18, 24, 18, .94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 18px 45px rgba(0, 0, 0, .18);
}

.command-panel {
  align-self: start;
  position: static;
  max-height: none;
  min-height: 0;
  display: grid;
  grid-template-rows: auto;
  overflow: visible;
  gap: 10px;
}

.command-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.command-header h3,
.command-header .eyebrow {
  margin: 0;
}

.turn-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #566650;
  box-shadow: 0 0 0 4px rgba(86, 102, 80, .16);
}

.turn-dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(242, 193, 78, .18), 0 0 18px rgba(242, 193, 78, .7);
  animation: livePulse 1.1s ease-in-out infinite alternate;
}

@keyframes livePulse {
  from {
    transform: scale(.92);
  }

  to {
    transform: scale(1.08);
  }
}

.disc-category-grid {
  grid-template-columns: 1fr;
}

.advanced {
  grid-template-columns: 1fr 1fr;
}

.advanced label {
  min-width: 0;
}

.throw-button {
  min-height: 48px;
  box-shadow: 0 8px 24px rgba(242, 193, 78, .18);
}

.tactics {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.tactics h3 {
  margin-bottom: 0;
}

.shot-list {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.shot-choice {
  border-color: #3d4c3b;
}

.shot-choice:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.command-chat,
.command-chat .chat-box {
  min-height: 0;
}

.command-chat .chat-box {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 12px;
  background: rgba(11, 15, 11, .72);
}

.command-chat .chat-log {
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.chat-panel {
  display: none;
}

.stats span {
  min-width: 86px;
  justify-content: center;
  text-align: center;
}

.description {
  background: rgba(10, 14, 10, .42);
  border: 1px solid #303d2f;
  border-radius: 8px;
  padding: 12px;
}

.wind-widget {
  width: 100%;
  grid-template-columns: 86px 118px 1fr;
  align-items: center;
  justify-items: center;
}

.wind-speed {
  justify-self: start;
}

.wind-caption {
  justify-self: start;
  text-align: left;
}

.map-panel {
  position: sticky;
  top: 94px;
}

.map-grid {
  gap: 5px;
}

.map-cell {
  border-color: rgba(237, 244, 232, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.score-panel {
  min-height: 0;
}

@media (max-width: 1180px) {
  .game-grid {
    grid-template-columns: minmax(320px, 1fr) minmax(340px, 430px);
    grid-template-areas:
      "situation command"
      "map command"
      "score command";
  }
}

@media (max-width: 820px) {
  .top-bar,
  .command-panel,
  .map-panel {
    position: static;
  }

  .top-bar,
  .hud-strip {
    align-items: stretch;
  }

  .game-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "situation"
      "command"
      "map"
      "score";
  }

  .command-panel {
    max-height: none;
    overflow: visible;
  }

  .wind-widget {
    grid-template-columns: 1fr;
  }

  .wind-speed,
  .wind-caption {
    justify-self: center;
    text-align: center;
  }

  .advanced {
    grid-template-columns: 1fr;
  }
}
