/* Shared styles for the public website (nolanbowl.com). Plain CSS, no build step. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --brand: #1f7a64;
  --brand-hover: #155e4d;
  --brand-soft: #e6f4ef;
  --brand-icon: #2f9e83;
  --notice-bg: #fff7e6;
  --notice-border: #f3c26b;
  --notice-text: #5c3d05;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #181b21;
    --text: #f1f5f9;
    --muted: #a3acb9;
    --border: #2a2f38;
    --brand: #3bbf9f;
    --brand-hover: #5fd3b6;
    --brand-soft: #16302a;
    --brand-icon: #3bbf9f;
    --notice-bg: #2a2110;
    --notice-border: #7a5a1e;
    --notice-text: #f5d9a3;
  }
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.55;
}
a {
  color: var(--brand);
}
a:hover {
  color: var(--brand-hover);
}

.notice {
  background: var(--notice-bg);
  border-bottom: 1px solid var(--notice-border);
  color: var(--notice-text);
}
.notice-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.95rem;
}
.notice svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.notice p {
  margin: 0;
}
.notice strong {
  display: block;
}

.landing {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.hero {
  width: 100%;
  max-width: 560px;
  text-align: center;
}
.mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--brand-soft);
  color: var(--brand-icon);
}
h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 7vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.tagline {
  margin: 0 auto 2rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0.8rem 1.75rem;
  border-radius: 12px;
  background: var(--brand);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.primary:hover {
  background: var(--brand-hover);
  color: #ffffff;
}
@media (prefers-color-scheme: dark) {
  .primary,
  .primary:hover {
    color: #0b1f1a;
  }
}
.primary:focus-visible,
.footer a:focus-visible {
  outline: 3px solid var(--brand-icon);
  outline-offset: 3px;
}
.sub {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1rem;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer a {
  font-weight: 600;
}

@media (max-width: 480px) {
  .landing {
    align-items: flex-start;
    padding-top: 2.5rem;
  }
  .hero .primary {
    width: 100%;
  }
}

/* Home: the link under the main button */
.more {
  margin: 1.5rem 0 0;
  font-weight: 600;
}

/* ---- Results page ---- */
.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand svg {
  color: var(--brand-icon);
}
.topbar .primary {
  margin-left: auto;
  min-height: 40px;
  padding: 0.45rem 1rem;
  font-size: 0.95rem;
  border-radius: 10px;
}

.results {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.results h1 {
  font-size: clamp(1.6rem, 5vw, 2rem);
  margin-bottom: 0.25rem;
}
.results .intro {
  margin: 0 0 1.25rem;
  color: var(--muted);
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.controls label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.controls .grow {
  flex: 1 1 220px;
}
/* 16px keeps iPhones from zooming in when a field is tapped */
.controls select,
.controls input {
  min-height: 44px;
  padding: 0 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.controls select {
  min-width: 220px;
  /* Drawn by us so it matches the search box; browsers ignore height on native ones */
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23808a99' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
}
.count {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.results table {
  width: 100%;
  border-collapse: collapse;
}
.results th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.results td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.results tbody tr:last-child td {
  border-bottom: none;
}
.results .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.results .rank {
  width: 4rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.results .points {
  font-weight: 700;
}
.results td.division {
  color: var(--muted);
  font-size: 0.9rem;
}
.results tr.podium td {
  background: var(--brand-soft);
}
.results tr.podium .rank {
  color: var(--brand);
  font-weight: 700;
}
.state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
}

/* Phones: drop the division column; the name and points matter most */
@media (max-width: 600px) {
  .results .division,
  .results th.division {
    display: none;
  }
  .controls select {
    min-width: 0;
    width: 100%;
  }
  .controls > label {
    flex: 1 1 100%;
  }
}

/* ---- Home: the automatic move to the app (home.js) ---- */
.notice a {
  color: inherit;
}
.notice .bookmark {
  display: block;
  margin-top: 0.35rem;
  font-weight: 600;
}
.redirect {
  margin: 0 auto 1.25rem;
  max-width: 22rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.redirect-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
#redirect-count {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.redirect-bar {
  height: 4px;
  margin: 0.6rem 0 0.4rem;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.redirect-bar span {
  display: block;
  height: 100%;
  background: var(--brand);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1s linear;
}
@media (prefers-reduced-motion: reduce) {
  .redirect-bar span {
    transition: none;
  }
}
.link-button {
  min-height: 44px;
  padding: 0 0.5rem;
  border: none;
  background: none;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-button:hover {
  color: var(--brand-hover);
}
.link-button:focus-visible {
  outline: 3px solid var(--brand-icon);
  outline-offset: 2px;
  border-radius: 6px;
}
.redirect-text .link-button {
  min-height: 0;
  padding: 0.25rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
