/* ==========================================================================
   Claim your spot.

   Phone-first: this is the page people open from a text message, standing in
   a kitchen. Big taps, one decision per screen, and the roster reads as a
   board filling up rather than a form being completed.
   ========================================================================== */

.claim {
  position: relative;
  z-index: 10;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 4rem;
  display: grid;
  gap: 1.25rem;
}

/* --- Head ---------------------------------------------------------------- */

.claim__head { display: grid; gap: 0.5rem; justify-items: center; text-align: center; }
.claim__crest { width: clamp(5.5rem, 22vw, 8rem); }
.claim__crest svg { width: 100%; height: auto; display: block; }

.claim__title {
  font-family: var(--display);
  font-size: clamp(2.1rem, 10vw, 3.4rem);
  line-height: 0.92;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}

.claim__note {
  margin: 0;
  max-width: 40ch;
  font-size: 0.92rem;
  color: var(--chalk-dim);
  text-wrap: pretty;
}

/* --- Progress ------------------------------------------------------------ */

.claim__progress { display: grid; gap: 0.4rem; }

.claim__progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.claim__progress-label {
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chalk-dim);
}

.claim__progress-count {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.claim__bar {
  height: 12px;
  background: rgba(5, 13, 8, 0.85);
  border: 2px solid var(--chalk-line);
  overflow: hidden;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.claim__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-bright));
  box-shadow: 0 0 16px rgba(233, 179, 65, 0.7);
  transition: width 600ms var(--ease-out);
}

/* --- Roster grid --------------------------------------------------------- */

.claim__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.6rem;
}

.spot {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 4.4rem;
  padding: 0.7rem 0.9rem;
  text-align: left;
  background: rgba(16, 38, 22, 0.72);
  border: 1px solid var(--chalk-line);
  border-left: 3px solid var(--chalk-faint);
  color: inherit;
  cursor: pointer;
  transition: border-color 160ms, background-color 160ms, transform 120ms;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.spot:hover:not(:disabled) { border-left-color: var(--gold); background: rgba(28, 64, 38, 0.8); }
.spot:active:not(:disabled) { transform: translateY(2px); }
.spot:disabled { cursor: default; }

.spot__name {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  text-transform: uppercase;
  color: var(--chalk);
  overflow-wrap: anywhere;
}

.spot__team {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--gold);
  overflow-wrap: anywhere;
}

.spot__state {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chalk-faint);
  white-space: nowrap;
}

/* Claimed */
.spot[data-claimed="true"] {
  border-left-color: var(--go);
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.12), rgba(16, 38, 22, 0.72));
}
.spot[data-claimed="true"] .spot__state { color: var(--go); }

/* The spot claimed on this device */
.spot[data-mine="true"] {
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(233, 179, 65, 0.2), rgba(16, 38, 22, 0.75));
}
.spot[data-mine="true"] .spot__state { color: var(--gold-bright); }

/* Someone else just claimed this while you were looking at it */
.spot.is-fresh { animation: spot-land 900ms var(--ease-slam) both; }
@keyframes spot-land {
  0%   { transform: scale(1.06); background-color: rgba(233, 179, 65, 0.5); }
  100% { transform: scale(1); }
}

.claim__closed {
  margin: 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--signal);
  background: rgba(255, 59, 78, 0.1);
  color: var(--chalk-soft);
  font-size: 0.9rem;
}
.claim__closed[hidden] { display: none; }
.claim__closed a { color: var(--gold); }

.claim__error { margin: 0; min-height: 1.2em; font-size: 0.88rem; color: var(--signal); text-align: center; }

.claim__foot {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 0.5rem;
}
.claim__link {
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 2px solid var(--gold-deep);
  padding-bottom: 0.15rem;
}

/* --- Team-name picker ---------------------------------------------------- */

.picker {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(5, 13, 8, 0.94);
  backdrop-filter: blur(10px);
  overflow-y: auto;
}
.picker[hidden] { display: none; }

.picker__card {
  display: grid;
  gap: 0.55rem;
  width: min(100%, 26rem);
  padding: 1.5rem 1.35rem;
  background: rgba(16, 38, 22, 0.94);
  border: 1px solid var(--gold-deep);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
}

.picker__eyebrow {
  margin: 0;
  font-family: var(--display);
  font-size: 0.76rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.picker__name {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(2rem, 9vw, 2.8rem);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--chalk);
  overflow-wrap: anywhere;
}

.picker__hint { margin: 0; font-size: 0.8rem; color: var(--chalk-faint); }

.picker__row { display: flex; gap: 0.6rem; margin-top: 0.35rem; }
.picker__row .btn { flex: 1 1 auto; min-height: 46px; }

@media (max-width: 620px) {
  .claim { padding-inline: 0.85rem; gap: 1rem; }
  .claim__grid { grid-template-columns: 1fr; }
  .spot { min-height: 4rem; }
  .spot__name { font-size: 1.35rem; }
  /* 16px stops iOS zooming the page the moment the field is focused. */
  .picker .text-input { font-size: 16px; }
}
