/* Leave the root font size to the browser so text follows the reader's own setting. */
:root {
  color-scheme: dark;
}

/* One focus ring for everything. .btn is listed because Bootstrap's own .btn:focus-visible
   rule is more specific and swaps the outline for a faint box-shadow. */
:focus-visible,
.btn:focus-visible {
  outline: 3px solid #fef08a;
  outline-offset: 2px;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
}

body {
  min-height: 100vh;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px;
}

.page-content {
  width: min(900px, 100%);
}

.ball-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1000;
  transform: translateY(-200%);
  border-radius: 8px;
  background: #fef08a;
  color: #0f172a;
  font-weight: 700;
  padding: 10px 14px;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 24px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand:hover {
  color: #fdba74;
}

.brand-ball {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fed7aa 0, #f97316 45%, #c2410c 100%);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.6), 0 0 12px rgba(249, 115, 22, 0.45);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.site-nav a {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  padding: 7px 14px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
}

.site-nav a:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #f8fafc;
}

.site-nav a[aria-current="page"] {
  border-color: #fdba74;
  background: rgba(249, 115, 22, 0.2);
  color: #fff7ed;
  font-weight: 700;
}

.site-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.signed-in-as strong {
  color: #f8fafc;
}

.header-button {
  display: inline-block;
  border: 1px solid rgba(203, 213, 225, 0.55);
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.2;
  padding: 7px 12px;
  text-decoration: none;
  cursor: pointer;
}

.header-button:hover {
  background: rgba(226, 232, 240, 0.12);
  color: #f8fafc;
}

.header-button.primary {
  border-color: #f97316;
  background: #f97316;
  color: #1c1917;
  font-weight: 700;
}

.header-button.primary:hover {
  background: #fb923c;
  color: #1c1917;
}

/* The skip link focuses <main> so keyboard users start there; no ring on the whole page. */
.site-main:focus {
  outline: none;
}

/* 44px minimum targets for fingers; mouse users keep the compact sizes. */
@media (pointer: coarse) {
  .site-nav a,
  .header-button,
  .filter-chip,
  .btn,
  .site-footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }
}

.hero-panel {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 18px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.hero-panel h1 {
  margin-bottom: 24px;
  font-size: clamp(2.3rem, 6vw, 5rem);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ball-button, .button-link {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: #111827;
  border: none;
  border-radius: 999px;
  padding: 22px 52px;
  font-size: clamp(1.4rem, 3vw, 2.3rem);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(249, 115, 22, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ball-button:hover, .button-link:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 18px 40px rgba(249, 115, 22, 0.4);
  text-decoration: none;
  color: #111827;
}

.status-box {
  margin-top: 20px;
  font-size: 1.1rem;
}

.status-label {
  color: #cbd5e1;
}

.possession-timer {
  margin-top: 10px;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.possession-timer strong {
  color: #fbbf24;
}

.user-list-panel {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 18px;
  padding: 20px 18px 12px;
}

.user-list-panel h2 {
  margin-bottom: 14px;
  font-size: 1.4rem;
}

.panel-heading, .page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.4rem;
}

.demo-banner, .status-message {
  border-radius: 12px;
  padding: 12px 16px;
}

.demo-banner {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(147, 197, 253, 0.35);
  color: #dbeafe;
}

.status-message {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(110, 231, 183, 0.35);
  color: #d1fae5;
}

.status-message.error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(252, 165, 165, 0.45);
  color: #fee2e2;
}

.handoff-panel {
  margin: 28px auto 0;
  max-width: 760px;
  text-align: left;
}

.handoff-panel > h2 {
  font-size: 1.45rem;
  text-align: center;
}

.handoff-panel > p, .handoff-note {
  color: #cbd5e1;
}

.pass-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.pass-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 16px;
}

/* A floated legend is laid out inside the box instead of cutting into its border. */
.pass-step legend {
  float: left;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 4px;
  padding: 0;
  font-size: 1.1rem;
  color: #f8fafc;
}

.step-number {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f97316;
  color: #1c1917;
  font-size: 0.9rem;
  font-weight: 800;
}

.pass-step .optional {
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 400;
}

.pass-step label {
  font-size: 0.9rem;
  color: #cbd5e1;
}

.pass-step .field-hint {
  margin: 0;
}

.pass-form select,
.pass-form textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 9px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 8px;
}

