/* Print modal tab active state (reliable override — Tailwind CDN JIT misses
   dynamically-added custom-color classes like text-night / bg-lime) */
.print-tab--active {
  background: #84cc16 !important;
  color: #020617 !important;
}

/* RSVP status select — native browser white bg overrides Tailwind CDN custom colors */
.rsvp-select {
  background: rgba(9, 17, 35, 0.85) !important;
  color: rgba(255, 255, 255, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  appearance: none;
  -webkit-appearance: none;
}
.rsvp-select:focus {
  outline: none;
  border-color: rgba(132, 204, 22, 0.6) !important;
}
.rsvp-select option {
  background: #0f172a;
  color: #e2e8f0;
}
/* Status-tinted variants */
.rsvp-select--confirmed {
  background: rgba(132, 204, 22, 0.15) !important;
  color: #84cc16 !important;
  border-color: rgba(132, 204, 22, 0.35) !important;
}
.rsvp-select--declined {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
.rsvp-select--maybe {
  background: rgba(251, 191, 36, 0.12) !important;
  color: #fcd34d !important;
  border-color: rgba(251, 191, 36, 0.3) !important;
}

/* Print modal Print button — same JIT issue with bg-lime/text-night */
.print-do-btn {
  background: #84cc16 !important;
  color: #020617 !important;
}
.print-do-btn:hover {
  background: #a3e635 !important;
}

/* Substitution planner ---------------------------------------------------- */
.subs-segment-selected {
  outline: 2px solid #fff;
  outline-offset: -1px;
  box-shadow: 0 0 12px rgba(132, 204, 22, 0.5);
  z-index: 10;
}

/* ===== Editor viewport-fit layout ======================================== */

/* Editor: scrollable page layout — landscape pitch is width-constrained */
.editor-main {
  overflow-y: auto !important;
  padding-top: 0.5rem !important;
  padding-bottom: 1rem !important;
}

/* Content wrapper */
.editor-content {
  max-width: none !important;
}

/* Toolbar stays compact at top */
.editor-toolbar {
  flex-shrink: 0;
}

/* Grid: natural height, no flex-fill */
.editor-grid {
  align-items: start;
}

/* Pitch column: full width of its grid column */
.editor-pitch-col {
  display: block;
}

/* Pitch wrap: full width */
.pitch-wrap {
  width: 100%;
}

/* Panel column: scroll independently */
.editor-panel-col {
  display: flex;
  flex-direction: column;
}

.editor-panel-col .panel {
  flex: 1;
  overflow-y: auto;
  max-height: 80vh;
}

/* ===== Pitch sizing ====================================================== */

/* Default: width-based aspect ratio (non-editor pages, fallback) */
.pitch-portrait {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.pitch-portrait::before {
  content: "";
  display: block;
  padding-top: 150%;
}

/* Editor page: half-pitch landscape (120:96 ≈ real half-pitch 68m×52.5m) */
.editor-main .pitch-portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 120 / 96;
  max-width: 100%;
}

.editor-main .pitch-portrait::before {
  display: none;
}

/* Flat pitch — no 3D perspective (avoids pixelation and distortion) */
.editor-main .pitch-inner {
  /* flat — no transform */
}

/* No counter-rotation needed without 3D tilt */
.editor-main .slot .slot-inner {
  /* flat — no transform */
}

/* Subtle vignette on edges for depth without distortion */
.editor-main .pitch-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 65%, rgba(0,0,0,0.18) 100%);
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

/* Subtle elevation glow under pitch */
.editor-main .pitch-portrait::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 8%;
  right: 8%;
  height: 20px;
  background: radial-gradient(ellipse at center, rgba(20, 160, 60, 0.25), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
  z-index: -1;
}

/* ===== Responsive breakpoints ============================================ */

@media (max-width: 1024px) {
  .pitch-portrait {
    width: clamp(420px, 100%, 520px);
  }
  .editor-main .pitch-portrait {
    width: 100%;
    height: auto;
    aspect-ratio: 120 / 96;
  }
  .jersey {
    width: 42px;
    height: 42px;
  }
  .name-label {
    font-size: 0.65rem;
  }
}

@media (max-width: 768px) {
  .pitch-portrait {
    width: clamp(320px, 92vw, 480px);
    height: auto;
    aspect-ratio: auto;
  }
  .editor-main .pitch-portrait {
    width: clamp(300px, 96vw, 560px);
    height: auto;
    aspect-ratio: 120 / 96;
  }
  .editor-main .pitch-portrait::before {
    display: none;
  }
  .editor-panel-col .panel {
    max-height: none;
    overflow-y: visible;
  }
  .jersey {
    width: 36px;
    height: 36px;
  }
  .name-label {
    font-size: 0.55rem;
  }
  .pos-label {
    font-size: 0.45rem;
  }
  .editor-main .pitch-inner::before {
    display: none;
  }
  .editor-main .pitch-portrait::after {
    display: none;
  }
}

/* Pitch base */
.pitch-inner {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(to bottom, #0d5426 0%, #0f6130 25%, #126836 50%, #157040 70%, #187844);
  overflow: hidden;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255,255,255,0.04);
}

.slots-layer {
  position: absolute;
  inset: 0;
}

/* Slight rounding on pitch edges for a natural grass look */
.editor-main .pitch-inner {
  border-radius: 8px;
}

/* Half-pitch slots: full half in landscape SVG (viewBox 0 0 120 96)
   midfield line: y=3/96=3.1% → top=3%   goal line: y=91/96=94.8% → bottom=5.2%
   sidelines: x=3/120=2.5%  x=117/120=97.5% → right=2.5% */
.editor-main .slots-layer {
  top: 3%;
  bottom: 5%;
  left: 2.5%;
  right: 2.5%;
  overflow: visible;
}

/* Slots */
.slot {
  position: absolute;
  transform: translate(-50%, -50%);
  user-select: none;
}

.slot .slot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.jersey {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  border-width: 2px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45), 0 1px 4px rgba(0, 0, 0, .3);
  position: relative;
  overflow: visible;
}

