/* Area styles: owned by the accounts sweep (story 3, U35). Tokens only. */

/* Club home: area cards */
.wm-area-card { position: relative; margin: 0; padding: var(--wm-space-4); font-family: var(--wm-font-heading); font-size: var(--wm-text-lg); transition: box-shadow .15s, border-color .15s; }
.wm-area-card:hover { box-shadow: var(--wm-shadow-2); border-color: var(--wm-text-muted); }
.wm-area-card a { color: var(--wm-text); text-decoration: none; display: flex; align-items: center; min-height: var(--wm-size-touch); }
.wm-area-card:focus-within { outline: var(--wm-focus-outline); outline-offset: var(--wm-space-1); }
.wm-area-card a:focus-visible { outline: none; }

/* Sign-in and password pages */
.wm-auth-card { max-width: var(--wm-size-narrow); margin: var(--wm-space-6) auto; padding: var(--wm-space-5); background: var(--wm-surface-raised); border: 1px solid var(--wm-border); border-radius: var(--wm-radius-lg); box-shadow: var(--wm-shadow-1); }
.wm-auth-brand { margin: 0 0 var(--wm-space-2); font-size: var(--wm-text-lg); color: var(--wm-accent); }
.wm-auth-tagline { margin: 0 0 var(--wm-space-3); font-size: var(--wm-text-sm); color: var(--wm-text-muted); }
.wm-auth-card .wm-page-header { margin-bottom: var(--wm-space-4); }
.wm-auth-card .form-text ul { margin: var(--wm-space-1) 0 0; padding-left: var(--wm-space-4); color: var(--wm-text-muted); }
.wm-auth-card .form-text li + li { margin-top: var(--wm-space-1); }
.wm-auth-card .wm-form-actions .btn { flex: 1 1 100%; }

/* Tables */
.wm-badge-row { display: flex; flex-wrap: wrap; gap: var(--wm-space-1); align-items: center; }
.wm-badge-row .wm-badge { white-space: nowrap; }
.wm-msg-col { min-width: 16rem; }
.wm-muted-line { color: var(--wm-text-muted); font-size: var(--wm-text-sm); }
.wm-granted { margin-top: var(--wm-space-2); color: var(--wm-text-muted); font-size: var(--wm-text-sm); }
.wm-granted ul { margin: 0; padding-left: var(--wm-space-4); }

/* Inbox */
.wm-inline-form .form-select { width: auto; min-width: 6rem; }
.wm-narrow-block { max-width: var(--wm-size-form); }

/* Inbox bulk actions: hide the bulk bar until at least one row is checked.
   :has() keeps this HTMX-safe (no load-time-only JS); #inbox-list is re-swapped on refresh. */
#inbox-bulk-bar { display: none; }
#inbox-bulk-area:has(tbody input[name="message_ids"]:checked) #inbox-bulk-bar { display: block; }

/* One-time passwords */
.wm-temp-secret { font-family: var(--wm-font-body); display: flex; gap: var(--wm-space-3); align-items: flex-start; padding: var(--wm-space-4); margin-bottom: var(--wm-space-4); background: var(--wm-warning-bg); color: var(--wm-warning); border: 1px solid var(--wm-warning); border-radius: var(--wm-radius-md); }
.wm-temp-secret p { margin: 0 0 var(--wm-space-1); }
.wm-temp-code { display: inline-block; padding: var(--wm-space-1) var(--wm-space-2); font-size: var(--wm-text-xl); color: var(--wm-text); background: var(--wm-surface-raised); border-radius: var(--wm-radius-sm); word-break: break-all; user-select: all; }
.wm-temp-note { font-size: var(--wm-text-sm); }
.wm-alert-wrap { margin-bottom: var(--wm-space-3); }

/* Rows with a link: keep the cell tap target. */
@media (max-width: 575.98px) {
  .wm-data-table:has(.wm-row-link) td { vertical-align: middle; }
  .wm-data-table td a.wm-row-link { display: flex; align-items: center; min-height: var(--wm-size-touch); }
}

