@import "./styles/base.css";
@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap");

.notice-modal-body{
  position: relative;
  padding: 18px 18px 12px;
  border-radius: 14px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255,216,77,0.18), transparent 50%),
    radial-gradient(120% 120% at 0% 100%, rgba(86,239,172,0.14), transparent 55%),
    rgba(12,18,34,0.6);
  border: 1px solid rgba(255,255,255,0.08);
}

.notice-modal-body::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  pointer-events: none;
}

.notice-body{
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  letter-spacing: 0.1px;
}

.notice-modal-body .formActions{
  justify-content: flex-end;
  margin-top: 12px;
}

/* Grid */
.grid11 {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 4px 2px;
}

.grid6 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  padding: 6px 4px;
}

/* Force square cells on mobile */
.grid11 button.cell,
.grid6 button.cell {
  aspect-ratio: 1 / 1 !important;
  width: 100% !important;
  height: auto !important;
  padding: 8px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  font-size: clamp(0.68rem, 2.3vw, 0.9rem) !important;
}

.hdr {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  min-height: 56px;
}

.hdrStacked{
  padding: 4px 2px;
}

.hdrStack{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hdrLine{
  font-size: 0.7rem;
  line-height: 1;
}

.hdr.corner {
  background: transparent;
}

.cell {
  min-height: 54px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px;
  background: rgba(255,255,255,.04);
  display: flex;
  align-items: center;          /* ⬅ center horizontally */
  justify-content: center;      /* ⬅ center vertically */
  cursor: pointer;
  position: relative;
}

.cell small {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  opacity: 0.95;
  text-align: center;
}


.cell .name {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  opacity: 0.9;
  text-align: center;
}

.cell.avail,
.cell.available {
  background: rgba(255,255,255,.04);
}

.cell.pending {
  background: rgba(255,216,77,.28);
  border-color: rgba(255,216,77,.45);
}

.cell.paid {
  background: rgba(56,216,106,.22);
  border-color: rgba(56,216,106,.45);
}

.cell.donation {
  background: rgba(120,80,190,.35);
  border-color: rgba(231,198,95,.6);
}

.cell.donation small,
.cell.donation .name {
  color: #f6d97b;
}

.cell.mine::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  border: 2px solid rgba(120,160,255,.75);
  box-shadow: 0 0 18px rgba(120,160,255,.25);
  pointer-events: none;
}

.cell.donation-mine::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  border: 2px dashed rgba(231,198,95,.9);
  box-shadow: 0 0 16px rgba(231,198,95,.35);
  pointer-events: none;
}