.pass-form select option {
  padding: 6px;
}

.pass-form textarea {
  resize: vertical;
}

.custom-message {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-message[hidden] {
  display: none;
}

.pass-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pass-confirm {
  max-width: min(440px, calc(100vw - 32px));
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.pass-confirm::backdrop {
  background: rgba(2, 6, 23, 0.7);
}

.pass-confirm h3 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.pass-confirm p {
  margin: 0 0 12px;
  color: #cbd5e1;
  overflow-wrap: anywhere;
}

.pass-confirm .pass-confirm-warning {
  color: #fde68a;
  font-weight: 700;
}

.pass-confirm .pass-actions {
  margin-top: 8px;
}

.char-count {
  align-self: flex-end;
  margin-top: -6px;
  color: #94a3b8;
  font-size: 0.8rem;
}

.player-card {
  max-width: 560px;
  margin: 24px auto 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-left-width: 5px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.85);
  padding: 16px 20px;
  text-align: left;
}

.player-card p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.5;
}

.player-card .player-card-title {
  margin-bottom: 6px;
  color: #f8fafc;
  font-size: 1.2rem;
  font-weight: 800;
}

.player-card.holding {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.14);
}

.player-card.waiting {
  border-color: #60a5fa;
}

.player-card.held {
  border-color: #a78bfa;
}

.visitor-cta {
  margin-top: 24px;
}

.visitor-cta .handoff-note {
  margin-top: 16px;
}

.how-it-works {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  padding: 24px;
}

.how-it-works h2 {
  margin: 0 0 16px;
  font-size: 1.3rem;
  text-align: center;
}

.how-it-works ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.how-it-works li {
  counter-increment: step;
}

.how-it-works h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.how-it-works h3::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f97316;
  color: #1c1917;
  font-weight: 800;
  font-size: 0.95rem;
}

.how-it-works p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .how-it-works ol {
    grid-template-columns: 1fr;
  }
}

.claim-form {
  margin-top: 24px;
}

.handoff-note {
  margin: 24px 0 0;
}

.status-box {
  margin-top: 0;
}

.count-badge {
  display: inline-flex;
  min-width: 28px;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  font-size: 0.8rem;
  vertical-align: middle;
}

.user-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-flag-atlas-preview {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.8);
}

.user-flag-atlas-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.user-flag-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  opacity: 0.16;
  pointer-events: none;
}

.users-report-page {
  position: relative;
  isolation: isolate;
}

.users-report-page.has-flag-background .user-flag-backdrop {
  display: block;
}

.users-report-page.has-flag-background .user-flag-atlas-preview {
  display: none;
}

.user-country-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 16px 0;
}

.user-country-filter label {
  font-weight: 700;
}

.user-country-filter select {
  min-width: 220px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 10px;
}

.user-country-status {
  color: #cbd5e1;
  font-size: 0.9rem;
}

.user-row[hidden],
[data-country-empty-state][hidden] {
  display: none;
}

.filter-chip {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  padding: 6px 11px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.85rem;
}

.filter-chip:hover, .filter-chip.selected {
  color: #f8fafc;
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(147, 197, 253, 0.55);
  text-decoration: none;
}

.history-panel {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 18px;
  padding: 20px 18px 12px;
}

.history-panel h2 {
  margin-bottom: 14px;
  font-size: 1.4rem;
}

.ball-home-scene {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 18px;
  background: linear-gradient(#172554 0 58%, #713f12 58% 100%);
  box-shadow: inset 0 -18px rgba(120, 53, 15, 0.35);
}

.tv {
  position: absolute;
  top: 62px;
  left: 50%;
  width: min(330px, 70%);
  transform: translateX(-50%);
  z-index: 3;
}

.tv-screen-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.tv-screen {
  position: relative;
  min-height: 170px;
  overflow: hidden;
  border: 12px solid #0f172a;
  border-radius: 10px;
  background: url("/Features/BallCup/background.svg") center / cover no-repeat;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.55);
  transition: transform .15s ease, box-shadow .15s ease;
}