.jersey.empty {
  background: transparent;
  border-style: dotted;
  border-color: rgba(255, 255, 255, .85);
}

.name-label {
  margin-top: 0.35rem;
  font-size: .7rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.pos-label {
  margin-top: .2rem;
  font-size: .55rem;
  font-weight: 500;
  line-height: 1rem;
  color: rgba(255, 255, 255, .75);
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Higher-contrast active highlight (teal) */
.slot.active .jersey {
  box-shadow: 0 0 0 3px rgba(6, 182, 212, .95), 0 2px 8px rgba(0, 0, 0, .25);
}

/* Edit grid + float animation -------------------------------------------- */
@keyframes floatYonly {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6%);
  }

  100% {
    transform: translateY(0);
  }
}

.pitch-inner.editing::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 2.5% 100%, 100% 2.5%;
  pointer-events: none;
}

.pitch-inner.editing .slot .float-wrap {
  animation: floatYonly 1.6s ease-in-out infinite;
}

/* Minor utilities */
.panel {
  background: rgba(9, 20, 37, .88);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 18px 45px rgba(8, 21, 37, .4);
  padding: 1rem;
  color: #e2e8f0;
}
.panel h2,
.panel .font-semibold,
.panel .text-slate-600 {
  color: #fff !important;
}
.panel .text-slate-500 {
  color: rgba(226, 232, 240, .65) !important;
}

/* Roster panel refinements */
.roster-panel {
  padding: 0.75rem !important;
}

.roster-card {
  cursor: pointer;
}

.roster-card:active {
  transform: scale(0.98);
}

/* Bench card when its player is already on the pitch */
.bench-assigned {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

.drag-area {
  min-height: 40px;
  padding: 0;
  border: none;
  border-radius: .5rem;
}

#assignModal {
  display: none;
  cursor: pointer;
}

#assignModal:not(.hidden) {
  display: block;
}

#assignModalInner {
  position: absolute;
  cursor: auto;
}

/* Better contrast for on-pitch avatars */
.jersey.with-photo {
  background-size: cover;
  background-position: center;
  position: relative;
  border-color: rgba(255, 255, 255, .95);
  outline: 2px solid rgba(255, 255, 255, .7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);
}