.selected {
  outline: 3px solid rgba(255,255,255,.55) !important;
  box-shadow: 0 0 0 3px rgba(0,0,0,.25) inset, 0 0 18px rgba(255,255,255,.15) !important;
  transform: translateY(-1px);
}

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.legend-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.progress-meter {
  min-width: 260px;
  flex: 1;
  max-width: 420px;
  background: rgba(12,18,34,.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.progress-title {
  font-size: 12px;
  color: var(--muted);
}

.progress-pct {
  font-weight: 700;
  font-size: 14px;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(86,239,172,.9), rgba(255,216,77,.9));
  transition: width 0.4s ease;
}

.progress-milestones {
  display: none;
}

@media (max-width: 720px) {
  .legend-row {
    flex-direction: column;
    align-items: stretch;
  }
  .progress-meter {
    max-width: 100%;
  }
}

/* Team labels aligned to grid */
.team-labels {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto 1fr;
  gap: 10px 10px;
  margin: 1rem 0 2rem;
}

.away-team-label {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.4px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.55), 0 0 8px rgba(0,0,0,0.35);
  background: linear-gradient(180deg, var(--team-primary, #9ca3af) 0 50%, var(--team-secondary, #4b5563) 50% 100%);
  padding: 8px 12px;
  border-radius: 12px;
}

.team-labels .board-scroll {
  grid-column: 2;
  grid-row: 2;
}

.home-team-label {
  grid-column: 1;
  grid-row: 2;
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.55), 0 0 8px rgba(0,0,0,0.35);
  background: linear-gradient(90deg, var(--team-primary, #9ca3af) 0 50%, var(--team-secondary, #4b5563) 50% 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: none;
  padding: 10px 6px;
  height: 100%;
}

.home-team-label .team-label-text {
  display: inline-block;
  transform: rotate(180deg);
}
/* Buttons / actions */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.action-btn,
.pay-btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.action-btn {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.action-btn:disabled,
.btn:disabled,
.pay-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pay-btn {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

/* Admin panel */
.adminPanel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.adminRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Payments pills */
.payPills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.payPill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  text-decoration: none;
}

.payPill .ico {
  font-size: 16px;
}

.payPill .label {
  font-weight: 800;
  font-size: 13px;
  opacity: 0.95;
}

.payPill .value {
  font-size: 13px;
  color: var(--muted);
}

/* Forms inside modal */
.form {
  display: grid;
  gap: 8px;
}

.form input {
  background: #0f1730;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  outline: none;
}

.form input:focus {
  border-color: rgba(120,160,255,.7);
  box-shadow: 0 0 0 3px rgba(120,160,255,.15);
}

/* Modal base */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modalCard {
  width: min(560px, 96vw);
  background: rgba(18,27,47,.98);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
}

.modalHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.modalTitle {
  font-weight: 900;
  letter-spacing: 0.2px;
}

.modalClose {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.modalBody {
  padding: 14px;
}

/* Board create/edit modal: wider + scrollable body */
.modal.boardModal .modalCard {
  width: min(760px, 96vw);
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.modal.boardModal .modalBody {
  padding: 20px 22px 24px;
  max-height: calc(100dvh - 140px);
  overflow: auto;
  min-height: 0;
}

/* Allow the board modal overlay itself to scroll on small screens */
.modal.boardModal {
  align-items: flex-start;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding:
    calc(12px + env(safe-area-inset-top))
    12px
    calc(12px + env(safe-area-inset-bottom))
    12px;
}

@media (max-width: 700px) {
  .modal.boardModal .modalHead {
    padding: 12px 14px;
  }
  .modal.boardModal .modalBody {
    padding: 18px 16px 22px;
  }
}

/* Show color inputs as visible swatches */
.modal input[type="color"] {
  width: 42px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.16);
  background: transparent;
}
.modal input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.modal input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 7px;
}

/* Admin modal: wider + scrollable body */
.adminModal .modalCard {
  width: min(760px, 96vw);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.adminModal .modalBody {
  overflow-y: auto;
  max-height: calc(100vh - 140px);
}

/* Pay modal can be wider */
.payModal .modalCard {
  width: min(760px, 96vw);
}

/* Board info line */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.stat {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-value {
  font-weight: 900;
  font-size: 16px;
}

.status-open {
  color: #86efac;
}

.status-locked {
  color: #fca5a5;
}

/* Team edit inputs (admin) */
.teamEdit {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.teamEdit input {
  background: #0f1730;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  min-width: 220px;
}

/* Small screens */
@media (max-width: 700px) {
  .wrap {
    padding: 12px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .counts {
    width: 100%;
    margin-left: 0;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .team-labels {
    grid-template-columns: 44px 1fr;
    gap: 8px 8px;
  }
}
/* =========================================================
   Mobile board UX upgrades (scroll + zoom + highlight)
   Works with app.js setupZoomUI() wrapper
   ========================================================= */

.board-scroll{
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 6px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);

  /* allow scroll; pinch handled by JS */
  touch-action: pan-x pan-y;
}

.board-scroll::-webkit-scrollbar{ height: 10px; }
.board-scroll::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}
.board-scroll::-webkit-scrollbar-track{
  background: rgba(0,0,0,0.12);
  border-radius: 999px;
}

.board-zoom{
  transform-origin: 0 0;
  width: max-content;
}

.zoom-controls{
  position: sticky;
  bottom: 10px;
  display: flex;
  gap: 10px;
  justify-content: center;
  z-index: 60;
  margin-top: 10px;
  padding-bottom: 6px;
}

.zoom-controls button{
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  min-width: 72px;
}

/* Row/Col highlight */
.hdr.hl{
  outline: 2px solid rgba(255,255,255,0.55);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.10);
}

.cell.focused{
  outline: 3px solid rgba(120,180,255,0.95);
  box-shadow: 0 0 0 5px rgba(120,180,255,0.18);
}

.cell.owner-hover{
  outline: 3px solid rgba(90,210,255,0.9);
  box-shadow: 0 0 0 5px rgba(90,210,255,0.2);
}

/* Make the grid NOT shrink on mobile: switch to fixed-size cells so it scrolls */
.grid11{
  --cell: 56px;
  --gap: 10px;

  grid-template-columns: repeat(11, var(--cell)) !important;
  gap: var(--gap) !important;

  width: max-content !important;
  min-width: calc(11 * var(--cell) + 10 * var(--gap)) !important;

  padding: 6px 4px !important;
}

.grid6{
  --cell: 64px;
  --gap: 12px;

  grid-template-columns: repeat(6, var(--cell)) !important;
  gap: var(--gap) !important;

  width: max-content !important;
  min-width: calc(6 * var(--cell) + 5 * var(--gap)) !important;

  padding: 6px 4px !important;
}

@media (max-width: 380px){
  .grid11{ --cell: 50px; --gap: 9px; }
  .grid6{ --cell: 56px; --gap: 10px; }
}

/* Keep headers & cells consistently square */
.hdr,
.cell{
  width: var(--cell);
  height: var(--cell);
  min-height: unset !important;
  aspect-ratio: 1 / 1 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 14px;
}

/* Header contrast */
.hdr{
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.10);
  font-weight: 900;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 10px rgba(0,0,0,0.45);
}

.hdr.corner{
  background: transparent;
  border: none;
}

/* Square text styling (coords + initials) */
.sqTop{
  font-size: 0.78rem;
  opacity: 0.75;
  font-weight: 800;
  line-height: 1;
}

.sqBottom{
  font-weight: 900;
  letter-spacing: 0.5px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 12px rgba(0,0,0,0.55);
  line-height: 1;
}

.cell.hasScoreOverlay .sqTop{
  display: none;
}

.cell.hasScoreOverlay .sqBottom{
  position: relative;
  z-index: 2;
}

.sqScores{
  position: absolute;
  inset: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  z-index: 1;
  pointer-events: none;
  font-size: clamp(0.55rem, 2vw, 0.8rem);
  font-weight: 900;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.sqScores.half{
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
}

.sqScore{
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f0f4ff;
  font-weight: 600;
  opacity: 0.92;
}

/* Make selection still very obvious */
.selected{
  outline: 3px solid rgba(255,255,255,.60) !important;
  box-shadow: 0 0 0 3px rgba(0,0,0,.25) inset, 0 0 18px rgba(255,255,255,.15) !important;
  transform: translateY(-1px);
}

/* Slightly nicer tap feel */
.cell{
  -webkit-tap-highlight-color: transparent;
}

.cell:active{
  transform: translateY(1px);
}
/* =========================================================
   FIX: Board info boxes (matches your index.html)
   HTML uses .board-details .stats-grid .stat-item
   ========================================================= */

.board-info .board-details{
  margin-top: 10px;
}

.board-select{
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.board-select-input{
  background: #0f1730;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.board-select-input:hover{
  border-color: rgba(255,255,255,0.5);
}

.board-select-input:focus{
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255,216,77,0.18);
  outline: none;
}

.board-helper{
  font-size: 11px;
  color: var(--muted);
  opacity: 0.9;
}

.board-info .board-title{
  font-weight: 900;
  font-size: 16px;
  margin: 8px 0 10px;
  color: var(--text);
}

/* 5-up grid like your original boxes */
.stats-grid{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* each box */
.stat-item{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
}

/* labels + values */
.stat-item .stat-label{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-item .stat-value{
  font-weight: 900;
  font-size: 16px;
}

/* status colors */
.stat-item .status-open{ color: #86efac; }
.stat-item .status-locked{ color: #fca5a5; }

/* count colors (optional, nice touch) */
.stat-item .available{ color: #e5e7eb; }
.stat-item .unpaid{ color: var(--yellow); }
.stat-item .paid{ color: var(--green); }

/* Profile: admin active boards cards */
.admin-boards-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-board-card{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
}

@media (max-width: 900px){
  .admin-boards-grid{ grid-template-columns: 1fr; }
}

/* Responsive: stack nicely on phones */
@media (max-width: 900px){
  .stats-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 600px){
  .stats-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
/* =========================================
   Board footer bar (moves Selected/Submit/Clear to bottom)
   ========================================= */

.board-footer{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center; /* centered by default */
}

/* Bottom actions row: tighter + cleaner */
.actions-row.actions-row--bottom{
  margin-top: 0;                 /* override the global margin-top */
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Make "Selected: X" look like a pill */
.selected-count{
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  font-weight: 800;
  letter-spacing: 0.2px;
}

/* Slightly smaller buttons so they don’t fight the board */
.actions-row.actions-row--bottom .btn{
  padding: 8px 12px;
  border-radius: 999px;
}

/* =========================================
   Zoom controls: shrink them (only applies if your zoom area has .zoom-controls)
   ========================================= */
.zoom-controls{
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.zoom-controls button,
.zoom-controls .btn{
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  min-height: 34px;
}

/* If your zoom has a "Reset" button, keep it slightly wider but still compact */
.zoom-controls button.zoom-reset,
.zoom-controls .zoom-reset{
  padding: 6px 14px;
}
/* =========================================
   CLEAN ZOOM CONTROLS (small + subtle)
   ========================================= */

.zoom-controls{
  position: static;          /* stop floating */
  margin-top: 6px;
  padding-bottom: 0;
  gap: 6px;
}

.zoom-controls button{
  min-width: auto;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
}

.zoom-controls button:hover{
  opacity: 1;
}
/* =========================================
   BOARD FOOTER (single clean control area)
   ========================================= */

.board-footer{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.10);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.actions-row--bottom{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.selected-count{
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  font-weight: 800;
  font-size: 12px;
}

.pay-all{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pay-all .btn{
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

.pay-all-hint{
  font-size: 11px;
  color: var(--muted);
  opacity: 0.9;
}
/* Prevent background scroll when modal is open */
body.modal-open{
  position: fixed;
  width: 100%;
  overflow: hidden;
}
/* =========================================================
   Mobile Pay Modal scroll fix
   Keeps header visible, body scrolls, honors safe areas
   Paste at VERY BOTTOM of styles.css
   ========================================================= */

/* Overlay should allow scrolling on mobile when needed */
#payModal.modal{
  align-items: flex-start; /* important: prevents "stuck center" scroll */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding:
    calc(12px + env(safe-area-inset-top))
    12px
    calc(12px + env(safe-area-inset-bottom))
    12px;
}

/* Card becomes a flex column and clamps to the visible viewport */
#payModal .modalCard{
  margin: auto; /* centers within the overlay padding */
  display: flex;
  flex-direction: column;
  width: min(760px, 96vw); /* matches your existing intent */
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

/* Make the body the scroll container (not the whole card) */
#payModal .payModalBody{
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0; /* REQUIRED for flex children to scroll */
}

/* Optional: tighten header spacing slightly on small screens */
@media (max-width: 700px){
  #payModal .modalHead{
    padding: 10px 12px;
  }
}
/* Payout cards row: keep them as real cards */
.payoutBar{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 10px;
}

/* Payout cards: force a tall card layout */
.payoutPill{
  --payoutColor: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 14px 14px 12px;
  min-height: 68px;          /* ✅ prevents "thin strip" */
  display: flex;             /* ✅ keeps label + amount stacked */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;

  background: color-mix(in srgb, var(--payoutColor) 18%, rgba(255,255,255,0.06));
  border-color: color-mix(in srgb, var(--payoutColor) 55%, rgba(255,255,255,0.14));
  box-shadow: 0 10px 22px rgba(0,0,0,0.28);
}

/* Text sizing (keeps the "card" feel) */
.payoutPill .lbl{
  font-size: 12px;
  letter-spacing: 0.12em;
  opacity: 0.85;
  font-weight: 800;
}

.payoutPill .amt{
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 18px rgba(0,0,0,0.35);
}



.payoutPill.final{
  background: rgba(56, 216, 106, 0.14);
  border-color: rgba(56,216,106,0.45);
}

@media (max-width: 520px){
  .payoutBar{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#claimSelectedBtn{
  background: rgba(56,216,106,0.22) !important;
  border: 1px solid rgba(56,216,106,0.50) !important;
  color: rgba(255,255,255,0.95) !important;
  font-weight: 900 !important;
  box-shadow: 0 10px 24px rgba(0,0,0,0.30);
}

#claimSelectedBtn:disabled{
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.10) !important;
  color: rgba(255,255,255,0.40) !important;
  box-shadow: none !important;
}
/* Sticky action bar on mobile */
@media (max-width: 820px){
  .actions, .actionRow, #actionsBar{
    position: sticky;
    bottom: 0;
    z-index: 80;
    background: rgba(10,16,30,0.86);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.10);
    padding: 10px 10px 14px;
  }
}
/* ── Admin: board management UI ───────────────────────────── */
.admin-divider{
  margin: 1.1rem 0 0.9rem;
  border-top: 1px solid var(--border);
  opacity: 0.9;
}
.admin-board-actions{
  gap: .65rem;
  flex-wrap: wrap;
}

/* ── Modal form layout helpers ─────────────────────────────── */
.formGrid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem .9rem;
}
.formGrid .full{ grid-column: 1 / -1; }
.formGrid label{
  display:block;
  font-size:.9rem;
  opacity:.9;
  margin:0 0 .35rem;
}
.formGrid input, .formGrid select, .formGrid textarea{
  width:100%;
  padding:.65rem .7rem;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: #fff;
  outline: none;
}
.formGrid textarea{
  min-height: 92px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .9rem;
}
.formActions{
  display:flex;
  gap:.6rem;
  justify-content:flex-end;
  margin-top: .9rem;
  flex-wrap: wrap;
}
.btn.danger{
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
@media (max-width: 720px){
  .formGrid{ grid-template-columns: 1fr; }
}
/* ===== Fundraiser Hero (Purple/Black first, subtle Gold accent) ===== */
:root{
  --purple: #7c3aed;   /* rich purple */
  --gold: #f5c542;     /* warm gold */
}

/* fundraiser hero styling */
.fundraiser-hero .hero-title{
  font-weight: 950;
  font-size: 18px;
  letter-spacing: 0.2px;
  color: var(--purple);                 /* ✅ purple primary */
}

.fundraiser-hero .hero-sub{
  margin-top: 6px;
  color: var(--text);
  opacity: 0.9;
  font-size: 13px;
  line-height: 1.4;
}

/* Studio badge/link: purple frame, muted gold text only */
.studio-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124,58,237,0.40);
  background: rgba(124,58,237,0.08);
  color: rgba(245,197,66,0.85);         /* ✅ subtle gold accent */
  font-weight: 800;
  font-size: 12px;
  text-decoration: none;
}

.studio-badge:hover{
  background: rgba(124,58,237,0.15);
  text-decoration: none;
}

.fundraiser-hero .hero-card{
  border: 1px solid rgba(124,58,237,0.35);
  background: rgba(124,58,237,0.06);
}

.fundraiser-hero .hero-card-title{
  color: var(--purple);                 /* ✅ purple headings */
  font-weight: 900;
}

/* Keep jump button mostly purple/black; tiny gold only on hover */
.hero-jump{
  border: 1px solid rgba(124,58,237,0.55);
}

.hero-jump:hover{
  border-color: rgba(245,197,66,0.55);
}

/* keep mobile layout clean */
@media (max-width: 800px){
  .fundraiser-hero .hero-grid{ grid-template-columns: 1fr; }
}

/* ===== Help / How-to toggle ===== */
.help-toggle{
  margin-top: 10px;
  border-radius: 999px;
  width: 100%;
}

@media (min-width: 801px){
  .help-toggle{
    width: auto;
  }
}

/* Collapsible help content */
#helpContent{
  overflow: hidden;
  transition: max-height 220ms ease, opacity 220ms ease, transform 220ms ease;
  max-height: 1200px; /* large enough to show fully */
  opacity: 1;
  transform: translateY(0);
}

#helpContent.is-collapsed{
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  margin-top: 0;
}
/* =========================================
   Floating / Sticky Action Bar
   ========================================= */

.actions-bar {
  transition: transform 200ms ease, opacity 200ms ease;
}

/* Mobile behavior */
@media (max-width: 820px) {
  .actions-bar {
    position: sticky;
    bottom: 0;
    z-index: 90;
    background: rgba(10,16,30,0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.12);
    padding:
      10px
      12px
      calc(10px + env(safe-area-inset-bottom))
      12px;
  }

  .actions-bar.hidden {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
  }
}
/* Payout legend chips */
.payoutLegend{
  width:100%;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:6px;
}

.payoutChip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  font-size:12px;
  font-weight:800;
}

.payoutChip .sw{
  width:12px;
  height:12px;
  border-radius:4px;
  display:inline-block;
}

.payoutChip .tx{
  opacity:.95;
}

/* Winner outline: like "Your square" but color-coded */
.cell.win{
  position: relative;
}

.cell.win::after{
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  border: 2px solid color-mix(in srgb, var(--winOutline, #f5c542) 85%, rgba(255,255,255,0.2));
  box-shadow: 0 0 18px color-mix(in srgb, var(--winOutline, #f5c542) 35%, transparent);
  pointer-events: none;
}


.winBadges{
  position:absolute;
  top:6px;
  right:6px;
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  justify-content:flex-end;
  max-width: 85%;
  pointer-events:none;
}

.winBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 6px;
  border-radius:999px;
  font-size:10px;
  font-weight:900;
  color:#0b1220;
  border: 1px solid rgba(255,255,255,0.25);
  text-transform: uppercase;
  letter-spacing: .2px;
}

/* Small admin modal button style */
.btn.danger{
  background: rgba(239,68,68,0.18);
  border-color: rgba(239,68,68,0.35);
}
/* =========================================================
   Printable / Shareable Board View (board.html)
   ========================================================= */

body.board-view{
  background: #f5f2ea;
  color: #111111;
}

.board-view .wrap{
  max-width: 980px;
  padding: 26px 22px 32px;
}

.boardview-hero{
  font-family: "Times New Roman", Times, serif;
  font-size: 34px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.board-view .boardview-header{
  text-align: center;
  margin-bottom: 14px;
}

.boardview-header{
  margin-bottom: 12px;
}

.boardview-title{
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 6px;
}

.boardview-meta{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: #333333;
  font-size: 12px;
  justify-content: center;
}

.boardview-actions{
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.board-view .boardview-actions .btn{
  background: #f2f2f2;
  color: #111111;
  border: 1px solid #b9b9b9;
  border-radius: 6px;
}

.bvPayouts{
  margin-top: 10px;
  color: #111111;
  font-size: 12px;
  line-height: 1.6;
}

.bvMessage{
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #c9c9c9;
  border-radius: 6px;
  background: #f7f7f7;
  color: #111111;
  font-size: 13px;
}

.bvFooter{
  margin-top: 10px;
  color: #333333;
  font-size: 12px;
}

.board-view .panel{
  background: #ffffff;
  border: 2px solid #111111;
  border-radius: 0;
  box-shadow: none;
}

.board-view .board-scroll{
  background: #ffffff;
  border: 1px solid #111111;
  padding: 0;
  border-radius: 0;
}

.board-view .grid11,
.board-view .grid6{
  gap: 0;
  padding: 0;
}

.board-view .hdr,
.board-view .cell{
  border-radius: 0;
  border: 1px solid #111111;
  background: #ffffff;
  color: #111111;
  box-shadow: none;
}

.board-view .hdr{
  font-weight: 900;
}

.board-view .cell small{
  color: #111111;
  opacity: 0.7;
}

.board-view .cell .name{
  color: #111111;
}

.board-view .payoutBar{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.board-view .payoutPill{
  background: #f4f4f4;
  border: 1px solid #111111;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  padding: 8px 10px;
}

.board-view .payoutPill .lbl{
  color: #111111;
}

.board-view .payoutPill .amt{
  color: #111111;
  font-size: 16px;
}

/* In board view, show the participant name more prominently */
.board-view .cell .name{
  position: static;
  transform: none;
  font-size: 0.72rem;
  opacity: 0.95;
  text-align: center;
  line-height: 1.1;
  margin-top: 2px;
  padding: 0 2px;
  word-break: break-word;
}

.board-view .cell small{
  font-size: 0.75rem;
  opacity: 0.75;
}

/* Print rules (8.5x11 landscape, grayscale-safe, minimal UI) */
@media print{
  @page{
    size: letter landscape;
    margin: 0.35in;
  }
  :root{
    --bg: #ffffff;
    --card: #ffffff;
    --text: #000000;
    --muted: #000000;
    --border: rgba(0,0,0,0.55);
  }

  body{
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
  }

  .no-print{
    display: none !important;
  }

  .wrap{
    max-width: none;
    padding: 0;
  }

  .boardview-header{
    margin-bottom: 4pt !important;
  }

  .boardview-hero{
    font-size: 16pt !important;
    letter-spacing: 1.6pt !important;
    margin-bottom: 2pt !important;
  }

  .boardview-title{
    font-size: 12pt !important;
    margin-bottom: 2pt !important;
  }

  .boardview-meta{
    font-size: 8pt !important;
  }

  .panel{
    background: #ffffff !important;
    border: 1px solid #000000 !important;
    padding: 4pt !important;
  }

  /* Make the grid fit nicely on paper */
  .grid11{
    --cell: 0.55in;
    --gap: 0.03in;
    grid-template-columns: repeat(11, var(--cell)) !important;
    gap: var(--gap) !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }

  .grid6{
    --cell: 0.85in;
    --gap: 0.04in;
    grid-template-columns: repeat(6, var(--cell)) !important;
    gap: var(--gap) !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }

  .board-scroll{
    overflow: visible !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .hdr, .cell{
    border: 1px solid rgba(0,0,0,0.75) !important;
    background: transparent !important;
    color: #000000 !important;
    box-shadow: none !important;
  }

  .hdr.corner{
    border: none !important;
  }

  /* Remove color fills (grayscale-safe) */
  .cell.pending, .cell.paid, .cell.avail, .cell.available{
    background: transparent !important;
  }

  /* Keep 'mine' outline from affecting print */
  .cell.mine::after,
  .cell.win::after{
    box-shadow: none !important;
  }

  .board-view .cell .name{
    font-size: 7pt;
    opacity: 1;
  }

  .board-view .cell small{
    font-size: 6pt;
  }

  /* Make team labels printable */
  .away-team-label,
  .home-team-label{
    color: #000000 !important;
    font-size: 10pt !important;
  }
  .bvPayouts{
    font-size: 8pt !important;
    margin-top: 3pt !important;
  }
  .bvMessage{
    font-size: 8pt !important;
    padding: 4pt 6pt !important;
    margin-top: 4pt !important;
  }
}


/* =========================================================
   Squares4U portal layout
   ========================================================= */

.portal-hero{
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(61, 214, 198, 0.18), transparent 55%),
    radial-gradient(120% 120% at 100% 0%, rgba(241, 178, 74, 0.18), transparent 55%),
    linear-gradient(135deg, rgba(11, 18, 32, 0.95), rgba(18, 28, 50, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.portal-hero::before,
.portal-hero::after{
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  z-index: 0;
}

.portal-hero::before{
  background: rgba(61, 214, 198, 0.25);
  top: -140px;
  left: -90px;
}

.portal-hero::after{
  background: rgba(241, 107, 74, 0.22);
  bottom: -160px;
  right: -90px;
}

.portal-hero-grid{
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 18px;
}

.portal-hero-main{
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.portal-eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

.portal-hero .hero-title{
  font-family: "Fraunces", "Times New Roman", serif;
  font-weight: 800;
  font-size: clamp(26px, 3.4vw, 40px);
  color: #f8fbff;
  margin-top: 8px;
  letter-spacing: 0.2px;
}

.portal-hero .hero-sub{
  font-size: 15px;
  line-height: 1.6;
  color: rgba(232, 238, 252, 0.85);
  margin-top: 8px;
}

.portal-cta-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.portal-cta{
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}

.portal-outline{
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.portal-ghost{
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.portal-micro{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(232, 238, 252, 0.65);
}

.portal-hero-card{
  background: rgba(8, 12, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.portal-hero-card-title{
  font-family: "Fraunces", "Times New Roman", serif;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 8px;
}

.portal-hero-stats{
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.portal-stat{
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
}

.portal-stat-label{
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.portal-stat-value{
  margin-top: 4px;
  font-weight: 700;
  color: #e8eefc;
}

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

.hero-card{
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
}

.hero-card-title{
  font-family: "Fraunces", "Times New Roman", serif;
  font-weight: 700;
  margin-bottom: 6px;
}

.hero-steps,
.hero-bullets{
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(232, 238, 252, 0.8);
}

.hero-note{
  margin-top: 8px;
  font-size: 11px;
  color: rgba(232, 238, 252, 0.6);
}

.portal-section-head{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.portal-board-grid{
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portal-board-card{
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  background: rgba(15, 22, 40, 0.7);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-board-head{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.portal-board-title{
  font-weight: 800;
  font-size: 16px;
}

.portal-board-meta{
  font-size: 12px;
  color: rgba(232, 238, 252, 0.7);
}

.portal-board-price{
  font-weight: 800;
  font-size: 14px;
  color: rgba(241, 178, 74, 0.9);
}

.portal-board-kickoff{
  font-size: 12px;
  color: rgba(232, 238, 252, 0.75);
}

.portal-board-progress-head{
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(232, 238, 252, 0.6);
}

.portal-board-progress-bar{
  margin-top: 6px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.portal-board-progress-bar span{
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(61, 214, 198, 0.9), rgba(241, 178, 74, 0.9));
}

.portal-board-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-info-grid{
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portal-info-card{
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
}

.portal-info-title{
  font-weight: 700;
  margin-bottom: 6px;
}

@keyframes portal-rise{
  from{
    opacity: 0;
    transform: translateY(12px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

.portal-hero,
.portal-board-card,
.portal-info-card{
  animation: portal-rise 500ms ease both;
}

@media (max-width: 980px){
  .portal-hero-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 860px){
  .portal-board-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-info-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 600px){
  .portal-board-grid,
  .portal-info-grid{ grid-template-columns: 1fr; }
}

.portal-boards,
.portal-info{
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.portal-boards h2,
.portal-info h2{
  font-family: "Fraunces", "Times New Roman", serif;
  font-weight: 700;
}
