:root {
  --bg-deep: #0d3b2a;
  --bg-mid: #16563c;
  --bg-soft: #f3efe3;
  --panel: rgba(255, 251, 245, 0.95);
  --panel-strong: rgba(255, 255, 252, 0.98);
  --text-dark: #163222;
  --text-muted: #5d655e;
  --accent: #c89b3c;
  --accent-dark: #8c6a1d;
  --accent-soft: rgba(200, 155, 60, 0.14);
  --error: #b53232;
  --success: #1f6a43;
  --border: rgba(22, 50, 34, 0.14);
  --shadow: 0 24px 60px rgba(6, 33, 22, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", sans-serif;
  color: var(--text-dark);
  background:
    radial-gradient(circle at top left, rgba(200, 155, 60, 0.22), transparent 28%),
    linear-gradient(135deg, var(--bg-deep), var(--bg-mid) 50%, #113425 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.35;
}

button,
input {
  font: inherit;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  gap: 2rem;
  align-items: stretch;
  min-height: 100vh;
  padding: 2rem;
}

.hero-panel,
.content-panel {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 42rem;
  padding: 3rem;
  color: #f7f3e9;
  background:
    linear-gradient(to top, rgba(10, 28, 19, 0.7), rgba(10, 28, 19, 0.16)),
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), transparent 35%),
    linear-gradient(135deg, #1c6a47, #0f3324 70%);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -18% auto;
  width: 21rem;
  height: 21rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 155, 60, 0.32), transparent 68%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-panel h1,
.content-panel h2,
.view-intro h3 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.95;
}

.hero-panel h1 {
  max-width: 8ch;
  font-size: clamp(4rem, 9vw, 7rem);
}

.hero-copy,
.section-copy {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  font-size: 1.1rem;
  line-height: 1.6;
}

.hero-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-details span {
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  font-weight: 600;
}

.content-panel {
  display: flex;
  flex-direction: column;
  min-height: 42rem;
  padding: 2rem 2rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.9)),
    var(--bg-soft);
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.content-panel h2,
.view-intro h3 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  color: var(--text-dark);
}

.session-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
}

.session-user {
  font-weight: 700;
}

.view {
  display: none;
  flex: 1;
}

.view.view-active {
  display: block;
}

.hidden {
  display: none;
}

.auth-toggle {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(22, 50, 34, 0.08);
}

.auth-toggle__button,
.ghost-button,
.submit-button {
  border-radius: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, background-color 160ms ease;
}

.auth-toggle__button,
.ghost-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dark);
  cursor: pointer;
}

.auth-toggle__button {
  padding: 0.7rem 1rem;
  font-weight: 700;
}

.auth-toggle__button.is-active {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 18px rgba(22, 50, 34, 0.08);
}

.auth-form {
  margin-top: 1.5rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.5rem 0 0;
}

.checkbox-row input {
  width: auto;
}

.field-group {
  margin-bottom: 1.15rem;
}

label {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-dark);
  background: var(--panel-strong);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus {
  outline: none;
  border-color: rgba(200, 155, 60, 0.8);
  box-shadow: 0 0 0 4px rgba(200, 155, 60, 0.14);
  transform: translateY(-1px);
}

input[aria-invalid="true"] {
  border-color: rgba(181, 50, 50, 0.7);
  box-shadow: 0 0 0 4px rgba(181, 50, 50, 0.08);
}

.field-hint,
.field-error,
.form-status {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
}

.field-hint {
  color: var(--text-muted);
}

.field-error {
  min-height: 1.15rem;
  color: var(--error);
}

.submit-button {
  width: 100%;
  margin-top: 0.8rem;
  padding: 1rem 1.25rem;
  border: 0;
  font-weight: 700;
  color: #fff9ee;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  cursor: pointer;
}

.submit-button:hover,
.ghost-button:hover,
.auth-toggle__button:hover {
  transform: translateY(-1px);
}

.submit-button:hover {
  box-shadow: 0 16px 28px rgba(140, 106, 29, 0.22);
  filter: saturate(1.05);
}

.submit-button--compact {
  width: auto;
  margin-top: 0;
}

.ghost-button {
  padding: 0.8rem 1rem;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.64);
  font-weight: 700;
}

.submit-button:focus-visible,
.ghost-button:focus-visible,
.auth-toggle__button:focus-visible,
.golfer-option input:focus-visible + span {
  outline: 3px solid rgba(22, 50, 34, 0.22);
  outline-offset: 3px;
}

.form-status {
  min-height: 1.4rem;
  font-weight: 700;
}

.form-status.error {
  color: var(--error);
}

.form-status.success {
  color: var(--success);
}