/* Number badge on photo avatars */
.num-badge {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translate(-50%, 0);
  background: rgba(15, 23, 42, .9);
  color: #fff;
  font-weight: 700;
  border-radius: 9999px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  line-height: 1;
  border: 1.5px solid rgba(255, 255, 255, .8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
  z-index: 1;
}

/* Keep empty slots crisp and readable */
.jersey.empty {
  background: rgba(255, 255, 255, .06);
  border-style: dotted;
  border-color: rgba(255, 255, 255, .85);
}

/* Pitch color token (keep in sync with .pitch-inner background) */
:root {
  --pitch-green: #166534;
}

/* Empty slots: solid pitch-color fill + strong outline to mask field lines */
.jersey.empty {
  background: var(--pitch-green);
  border-style: dashed;
  border-color: rgba(255, 255, 255, .7);
  outline: 2px solid rgba(0, 0, 0, .2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

/* Name remains readable on/near lines */
.name-label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

.pos-label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

/* Keep pitch legible on non-editor pages */
body {
  background-color: #081525;
  background-image:
    radial-gradient(circle at top 8% left 12%, rgba(132, 204, 22, .08), transparent 45%),
    radial-gradient(circle at bottom 6% right 18%, rgba(250, 204, 21, .06), transparent 55%),
    radial-gradient(circle at center, rgba(12, 45, 32, .28), transparent 65%);
  background-attachment: fixed;
  color: #e2e8f0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  border-radius: 9999px;
  transition: background-color .2s ease, color .2s ease;
}

.nav-link:hover,
.nav-link:focus {
  background: rgba(132, 204, 22, .15);
  color: #fff;
}

.nav-link::before {
  content: '';
  width: .35rem;
  height: .35rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .35);
  transition: transform .2s ease, background .2s ease;
}

.nav-link:hover::before,
.nav-link:focus::before {
  transform: scale(1.8);
  background: #84cc16;
}

.tip-card { background: linear-gradient(135deg, rgba(250, 204, 21, 0.25), rgba(180, 83, 9, 0.25)); color: #fffaf0; border: 1px solid rgba(250, 204, 21, 0.55); box-shadow: 0 10px 25px rgba(250, 204, 21, 0.18); }

.select-pill { background: rgba(10, 21, 40, 0.92); color: #f8fafc; border: 1px solid rgba(255, 255, 255, 0.38); border-radius: 9999px; padding: 0.4rem 0.9rem; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 18px rgba(8, 21, 37, 0.35); }
.select-pill:focus { outline: none; border-color: rgba(132, 204, 22, 0.7); box-shadow: 0 0 0 2px rgba(132, 204, 22, 0.35); }
.select-pill option { color: #0f172a; background: #f8fafc; }

.assign-card { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.9rem 1rem; border-radius: 1rem; border: 1px solid rgba(255,255,255,0.16); background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 32, 52, 0.92)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 25px rgba(8,21,37,0.4); transition: border-color .2s ease, transform .2s ease; }
.assign-card:hover { border-color: rgba(132,204,22,0.75); transform: translateY(-2px); }
.assign-card__name { font-weight: 600; color: #fff; }
.assign-card__meta { font-size: .75rem; color: rgba(226,232,240,.8); }

.button-label { font-size: 0.7rem; letter-spacing: 0.35em; color: rgba(132, 204, 22, 0.95); font-weight: 700; text-transform: uppercase; }

.assign-card__cta { font-size: 0.7rem; letter-spacing: 0.35em; color: rgba(132,204,22,0.95); font-weight:700; text-transform: uppercase; }

.collapsible-wrapper {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition: max-height .6s ease, opacity .6s ease, margin .3s ease;
}
.collapsible-wrapper.is-open {
  max-height: var(--collapsible-max, 1200px);
  opacity: 1;
  margin-top: 1.25rem;
}

.match-card {
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.match-card--win {
  border-color: rgba(132, 204, 22, 0.45);
  box-shadow: 0 12px 28px rgba(132, 204, 22, 0.20);
}
.match-card--loss {
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow: 0 12px 28px rgba(248, 113, 113, 0.15);
}
.match-card--draw {
  border-color: rgba(250, 204, 21, 0.45);
  box-shadow: 0 12px 28px rgba(250, 204, 21, 0.18);
}
.match-card.match-card--win:hover,
.match-card.match-card--loss:hover,
.match-card.match-card--draw:hover {
  transform: translateY(-2px);
}

.match-search__panel {
  background: rgba(8, 18, 34, 0.995);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  z-index: 60;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.match-search__result {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.75rem;
  transition: background .2s ease;
}

.match-search__result:hover {
  background: rgba(255, 255, 255, 0.08);
}

.match-search__type {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.flash-fade {
  transition: opacity .35s ease, transform .35s ease;
}

.flash-dismissed {
  opacity: 0;
  transform: translateY(-4px);
}

@keyframes flashPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(132, 204, 22, .45);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(132, 204, 22, .12);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(132, 204, 22, .45);
  }
}

.flash-success {
  animation: flashPulse 1.6s ease-in-out infinite;
}

/* Landing hero ----------------------------------------------------------- */
.hero-mosaic {
  position: absolute;
  inset: 0;
  padding: 2.75rem;
}

.hero-device {
  position: absolute;
  display: flex;
  flex-direction: column;
  border-radius: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), transparent 55%), rgba(8, 18, 34, 0.88);
  box-shadow:
    0 12px 35px rgba(2, 6, 23, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  overflow: hidden;
}

.hero-device--desktop {
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 82%;
  padding: 1.6rem 1.75rem;
  gap: 1.25rem;
}

.hero-device--tablet {
  top: 4%;
  left: 5%;
  width: 52%;
  padding: 1.35rem;
  gap: 1.05rem;
  border-radius: 1.5rem;
  background: radial-gradient(circle at top, rgba(250, 204, 21, 0.14), transparent 60%), rgba(10, 23, 42, 0.92);
}

.hero-device--phone {
  bottom: 4%;
  right: 6%;
  width: 32%;
  padding: 1.1rem 1.2rem 1.25rem;
  gap: 0.9rem;
  border-radius: 1.2rem;
  background: radial-gradient(circle at top right, rgba(132, 204, 22, 0.18), transparent 55%), rgba(9, 18, 33, 0.95);
}

.hero-device__toolbar {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  height: 0.75rem;
}

.hero-device__toolbar span {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.45);
}

.hero-device__toolbar span:nth-child(1) { background: rgba(248, 113, 113, 0.7); }
.hero-device__toolbar span:nth-child(2) { background: rgba(250, 204, 21, 0.7); }
.hero-device__toolbar span:nth-child(3) { background: rgba(132, 204, 22, 0.75); }

.hero-device__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-flag {
  font-size: 0.55rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.6);
  margin: 0;
}

.hero-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.hero-meta__label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: rgba(226, 232, 240, 0.5);
  margin-bottom: 0.25rem;
}

.hero-meta__value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f1f5f9;
}

.hero-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
}