/* People and whitelist */
.wm-people-table td { vertical-align: middle; }
.wm-email-cell { overflow-wrap: anywhere; min-width: 10rem; }
.wm-whitelist-form .form-check { padding-left: 0; display: flex; align-items: center; gap: var(--wm-space-2); }
.wm-whitelist-form .form-check-input { float: none; margin: 0; flex: none; }

/* U96: site footer */
.wm-site-footer {
  flex-shrink: 0;
  margin-top: var(--wm-space-5, 2rem);
  padding: var(--wm-space-3) 0 var(--wm-space-4);
  border-top: 1px solid var(--wm-border);
  font-size: var(--wm-text-xs, 0.75rem);
  color: var(--wm-text-muted);
}

.wm-site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--wm-space-2);
  max-width: var(--wm-size-wide, 80rem);
  margin: 0 auto;
  padding: 0 var(--wm-space-4);
}

.wm-site-footer-copyright,
.wm-site-footer-credit,
.wm-site-footer-support,
.wm-site-footer-links {
  margin: 0;
  white-space: nowrap;
}

.wm-site-footer-credit {
  display: flex;
  align-items: center;
  gap: var(--wm-space-1);
}

.wm-codeherder-link {
  display: inline-flex;
  align-items: center;
  gap: var(--wm-space-1);
  color: inherit;
  text-decoration: none;
}

.wm-codeherder-link:hover {
  color: var(--wm-accent);
  text-decoration: underline;
}

.wm-codeherder-favicon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.wm-kofi-link {
  display: inline-flex;
  align-items: center;
  gap: var(--wm-space-1);
  color: inherit;
  text-decoration: none;
}

.wm-kofi-link:hover {
  color: var(--wm-accent);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .wm-site-footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .wm-site-footer-copyright,
  .wm-site-footer-credit,
  .wm-site-footer-support,
  .wm-site-footer-links {
    white-space: normal;
  }
}

/* Inbox (U84 S10) */
@media (max-width: 575.98px) {
  .wm-map-kind .btn-group { display: flex; flex-wrap: wrap; gap: var(--wm-space-1, .25rem); }
  .wm-map-kind .btn-group > .btn { flex: 1 1 calc(50% - .25rem); border-radius: var(--bs-btn-border-radius) !important; margin-left: 0; }
}

/* Dashboard (Player Dashboard with Contextual Quick Actions) */
.wm-dashboard-header .wm-avatar-lg { width: 4rem; height: 4rem; font-size: var(--wm-text-2xl); }
.wm-dashboard-header .wm-stat-value { font-size: var(--wm-text-xl); font-weight: 600; line-height: 1.2; }
.wm-dashboard-header .wm-stat-label { font-size: var(--wm-text-xs); text-transform: uppercase; letter-spacing: 0.05em; }

.wm-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--wm-space-4);
}

.wm-dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: var(--wm-space-3); }
.wm-dashboard-stat { min-width: 0; }
.min-width-0 { min-width: 0; }
.wm-dashboard-section { display: flex; flex-direction: column; }
.wm-dashboard-section .card-header { background: var(--wm-surface-sunken); border-bottom: 1px solid var(--wm-border); }
.wm-dashboard-section .card-header h3 { display: flex; align-items: center; gap: var(--wm-space-2); }
.wm-dashboard-section .list-group-item { border: none; border-bottom: 1px solid var(--wm-border); transition: background-color .15s; }
.wm-dashboard-section .list-group-item:last-child { border-bottom: none; }
.wm-dashboard-section .list-group-item:hover { background: var(--wm-surface-sunken); }
.wm-dashboard-section .stretched-link::after { inset: 0; }
.wm-dashboard-section .list-group-item .btn { position: relative; z-index: 2; }
.wm-dashboard-section .list-group-item a.text-decoration-none { display: flex; align-items: center; gap: var(--wm-space-2); width: 100%; }
.wm-dashboard-section .list-group-item small.text-muted { font-size: var(--wm-text-sm); }