.tv-screen-downhill {
  background-image: url("/Features/Downhill/FirstHill.svg");
}

.tv-screen-climber {
  background-image: url("/Features/Climber/background.svg");
}

.tv-screen-link:hover .tv-screen,
.tv-screen-link:focus-visible .tv-screen {
  transform: scale(1.015);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.7), 0 0 0 3px #fef08a;
}

.tv-screen-link:focus-visible {
  outline: none;
}

.tv-caption {
  position: absolute;
  right: 8px;
  bottom: 7px;
  padding: 4px 7px;
  border-radius: 4px;
  background: rgba(15, 23, 42, .82);
  color: #fef08a;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.tv-channel-knob {
  position: absolute;
  right: -24px;
  bottom: 22px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 4px solid #1e293b;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 2px 3px 4px rgba(15, 23, 42, .45);
  cursor: pointer;
  transition: transform .2s ease;
}

.tv-channel-knob span {
  display: block;
  width: 3px;
  height: 10px;
  border-radius: 3px;
  background: #e2e8f0;
  transform: translateY(-4px);
}

.tv-stand {
  width: 70%;
  height: 12px;
  margin: 0 auto;
  background: #0f172a;
  border-radius: 0 0 8px 8px;
}

.coffee-table {
  position: absolute;
  right: 8%;
  bottom: 38px;
  z-index: 2;
  width: 150px;
  height: 106px;
}

.coffee-table-top {
  position: relative;
  height: 28px;
  border: 3px solid #431407;
  border-radius: 50%;
  background: #a16207;
  box-shadow: 0 8px 10px rgba(15, 23, 42, .32);
}

.coffee-mug {
  position: absolute;
  right: 8%;
  bottom: 8px;
  width: 94px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 5px 3px rgba(15, 23, 42, .35));
}

.coffee-table-leg {
  position: absolute;
  top: 19px;
  width: 12px;
  height: 82px;
  border-radius: 0 0 8px 8px;
  background: #713f12;
}

.coffee-table-leg-left { left: 24px; transform: rotate(7deg); }
.coffee-table-leg-right { right: 24px; transform: rotate(-7deg); }

.couch {
  position: absolute;
  bottom: 36px;
  left: 50%;
  width: min(520px, 84%);
  height: 120px;
  transform: translateX(-50%);
  border-radius: 30px 30px 16px 16px;
  background: #9a3412;
  box-shadow: 0 15px 20px rgba(15, 23, 42, 0.35);
}

.couch-back, .couch-seat {
  position: absolute;
  left: 8%;
  width: 84%;
  border-radius: 18px;
  background: #c2410c;
}

.couch-back {
  top: 12px;
  height: 58px;
}

.couch-seat {
  bottom: 10px;
  height: 36px;
  background: #ea580c;
}

.couch-arm {
  position: absolute;
  top: 28px;
  width: 12%;
  height: 78px;
  border-radius: 18px;
  background: #c2410c;
}

.couch-arm.left { left: 2%; }
.couch-arm.right { right: 2%; }

.home-ball {
  position: absolute;
  bottom: 92px;
  left: 50%;
  display: flex;
  width: 76px;
  height: 76px;
  justify-content: center;
  align-items: center;
  transform: translateX(-50%);
  border: 3px solid #fef08a;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fef08a, #eab308 45%, #a16207);
  color: #713f12;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.4);
}

.scene-message {
  position: absolute;
  right: 16px;
  bottom: 8px;
  left: 16px;
  margin: 0;
  text-align: center;
  color: #fef3c7;
}

.user-list-box, .history-list, .report-table-scroll {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-color: #475569 #0f172a;
}

.user-list-box, .history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  color: #e2e8f0;
}

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
}

.user-row.has-ball {
  border-color: rgba(250, 204, 21, 0.9);
  background: rgba(120, 119, 198, 0.18);
}

/* Muted color only: opacity on top of it dropped these rows to about 3:1 contrast. */
.user-row.already-held, .report-table tr.already-held {
  color: #94a3b8;
}