.hero-progress__label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.55);
}

.hero-progress__track {
  height: 6px;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.hero-progress__value {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(132, 204, 22, 0.8), rgba(45, 212, 191, 0.9));
  border-radius: 9999px;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.35);
}

.hero-progress__pct {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(190, 242, 100, 0.95);
}

.hero-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  font-size: 0.82rem;
}

.hero-checklist li {
  padding: 0.45rem 0.6rem;
  border-radius: 0.8rem;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hero-checklist li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: transparent;
}

.hero-checklist li.complete {
  border-color: rgba(132, 204, 22, 0.45);
  color: rgba(190, 242, 100, 0.95);
}

.hero-checklist li.complete::before {
  background: rgba(132, 204, 22, 0.95);
  border-color: rgba(132, 204, 22, 0.6);
  box-shadow: 0 0 6px rgba(132, 204, 22, 0.5);
}

.hero-device__eyebrow {
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.55);
  margin: 0;
}

.hero-device__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
}

.hero-device__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: #e2e8f0;
}

.hero-device__list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.65rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
}

.hero-pill--lime {
  background: rgba(132, 204, 22, 0.18);
  color: rgba(190, 242, 100, 0.95);
}

.hero-pill--sky {
  background: rgba(56, 189, 248, 0.18);
  color: rgba(125, 211, 252, 0.95);
}

