:root{
  --bg: #000000;
  --fg: #ffffff;
  --gold: #ffd54a;
  --muted: #9aa0a6;
  --card: #0a0a0a;
  --line: #1a1a1a;
  --shadow: 0 12px 30px rgba(0,0,0,0.4);
  --overlay: rgba(0,0,0,0.65);
}

*{ box-sizing: border-box; }
html,body{ height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

a{ color: var(--gold); text-decoration: none; }
a:hover{ text-decoration: underline; }

.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.profile-page .wrap{
  max-width: 1100px;
}

header.topbar{
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.brand{
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-logo{
  height: 56px;
  width: 56px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.brand-title{
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-sub{
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  opacity: 0.8;
}

.nav{
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #101010;
  color: var(--fg);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.btn:hover{
  text-decoration: none;
  border-color: var(--gold);
}

.btn-gold,
.btn.gold{
  background: var(--gold);
  color: #111111;
  border-color: var(--gold);
}

.btn-danger{
  background: #ff5a5f;
  color: #111111;
  border-color: #ff5a5f;
}

.btn.ghost{ background: transparent; }

.btn-sm{
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.1;
}

.hero{
  margin: 16px 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}

.hero h1{
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.hero p{
  margin: 0;
  color: var(--muted);
}

.row,
.grid{
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.grid + .grid,
.row + .row{
  margin-top: 16px;
}

.admin-event-columns{
  flex-wrap: nowrap;
}

.admin-event-columns .card.third{
  flex: 0 0 33.333%;
  min-width: 0;
}

.admin-event-columns .card.two-thirds{
  flex: 0 0 66.666%;
  min-width: 0;
}

.col,
.card.half{
  flex: 1 1 320px;
}

.profile-edit-col{
  flex: 0 0 528px;
  max-width: 528px;
  min-width: 320px;
}

.profile-side-col{
  flex: 0 0 528px;
  max-width: 528px;
  min-width: 320px;
}

.profile-row{
  flex-wrap: nowrap;
}

@media (max-width: 980px){
  .profile-row{
    flex-wrap: wrap;
  }

  .profile-edit-col,
  .profile-side-col{
    flex: 1 1 100%;
    max-width: 100%;
  }
}

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

.kv{
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
}

.card{
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 16px;
}

.card.invites-card{
  font-size: 14px;
}

.actions-admin-card,
.invites-admin-card{
  margin-bottom: 16px;
}

.card.full{
  flex: 1 1 100%;
}

.card.third{
  flex: 1 1 280px;
}

.card.two-thirds{
  flex: 2 1 560px;
}

.card h2{
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}

.meta{
  color: var(--muted);
  font-size: 12px;
  opacity: 0.8;
}

.batch-status.is-inactive{
  visibility: hidden;
}

.roster-count{
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}

.count{
  font-weight: 800;
}

.count-warn{
  color: var(--gold);
}

.count-ok{
  color: #33d17a;
}

.goalie-prompt{
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.goalie-prompt.is-open{
  display: flex;
}

.goalie-prompt-card{
  width: min(420px, 92vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.goalie-prompt-title{
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.goalie-prompt-actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.count-bad{
  color: #ff5a5f;
}

.tabs{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  color: var(--fg);
}

.tabs-secondary{
  padding: 6px 0 14px;
  border-bottom: 1px dashed var(--line);
}

.tabs-secondary .tab{
  font-size: 14px;
}

.tab-label{
  background: transparent;
  border-color: transparent;
  color: var(--muted) !important;
  cursor: default;
  padding-left: 0;
}

.roster-tabs{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.roster-tab{
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #101010;
  color: var(--fg);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.roster-tab.is-active{
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.roster-panel{
  display: none;
}

.roster-panel.is-active{
  display: block;
}

.tab{
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  user-select: none;
  font-size: 16px;
  color: var(--fg) !important;
}

.tabs .tab:link,
.tabs .tab:visited,
.tabs .tab:hover,
.tabs .tab:active,
.tabs a.tab,
.tabs a{
  color: var(--fg) !important;
  text-decoration: none;
}

.tab.active{
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
  color: var(--fg) !important;
}

.tab.gold{
  background: var(--gold);
  color: #111111 !important;
  border-color: var(--gold);
}

.tab-logout{
  margin-left: auto;
}

.table{
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td{
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.events-table th,
.events-table td{
  font-size: 12px;
}

.invites-admin-card .table th,
.invites-admin-card .table td{
  font-size: 13px;
  white-space: nowrap;
}

.invites-admin-card .invite-row-action{
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.1;
}

.roster-admin-card .table th,
.roster-admin-card .table td{
  font-size: 13px;
}

.roster-admin-card .btn{
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.1;
}

.paid-toggle{
  margin-left: 0;
  border-color: #3a3a3a;
}

.paid-toggle.is-active{
  background: var(--gold);
  border-color: var(--gold);
  color: #111111;
}

.present-toggle{
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid var(--line, #1a1a1a);
  background: transparent;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.present-toggle.is-active{
  background: var(--gold);
  border-color: var(--gold);
  color: #111111;
}

.present-toggle.is-active::after{
  content: "✓";
}

.roster-guest-row td{
  background: rgba(255, 255, 255, 0.02);
}

.roster-guest-name{
  padding-left: 18px;
}

.table th{
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table-wrap{
  max-height: 520px;
  overflow: auto;
}

.invite-table-wrap{
  max-height: 260px;
  overflow: auto;
}

/* In the admin manage-event two-column layout, let the invite list consume
   remaining card height before it starts scrolling. */
.admin-event-columns .invites-admin-card{
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.admin-event-columns .invites-admin-card .invite-table-wrap{
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.rsvp-choice-buttons{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.message-list{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.message-scroll{
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.message-item{
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #0c0c0c;
}

.message-meta{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.message-author{
  font-weight: 600;
  color: var(--fg);
}

.message-body{
  margin-top: 6px;
}

.message-image{
  display: block;
  max-width: 100%;
  max-height: 260px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.message-actions{
  margin-top: 8px;
}

.message-actions summary{
  cursor: pointer;
}

.roster-columns{
  column-count: 2;
  column-gap: 24px;
  margin-top: 8px;
}

.roster-item{
  break-inside: avoid;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

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

@media (max-width: 780px){
  .admin-event-columns{
    flex-wrap: wrap;
  }

  .admin-event-columns .card.third,
  .admin-event-columns .card.two-thirds{
    flex: 1 1 100%;
  }

  /* Keep a bounded scroll region on stacked mobile cards. */
  .admin-event-columns .invites-admin-card .invite-table-wrap{
    max-height: 260px;
  }

  .hide-mobile{
    display: none;
  }

  .roster-columns{
    column-count: 1;
  }

  .wrap{
    padding: 12px;
  }

  header.topbar{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .brand{
    gap: 12px;
  }

  .brand-logo{
    height: 48px;
    width: 48px;
  }

  .tabs{
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .tab{
    white-space: nowrap;
  }

  .tab-logout{
    margin-left: 0;
  }

  .table-wrap{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table th,
  .table td{
    padding: 6px 8px;
    font-size: 13px;
  }

  .card.two-thirds,
  .card.third{
    flex: 1 1 100%;
  }

  .profile-edit-col,
  .profile-side-col{
    flex: 1 1 100%;
    max-width: 100%;
  }

  .actions-admin-card .event-details-row > div{
    flex: 1 1 100%;
    min-width: 0;
  }

  .actions-admin-card input[type="date"],
  .actions-admin-card input[type="time"],
  .actions-admin-card input[type="text"],
  .actions-admin-card input[type="number"],
  .actions-admin-card select{
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

}

.badge{
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #0c0c0c;
}

.badge.warn{
  background: #141000;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.badge.ok{
  background: #00140a;
  border: 1px solid #33d17a;
  color: #33d17a;
}

.badge.full{
  border: 1px solid #ffffff;
  color: #ffffff;
}

.badge.need{
  background: #1a0000;
  border: 1px solid #ff5a5f;
  color: #ff5a5f;
}

.chip{
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
}

.chip.active{
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

code, pre{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  background: #0d0d0d;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

pre{
  white-space: pre-wrap;
  overflow-x: auto;
}

.footer{
  margin-top: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  opacity: 0.7;
}

hr{
  border: none;
  border-top: 1px solid var(--line);
  margin: 12px 0;
}

.lock-pill{
  font-size: 12px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  opacity: 0.8;
}

/* Forms */
form p{ margin: 12px 0; }
label{ font-weight: 700; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"],
input[type="number"], select, textarea{
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0e0e0e;
  color: var(--fg);
  box-sizing: border-box;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button{
  filter: invert(1) sepia(1) saturate(6) hue-rotate(5deg);
  opacity: 0.9;
}
input::placeholder, textarea::placeholder{ color: var(--muted); }
textarea{ resize: vertical; }
ul{ margin: 8px 0 0; padding-left: 18px; }

.guest-row{
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
}

.guest-name{ flex: 1 1 auto; }
.guest-skill{ flex: 0 0 140px; }

.guest-row input,
.guest-row select{
  height: 42px;
}

.quick-actions-wrap{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

.quick-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  max-width: 100%;
  min-width: 0;
}

.quick-actions__field{
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-actions input,
.quick-actions select{
  height: 42px;
}

.quick-actions__label-spacer{
  visibility: hidden;
}

.quick-actions__submit{
  align-self: flex-start;
}

@media (max-width: 780px){
  .quick-actions{
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
  }

  .quick-actions__field{
    width: 100%;
  }

  .quick-actions__field--submit{
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
  }

  .quick-actions__label-spacer{
    display: none;
  }

  .quick-actions input[type="date"]{
    height: 20px;
    max-width: 100%;
    width: 100%;
    min-width: 0;
  }
}

.login-overlay{
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card{
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.toggle-check{
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.toggle-check.active{
  background: var(--gold);
  color: #111111;
  transform: scale(1.02);
}
