/* Fonts: self-hosted latin subsets (SIL Open Font License, see /fonts/OFL-*.txt). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-latin.woff2') format('woff2');
}
/* Arial resized to Inter's metrics, so text doesn't jump when Inter finishes loading. */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

:root {
  --night: #1b1f3b;
  --night-2: #2a2f5a;
  --coral: #ff5a4e;
  --coral-dark: #e0442f;
  --gold: #ffb703;
  --teal: #0d9488;
  --cream: #fff8ef;
  --sand: #f5e9d8;
  --ink: #1f2233;
  --muted: #5d6178;
  --line: #e7dccb;
  --ok: #138a52;
  --error: #c62f2f;
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(27, 31, 59, 0.25);
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Component display rules (grid/flex) must not override the hidden attribute. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  font-weight: 800;
}
h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
}
h3 {
  font-size: 1.2rem;
}

a {
  color: var(--coral-dark);
}

.container {
  width: min(1100px, 100% - 2.5rem);
  margin-inline: auto;
}
.narrow {
  width: min(680px, 100% - 2.5rem);
}
.section {
  padding-block: clamp(3rem, 8vw, 5.5rem);
}
.section-alt {
  background: var(--sand);
}
.capitalize::first-letter {
  text-transform: uppercase;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1.25rem, 4vw, 2.5rem);
  background: rgba(27, 31, 59, 0.92);
  backdrop-filter: blur(10px);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
}
.brand-mark {
  display: block;
  width: auto;
  height: 2.4rem;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.site-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover {
  color: #fff;
}
.site-nav .nav-cta {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
}
@media (max-width: 560px) {
  .brand-text,
  .site-nav a:not(.nav-cta) {
    display: none;
  }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 110%, rgba(255, 183, 3, 0.55), transparent 45%),
    radial-gradient(circle at 10% 120%, rgba(255, 90, 78, 0.6), transparent 50%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 60%, #4a3a6b 100%);
}
.hero::after {
  /* Silhouette of colonial rooftops at sunset. */
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 70px;
  background: var(--cream);
  clip-path: polygon(
    0 100%, 0 60%, 6% 60%, 6% 35%, 9% 20%, 12% 35%, 12% 60%, 22% 60%, 22% 45%, 30% 45%, 30% 60%, 38% 60%,
    38% 30%, 41% 30%, 41% 15%, 43% 5%, 45% 15%, 45% 30%, 48% 30%, 48% 60%, 60% 60%, 60% 40%, 70% 40%, 70% 60%,
    78% 60%, 78% 25%, 81% 10%, 84% 25%, 84% 60%, 92% 60%, 92% 45%, 100% 45%, 100% 100%
  );
}
.hero-inner {
  position: relative;
  padding-block: clamp(3.5rem, 10vw, 7rem) clamp(5.5rem, 12vw, 8rem);
}
.kicker {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral);
}
.hero .kicker {
  color: var(--gold);
}
.accent {
  background: linear-gradient(90deg, var(--gold), var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  max-width: 40rem;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: rgba(255, 255, 255, 0.88);
}
.lead-sm {
  color: var(--muted);
  font-size: 1.05rem;
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}
.facts li {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.fact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.75;
}
.fact-value {
  font-weight: 600;
  font-size: 1.05rem;
}
.facts-dark li {
  background: #fff;
  border-color: var(--line);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--night);
  color: #fff;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}
.btn-primary {
  background: var(--coral);
  box-shadow: 0 10px 24px -10px rgba(255, 90, 78, 0.8);
}
.btn-primary:hover {
  background: var(--coral-dark);
}
.btn-ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.btn-disabled {
  background: rgba(255, 255, 255, 0.15);
  cursor: default;
}
.btn-block {
  width: 100%;
}
.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 1.1rem;
  right: 1.25rem;
  font-family: var(--display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--sand);
}
.step-icon {
  font-size: 2rem;
}
.steps p {
  margin: 0;
  color: var(--muted);
}

/* Rules */
.rules {
  display: grid;
  gap: 0.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}
.rules li {
  position: relative;
  padding: 1rem 1.25rem 1rem 3.75rem;
  border-radius: 14px;
  background: var(--cream);
  counter-increment: rule;
}
.rules li::before {
  content: counter(rule);
  position: absolute;
  left: 1rem;
  top: 0.95rem;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--night);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Prizes */
.prizes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.prize {
  padding: 1.75rem;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(140deg, var(--night), var(--night-2));
}
.prize:nth-child(2) {
  background: linear-gradient(140deg, var(--coral-dark), var(--coral));
}
.prize-icon {
  font-size: 2.4rem;
}
.prize p {
  margin: 0;
  opacity: 0.9;
}
.announce {
  margin-top: 1.5rem;
  font-size: 1.1rem;
}
.cta-band {
  text-align: center;
  padding-top: 0;
}
.cta-band p {
  color: var(--muted);
}