.user-row.is-me {
  border-color: rgba(253, 186, 116, 0.7);
}

.you-marker {
  margin-left: 4px;
  color: #fdba74;
  font-size: 0.85rem;
  font-weight: 700;
}

.user-name {
  font-weight: 600;
}

.user-country {
  color: #94a3b8;
  font-weight: 400;
}

.user-state {
  white-space: nowrap;
  font-size: 0.84rem;
}

.current-owner {
  color: #fde047;
}

.held-state {
  color: #94a3b8;
}

.eligible-state {
  color: #86efac;
}

.list-legend, .muted-text {
  color: #94a3b8;
  font-size: 0.85rem;
}

.list-legend {
  margin: 12px 0 0;
}

.empty-state {
  color: #cbd5e1;
  padding: 12px 0;
}

.history-row time {
  color: #94a3b8;
  white-space: nowrap;
}

.page-title-row {
  padding: 12px 0;
}

.page-title-row h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
}

.eyebrow {
  margin: 0 0 4px;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.report-table th, .report-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  text-align: left;
}

.report-table thead {
  position: sticky;
  top: 0;
  background: #172235;
}

.report-table tbody tr:last-child th, .report-table tbody tr:last-child td {
  border-bottom: 0;
}

.mini-game-report-filters {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mini-game-report-filters label {
  display: block;
  margin-bottom: 6px;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
}

.mini-game-report-filters select {
  min-width: 180px;
  padding: 9px 11px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: #172235;
  color: #f8fafc;
}

.mini-game-score-table th:last-child,
.mini-game-score-table td:last-child {
  white-space: nowrap;
}

form {
  margin: 0;
}

.logout-form {
  display: inline-block;
}

.auth-form {
  max-width: 420px;
  margin: 24px auto 0;
  background: rgba(15, 23, 42, 0.75);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.auth-form h1 {
  margin-bottom: 18px;
  font-size: 1.8rem;
  text-align: center;
}

.error-page {
  text-align: center;
}

.error-page p {
  color: #cbd5e1;
}

.error-page .muted-text {
  margin: 16px 0 0;
}

.field-hint, .field-error {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
}

.field-hint {
  color: #94a3b8;
}

.field-error {
  color: #fca5a5;
}

.field-error:empty {
  display: none;
}

.form-group .input-validation-error {
  border-color: #f87171;
}

.transfer-method {
  margin-left: 8px;
  border-radius: 999px;
  padding: 1px 8px;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  font-size: 0.75rem;
}

.privacy-page {
  padding-bottom: 20px;
}

.privacy-page h2 {
  margin: 18px 0 8px;
  font-size: 1.15rem;
}

.privacy-page h2:first-child {
  margin-top: 0;
}

.privacy-page p, .privacy-page li {
  color: #cbd5e1;
  line-height: 1.6;
}

.site-footer {
  padding: 24px 0 4px;
  text-align: center;
  font-size: 0.85rem;
}

.site-footer a {
  color: #94a3b8;
}

.wall-content .site-footer {
  padding: 8px 0;
}

.wall-content .site-footer a {
  color: #ffedd5;
}

form[aria-busy="true"] button {
  cursor: wait;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #e2e8f0;
}

.form-group input,
.form-group select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  padding: 10px 12px;
}

.form-group select option {
  background: #0f172a;
  color: #f8fafc;
}

.validation-summary {
  color: #fca5a5;
  margin-bottom: 12px;
}

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

.text-link {
  color: #93c5fd;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .page-shell {
    padding: 14px;
  }

  .site-header {
    justify-content: center;
  }

  /* One scroll area per page on phones: nested scroll boxes trap thumbs and hide rows. */
  .user-list-box, .history-list, .report-table-scroll {
    max-height: none;
  }

  .panel-heading, .page-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .pass-form {
    grid-template-columns: 1fr;
  }

  .history-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* Illustrated Ball Home scene */
.ball-home-scene {
  --wall-end: calc(50% - min(260px, 42%));
  min-height: 500px;
  background: linear-gradient(#20315e 0 64%, #81502f 64% 100%);
  box-shadow: inset 0 -22px rgba(73, 36, 20, .28);
}

.ball-home-scene::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(255,255,255,.15), transparent 34%), repeating-linear-gradient(90deg, transparent 0 70px, rgba(255,255,255,.025) 71px 72px);
  content: "";
}