.hero-pill--amber {
  background: rgba(250, 204, 21, 0.2);
  color: rgba(253, 224, 71, 0.95);
}

.hero-pill--outline {
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: rgba(226, 232, 240, 0.8);
  background: rgba(8, 18, 34, 0.6);
}

.hero-device__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.hero-avatar-group {
  display: inline-flex;
  align-items: center;
}

.hero-avatar-group span {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.8);
  margin-left: -8px;
}

.hero-avatar-group span:first-child {
  margin-left: 0;
}

.hero-device__cta {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(190, 242, 100, 0.85);
}

.hero-chat {
  background: rgba(15, 23, 42, 0.78);
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 0.65rem 0.7rem;
  font-size: 0.78rem;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero-chat p {
  margin: 0;
}

.hero-chat p strong {
  color: #fff;
  font-weight: 600;
}

.hero-chat p span {
  font-size: 0.65rem;
  color: rgba(226, 232, 240, 0.45);
  margin-left: 0.4rem;
}

.hero-reaction-tray {
  display: flex;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
  justify-content: space-between;
}

.hero-reaction-tray span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.hero-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(8, 18, 34, 0.86);
  color: rgba(226, 232, 240, 0.8);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.hero-badge strong {
  color: #fff;
  font-weight: 600;
}

.hero-badge--top {
  top: 8%;
  right: 8%;
}

.hero-badge--bottom {
  bottom: 10%;
  left: 10%;
}

.hero-badge__dot {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: rgba(132, 204, 22, 0.85);
  box-shadow: 0 0 8px rgba(132, 204, 22, 0.6);
}

@media (max-width: 1024px) {
  .hero-mosaic {
    padding: 2.2rem;
  }
  .hero-device--desktop {
    width: 92%;
    top: 14%;
  }
  .hero-device--tablet {
    width: 58%;
  }
  .hero-device--phone {
    width: 36%;
  }
}

@media (max-width: 768px) {
  .hero-mosaic {
    position: relative;
    padding: 1.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  .hero-device {
    position: relative;
    width: 100%;
    transform: none;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
  }
  .hero-device--desktop,
  .hero-device--tablet,
  .hero-device--phone {
    width: 100%;
    animation: heroFloatMobile 5s ease-in-out infinite;
  }
  .hero-badge {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    justify-content: center;
    margin: 0 auto;
  }
}

/* ===== Splash page animations ============================================ */

/* Floating animation for hero devices */
@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(0.5deg); }
}
@keyframes heroFloatAlt {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
  50% { transform: translateX(-50%) translateY(-10px) rotate(-0.3deg); }
}
@keyframes heroFloatPhone {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.8deg); }
}
/* Mobile-safe float: translateY only, no translateX or rotate that cause clipping */
@keyframes heroFloatMobile {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Desktop-only: animations that use translateX(-50%) must never run at mobile */
@media (min-width: 769px) {
  .hero-device--desktop {
    animation: heroFloatAlt 5s ease-in-out infinite;
  }
  .hero-device--tablet {
    animation: heroFloat 6s ease-in-out infinite 0.5s;
  }
  .hero-device--phone {
    animation: heroFloatPhone 4.5s ease-in-out infinite 1s;
  }
}
.hero-badge--top {
  animation: heroFloat 7s ease-in-out infinite 1.5s;
}
.hero-badge--bottom {
  animation: heroFloat 6.5s ease-in-out infinite 2s;
}

/* Entrance animations for splash hero */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideRight {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.splash-animate-1 { animation: fadeSlideUp 0.8s ease-out both; }
.splash-animate-2 { animation: fadeSlideUp 0.8s ease-out 0.15s both; }
.splash-animate-3 { animation: fadeSlideUp 0.8s ease-out 0.3s both; }
.splash-animate-4 { animation: fadeSlideRight 0.8s ease-out 0.45s both; }
.splash-animate-hero { animation: scaleIn 1s ease-out 0.3s both; }

/* Animated gradient orb */
@keyframes orbDrift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes orbDrift2 {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-25px, 25px) scale(1.1); }
  66% { transform: translate(20px, -10px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}
.orb-animate { animation: orbDrift 8s ease-in-out infinite; }
.orb-animate-2 { animation: orbDrift2 10s ease-in-out infinite; }

/* Pulse glow on progress bar */
@keyframes progressGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(45, 212, 191, 0.35); }
  50% { box-shadow: 0 0 20px rgba(45, 212, 191, 0.6), 0 0 40px rgba(132, 204, 22, 0.2); }
}
.hero-progress__value { animation: progressGlow 3s ease-in-out infinite; }