/* Cards & forms */
.card {
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 1.35rem;
}
.form {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.field {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  border: 0;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
label,
legend {
  font-weight: 600;
}
legend {
  padding: 0;
  margin-bottom: 0.25rem;
}
.member-row {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.member-row label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
input[type='text'],
input[type='tel'],
input[type='email'] {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: var(--cream);
  color: var(--ink);
}
input:focus {
  outline: 3px solid rgba(255, 90, 78, 0.3);
  border-color: var(--coral);
}
input[aria-invalid='true'] {
  border-color: var(--error);
}
.hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.optional {
  font-weight: 400;
  color: var(--muted);
}
.field-error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--error);
}
.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 500;
}
.check input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.2rem;
  accent-color: var(--coral);
}
.hp {
  position: absolute;
  left: -9999px;
}

.alert {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  border: 1px solid;
}
.alert-error {
  background: #fdecec;
  border-color: #f3b9b9;
  color: #8a1f1f;
}
.alert-success {
  background: #e7f6ee;
  border-color: #a9dcbf;
  color: #0e5e38;
}
.message {
  padding-block: 5rem;
  text-align: center;
}

/* Team page */
.team h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  margin-bottom: 0.25rem;
}
.members {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.team-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 800px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}
.upload-card,
.share-card {
  display: grid;
  gap: 1rem;
  align-content: start;
}
.status {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 500;
}
.status-open {
  background: #e7f6ee;
  color: var(--ok);
}
.status-wait {
  background: #fff4d6;
  color: #7a5400;
}
.status-closed {
  background: var(--sand);
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.3rem;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
.upload-form {
  display: grid;
  gap: 1rem;
}
.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.25rem;
  padding: 2.25rem 1rem;
  border: 2px dashed var(--coral);
  border-radius: var(--radius);
  background: #fff3ef;
  text-align: center;
  cursor: pointer;
}
.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone-title {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--coral-dark);
}
.dropzone-hint {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}
.upload-queue {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.upload-queue:empty {
  display: none;
}
.upload-queue li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--cream);
  font-size: 0.9rem;
}
.q-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.q-status {
  color: var(--muted);
}
.upload-queue li[data-state='ok'] .q-status {
  color: var(--ok);
  font-weight: 600;
}
.upload-queue li[data-state='error'] .q-status {
  color: var(--error);
  font-weight: 600;
}
.q-bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.q-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--coral);
  transition: width 0.2s;
}
.upload-queue li[data-state='ok'] .q-bar span {
  background: var(--ok);
}
.danger-zone {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.rotation-bar {
  height: 10px;
  margin: 0.75rem 0 0.25rem;
}
.qr {
  justify-self: center;
  width: min(220px, 100%);
  padding: 0.5rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}
.qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.copy-row {
  display: flex;
  gap: 0.5rem;
}
.copy-row input {
  min-width: 0;
  font-size: 0.8rem;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  padding: 0 0.5rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  background: var(--night);
  color: var(--gold);
  font-size: 1rem;
  vertical-align: middle;
}
.photo-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.photo-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  background: var(--cream);
}
.photo-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-meta {
  flex: none;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Admin */
.table-wrap {
  overflow-x: auto;
  margin-top: 1.5rem;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th,
.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.table th {
  background: var(--sand);
  font-weight: 600;
}
.table .links a {
  display: block;
}

/* Footer */
.site-footer {
  padding: 2.5rem 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  background: var(--night);
}
.site-footer p {
  margin: 0.25rem 0;
}
.site-footer a {
  color: var(--gold);
}

/* Rally state */
.btn-dark {
  background: var(--night);
  color: #fff;
}
.btn-danger {
  background: var(--error);
}
.btn-big {
  padding: 1.1rem 2.25rem;
  font-size: 1.15rem;
}
.alert-info {
  background: #eef3fb;
  border-color: #c4d4ee;
  color: #24406e;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(19, 138, 82, 0.2);
  border: 1px solid rgba(110, 231, 170, 0.5);
  color: #b6f5d3;
  font-weight: 600;
}
.live-badge .dot {
  background: #6ee7aa;
}
.live-badge-closed {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.control-card {
  display: grid;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.control-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.control-head h2 {
  margin: 0;
}
.control-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.control-actions form {
  margin: 0;
}
.badge {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}
.badge-pending {
  background: #fff4d6;
  color: #7a5400;
}
.badge-open {
  background: #e7f6ee;
  color: var(--ok);
}
.badge-closed {
  background: var(--sand);
  color: var(--muted);
}
.ref-form {
  display: grid;
  gap: 0.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.ref-form input[type='url'] {
  width: 100%;
  min-width: 0;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: var(--cream);
}
.admin-title {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
}

/* Original photos gallery */
.gallery-card {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.gallery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.gallery-head h2 {
  margin: 0;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery li {
  position: relative;
}
.ref {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background-color: var(--sand);
  background-size: cover;
  background-position: center;
}
.ref::before {
  /* Blur the tiny inline placeholder while the thumbnail downloads. */
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  filter: blur(8px);
  transform: scale(1.1);
}
.ref img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ref-num {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  min-width: 1.8rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(27, 31, 59, 0.85);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
}
.gallery-admin {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.gallery-admin form {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  margin: 0;
}
.ref-delete {
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 50%;
  background: rgba(198, 47, 47, 0.9);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.ref-upload {
  display: grid;
  gap: 0.75rem;
}

.viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
  touch-action: pan-y;
}
.viewer::backdrop {
  background: #000;
}
.viewer[open] {
  display: grid;
  grid-template-rows: 1fr auto;
}
.viewer-img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  transition: filter 0.2s;
  user-select: none;
  -webkit-user-drag: none;
}
.viewer-img.loading {
  filter: blur(2px);
}
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.8);
}
.viewer-count {
  min-width: 4rem;
  text-align: center;
  font-weight: 600;
}
.viewer-btn {
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.viewer-close {
  font-size: 1.1rem;
}

/* Admin sign-in */
.site-nav .nav-admin {
  padding: 0.4rem 0.85rem;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}
@media (max-width: 560px) {
  .site-nav a.nav-admin {
    display: inline-block;
  }
}
.login-card {
  margin-top: 1.5rem;
}
.btn-google {
  gap: 0.75rem;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
}
.btn-google:hover {
  background: var(--cream);
}
.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.admin-bar .kicker {
  margin: 0;
}
.admin-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.admin-user img {
  border-radius: 50%;
}

/* Encrypted pre-download + start QR */
.prefetch-card {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.prefetch-card .prefetch-title {
  margin: 0;
  font-weight: 600;
}
.prefetch-card.done {
  background: #e7f6ee;
}
.prefetch-card.done .prefetch-title {
  color: var(--ok);
}
.prefetch-card.done .q-bar span {
  background: var(--ok);
}
.qr-big {
  width: min(360px, 100%);
}
.unlock-card {
  border: 2px solid var(--ok);
}

/* Admin: team photos (from R2) */
.text-error {
  color: var(--error);
  font-weight: 600;
}
.admin-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.admin-photo {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
}
.admin-photo-img {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: var(--sand);
}
.admin-photo-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.no-preview {
  padding: 1rem;
  font-size: 0.9rem;
  text-align: center;
  color: var(--muted);
}
.admin-photo-body {
  display: grid;
  gap: 0.35rem;
  word-break: break-word;
}
.admin-photo-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.admin-photo-status form {
  margin: 0;
}
.pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.pill-ok {
  background: #e7f6ee;
  color: var(--ok);
}
.pill-error {
  background: #fdecec;
  color: var(--error);
}

/* Admin on phones: team cards instead of a wide table */
.facts-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}
.facts-compact li {
  padding: 0.6rem 0.75rem;
}
.facts-compact .fact-value {
  font-size: 1rem;
}
.team-search {
  width: 100%;
  margin: 0.5rem 0 1rem;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
}
.team-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.team-card {
  display: grid;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
}
.team-card p {
  margin: 0;
}
.team-card-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 1.1rem;
}
.team-num {
  color: var(--coral-dark);
  font-weight: 700;
  font-size: 0.9rem;
}
.team-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.team-card-actions .btn {
  flex: 1 1 auto;
}
.admin-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 2rem;
}
details.setup {
  margin-top: 1rem;
}
details.setup > summary {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  font-weight: 600;
  cursor: pointer;
}
details.setup[open] > summary {
  margin-bottom: 1rem;
}
@media (max-width: 560px) {
  .control-actions .btn,
  .control-actions form {
    width: 100%;
  }
  .admin-photos {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .admin-photo {
    padding: 0.5rem;
    gap: 0.5rem;
    font-size: 0.85rem;
  }
}

/* Full-screen start QR (/admin/qr) */
.qr-screen {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1rem;
  min-height: 100dvh;
  margin: 0;
  padding: 1.25rem;
  background: #fff;
  text-align: center;
}
.qr-screen-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  font-weight: 800;
  color: var(--night);
}
.qr-screen-code {
  width: min(92vw, 78dvh, 640px);
}
.qr-screen-code svg {
  display: block;
  width: 100%;
  height: auto;
}
.qr-screen-hint {
  margin: 0;
  max-width: 30rem;
  color: var(--muted);
}
/* Keep "Reiniciar" (rotates the photo key) away from the thumb's path to "Cerrar". */
.control-actions form + form {
  margin-top: 0.75rem;
}

/* Staging only (ENVIRONMENT=staging) */
.staging-banner {
  padding: 0.45rem 1rem;
  background: repeating-linear-gradient(135deg, #ffb703 0 14px, #ffd166 14px 28px);
  color: #1b1f3b;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}
.staging-banner a {
  color: inherit;
}
