:root {
  --bg: #090c14;
  --bg-soft: #111624;
  --panel: rgba(14, 19, 31, 0.82);
  --panel-strong: rgba(18, 24, 38, 0.95);
  --line: rgba(136, 155, 191, 0.2);
  --text: #eef2ff;
  --muted: #9ca8c7;
  --accent: #ff5e7e;
  --accent-alt: #5bc0ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Bahnschrift, "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(91, 192, 255, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 94, 126, 0.15), transparent 28%),
    linear-gradient(160deg, #06070d 0%, #0c101a 45%, #070910 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
}

.app-shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.hero-card,
.calculator-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 2rem;
  margin-bottom: 1.5rem;
  animation: rise-in 550ms ease-out;
}

.calculator-card {
  padding: 2rem;
  animation: rise-in 720ms ease-out;
}

.eyebrow,
.section-label,
.result-label {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--muted);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.hero-copy {
  color: var(--muted);
  max-width: 62ch;
}

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

.ghost-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.ghost-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(91, 192, 255, 0.5);
  background: rgba(91, 192, 255, 0.08);
}

.meta-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(120px, 0.45fr) minmax(0, 0.9fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.meta-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.meta-card span {
  font-weight: 700;
}

.meta-copy p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.player-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-strong);
}

.player-card span {
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font: inherit;
  color: #ffffff;
  background: #05070d;
  outline: none;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

input:focus,
select:focus {
  border-color: var(--accent-alt);
  box-shadow: 0 0 0 3px rgba(91, 192, 255, 0.18);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #ffffff 50%),
    linear-gradient(135deg, #ffffff 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.8rem;
}

select option {
  color: #ffffff;
  background: #05070d;
}

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

.result-box {
  padding: 1.25rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.result-box strong {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.result-box.accent {
  background: linear-gradient(135deg, rgba(255, 94, 126, 0.18), rgba(91, 192, 255, 0.14));
}

.submission-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
}

.submission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 1rem 1.35rem;
  font: inherit;
  font-weight: 700;
  color: #09111d;
  background: linear-gradient(135deg, #f1f5ff, #72d0ff);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  box-shadow: 0 18px 36px rgba(91, 192, 255, 0.18);
}

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

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  color: rgba(238, 242, 255, 0.48);
  background: rgba(255, 255, 255, 0.015);
  transform: none;
}

.status-message {
  margin-bottom: 0;
  color: var(--muted);
  text-align: right;
}

.status-message.is-error {
  color: #ff93a8;
}

.status-message.is-success {
  color: #8de8bc;
}

.organizer-results {
  margin-top: 1.5rem;
}

.organizer-payload {
  margin-top: 1rem;
}

.organizer-payload pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
  font: 0.95rem/1.5 Consolas, "Courier New", monospace;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 1.5rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(156, 168, 199, 0.36);
}

.site-footer a:hover {
  color: var(--text);
  border-color: var(--accent-alt);
}

.legal-shell h1 {
  max-width: 12ch;
}

.legal-section {
  margin-bottom: 1.25rem;
}

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

.legal-copy {
  display: grid;
  gap: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.legal-copy p,
.legal-stack p {
  margin-bottom: 0;
}

.legal-copy strong {
  color: var(--text);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .meta-grid,
  .rank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 1rem, 100%);
    padding: 1rem 0 2rem;
  }

  .hero-card,
  .calculator-card {
    padding: 1.25rem;
    border-radius: 22px;
  }

  .meta-grid,
  .card-header,
  .results-panel,
  .rank-grid,
  .legal-stack {
    grid-template-columns: 1fr;
  }

  .card-header {
    display: grid;
  }

  .submission-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .submission-actions {
    flex-direction: column;
  }

  .status-message {
    text-align: left;
  }
}