/* Blinking dot */
@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(132, 204, 22, 0.6); }
  50% { opacity: 0.5; box-shadow: 0 0 4px rgba(132, 204, 22, 0.3); }
}
.hero-badge__dot { animation: dotPulse 2s ease-in-out infinite; }

/* Subtle shimmer across hero card */
@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}
.hero-device--desktop::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  animation: shimmer 6s ease-in-out infinite;
  pointer-events: none;
}

/* ===== Login page animations ============================================= */

/* Floating particles background */
@keyframes loginParticle {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(40px) scale(0.5); opacity: 0; }
}

.login-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(132, 204, 22, 0.4);
  pointer-events: none;
  animation: loginParticle linear infinite;
}

/* Animated gradient background for login */
@keyframes loginGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.login-bg-animated {
  background-size: 200% 200%;
  animation: loginGradientShift 12s ease-in-out infinite;
}

/* Login card entrance */
@keyframes loginCardEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card-animate {
  animation: loginCardEnter 0.6s ease-out both;
}
.login-card-animate-delay {
  animation: loginCardEnter 0.6s ease-out 0.2s both;
}

/* Subtle floating for login orbs */
@keyframes loginOrb {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  25% { transform: translate(15px, -20px) scale(1.05); opacity: 0.8; }
  50% { transform: translate(-10px, 10px) scale(1.1); opacity: 0.6; }
  75% { transform: translate(20px, 5px) scale(0.95); opacity: 0.75; }
}

/* ===== Celebration system ================================================ */

