:root {
  --bg: #f4efe7;
  --bg-accent: #e5dccf;
  --panel: rgba(255, 252, 247, 0.86);
  --panel-strong: #fffaf2;
  --text: #18332d;
  --muted: #5f6f69;
  --line: rgba(24, 51, 45, 0.12);
  --primary: #17302b;
  --primary-soft: #254b43;
  --highlight: #d88b49;
  --highlight-soft: rgba(216, 139, 73, 0.16);
  --success: #2d7d5d;
  --danger: #b65744;
  --shadow: 0 18px 45px rgba(32, 46, 42, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-width: 460px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Outfit", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(216, 139, 73, 0.2), transparent 32%),
    radial-gradient(circle at top right, rgba(23, 48, 43, 0.12), transparent 28%),
    linear-gradient(180deg, #f6f0e7 0%, #ece3d5 100%);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 70%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 70%);
}

.shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.shell-auth {
  padding-top: 38px;
}

.shell-app {
  padding-top: 24px;
}

.shell-admin {
  --max-width: 1120px;
  padding-top: 24px;
}

.admin-guard-body .shell-admin {
  width: min(100%, 460px);
}

.hero-card,
.panel {
  position: relative;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(23, 48, 43, 0.96) 0%, rgba(23, 48, 43, 0.9) 52%, rgba(23, 48, 43, 0.26) 72%, rgba(23, 48, 43, 0.08) 100%),
    url("/assets/ui-background.png"),
    var(--primary);
  background-position: left top, center right, center;
  background-repeat: no-repeat;
  background-size: cover, cover, cover;
  color: #f9f3eb;
  overflow: hidden;
}

.hero-card.compact {
  padding-bottom: 20px;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(56%, 220px);
}

.hero-content-wide {
  width: min(72%, 540px);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.72;
}

.hero-card h1 {
  margin: 0;
  font-size: 2.1rem;
  font-size: clamp(1.9rem, 5vw, 2.45rem);
  line-height: 1.02;
}

.hero-copy {
  margin: 12px 0 0;
  line-height: 1.45;
  color: rgba(249, 243, 235, 0.82);
}

.welcome-name {
  margin: 6px 0 0;
  font-size: 2rem;
  line-height: 0.98;
  font-weight: 700;
  color: #fffaf2;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.welcome-name.is-medium {
  font-size: 1.7rem;
}

.welcome-name.is-long {
  font-size: 1.45rem;
}

.panel {
  margin-top: 16px;
  padding: 18px;
  background: var(--panel);
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.panel-header p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 15px 16px;
  font: inherit;
  outline: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(216, 139, 73, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px var(--highlight-soft);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-button,
.ghost-button,
.danger-button {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--highlight), #e9a66a);
  color: #fffaf3;
  box-shadow: 0 14px 24px rgba(216, 139, 73, 0.28);
}

.ghost-button {
  background: rgba(23, 48, 43, 0.08);
  color: var(--primary);
}

.danger-button {
  background: linear-gradient(135deg, var(--danger), #d47763);
  color: #fff7f3;
  box-shadow: 0 14px 24px rgba(182, 87, 68, 0.24);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.feedback {
  min-height: 24px;
  margin: 14px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.feedback.error {
  color: var(--danger);
}

.feedback.success {
  color: var(--success);
}

.auto-login {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
  padding: 24px 6px 8px;
}

.auto-login.visible {
  padding: 16px 0;
}

.pulse-ring {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(216, 139, 73, 0.75) 0%, rgba(216, 139, 73, 0.2) 38%, transparent 39%),
    radial-gradient(circle, rgba(23, 48, 43, 0.92) 0 32%, transparent 33%);
  animation: pulse 1.9s ease-in-out infinite;
}

.auto-title,
.confirm-label {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auto-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.confirm-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid rgba(216, 139, 73, 0.2);
}

.confirm-summary {
  margin: 8px 0 16px;
  font-size: 1rem;
  line-height: 1.5;
}

.stats-panel {
  margin-bottom: 12px;
}

.stats-toolbar {
  position: -webkit-sticky;
  position: sticky;
  top: 12px;
  z-index: 5;
  margin-top: 4px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(244, 239, 231, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(24, 51, 45, 0.08);
  box-shadow: 0 10px 24px rgba(32, 46, 42, 0.08);
}

.stats-section + .stats-section {
  margin-top: 22px;
}

.stats-bubble {
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.56);
  background: rgba(255, 252, 247, 0.78);
  box-shadow: 0 16px 34px rgba(32, 46, 42, 0.08);
  content-visibility: auto;
  contain: layout paint style;
  contain-intrinsic-size: 1px 720px;
}

.section-heading {
  margin-top: 18px;
}

.stats-section .section-heading:first-child {
  margin-top: 0;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 1.08rem;
}

.stats-section .section-heading:first-child h2 {
  font-size: 1.4rem;
  line-height: 1.05;
}

.banner-message {
  margin-top: 6px;
  margin-bottom: 10px;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 700;
}

.banner-fade-out {
  animation: fade-out 0.45s ease forwards;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.stat-card,
.split-row {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.stat-card {
  padding: 14px;
}

.stat-card .value {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
}

.stat-card .label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-summary-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 6px;
}

.club-totals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.split-list,
.bar-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.split-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
}

.split-row .name {
  font-weight: 600;
}

.split-row .value {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.bar-row {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

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

.bar-meta .name {
  font-weight: 600;
}

.bar-meta .value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bar-track {
  overflow: hidden;
  height: 16px;
  border-radius: 999px;
  background: rgba(23, 48, 43, 0.08);
}

.bar-fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 36px;
  height: 100%;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--highlight), #e9a66a);
  color: #fffaf3;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(220px, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.admin-toolbar {
  grid-template-columns: 1fr 1fr;
}

.admin-guard-panel {
  margin-top: 72px;
}

.admin-note-card {
  align-content: start;
}

.admin-note {
  margin: 12px 0 0;
  line-height: 1.55;
  color: var(--muted);
}

.report-output {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}

.admin-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(23, 48, 43, 0.04);
}

.admin-table td {
  font-variant-numeric: tabular-nums;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-actions-cell {
  width: 1%;
  white-space: nowrap;
}

.small-button {
  padding: 10px 14px;
  font-size: 0.92rem;
}

.admin-table-empty {
  margin-top: 12px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.pseudo-history {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2px;
}

.pseudo-history-label {
  width: 100%;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.pseudo-chip {
  -webkit-appearance: none;
  appearance: none;
  margin: 0 8px 6px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.pseudo-chip:hover {
  border-color: rgba(216, 139, 73, 0.7);
}

.app-footer {
  margin-top: 18px;
  text-align: center;
}

.logout-link {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 8px 12px;
  opacity: 0.8;
  transition: opacity 0.18s ease;
}

.logout-link:hover {
  opacity: 1;
}

.modal-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 51, 45, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.modal-card {
  width: 100%;
  max-width: 380px;
  padding: 22px;
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  border: 1px solid rgba(216, 139, 73, 0.2);
  box-shadow: var(--shadow);
}

.modal-title {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.modal-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@media (hover: none), (pointer: coarse) {
  body::before {
    display: none;
  }

  .hero-card,
  .panel {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 10px 22px rgba(32, 46, 42, 0.08);
  }

  .hero-card {
    background:
      linear-gradient(90deg, rgba(23, 48, 43, 0.98) 0%, rgba(23, 48, 43, 0.94) 56%, rgba(23, 48, 43, 0.28) 76%, rgba(23, 48, 43, 0.08) 100%),
      url("/assets/ui-background.png"),
      var(--primary);
    background-position: left top, 76% center, center;
    background-size: cover, cover, cover;
  }

  .stats-toolbar {
    top: 8px;
    background: rgba(244, 239, 231, 0.98);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 6px 16px rgba(32, 46, 42, 0.08);
  }

  .stats-bubble {
    box-shadow: 0 10px 22px rgba(32, 46, 42, 0.06);
  }

  .pulse-ring {
    animation-duration: 2.6s;
  }
}

@media (max-width: 380px) {
  .shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero-content {
    width: min(60%, 190px);
  }

  .button-row,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .hero-content-wide {
    width: min(78%, 420px);
  }
}