@media (max-width: 575.98px) {
  .wm-dashboard-grid { grid-template-columns: 1fr; }
  .wm-dashboard-header .wm-avatar-lg { width: 3rem; height: 3rem; font-size: var(--wm-text-xl); }
  .wm-dashboard-header .wm-stat-value { font-size: var(--wm-text-lg); }
  .wm-dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .wm-dashboard-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Session desk (GM/admin club home) */
.wm-session-desk {
  margin-bottom: var(--wm-space-5);
  padding: var(--wm-space-4);
  background: var(--wm-surface-raised);
  border: 1px solid var(--wm-border);
  border-radius: var(--wm-radius-lg);
}

.wm-session-desk__waiting,
.wm-session-desk__after,
.wm-session-desk__dashboard {
  margin-bottom: var(--wm-space-4);
}

.wm-session-desk__waiting:last-child,
.wm-session-desk__after:last-child,
.wm-session-desk__dashboard:last-child {
  margin-bottom: 0;
}

.wm-session-desk h3 {
  margin: 0 0 var(--wm-space-3);
  font-size: var(--wm-text-lg);
  font-weight: 600;
  color: var(--wm-text);
}

.wm-session-desk__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--wm-space-2);
}

.wm-session-desk__item {
  margin: 0;
}

.wm-session-desk__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wm-space-3);
  padding: var(--wm-space-2) var(--wm-space-3);
  min-height: var(--wm-size-touch);
  color: var(--wm-text);
  text-decoration: none;
  background: var(--wm-surface-sunken);
  border: 1px solid var(--wm-border);
  border-radius: var(--wm-radius-md);
  transition: background-color .15s, border-color .15s;
}

.wm-session-desk__link:hover {
  background: var(--wm-surface);
  border-color: var(--wm-text-muted);
  text-decoration: none;
}

.wm-session-desk__link:focus-visible {
  outline: var(--wm-focus-outline);
  outline-offset: var(--wm-space-1);
}

.wm-session-desk__dashboard-link {
  display: inline-flex;
  align-items: center;
  gap: var(--wm-space-2);
  padding: var(--wm-space-3) var(--wm-space-4);
  min-height: var(--wm-size-touch);
  font-weight: 600;
  color: var(--wm-accent);
  text-decoration: none;
  background: var(--wm-accent-bg);
  border: 1px solid var(--wm-accent);
  border-radius: var(--wm-radius-md);
  transition: background-color .15s, border-color .15s;
}

.wm-session-desk__dashboard-link:hover {
  background: var(--wm-accent);
  color: var(--wm-on-accent);
  text-decoration: none;
}

.wm-session-desk__dashboard-link:focus-visible {
  outline: var(--wm-focus-outline);
  outline-offset: var(--wm-space-1);
}

/* Two-column layout from md breakpoint */
@media (min-width: 768px) {
  .wm-session-desk {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--wm-space-4);
  }

  .wm-session-desk__waiting,
  .wm-session-desk__after,
  .wm-session-desk__dashboard {
    margin-bottom: 0;
  }

  .wm-session-desk__waiting {
    grid-column: 1;
    grid-row: 1;
  }

  .wm-session-desk__after {
    grid-column: 2;
    grid-row: 1;
  }

  .wm-session-desk__dashboard {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 575.98px) {
  .wm-session-desk {
    padding: var(--wm-space-3);
  }

  .wm-session-desk__link {
    padding: var(--wm-space-3);
  }

  .wm-session-desk__dashboard-link {
    width: 100%;
    justify-content: center;
  }
}

/* No character state */
.wm-dashboard-header .wm-avatar { background: var(--wm-surface-sunken); color: var(--wm-text-muted); display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.wm-dashboard-header .wm-avatar-sm { width: 2rem; height: 2rem; font-size: var(--wm-text-sm); }
.wm-dashboard-header .wm-avatar-lg { width: 4rem; height: 4rem; font-size: var(--wm-text-2xl); }

/* message_new page: prevent overflow at small widths by relaxing min-width */
@media (max-width: 575.98px) {
  .wm-msg-col--fluid { min-width: 0; }
}