@keyframes confettiFall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
@keyframes confettiSway {
  0%, 100% { margin-left: 0; }
  25% { margin-left: 15px; }
  75% { margin-left: -15px; }
}
@keyframes celebratePulse {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes celebrateBannerSlide {
  from { transform: translateX(-50%) translateY(-40px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 12px;
  animation: confettiFall linear forwards, confettiSway 1s ease-in-out infinite;
}

.confetti-piece--circle {
  border-radius: 50%;
}
.confetti-piece--rect {
  border-radius: 2px;
  width: 8px;
  height: 14px;
}
.confetti-piece--star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  width: 14px;
  height: 14px;
}
/* Soccer ball confetti */
.confetti-piece--ball {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 30%, #e5e7eb 50%, #9ca3af 70%);
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: inset -2px -2px 4px rgba(0,0,0,0.1);
}

.celebrate-banner {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  pointer-events: none;
  animation: celebrateBannerSlide 0.5s ease-out 0.3s both;
  text-align: center;
  background: rgba(2, 8, 20, 0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 1.5rem 2.5rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  white-space: nowrap;
}
.celebrate-banner__text {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  font-size: 3rem;
  color: #bef264;
  text-shadow: 0 2px 12px rgba(132,204,22,0.4);
  animation: celebratePulse 0.6s ease-out 0.5s both;
}
.celebrate-banner__sub {
  font-size: 1rem;
  color: rgba(226,232,240,0.85);
  margin-top: 0.5rem;
  animation: celebratePulse 0.6s ease-out 0.8s both;
}

/* ===== Phase 1 UI Improvements ===== */

/* Focus Indicators for Accessibility */
*:focus-visible {
  outline: 2px solid #84cc16;
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #84cc16;
  outline-offset: 2px;
}

.nav-link:focus-visible {
  outline: 2px solid #84cc16;
  outline-offset: -2px;
}

/* Loading States */
.loading-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.loading-spinner--lg { width: 2.5rem; height: 2.5rem; border-width: 3px; }
.loading-spinner--sm { width: 1rem; height: 1rem; border-width: 2px; }
.loading-spinner--lime { border-color: rgba(132, 204, 22, 0.3); border-top-color: #84cc16; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading-skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 1rem; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.5rem; width: 60%; margin-bottom: 1rem; }
.skeleton-card { height: 8rem; width: 100%; }

/* Mobile Navigation */
[data-mobile-nav-overlay] { transition: opacity 0.3s ease-out; }
[data-mobile-nav-overlay].hidden { opacity: 0; pointer-events: none; }
[data-mobile-nav-drawer] { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }

/* Button States */
button:active, .btn:active { transform: scale(0.98); }
button:disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Smooth Transitions */
.transition-smooth { transition: all 0.2s ease-in-out; }

/* ── Print styles (drill detail + saved drills list) ────────────────────── */
@media print {
  /* Page margins */
  @page { margin: 1.2cm 1.5cm; }

  /* Hide chrome & interactive elements */
  nav, header.print-hide, .print-hide,
  button, [onclick], form,
  .drill-fav-btn { display: none !important; }

  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 10pt;
  }
  a { color: inherit !important; text-decoration: none !important; }

  /* ── KEY FIX: backdrop-filter makes sections invisible in print ── */
  * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* All dark cards/sections → white */
  .rounded-3xl, .rounded-2xl, section,
  [class*="bg-night"], [class*="bg-white\/5"] {
    background: #fff !important;
    border-color: #e5e7eb !important;
    box-shadow: none !important;
  }

  /* Text colours */
  .text-white, .text-white\/80, .text-white\/75, .text-white\/70 { color: #111 !important; }
  .text-white\/50, .text-white\/55, .text-white\/60 { color: #555 !important; }
  .text-white\/40 { color: #888 !important; }

  /* ── Shrink animation to compact field thumbnail ── */
  .print-anim-wrap {
    max-height: 90px !important;
    height: 90px !important;
    aspect-ratio: unset !important;
  }
  /* Pause SVG animations — renders as a static snapshot */
  .print-anim-wrap svg * { animation-play-state: paused !important; }
  /* Lighten the dark green field for printing */
  .print-anim-wrap svg rect[fill="#0f3b21"] { fill: #d1fae5 !important; }
  .print-anim-wrap svg circle[fill="#84cc16"] { fill: #15803d !important; }
  .print-anim-wrap svg circle[fill="rgba(255,255,255,0.7)"],
  .print-anim-wrap svg circle[fill="rgba(255,255,255,0.65)"],
  .print-anim-wrap svg circle[fill="rgba(255,255,255,0.75)"] { fill: #6b7280 !important; }

  /* ── Tighten spacing so everything fits on one page ── */
  .space-y-6 > * + * { margin-top: 0.5rem !important; }
  .space-y-2\.5 > * + * { margin-top: 0.3rem !important; }
  .px-6 { padding-left: 0.65rem !important; padding-right: 0.65rem !important; }
  .py-5 { padding-top: 0.4rem !important; padding-bottom: 0.4rem !important; }
  .mb-3 { margin-bottom: 0.3rem !important; }
  .mb-4 { margin-bottom: 0.35rem !important; }
  .mt-2 { margin-top: 0.2rem !important; }

  /* Heading sizes */
  h1.text-3xl { font-size: 16pt !important; }

  /* Drill detail: single column */
  .drill-detail-grid { display: block !important; }

  /* Studio grid: single column for printing saved drills */
  #drill-grid { display: block !important; }
  .drill-card {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 20pt;
    border: 1pt solid #d1d5db !important;
    background: #fff !important;
  }

  /* TactIQ print header */
  body::before {
    content: "TactIQ \2014  Drill Library";
    display: block;
    font-size: 9pt;
    color: #9ca3af;
    border-bottom: 1pt solid #e5e7eb;
    padding-bottom: 5pt;
    margin-bottom: 10pt;
    font-family: sans-serif;
  }
}