.home-bulby-area {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 36%;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
}

.home-bulby {
  display: block;
  flex: none;
  width: 130px;
  height: auto;
  margin-left: 7%;
}

.wall-art {
  position: absolute;
  top: 50px;
  display: grid;
  width: 86px;
  height: 98px;
  place-items: center;
  border: 6px solid #92400e;
  background: #fef3c7;
  box-shadow: 0 7px 12px rgba(15,23,42,.2);
  color: #78350f;
  transform: rotate(-3deg);
}
.wall-art small { font-size: .5rem; font-weight: 800; text-transform: uppercase; }
.art-football { right: 17%; top: 38px; transform: rotate(4deg); }
.art-baseball { right: 7%; top: 62px; transform: rotate(-5deg); }
.mini-ball { display: block; width: 39px; height: 39px; border-radius: 50%; }
.football-ball { width: 48px; height: 29px; border-radius: 50%; background: #92400e; transform: rotate(-18deg); }
.football-ball::after { display: block; height: 3px; margin: 13px 10px; background: #fef3c7; content: ""; }
.baseball-ball { background: #fefefe; border: 2px solid #dc2626; }

.tv { top: 62px; left: 50%; width: min(330px, 70%); z-index: 3; }

.couch { bottom: 58px; }
.home-ball { width: 118px; height: 118px; border: 0; background: transparent; box-shadow: none; cursor: pointer; filter: drop-shadow(0 8px 8px rgba(15,23,42,.4)); animation: ball-breathe 3s ease-in-out infinite; }
.home-ball svg { width: 100%; height: 100%; }
.portrait-hint { position: absolute; right: -34px; bottom: 12px; padding: 4px 8px; border-radius: 999px; background: #fef3c7; color: #78350f; font-size: .65rem; font-weight: 800; opacity: 0; transition: opacity .2s; }
.home-ball:hover .portrait-hint, .home-ball:focus-visible .portrait-hint { opacity: 1; }
.home-ball:focus-visible { outline: 3px solid #fef08a; outline-offset: 5px; }
@keyframes ball-breathe { 50% { transform: translateX(-50%) translateY(-5px); } }

.side-table { position: absolute; left: 7%; bottom: 48px; z-index: 2; width: 130px; height: 96px; }
.table-top { position: absolute; top: 0; width: 100%; height: 22px; border-radius: 50%; background: #92400e; box-shadow: 0 5px 5px rgba(15,23,42,.25); }
.table-leg { position: absolute; top: 17px; width: 12px; height: 79px; background: #78350f; }
.table-leg-left { left: 18px; transform: rotate(7deg); }
.table-leg-right { right: 18px; transform: rotate(-7deg); }
.table-globe { position: absolute; top: -62px; left: 34px; width: 62px; height: 62px; }
.globe-link { display: block; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; transition: transform .2s, filter .2s; }
.globe-link img { display: block; width: 100%; height: auto; }
.globe-link:hover, .globe-link:focus-visible { transform: scale(1.1); filter: drop-shadow(0 0 10px #67e8f9); }
.globe-link:focus-visible { outline: 3px solid #fef08a; outline-offset: 4px; }

.holder-modal[hidden] { display: none; }
.holder-modal { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; }
.holder-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .78); backdrop-filter: blur(5px); }
.holder-card { position: relative; z-index: 1; display: grid; width: min(480px, 100%); overflow: hidden; border: 1px solid rgba(125, 211, 252, .45); border-radius: 24px; background: #172554; box-shadow: 0 25px 70px rgba(0,0,0,.45); color: #e0e7ff; }
.holder-flag { display: grid; min-height: 150px; max-height: 190px; place-items: center; overflow: hidden; background: #0f172a; }
.holder-flag svg, .holder-flag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.holder-flag img { width: 150px; height: 150px; object-fit: contain; }
.holder-details { padding: 24px 28px 28px; }
.holder-details h2 { margin-bottom: 18px; color: #fef08a; }
.holder-heading-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 10px; align-items: center; text-align: center; }
.holder-heading-row h2 { margin-bottom: 18px; }
.holder-position { min-height: 1.2em; margin: 0 0 4px; color: #bfdbfe; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.holder-arrow { width: 42px; height: 42px; padding: 0; border: 1px solid rgba(125, 211, 252, .5); border-radius: 50%; background: rgba(15, 23, 42, .65); color: #fef08a; font-size: 1.35rem; cursor: pointer; }
.holder-arrow:hover:not(:disabled), .holder-arrow:focus-visible:not(:disabled) { border-color: #fef08a; background: #1e3a8a; }
.holder-arrow:disabled { cursor: default; opacity: .3; }
.holder-stat-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.holder-stat-list div { padding: 12px; border: 1px solid rgba(148, 163, 184, .28); border-radius: 12px; background: rgba(15, 23, 42, .48); }
.holder-stat-list dt { margin-bottom: 4px; color: #93c5fd; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.holder-stat-list dd { margin: 0; color: #f8fafc; font-weight: 700; overflow-wrap: anywhere; }

.mission-modal[hidden] { display: none; }
.mission-modal { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; }
.mission-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .72); backdrop-filter: blur(4px); }
.mission-card { position: relative; z-index: 1; width: min(480px, 100%); padding: 30px; border: 1px solid rgba(253, 230, 138, .4); border-radius: 24px; background: #172554; box-shadow: 0 25px 70px rgba(0,0,0,.4); color: #e0e7ff; text-align: center; }
.mission-card h2 { color: #fef08a; }
.mission-card p { line-height: 1.7; }
.mission-icon { width: 92px; margin: 0 auto 8px; }
.mission-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: #cbd5e1; font-size: 2rem; cursor: pointer; }
.mission-signoff { color: #fcd34d; font-style: italic; }
.globe-report-link { color: #bae6fd; font-size: .85rem; text-decoration: none; }
.globe-report-link:hover { color: #fff; text-decoration: underline; }
body.modal-open { overflow: hidden; }

@media (min-width: 701px) and (max-width: 1000px) {
  .ball-home-scene { --wall-end: calc(7% + 140px); }
  .couch { left: calc(7% + 140px); width: calc(86% - 140px); max-width: 520px; transform: none; }
  .home-ball { left: calc(7% + 140px + min(260px, 43% - 70px)); }
}

@media (max-width: 700px) {
  .ball-home-scene { --wall-end: calc(3% + 105px); min-height: 690px; }
  .home-bulby { width: min(92px, 19%); margin-left: 3%; }
  .wall-art { transform: scale(.78); }
  .art-football { right: 9%; }
  .art-baseball { right: 0; top: 105px; }
  .tv {
    top: 52px;
    left: 55%;
    width: 56%;
  }

  .coffee-table {
  right: 3%;
  bottom: 30px;
  transform: scale(.8);
  transform-origin: bottom right; }
  .side-table { left: 3%; bottom: 40px; transform: scale(.78); transform-origin: bottom left; }
  .couch { bottom: 70px; left: calc(3% + 105px); width: calc(94% - 105px); transform: none; }
  .home-ball { left: calc(50% + 52.5px); }
  .scene-message { bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-ball { animation: none; }
}

.corkboard-home-link {
  position: relative;
  display: block;
  flex: 0 1 auto;
  width: min(var(--wall-end), 150px);
  aspect-ratio: 4 / 3;
  min-height: 44px;
  margin: 8px 0 0 3%;
  background: url("/images/corkboard.svg") center / 100% 100% no-repeat;
  filter: drop-shadow(0 5px 5px rgba(15, 23, 42, .4));
  pointer-events: auto;
  transition: filter .15s ease;
}

@media (max-width: 700px) {
  .home-bulby-area { z-index: 4; }
  .corkboard-home-link {
    width: min(96px, 22%);
    margin-top: 6px;
    margin-left: 2%;
  }
}

.corkboard-home-link:hover,
.corkboard-home-link:focus-visible {
  filter: drop-shadow(0 0 7px #facc15);
}

.corkboard-preview-notes {
  position: absolute;
  inset: 14% 12%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12% 9%;
}

.corkboard-preview-notes span {
  background: #ffeb75;
  box-shadow: 1px 2px 2px rgba(63, 37, 17, .4);
  transform: rotate(-4deg);
}

.corkboard-preview-notes span:nth-child(even) { transform: rotate(4deg); }

.corkboard-home-label {
  position: absolute;
  right: 12%;
  bottom: 9%;
  padding: 1px 4px;
  background: #fff2a1;
  color: #563315;
  font-size: .65rem;
  font-weight: 800;
}

.reports-shell {
  padding: 0;
  background: #20315e;
}

.reports-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.reports-content > .site-header {
  margin: 0;
  padding: 10px clamp(14px, 4vw, 56px);
  background: rgba(15, 23, 42, .86);
}

.reports-content > .site-main {
  display: flex;
  flex: 1;
  padding: clamp(10px, 2vw, 24px);
}

.reports-content > .site-footer { padding: 0 0 8px; }

.reports-board {
  flex: 1;
  padding: clamp(30px, 5vw, 70px);
  background: url("/images/corkboard.svg") center / 100% 100% no-repeat;
  color: #3f250f;
}

.reports-heading h1 {
  margin: 0;
  color: #3f250f;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.reports-heading .eyebrow { color: #513013; }
.reports-heading p:last-child { margin: 4px 0 0; }

.reports-notes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-items: center;
  gap: clamp(24px, 4vw, 60px);
  margin: clamp(28px, 4vw, 54px) auto;
  max-width: 1000px;
}

.report-note {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 210px);
  aspect-ratio: 1;
  min-height: 160px;
  padding: 28px 18px 16px;
  background: #ffeb75;
  box-shadow: 3px 6px 8px rgba(63, 37, 17, .35);
  color: #49320b;
  transform: rotate(-4deg);
}

.report-note:nth-child(even) { background: #fff18a; transform: rotate(3deg); }
.report-note:nth-child(3) { transform: rotate(-2deg); }
.report-note:nth-child(5) { transform: rotate(-3deg); }

.report-note-pin {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 8%, #e5534b 20%, #a61616 100%);
  box-shadow: 1px 2px 2px rgba(63, 37, 17, .5);
  transform: translateX(-50%);
}

.report-note:nth-child(2) .report-note-pin { filter: hue-rotate(210deg); }
.report-note:nth-child(3) .report-note-pin { filter: hue-rotate(110deg); }
.report-note:nth-child(4) .report-note-pin { filter: hue-rotate(30deg); }

.report-note-link {
  justify-content: center;
  text-decoration: none;
  transition: box-shadow .15s ease;
}

.report-note-link:hover,
.report-note-link:focus-visible {
  color: #49320b;
  box-shadow: 3px 8px 16px rgba(63, 37, 17, .55), 0 0 0 3px #fff3a3;
}

.report-note-label {
  margin-bottom: 8px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.report-note-link strong { font-size: clamp(1rem, 2vw, 1.4rem); line-height: 1.2; }
.report-note-arrow { align-self: flex-end; font-size: 1.5rem; }

@media (max-width: 640px) {
  .reports-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reports-board { padding: 30px 28px; }
  .report-note { padding: 27px 12px 12px; }
}

@media (max-width: 360px) {
  .reports-notes { grid-template-columns: 1fr; }
}

.wall-shell {
  display: block;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background-color: #873a32;
  background-image:
    linear-gradient(rgba(32, 12, 15, .34), rgba(32, 12, 15, .34)),
    url("/images/brick-wall.svg");
  background-size: auto, 300px 96px;
}

.wall-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
}

/* On the full-height Wall the header takes its own row and the page fills what is left. */
.wall-content > .site-header {
  margin: 0;
  padding: 10px clamp(14px, 4vw, 56px);
  background: rgba(15, 23, 42, 0.86);
  border-bottom: 1px solid rgba(255, 237, 213, 0.25);
}

.wall-content > .site-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.wall-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: min(1480px, 100%);
  min-height: 0;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 42px) clamp(14px, 4vw, 56px) 28px;
  color: #fff7ed;
}

.wall-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  align-items: end;
  gap: 20px;
}

.wall-title h1 {
  margin: 0;
  color: #fef08a;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1;
  text-shadow: 3px 4px 0 #7c2d12, 0 5px 16px rgba(15, 23, 42, .7);
  transform: rotate(-1deg);
}

.wall-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wall-search {
  display: flex;
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 237, 213, .55);
  background: rgba(15, 23, 42, .78);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .25);
}

.wall-search input,
.wall-sort select {
  min-width: 0;
  min-height: 42px;
  border: 0;
  color: #fff7ed;
  background: transparent;
}

.wall-search input {
  flex: 1;
  padding: 8px 11px;
}

.wall-search input::placeholder {
  color: #cbd5e1;
}

.wall-search button {
  border: 0;
  padding: 0 13px;
  color: #1c1917;
  background: #facc15;
  font-weight: 800;
}

.wall-sort {
  border: 1px solid rgba(255, 237, 213, .55);
  background: rgba(15, 23, 42, .78);
}

.wall-sort select {
  padding: 0 9px;
}

.wall-sort option {
  color: #f8fafc;
  background: #172235;
}

.wall-note {
  margin: 14px 0 0;
  color: #ffedd5;
  font-size: .9rem;
  text-shadow: 0 2px 4px rgba(15, 23, 42, .8);
}

.wall-feed {
  flex: 1;
  width: 100%;
  min-height: 0;
  max-width: 1320px;
  overflow-y: auto;
  margin: 24px auto 0;
  border: 9px solid #cbd5e1;
  padding: clamp(14px, 2vw, 24px);
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .35), inset 0 0 0 1px #e2e8f0;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.wall-feed-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wall-page-result {
  display: contents;
}

.wall-message {
  padding: 0 0 11px;
  border-bottom: 1px solid #e2e8f0;
}

.wall-message-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: clamp(7px, 1.4vw, 15px);
  color: #475569;
  font-size: .78rem;
  line-height: 1.3;
}

.wall-pass {
  display: inline-flex;
  min-width: 0;
  max-width: min(100%, 320px);
  align-items: baseline;
  overflow: hidden;
  color: #7f1d1d;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wall-username,
.wall-recipient {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wall-message-meta time {
  overflow: hidden;
  color: #64748b;
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wall-empty-state .text-link {
  margin-left: .35em;
}

.wall-message-text {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #1e293b;
  font-size: clamp(1.08rem, 2vw, 1.45rem);
  font-weight: 750;
  line-height: 1.3;
}

.wall-paint-0 .wall-message-text { color: #1e293b; }
.wall-paint-1 .wall-message-text { color: #854d0e; }
.wall-paint-2 .wall-message-text { color: #1e40af; }
.wall-paint-3 .wall-message-text { color: #9f1239; }
.wall-paint-4 .wall-message-text { color: #166534; }

.wall-empty-state {
  margin: 10px 0;
  color: #334155;
  font-size: 1.1rem;
}

.wall-status {
  min-height: 1.5em;
  margin: 10px 0;
  color: #7f1d1d;
  text-align: center;
}

.wall-load-more {
  display: block;
  margin: 8px auto 16px;
  border: 1px solid #94a3b8;
  padding: 8px 14px;
  color: #1e293b;
  background: #f1f5f9;
  font-weight: 700;
}

.wall-load-more[hidden] {
  display: none;
}

.wall-load-more:disabled {
  cursor: wait;
  opacity: .7;
}

.wall-sentinel {
  height: 1px;
}

@media (max-width: 700px) {
  .wall-shell {
    padding: 0;
  }

  .wall-header {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .wall-controls {
    width: 100%;
  }

  .wall-sort select {
    max-width: 138px;
  }

  .wall-feed {
    margin-top: 20px;
    border-width: 6px;
    padding: 12px;
  }

  .wall-feed-items {
    gap: 10px;
  }

  .wall-message-meta {
    gap: 7px;
    font-size: .72rem;
  }

  .wall-username {
    max-width: 90px;
  }

  .wall-message-meta time {
    font-size: .68rem;
  }

  .wall-message-text {
    font-size: 1.12rem;
  }

}