.entry-toolbar,
.entry-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.entry-toolbar {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.entry-actions {
  margin-top: 1.25rem;
}

.entry-actions--top {
  margin-top: 0;
  margin-bottom: 1.25rem;
  justify-content: flex-start;
}

.search-field {
  flex: 1;
  margin: 0;
}

.search-field span {
  display: block;
  margin-bottom: 0.45rem;
}

.entry-summary {
  min-width: 12rem;
  text-align: right;
}

.entry-summary span {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.entry-summary #budget-left {
  color: var(--text-muted);
}

.golfer-table-shell {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.golfer-table {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(8rem, 0.8fr) minmax(8rem, 0.7fr);
  gap: 1rem;
  align-items: center;
}

.golfer-table--header {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(22, 50, 34, 0.08);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.golfer-list {
  max-height: 25rem;
  overflow-y: auto;
}

.golfer-option {
  position: relative;
  display: block;
  border-bottom: 1px solid rgba(22, 50, 34, 0.08);
}

.golfer-option:last-child {
  border-bottom: 0;
}

.golfer-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.golfer-option span {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(8rem, 0.8fr) minmax(8rem, 0.7fr);
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.golfer-option span strong,
.golfer-option span small,
.golfer-option span em {
  display: block;
}

.golfer-name {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
}

.flag-icon {
  width: 1.15rem;
  height: 0.86rem;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(22, 50, 34, 0.08);
  flex: 0 0 auto;
}

.golfer-option span small,
.golfer-option span em {
  color: var(--text-muted);
  font-style: normal;
}

.golfer-option input:checked + span {
  background: rgba(200, 155, 60, 0.15);
  box-shadow: inset 4px 0 0 rgba(200, 155, 60, 0.9);
}

.entries-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.entry-card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
}

.entry-card h4 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.85rem;
  text-transform: uppercase;
}

.entry-card p {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
}

.entry-card ul {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.entry-card li + li {
  margin-top: 0.35rem;
}

.commissioner-grid {
  display: grid;
  gap: 1rem;
}

.commissioner-card {
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.commissioner-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.commissioner-card__header h4 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.8rem;
  text-transform: uppercase;
}

.commissioner-card__header p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
}

.commissioner-card__entries {
  display: grid;
  gap: 0.85rem;
}

.commissioner-entry {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(22, 50, 34, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.commissioner-entry__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.commissioner-entry__header strong,
.commissioner-entry__header span {
  display: block;
}

.commissioner-entry__header span {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-weight: 700;
}

.commissioner-entry ul {
  margin: 0.8rem 0 0;
  padding-left: 1.15rem;
}

.commissioner-entry li + li {
  margin-top: 0.25rem;
}

.commissioner-delete-user {
  color: var(--error);
  border-color: rgba(181, 50, 50, 0.22);
}

.empty-state {
  margin: 0;
  padding: 1.4rem;
  border: 1px dashed rgba(22, 50, 34, 0.24);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--text-muted);
}

.empty-state--compact {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.selected-team {
  position: sticky;
  bottom: 0;
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 251, 245, 0.96);
  box-shadow: 0 -10px 28px rgba(22, 50, 34, 0.08);
}

.selected-team__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.selected-team__header h4 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  text-transform: uppercase;
}

.selected-team__budget {
  text-align: right;
}

.selected-team__budget span {
  display: block;
  font-weight: 700;
}

.selected-team__budget span + span {
  margin-top: 0.35rem;
  color: var(--text-muted);
}

.selected-team__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.selected-golfer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 14rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.selected-golfer__details {
  min-width: 0;
}

.selected-golfer strong {
  font-size: 0.95rem;
}

.selected-golfer span {
  color: var(--text-muted);
  font-weight: 700;
}

.selected-golfer__remove {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(22, 50, 34, 0.16);
  border-radius: 999px;
  background: rgba(22, 50, 34, 0.06);
  color: var(--text-dark);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.selected-golfer__remove:hover {
  background: rgba(181, 50, 50, 0.12);
  border-color: rgba(181, 50, 50, 0.28);
  color: var(--error);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .hero-panel,
  .content-panel {
    min-height: auto;
  }

  .hero-panel {
    min-height: 24rem;
    padding: 2rem;
  }
}

@media (max-width: 760px) {
  .content-panel {
    padding: 1.5rem 1rem 1rem;
  }

  .app-header,
  .entry-toolbar,
  .entry-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .entry-summary {
    min-width: 0;
    text-align: left;
  }

  .selected-team__header {
    flex-direction: column;
  }

  .selected-team__budget {
    text-align: left;
  }

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

  .session-controls {
    width: 100%;
    justify-content: space-between;
  }

  .golfer-table,
  .golfer-option span {
    grid-template-columns: minmax(0, 1.3fr) minmax(7rem, 0.8fr) minmax(7rem, 0.8fr);
    gap: 0.75rem;
  }
}

@media (max-width: 620px) {
  .golfer-table--header {
    display: none;
  }

  .golfer-option span {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (max-width: 540px) {
  .hero-panel h1 {
    font-size: 3.6rem;
  }

  .hero-copy,
  .section-copy {
    font-size: 1rem;
  }

  .content-panel h2,
  .view-intro h3 {
    font-size: 2.5rem;
  }
}
