:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1d2433;
  --subtle: #65708a;
  --line: #d7deeb;
  --primary: #0f766e;
  --primary-dark: #0b5a53;
  --danger-bg: #fdecec;
  --danger-text: #8f2222;
  --success-bg: #e8f8ed;
  --success-text: #1c6432;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.site-nav {
  width: 100%;
  background: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(215, 222, 235, 0.8);
  backdrop-filter: blur(6px);
}

.site-nav .container {
  max-width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.brand img {
  display: block;
  width: auto;
  height: auto;
  max-width: 260px;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
  margin: 0;
  opacity: 0.5;
}

.links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  flex: 0 1 auto;
  padding: 6px;
  border: 1px solid rgba(191, 208, 239, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.links a,
.links .nav-link-btn,
.links form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-bottom-width: 1px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  min-height: 36px;
}

.nav-link-btn {
  border: 1px solid var(--line);
  width: auto;
}

.links a:hover,
.links .nav-link-btn:hover,
.links form button:hover {
  background: rgba(248, 251, 255, 0.95);
  border-color: #bfd0ef;
  color: var(--primary);
}

.links a.active,
.links .nav-link-btn.active {
  background: #eaf8f5;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.links form {
  margin: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.narrow {
  max-width: 560px;
}

h1 {
  margin: 0;
  font-size: 2rem;
}

h2 {
  margin: 0;
  font-size: 1.25rem;
}

.subtitle {
  color: var(--subtle);
  margin: 8px 0 18px;
}

.subtitle.compact {
  margin: 6px 0 10px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-title-block {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-title-text {
  min-width: 0;
  flex: 1 1 auto;
}

.page-title-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  width: auto;
  margin-top: 0;
}

.page-title-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 240px;
  max-height: 56px;
  object-fit: contain;
  object-position: right center;
  opacity: 0.5;
}

.page-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 6px;
  border: 1px solid rgba(191, 208, 239, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.page-tabs a,
.page-tabs .nav-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  min-height: 36px;
}

.page-tabs a.active,
.page-tabs .nav-link-btn.active {
  background: #eaf8f5;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.sticky-calendar-tabs {
  position: sticky;
  top: 8px;
  z-index: 30;
}

body.authenticated .site-nav {
  display: none;
}

body.anonymous .site-nav {
  display: none;
}

.page-menu-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(191, 208, 239, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.page-menu-dropdown select {
  min-width: 220px;
  max-width: 280px;
}

.calendar-fab-menu {
  position: fixed;
  top: 96px;
  right: 14px;
  z-index: 1250;
}

.calendar-fab-menu.is-dragging {
  opacity: 0.2;
}

.calendar-fab-toggle {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(191, 208, 239, 0.95);
  background: rgba(255, 255, 255, 0.42);
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  backdrop-filter: blur(6px);
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.calendar-fab-menu.is-dragging .calendar-fab-toggle {
  cursor: grabbing;
}

.calendar-fab-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #3a4b69;
  border-radius: 999px;
}

.calendar-fab-panel {
  position: absolute;
  top: 48px;
  right: 0;
  min-width: 200px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(191, 208, 239, 0.95);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px rgba(29, 36, 51, 0.12);
}

.calendar-fab-panel.hidden {
  display: none;
}

.calendar-fab-panel a,
.calendar-fab-panel button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.calendar-fab-panel a.active {
  background: #eaf8f5;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.calendar-fab-panel button.active {
  background: #eaf8f5;
  border-color: var(--primary);
  color: var(--primary-dark);
}

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

label {
  font-weight: 600;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
  background: #fff;
}

button,
.button-link {
  display: inline-block;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: var(--primary-dark);
}

.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.secondary:hover {
  background: #eaf8f5;
}

.warning {
  background: #fff4e5;
  color: #9a3412;
  border: 1px solid #fdba74;
}

.warning:hover {
  background: #ffedd5;
}

.small {
  padding: 6px 10px;
  font-size: 0.82rem;
}

.stacked {
  display: grid;
  gap: 10px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.grid-form button {
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
}

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

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

.action-cell {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.data-table td.action-cell {
  vertical-align: top;
}

.action-cell form {
  margin: 0;
}

@media (min-width: 901px) {
  .data-table td.action-cell {
    display: table-cell;
    vertical-align: middle;
    white-space: normal;
  }

  .data-table td.action-cell > * {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 8px;
  }

  .data-table td.action-cell > *:last-child {
    margin-right: 0;
  }

  .data-table td.action-cell form {
    display: inline-block;
    margin: 0;
  }
}

.avatar,
.mini-avatar {
  object-fit: cover;
  border-radius: 999px;
}

.avatar {
  width: 56px;
  height: 56px;
}

.mini-avatar {
  width: 36px;
  height: 36px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.flash {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.flash.error {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.flash.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.pill.pending {
  background: #fef3c7;
  color: #7a5600;
}

.pill.success {
  background: #dcfce7;
  color: #18603a;
}

.pill.accepted {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.pill.confirmed {
  background: #ccfbf1;
  color: #115e59;
  border: 1px solid #5eead4;
}

.pill.open {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.pill.public {
  background: #e0f2fe;
  color: #0c4a6e;
  border: 1px solid #7dd3fc;
}

.pill.personal {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
}

.pill.private {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.pill.community {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
}

.my-games-pending-alert {
  border-color: #f59e0b;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.my-games-pending-alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.calendar-actions-left,
.calendar-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--subtle);
}

.view-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.view-switch .slider {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background 0.2s ease;
}

.view-switch .slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.view-switch input:checked + .slider {
  background: #0f766e;
}

.view-switch input:checked + .slider::after {
  transform: translateX(18px);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-grid.week-feed {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.weekday {
  font-weight: 700;
  color: var(--subtle);
  text-align: center;
  padding: 6px 0;
}

.day {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.day.current-week {
  border-color: #0f766e;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.week-feed-day {
  min-height: unset;
}

.week-feed-header {
  font-weight: 700;
  color: var(--subtle);
  margin-bottom: 6px;
}

.week-feed-empty {
  margin-top: 8px;
}

.mobile-week-nav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: none;
  gap: 12px;
  z-index: 1200;
  pointer-events: none;
}

.week-float-btn {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(15, 23, 42, 0.22);
  color: #ffffff;
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

.week-float-btn:hover {
  background: rgba(15, 23, 42, 0.32);
}

.week-float-label {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
  color: #ffffff;
  backdrop-filter: blur(4px);
  padding: 8px 12px;
  font-size: 0.82rem;
  white-space: nowrap;
  pointer-events: auto;
}

.week-range-placeholder {
  background: rgba(107, 114, 128, 0.45);
  border-color: rgba(209, 213, 219, 0.7);
}

.week-range-placeholder.hold-active {
  background: rgba(75, 85, 99, 0.62);
}

.swipe-shadow {
  position: fixed;
  left: 0;
  top: 0;
  width: 42px;
  height: 42px;
  transform: translate(calc(var(--swipe-arrow-x, 50vw) - 50%), calc(var(--swipe-arrow-y, 50vh) - 50%));
  pointer-events: none;
  z-index: 1195;
  opacity: 0;
  transition: opacity 90ms linear, transform 80ms linear;
  will-change: transform, opacity;
}

.swipe-shadow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border-top: 3px solid rgba(15, 23, 42, var(--swipe-arrow-opacity, 0.38));
  border-right: 3px solid rgba(15, 23, 42, var(--swipe-arrow-opacity, 0.38));
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 6px rgba(15, 23, 42, 0.32));
}

.swipe-shadow.active {
  opacity: 1;
}

.swipe-shadow.dir-next::before {
  transform: translate(-50%, -50%) rotate(45deg) scale(var(--swipe-arrow-scale, 1));
}

.swipe-shadow.dir-prev::before {
  transform: translate(-50%, -50%) rotate(-135deg) scale(var(--swipe-arrow-scale, 1));
}

.day.empty {
  background: #f7f9fc;
  border-style: dashed;
}

.day-number {
  font-weight: 700;
  margin-bottom: 6px;
}

.event {
  margin-bottom: 6px;
  padding: 6px;
  border-radius: 6px;
  background: #f5f5f5;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  border: 1px solid transparent;
}

.event:focus {
  outline: none;
  border-color: #1d2433;
}

.event small {
  color: #2f3544;
}

.privacy-mode-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
}

.privacy-mode-chip.public {
  background: #e8f8ed;
  color: #166534;
  border-color: #86efac;
}

.privacy-mode-chip.personal {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.privacy-mode-chip.private {
  background: #feeceb;
  color: #9f1239;
  border-color: #fda4af;
}

.privacy-mode-chip.community {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.event-orange {
  background: #ffedd5;
  border-color: #fdba74;
}

.event-red {
  background: #fee2e2;
  border-color: #fca5a5;
}

.event-green {
  background: #dcfce7;
  border-color: #86efac;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-content {
  position: relative;
  width: min(560px, calc(100% - 24px));
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 16px;
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--subtle);
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  background: #f8fafc;
  color: var(--text);
}

#reservationModal .modal-content {
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c5cfdf transparent;
}

#reservationModal .modal-content::-webkit-scrollbar {
  width: 6px;
}

#reservationModal .modal-content::-webkit-scrollbar-track {
  background: transparent;
}

#reservationModal .modal-content::-webkit-scrollbar-thumb {
  background: #c5cfdf;
  border-radius: 999px;
}

.players-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.search-row {
  display: flex;
  gap: 8px;
}

.search-row input {
  flex: 1;
}

.dual-range-wrap {
  width: 100%;
  display: grid;
  gap: 6px;
}

.dual-range-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--subtle);
  font-size: 0.9rem;
}

.dual-range-box {
  position: relative;
  height: 30px;
}

.dual-range-box input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  margin: 0;
  pointer-events: none;
  background: transparent;
}

.dual-range-box input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
}

.dual-range-box input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
}

.search-results,
.selected-players {
  display: grid;
  gap: 6px;
}

.search-result-row,
.selected-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.avatars-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
}

.avatars-row.compact {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px;
  width: fit-content;
}

.avatar-chip {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #1f2937;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1;
  overflow: hidden;
  padding: 0;
}

.avatar-chip-link {
  text-decoration: none;
  color: inherit;
}

button.avatar-chip {
  cursor: pointer;
  padding: 0;
  border: 1px solid #cbd5e1;
}

.avatar-chip.small {
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
}

.avatar-chip.empty {
  background: #f8fafc;
  color: #64748b;
  border-style: dashed;
}

.avatar-chip.pending {
  opacity: 0.5;
}

.avatars-row.compact .avatar-chip {
  border: 1px solid #cbd5e1;
  box-shadow: none;
}

.avatars-row.compact .avatar-chip + .avatar-chip {
  margin-left: 0;
}

.avatar-chip-img {
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  margin: -1px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: inherit;
}

.event .avatars-row {
  gap: 4px;
  margin: 4px 0 2px;
}

.event .avatar-chip,
.event .avatar-chip.small {
  width: 52px;
  height: 52px;
  font-size: 0.9rem;
  overflow: hidden;
  border-radius: 999px;
}

.event .avatar-chip-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 999px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.check-line input {
  width: auto;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.segmented-control input[type="radio"] {
  display: none;
}

.segmented-control label {
  margin: 0;
  padding: 8px 10px;
  text-align: center;
  font-weight: 600;
  color: var(--subtle);
  background: #fff;
  border-right: 1px solid var(--line);
  cursor: pointer;
}

.segmented-control label:last-of-type {
  border-right: none;
}

.segmented-control input[type="radio"]:checked + label {
  background: #eaf8f5;
  color: var(--primary-dark);
}

#privacyPersonal:checked + label {
  background: #e6f0ff;
  color: #1e40af;
}

#privacyPublic:checked + label {
  background: #e8f8ed;
  color: #166534;
}

#privacyCommunity:checked + label {
  background: #eef2ff;
  color: #3730a3;
}

#privacyPrivate:checked + label {
  background: #feeceb;
  color: #9f1239;
}

.community-visibility-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px 10px;
}

.community-visibility-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.community-check {
  margin-top: 2px;
}

.privacy-help {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--subtle);
}

.page-communities .community-name-link,
.page-community_detail .community-name-link {
  color: #0b5a53;
  font-weight: 700;
  text-decoration: none;
}

.page-communities .community-name-link:hover,
.page-community_detail .community-name-link:hover {
  text-decoration: underline;
}

.page-community_detail .community-top-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-community_detail .community-top-divider {
  color: var(--subtle);
}

.community-games-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 6px;
  border-bottom: 1px dashed #dbe7f2;
}

.community-games-head h2 {
  margin: 0;
}

.community-games-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.community-games-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.community-games-stat strong {
  color: #0f172a;
  font-size: 0.84rem;
}

.community-games-filter-row {
  margin-top: 4px;
  margin-bottom: 8px;
}

.community-games-past-switch {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid #dbe7f2;
  border-radius: 999px;
  background: #f8fbff;
}

.community-games-past-switch span:first-child {
  color: #0f766e;
  font-weight: 700;
}

.community-games-past-switch input:checked + .slider + span {
  color: #9a3412;
  font-weight: 700;
}

.community-games-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 2px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.community-games-carousel::-webkit-scrollbar {
  height: 8px;
}

.community-games-carousel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.community-game-bubble {
  min-width: 220px;
  max-width: 220px;
  scroll-snap-align: start;
  border: 1px solid #dbe7f2;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 14px;
  padding: 10px;
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: 6px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.community-game-bubble:hover {
  border-color: #93c5fd;
}

.community-game-time {
  font-size: 0.78rem;
  color: var(--subtle);
}

.community-game-title {
  font-weight: 700;
  line-height: 1.2;
  color: #0f172a;
}

.community-game-station {
  font-size: 0.82rem;
  color: #334155;
}

.community-game-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.community-game-owner {
  font-size: 0.78rem;
  color: var(--subtle);
}

.community-game-bubble.is-past-hidden {
  display: none;
}

.pill.not-full {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.community-invites-bubbles {
  display: grid;
  gap: 8px;
}

.community-invite-bubble {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #dbe7f2;
  border-radius: 12px;
  padding: 8px 10px;
  background: #f8fbff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.community-invite-avatar {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.community-invite-avatar .mini-avatar {
  width: 32px;
  height: 32px;
}

.community-invite-avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
}

.member-avatar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.community-invite-text {
  min-width: 0;
}

.community-invite-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.community-invite-email,
.community-invite-time {
  font-size: 0.76rem;
  color: var(--subtle);
}

.community-invite-actions {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.community-invite-actions form {
  margin: 0;
}

.community-invite-actions .pill.pending {
  min-height: 28px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
}

.community-invite-delete-btn {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #fca5a5;
  color: #9f1239;
  background: #fff;
  font-weight: 700;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.community-invite-delete-btn:hover {
  border-color: #fb7185;
  background: #fff1f2;
}

.community-invite-delete-btn:focus-visible {
  outline: 2px solid #fb7185;
  outline-offset: 1px;
}

.community-danger-zone {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #fecaca;
}

.community-danger-toggle {
  margin-top: 10px;
}

.community-members-danger-switch {
  margin-top: 10px;
  margin-bottom: 14px;
}

.community-members-danger-switch input:checked + .slider {
  background: #b91c1c;
}

.community-members-danger-switch input:checked ~ span:last-child {
  color: #991b1b;
  font-weight: 700;
}

.page-community_detail #communityMembersTable {
  width: 100%;
}

@media (min-width: 901px) {
  .page-community_detail #communityMembersTable {
    border-collapse: separate;
    border-spacing: 0 8px;
  }

  .page-community_detail #communityMembersTable thead th {
    border-bottom: 1px solid #dbe7f2;
    color: #475569;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0 12px 6px;
  }

  .page-community_detail #communityMembersTable tbody tr {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
  }

  .page-community_detail #communityMembersTable tbody td {
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
  }

  .page-community_detail #communityMembersTable tbody td:first-child {
    border-left: 1px solid #e2e8f0;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    width: 56px;
  }

  .page-community_detail #communityMembersTable tbody td:last-child {
    border-right: 1px solid #e2e8f0;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
  }

  .page-community_detail #communityMembersTable td:nth-child(2) {
    font-weight: 700;
    color: #0f172a;
  }

  .page-community_detail #communityMembersTable .member-avatar-link .mini-avatar,
  .page-community_detail #communityMembersTable .member-avatar-link .community-invite-avatar-fallback {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 2px solid #e2e8f0;
    background: #f1f5f9;
  }

  .page-community_detail #communityMembersTable .member-avatar-link:hover .mini-avatar,
  .page-community_detail #communityMembersTable .member-avatar-link:hover .community-invite-avatar-fallback {
    border-color: #93c5fd;
  }

  .page-community_detail #communityMembersTable .action-cell {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .page-community_detail #communityMembersTable .action-cell .small {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 0.78rem;
    border-radius: 999px;
  }
}

.community-danger-zone h4 {
  margin: 0 0 4px;
  color: #991b1b;
}

.community-danger-button {
  background: #b91c1c;
  border: 1px solid #b91c1c;
  color: #fff;
}

.community-danger-button:hover {
  background: #991b1b;
  border-color: #991b1b;
}

.community-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.community-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
  object-fit: cover;
  object-position: center;
}

.community-logo-small {
  width: 40px;
  height: 40px;
  font-size: 0.86rem;
  font-weight: 700;
}

.community-logo-large {
  width: 54px;
  height: 54px;
  font-size: 1rem;
  font-weight: 700;
}

.community-logo-placeholder {
  text-transform: uppercase;
}

.required-star {
  color: #b91c1c;
  font-weight: 700;
}

.map-picker-canvas {
  width: 100%;
  height: 320px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.map-picker-modal {
  z-index: 1300;
}

.page-communities .communities-toolbar {
  margin-bottom: 10px;
  align-items: center;
}

.page-communities .communities-toolbar input[type="text"] {
  width: 100%;
}

.community-sort-btn {
  border: none;
  background: transparent;
  color: var(--subtle);
  font-weight: 700;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.community-sort-btn .community-sort-arrow {
  font-size: 0.82rem;
  line-height: 1;
  color: #64748b;
}

.community-sort-btn.is-active {
  color: #0f766e;
}

.community-sort-btn.is-active .community-sort-arrow {
  color: #0f766e;
}

.page-communities .pending-invitations-card {
  border: 1px solid #fcd34d;
  background: linear-gradient(180deg, #fffdf3 0%, #fff9e8 100%);
}

.page-communities .pending-invitations-card h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pending-invitations-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #b45309;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 7px;
}

.page-communities #communityInvitesTable .community-invite-row {
  background: #fff;
}

.page-communities #communityInvitesTable .community-invite-row td:first-child .community-name-link {
  color: #7c2d12;
  font-weight: 800;
}

.pending-invite-accept-btn {
  border-color: #65a30d;
  background: #ecfccb;
  color: #3f6212;
}

.pending-invite-accept-btn:hover {
  border-color: #4d7c0f;
  background: #d9f99d;
}

.pending-invite-reject-btn {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #9f1239;
}

.pending-invite-reject-btn:hover {
  border-color: #fb7185;
  background: #ffe4e6;
}

@media (max-width: 900px) {
  .page-communities .communities-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .page-communities .communities-toolbar input[type="text"] {
    width: 100%;
    min-width: 0;
  }

  .page-communities .table-wrap,
  .page-community_detail .table-wrap {
    overflow: visible;
  }

  .page-communities .data-table,
  .page-community_detail .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .page-communities .data-table thead,
  .page-community_detail .data-table thead {
    display: none;
  }

  .page-communities .data-table,
  .page-communities .data-table tbody,
  .page-communities .data-table tr,
  .page-communities .data-table td,
  .page-community_detail .data-table,
  .page-community_detail .data-table tbody,
  .page-community_detail .data-table tr,
  .page-community_detail .data-table td {
    display: block;
    width: 100%;
  }

  .page-communities .data-table tbody,
  .page-community_detail .data-table tbody {
    display: grid;
    gap: 8px;
  }

  .page-communities .data-table tr,
  .page-community_detail .data-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 4px 14px rgba(29, 36, 51, 0.06);
  }

  .page-communities .data-table td,
  .page-community_detail .data-table td {
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
    padding: 6px 0;
    text-align: left;
  }

  .page-communities .data-table td:last-child,
  .page-community_detail .data-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .page-communities .data-table td::before,
  .page-community_detail .data-table td::before {
    content: "";
    display: block;
    margin-bottom: 3px;
    color: var(--subtle);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .page-communities #communitiesTable td:nth-child(1)::before { content: "Logo"; }
  .page-communities #communitiesTable td:nth-child(2)::before { content: "Name"; }
  .page-communities #communitiesTable td:nth-child(3)::before { content: "Location"; }
  .page-communities #communitiesTable td:nth-child(4)::before { content: "Privacy"; }
  .page-communities #communitiesTable td:nth-child(5)::before { content: "Members"; }
  .page-communities #communitiesTable td:nth-child(6)::before { content: "Your status"; }
  .page-communities #myCommunitiesTable td:nth-child(1)::before { content: "Logo"; }
  .page-communities #myCommunitiesTable td:nth-child(2)::before { content: "Name"; }
  .page-communities #myCommunitiesTable td:nth-child(3)::before { content: "Location"; }
  .page-communities #myCommunitiesTable td:nth-child(4)::before { content: "Privacy"; }
  .page-communities #myCommunitiesTable td:nth-child(5)::before { content: "Members"; }
  .page-communities #myCommunitiesTable td:nth-child(6)::before { content: "Your status"; }
  .page-communities #communityInvitesTable td:nth-child(1)::before { content: "Community"; }
  .page-communities #communityInvitesTable td:nth-child(2)::before { content: "Invited by"; }
  .page-communities #communityInvitesTable td:nth-child(3)::before { content: "Invited at"; }
  .page-communities #communityInvitesTable td:nth-child(4)::before { content: "Action"; }

  .page-community_detail #communityMembersTable td:nth-child(1)::before { content: "Picture"; }
  .page-community_detail #communityMembersTable td:nth-child(2)::before { content: "Name"; }
  .page-community_detail #communityMembersTable td:nth-child(3)::before { content: "Role"; }
  .page-community_detail #communityMembersTable td:nth-child(4)::before { content: "Actions"; }

  .page-community_detail #communityRequestsTable td:nth-child(1)::before { content: "Picture"; }
  .page-community_detail #communityRequestsTable td:nth-child(2)::before { content: "Name"; }
  .page-community_detail #communityRequestsTable td:nth-child(3)::before { content: "Requested"; }
  .page-community_detail #communityRequestsTable td:nth-child(4)::before { content: "Action"; }

  .page-community_detail #communityMembersTable tr {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    grid-template-areas:
      "avatar name role"
      "actions actions actions";
    gap: 6px 8px;
    align-items: center;
    padding: 8px;
  }

  .page-community_detail #communityMembersTable td {
    border-bottom: none;
    padding: 0;
  }

  .page-community_detail #communityMembersTable td::before {
    display: none;
  }

  .page-community_detail #communityMembersTable td:nth-child(1) {
    grid-area: avatar;
  }

  .page-community_detail #communityMembersTable td:nth-child(2) {
    grid-area: name;
    min-width: 0;
    font-weight: 600;
  }

  .page-community_detail #communityMembersTable td:nth-child(3) {
    grid-area: role;
    justify-self: end;
  }

  .page-community_detail #communityMembersTable td:nth-child(4) {
    grid-area: actions;
  }

  .page-community_detail #communityMembersTable .mini-avatar {
    width: 32px;
    height: 32px;
  }

  .page-community_detail #communityMembersTable .action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .page-community_detail #communityMembersTable td.member-actions-cell.initially-hidden {
    display: none !important;
  }

  .page-community_detail #communityMembersTable .action-cell form {
    margin: 0;
  }

  .page-community_detail #communityMembersTable .action-cell .small {
    width: auto;
    min-width: 0;
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .page-community_detail #communityRequestsTable tr {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    grid-template-areas:
      "avatar name requested"
      "actions actions actions";
    gap: 6px 8px;
    align-items: center;
    padding: 8px;
  }

  .page-community_detail #communityRequestsTable td {
    border-bottom: none;
    padding: 0;
  }

  .page-community_detail #communityRequestsTable td::before {
    display: none;
  }

  .page-community_detail #communityRequestsTable td:nth-child(1) {
    grid-area: avatar;
  }

  .page-community_detail #communityRequestsTable td:nth-child(2) {
    grid-area: name;
    min-width: 0;
    font-weight: 600;
  }

  .page-community_detail #communityRequestsTable td:nth-child(3) {
    grid-area: requested;
    justify-self: end;
    color: var(--subtle);
    font-size: 0.78rem;
  }

  .page-community_detail #communityRequestsTable td:nth-child(4) {
    grid-area: actions;
  }

  .page-community_detail #communityRequestsTable .mini-avatar {
    width: 32px;
    height: 32px;
  }

  .page-community_detail #communityRequestsTable .action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .page-community_detail #communityRequestsTable .action-cell form {
    margin: 0;
  }

  .page-community_detail #communityRequestsTable .action-cell .small {
    width: auto;
    min-width: 0;
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .page-communities #communitiesTable tr {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    grid-template-areas:
      "logo name privacy"
      "location location members"
      "status status status";
    gap: 6px 8px;
    align-items: center;
    padding: 8px;
  }

  .page-communities #communitiesTable td {
    border-bottom: none;
    padding: 0;
  }

  .page-communities #communitiesTable td::before {
    display: none;
  }

  .page-communities #communitiesTable td:nth-child(1) { grid-area: logo; }
  .page-communities #communitiesTable td:nth-child(2) { grid-area: name; min-width: 0; }
  .page-communities #communitiesTable td:nth-child(3) { grid-area: location; color: var(--subtle); font-size: 0.82rem; }
  .page-communities #communitiesTable td:nth-child(4) { grid-area: privacy; justify-self: end; }
  .page-communities #communitiesTable td:nth-child(5) { grid-area: members; justify-self: end; font-weight: 700; }
  .page-communities #communitiesTable td:nth-child(6) { grid-area: status; }

  .page-communities #communitiesTable .community-logo-small {
    width: 32px;
    height: 32px;
  }

  .page-communities #myCommunitiesTable tr {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    grid-template-areas:
      "logo name privacy"
      "location location members"
      "status status status";
    gap: 6px 8px;
    align-items: center;
    padding: 8px;
  }

  .page-communities #myCommunitiesTable td {
    border-bottom: none;
    padding: 0;
  }

  .page-communities #myCommunitiesTable td::before {
    display: none;
  }

  .page-communities #myCommunitiesTable td:nth-child(1) { grid-area: logo; }
  .page-communities #myCommunitiesTable td:nth-child(2) { grid-area: name; min-width: 0; }
  .page-communities #myCommunitiesTable td:nth-child(3) { grid-area: location; color: var(--subtle); font-size: 0.82rem; }
  .page-communities #myCommunitiesTable td:nth-child(4) { grid-area: privacy; justify-self: end; }
  .page-communities #myCommunitiesTable td:nth-child(5) { grid-area: members; justify-self: end; font-weight: 700; }
  .page-communities #myCommunitiesTable td:nth-child(6) { grid-area: status; }

  .page-communities #myCommunitiesTable .community-logo-small {
    width: 32px;
    height: 32px;
  }

  .page-communities #communityInvitesTable tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "community invited_at"
      "invited_by invited_by"
      "actions actions";
    gap: 6px 8px;
    align-items: center;
    padding: 8px;
  }

  .page-communities .pending-invitations-card {
    border-width: 2px;
  }

  .page-communities #communityInvitesTable td {
    border-bottom: none;
    padding: 0;
  }

  .page-communities #communityInvitesTable td::before {
    display: none;
  }

  .page-communities #communityInvitesTable td:nth-child(1) { grid-area: community; min-width: 0; font-weight: 600; }
  .page-communities #communityInvitesTable td:nth-child(2) { grid-area: invited_by; color: var(--subtle); font-size: 0.82rem; }
  .page-communities #communityInvitesTable td:nth-child(3) { grid-area: invited_at; justify-self: end; color: var(--subtle); font-size: 0.78rem; }
  .page-communities #communityInvitesTable td:nth-child(4) { grid-area: actions; }

  .page-communities #communityInvitesTable .action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .page-communities #communityInvitesTable .action-cell form {
    margin: 0;
  }

  .page-communities #communityInvitesTable .action-cell .small {
    width: auto;
    min-width: 0;
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .page-communities #communitiesTable tr.community-tap-row,
  .page-communities #myCommunitiesTable tr.community-tap-row {
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.12s ease;
  }

  .page-communities #communitiesTable tr.community-tap-row:active,
  .page-communities #myCommunitiesTable tr.community-tap-row:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(29, 36, 51, 0.08);
  }

  .page-communities .action-cell,
  .page-community_detail .action-cell {
    width: 100%;
    display: grid;
    gap: 6px;
  }

  .page-communities .action-cell .small,
  .page-communities .action-cell .button-link,
  .page-community_detail .action-cell .small,
  .page-community_detail .action-cell .button-link {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .page-community_detail .community-top-meta {
    display: grid;
    gap: 4px;
  }

  .page-community_detail .community-top-divider {
    display: none;
  }

  .community-title-row {
    gap: 8px;
  }

  .community-logo-large {
    width: 46px;
    height: 46px;
  }

  .community-game-bubble {
    min-width: 84vw;
    max-width: 84vw;
    padding: 9px;
  }

  .community-games-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-bottom: 4px;
  }

  .community-games-stats {
    width: 100%;
  }

  .community-games-stat {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  .community-invite-bubble {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "avatar status"
      "text text";
    row-gap: 6px;
  }

  .community-invite-avatar {
    grid-area: avatar;
  }

  .community-invite-text {
    grid-area: text;
  }

  .community-invite-bubble .pill {
    grid-area: status;
    justify-self: end;
  }

  .community-invite-actions {
    grid-area: status;
    align-items: flex-end;
    justify-self: end;
    flex-direction: row;
  }

  .community-invite-delete-btn {
    width: auto;
    min-width: 0;
    padding: 4px 9px;
    font-size: 0.76rem;
    min-height: 26px;
  }
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-actions-start {
  justify-content: flex-start;
}

.modal-actions-tight-top {
  margin-top: 8px;
}

.modal-actions-mt-2 {
  margin-top: 2px;
}

.initially-hidden {
  display: none;
}

.form-top-gap-sm {
  margin-top: 0.5rem;
}

.section-top-gap-sm {
  margin-top: 8px;
}

.game-card-avatars-row {
  margin-top: 10px;
}

.player-avatar-fallback {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}

.player-title {
  margin: 0;
}

.subtitle-top-gap-xs {
  margin-top: 6px;
}

.subtitle-inline-vs {
  margin: 6px 0;
}

.selected-players-top-gap-sm {
  margin-top: 8px;
}

.calendar-actions-right-grow {
  flex: 1;
}

.public-games-filter-row {
  margin-bottom: 0;
  width: 100%;
}

.public-games-filter-toggle {
  margin-top: 0;
  justify-content: flex-start;
  justify-self: start;
  width: fit-content;
  margin-left: 0;
  padding-left: 0;
}

.public-games-filter-controls-hidden {
  display: none;
}

.public-reservations-filter-row {
  margin-bottom: 10px;
}

.game-card-layout {
  display: flex;
  flex-direction: column;
}

.game-card-main-details {
  margin-top: 0;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(59, 90, 141, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, #f4f8ff 0%, #ffffff 100%);
  color: #1f3558;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(31, 53, 88, 0.1);
}

.game-card-main-details-title {
  width: 100%;
  margin-bottom: 2px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: #3a4b69;
}

.game-card-main-details-line {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.game-card-main-details-line-top {
  font-weight: 700;
}

.game-card-main-details-line-strong {
  display: block;
  font-weight: 900;
  font-size: 1.08rem;
  color: #1d2433;
}

.game-card-detail-sep {
  color: #436b8b;
  font-weight: 700;
}

.game-card-detail-time {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(59, 90, 141, 0.32);
  background: rgba(59, 90, 141, 0.1);
}

#modalReservationInfo .modal-reservation-info-line {
  display: block;
  font-size: 1.14rem;
  line-height: 1.5;
}

#modalReservationInfo .modal-reservation-info-line-strong {
  margin-top: 2px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #1d2433;
}

.game-card-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.share-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.game-card-share-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.modal-share-row {
  justify-content: space-between;
}

.share-emoji {
  font-size: 1.05rem;
  line-height: 1;
}

.share-hint {
  margin: 0;
  font-size: 0.8rem;
}

.share-icon-btn.share-available {
  opacity: 0.7;
}

.share-icon-btn.share-disabled,
.share-icon-btn:disabled {
  opacity: 1;
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}

.incoming-block {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.results-panel {
  display: grid;
  gap: 8px;
}

.result-teams-preview {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}

.result-team-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.result-team-box.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.result-team-title {
  font-weight: 700;
  color: var(--subtle);
  font-size: 0.85rem;
}

.result-vs {
  font-weight: 800;
  color: var(--subtle);
}

.manage-team-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}

.manage-team-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.manage-team-box.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.manage-team-avatar {
  width: 52px;
  height: 52px;
  font-size: 0.9rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.manage-team-avatar:active {
  cursor: grabbing;
}

.is-dragging-avatar {
  opacity: 0.2 !important;
}

.drag-touch-ghost {
  position: fixed;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.2;
  z-index: 2500;
  transform: translate(-50%, -50%);
}

.result-row-teams {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.result-draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.result-draggable:active {
  cursor: grabbing;
}

.results-panel .avatar-chip {
  width: 52px;
  height: 52px;
  font-size: 0.9rem;
}

.incoming-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.page-my_games .my-games-hero {
  margin-bottom: 12px;
}

.page-my_games .my-games-section {
  margin-bottom: 14px;
}

.page-my_games #invitesTable th:nth-child(3),
.page-my_games #invitesTable td:nth-child(3) {
  display: none;
}

.page-my_games .data-table tr[data-game-href] {
  cursor: pointer;
}

.page-my_games .data-table tr[data-game-href]:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

.page-my_games .my-games-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.page-my_games .my-games-filter {
  margin-bottom: 10px;
  align-items: center;
}

.page-my_games .my-games-actions {
  justify-content: flex-end;
  margin-top: 0;
  margin-left: auto;
}

.page-my_games .my-games-quick-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: -2px 0 10px;
}

.page-my_games .my-games-quick-filter-block {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  background: #f8fbff;
}

.page-my_games .my-games-quick-filter-title {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-my_games .my-games-filter .check-line {
  margin: 0;
}

.page-my_games .my-games-filter .my-games-past-switch {
  margin: 0;
  white-space: nowrap;
}

.page-my_games .my-games-quick-filters,
.my-games-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 10px;
}

.page-my_games .my-games-quick-filters .small,
.my-games-quick-filters .small {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  line-height: 1.1;
}

.page-my_games .my-games-quick-filters .small.is-active,
.my-games-quick-filters .small.is-active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.page-my_games .my-games-cards-toggle {
  margin: 6px 0 10px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  line-height: 1.1;
}

.page-my_games .calendar-bubble-btn,
.calendar-bubble-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.55);
  color: #475569;
}

.page-my_games .my-games-court-meta {
  display: grid;
  gap: 1px;
}

.page-my_games .my-games-court-line {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
}

.page-my_games .my-games-court-label {
  font-size: 0.72rem;
  color: var(--subtle);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 0;
}

.page-my_games .my-games-court-value {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.page-my_games .my-games-owner-val,
.my-games-owner-val {
  display: inline-block;
  font-weight: 600;
  color: #334155;
}

.page-my_games .my-games-court-compact,
.my-games-court-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 0;
  align-items: center;
  border: 1px solid #e7edf7;
  border-radius: 8px;
  background: #f8fbff;
  overflow: hidden;
}

.page-my_games .my-games-court-owner,
.my-games-court-owner {
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 700;
  color: #0f172a;
  min-width: 0;
  padding: 6px 7px;
  background: #ffffff;
  border-right: 1px solid #e7edf7;
}

.page-my_games .my-games-court-place,
.my-games-court-place {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.76rem;
  line-height: 1.2;
  color: #475569;
  min-width: 0;
  padding: 6px 7px;
}

.page-my_games .my-games-court-primary,
.my-games-court-primary {
  font-weight: 700;
  color: #1f2937;
}

.page-my_games .my-games-court-sep,
.my-games-court-sep {
  color: #94a3b8;
}

.page-my_games .my-games-court-secondary,
.my-games-court-secondary {
  color: #64748b;
}

.page-my_games .my-games-level-badge,
.my-games-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  min-width: 28px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.page-my_games .my-games-price-val,
.my-games-price-val {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid #dbe7f2;
  background: #f8fbff;
  color: #334155;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.page-my_games .my-games-when-cell,
.my-games-when-cell {
  display: grid;
  gap: 4px;
}

.page-my_games .my-games-weekday,
.my-games-weekday {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #dbe7f2;
  background: #f8fbff;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

.page-my_games .my-games-date,
.my-games-date {
  display: inline-grid;
  align-items: start;
  justify-items: start;
  gap: 2px;
  text-align: left;
}

.page-my_games .my-games-date-top,
.my-games-date-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-my_games .my-games-date-duration,
.my-games-date-duration {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.1;
}

@media (min-width: 901px) {
  .page-my_games #invitesTable .my-games-when-cell,
  .page-my_games #ownedTable .my-games-when-cell {
    display: block;
  }

  .page-my_games #invitesTable .my-games-weekday,
  .page-my_games #ownedTable .my-games-weekday {
    padding: 1px 7px;
    font-size: 0.68rem;
    background: #ffffff;
    color: #64748b;
    border-color: #cbd5e1;
  }
}

/* Fallback for templates where body endpoint class differs from .page-my_games */
.my-games-court-meta {
  display: grid;
  gap: 1px;
}

.my-games-court-line {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
}

.my-games-court-label {
  font-size: 0.72rem;
  color: var(--subtle);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 0;
}

.my-games-court-value {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.page-players .players-section,
.page-player .player-section {
  margin-bottom: 14px;
}

.page-players .players-name-link {
  color: #0b5a53;
  font-weight: 700;
  text-decoration: none;
}

.page-players .players-name-link:hover {
  text-decoration: underline;
}

.page-players .players-name-link.is-static {
  color: #1d2433;
}

.players-stat-inline {
  display: inline;
  font-size: 0.84rem;
  font-weight: 700;
  color: #1d2433;
}

@media (max-width: 900px) {
  .page-players .table-wrap,
  .page-player .table-wrap {
    overflow: visible;
  }

  .page-players .data-table,
  .page-player .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .page-players .data-table thead,
  .page-player .data-table thead {
    display: none;
  }

  .page-players .data-table,
  .page-players .data-table tbody,
  .page-players .data-table tr,
  .page-players .data-table td,
  .page-player .data-table,
  .page-player .data-table tbody,
  .page-player .data-table tr,
  .page-player .data-table td {
    display: block;
    width: 100%;
  }

  .page-players .data-table tbody,
  .page-player .data-table tbody {
    display: grid;
    gap: 8px;
  }

  .page-players .data-table tr,
  .page-player .data-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 4px 14px rgba(29, 36, 51, 0.06);
  }

  .page-players .data-table td,
  .page-player .data-table td {
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
    padding: 6px 0;
    text-align: left;
  }

  .page-players .data-table td:last-child,
  .page-player .data-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .page-players .data-table td::before,
  .page-player .data-table td::before {
    content: "";
    display: block;
    margin-bottom: 3px;
    color: var(--subtle);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .page-players #playersTable tr {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "picture name"
      "level games";
    column-gap: 10px;
    row-gap: 6px;
    align-items: center;
  }

  .page-players #playersTable td {
    border-bottom: none;
    padding: 0;
  }

  .page-players #playersTable td::before {
    display: none;
  }

  .page-players #playersTable td:nth-child(1) { grid-area: picture; }
  .page-players #playersTable td:nth-child(2) { grid-area: name; min-width: 0; }
  .page-players #playersTable td:nth-child(3) { grid-area: level; }
  .page-players #playersTable td:nth-child(4) { grid-area: games; }

  .page-players #playersTable td:nth-child(1) .mini-avatar {
    width: 44px;
    height: 44px;
  }

  .page-players .players-name-link {
    display: block;
    font-size: 0.96rem;
    line-height: 1.2;
    word-break: break-word;
  }

  .page-players .players-stat-inline {
    display: inline;
    font-size: 0.84rem;
    font-weight: 700;
    color: #1d2433;
  }

  .page-player #playerGamesTable td:nth-child(1)::before { content: "When"; }
  .page-player #playerGamesTable td:nth-child(2)::before { content: "Duration"; }
  .page-player #playerGamesTable td:nth-child(3)::before { content: "Court"; }
  .page-player #playerGamesTable td:nth-child(4)::before { content: "Status"; }

  .page-player #playerResultsTable td:nth-child(1)::before { content: "Created"; }
  .page-player #playerResultsTable td:nth-child(2)::before { content: "Game"; }
  .page-player #playerResultsTable td:nth-child(3)::before { content: "Score"; }
}

.player-communities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 12px;
}

.player-community-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.player-community-logo {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  background: var(--surface-2);
}

.player-community-logo-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--subtle);
}

.player-community-name {
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  max-width: 100%;
}

.page-admin_players .search-row {
  margin-bottom: 10px;
}

.admin-players-sort-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 10px;
}

.admin-players-sort-row .community-sort-btn.small {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
}

.admin-players-danger-switch {
  margin-bottom: 10px;
}

.admin-players-danger-switch input:checked + .slider {
  background: #b91c1c;
}

.admin-players-danger-switch input:checked ~ span:last-child {
  color: #991b1b;
  font-weight: 700;
}

.admin-player-id-full,
.admin-player-level-full {
  display: none;
}

.admin-player-id-short,
.admin-player-level-short {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #dbe7f2;
  background: #f8fbff;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.admin-player-level-short {
  color: #1e40af;
  border-color: #bfdbfe;
  background: #dbeafe;
}

@media (max-width: 900px) {
  .page-admin_players .grid-form {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .page-admin_players .search-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .page-admin_players .search-row input[type="text"] {
    width: 100%;
  }

  .admin-players-sort-row {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    margin-bottom: 8px;
  }

  .admin-players-sort-row .community-sort-btn.small {
    flex: 0 0 auto;
    font-size: 0.74rem;
    padding: 4px 7px;
  }

  .page-admin_players .table-wrap {
    overflow: visible;
  }

  .page-admin_players .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .page-admin_players .data-table thead {
    display: none;
  }

  .page-admin_players .data-table,
  .page-admin_players .data-table tbody,
  .page-admin_players .data-table tr,
  .page-admin_players .data-table td {
    display: block;
    width: 100%;
  }

  .page-admin_players .data-table tbody {
    display: grid;
    gap: 8px;
  }

  .page-admin_players .data-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 4px 14px rgba(29, 36, 51, 0.06);
  }

  .page-admin_players .data-table td {
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
    padding: 6px 0;
    text-align: left;
  }

  .page-admin_players .data-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .page-admin_players #adminPlayersTable tr {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    grid-template-areas:
      "avatar first id"
      "avatar second level"
      "email email email"
      "trainer location location"
      "actions actions actions";
    gap: 4px 8px;
    align-items: start;
    padding: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  }

  .page-admin_players #adminPlayersTable td {
    border-bottom: none;
    padding: 0;
  }

  .page-admin_players #adminPlayersTable td::before {
    display: none;
  }

  .page-admin_players #adminPlayersTable td:nth-child(1) {
    grid-area: id;
    justify-self: end;
    padding: 0;
  }
  .page-admin_players #adminPlayersTable td:nth-child(2) { grid-area: avatar; }
  .page-admin_players #adminPlayersTable td:nth-child(3) {
    grid-area: first;
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.15;
    color: #0f172a;
  }
  .page-admin_players #adminPlayersTable td:nth-child(4) {
    grid-area: second;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.15;
  }
  .page-admin_players #adminPlayersTable td:nth-child(5) {
    grid-area: email;
    color: #64748b;
    font-size: 0.76rem;
    overflow-wrap: anywhere;
  }
  .page-admin_players #adminPlayersTable td:nth-child(6) {
    grid-area: level;
    justify-self: end;
    padding: 0;
  }
  .page-admin_players #adminPlayersTable td:nth-child(7) { grid-area: trainer; }
  .page-admin_players #adminPlayersTable td:nth-child(8) {
    grid-area: location;
    color: #64748b;
    font-size: 0.76rem;
    overflow-wrap: anywhere;
  }
  .page-admin_players #adminPlayersTable td:nth-child(9) { grid-area: actions; margin-top: 2px; }

  .page-admin_players #adminPlayersTable .mini-avatar {
    width: 34px;
    height: 34px;
  }

  .page-admin_players #adminPlayersTable .action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
    align-items: center;
  }

  .page-admin_players #adminPlayersTable .action-cell form {
    margin: 0;
  }

  .page-admin_players #adminPlayersTable .action-cell .small,
  .page-admin_players #adminPlayersTable .action-cell .button-link.small {
    width: auto;
    min-width: 86px;
    padding: 4px 7px;
    font-size: 0.74rem;
    text-align: center;
    justify-content: center;
  }

  .page-admin_players .admin-player-id-short,
  .page-admin_players .admin-player-level-short {
    display: none;
  }

  .page-admin_players .admin-player-id-full,
  .page-admin_players .admin-player-level-full {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #dbe7f2;
    background: #f8fbff;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
  }

  .page-admin_players .admin-player-level-full {
    color: #1e40af;
    border-color: #bfdbfe;
    background: #dbeafe;
  }
}

@media (max-width: 900px) {
  .page-my_games .my-games-filter {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .page-my_games .my-games-filter input[type="text"] {
    width: 100%;
  }

  .page-my_games .my-games-section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .page-my_games .my-games-actions {
    width: 100%;
    margin-left: 0;
  }

  .page-my_games .my-games-actions .small {
    width: 100%;
  }

  .page-my_games .my-games-quick-filter-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    margin: -1px 0 8px;
  }

  .page-my_games .my-games-quick-filter-block {
    padding: 6px 7px;
    border-radius: 9px;
  }

  .page-my_games .my-games-quick-filter-title {
    font-size: 0.66rem;
    margin-bottom: 5px;
  }

  .page-my_games .my-games-quick-filters,
  .my-games-quick-filters {
    margin: 0;
    gap: 5px;
  }

  .page-my_games .my-games-cards-toggle {
    margin: 4px 0 8px;
    width: 100%;
    justify-content: center;
  }

  .page-my_games .data-table tbody tr.mobile-card-hidden {
    display: none;
  }

  .page-my_games .table-wrap {
    overflow: visible;
  }

  .page-my_games .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .page-my_games .data-table thead {
    display: none;
  }

  .page-my_games .data-table,
  .page-my_games .data-table tbody,
  .page-my_games .data-table tr,
  .page-my_games .data-table td {
    display: block;
    width: 100%;
  }

  .page-my_games .data-table tbody {
    display: grid;
    gap: 6px;
  }

  .page-my_games .data-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(29, 36, 51, 0.07);
  }

  .page-my_games .data-table td {
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
    padding: 6px 8px;
    text-align: left;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    column-gap: 6px;
    align-items: start;
  }

  .page-my_games .data-table td:last-child {
    border-bottom: none;
    padding-bottom: 8px;
  }

  .page-my_games .data-table td::before {
    content: "";
    display: block;
    margin: 0;
    padding-top: 1px;
    color: var(--subtle);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .page-my_games .data-table td > * {
    min-width: 0;
  }

  .page-my_games .data-table td .row-actions {
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    justify-content: stretch;
  }

  .page-my_games .data-table td .row-actions button,
  .page-my_games .data-table td .row-actions .button-link {
    flex: 1 1 0;
    min-width: 0;
  }

  .page-my_games .data-table td .small,
  .page-my_games .data-table td .button-link.small {
    padding: 4px 7px;
    font-size: 0.72rem;
    border-radius: 9px;
  }

  .page-my_games .data-table td:nth-child(1) {
    grid-template-columns: 1fr;
    gap: 4px;
    background: #ffffff;
    border-bottom: 1px solid #e7edf7;
    padding: 7px 8px;
  }

  .page-my_games .data-table td:nth-child(1)::before {
    display: none;
  }

  .page-my_games .data-table td:nth-child(1) .my-games-date,
  .page-my_games .data-table td:nth-child(1) .button-link.small {
    width: 100%;
  }

  .page-my_games #invitesTable td:nth-child(6),
  .page-my_games #invitesTable td:nth-child(7),
  .page-my_games #applicationsTable td:nth-child(7),
  .page-my_games #applicationsTable td:nth-child(8),
  .page-my_games #pendingRequestsTable td:nth-child(5),
  .page-my_games #ownedTable td:nth-child(7),
  .page-my_games #ownedTable td:nth-child(8) {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .page-my_games #invitesTable td:nth-child(6)::before,
  .page-my_games #invitesTable td:nth-child(7)::before,
  .page-my_games #applicationsTable td:nth-child(7)::before,
  .page-my_games #applicationsTable td:nth-child(8)::before,
  .page-my_games #pendingRequestsTable td:nth-child(5)::before,
  .page-my_games #ownedTable td:nth-child(7)::before,
  .page-my_games #ownedTable td:nth-child(8)::before {
    margin-bottom: 2px;
  }

  .page-my_games #invitesTable td:nth-child(7) .small,
  .page-my_games #applicationsTable td:nth-child(7) .small,
  .page-my_games #applicationsTable td:nth-child(8) .small,
  .page-my_games #ownedTable td:nth-child(8) .small {
    width: 100%;
  }

  .page-my_games .my-games-court-line {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 4px;
  }

  .page-my_games .my-games-court-label {
    font-size: 0.64rem;
  }

  .page-my_games .my-games-court-value {
    font-size: 0.79rem;
    line-height: 1.15;
  }

  .page-my_games .my-games-weekday,
  .my-games-weekday {
    font-size: 0.62rem;
    padding: 1px 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
    border-radius: 999px;
    font-weight: 700;
  }

  .page-my_games #invitesTable .my-games-when-cell,
  .page-my_games #ownedTable .my-games-when-cell {
    display: block;
  }

  .page-my_games .my-games-date {
    padding: 5px 7px;
    align-items: center;
    justify-items: start;
    border-radius: 8px;
    border: 1px solid #d6e3f3;
    background: #f8fbff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }

  .page-my_games #invitesTable td:nth-child(1) .button-link.small,
  .page-my_games #ownedTable td:nth-child(1) .button-link.small {
    width: 100%;
    max-width: none;
    text-align: left;
  }

  .page-my_games #invitesTable td:nth-child(7) .small,
  .page-my_games #ownedTable td:nth-child(8) .small {
    width: 100%;
  }

  /* Compact mobile card composition for key My Games tables */
  .page-my_games #invitesTable tr {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "when when when"
      "court court court"
      "level status calendar"
      "action action action";
    gap: 0;
  }

  .page-my_games #invitesTable td {
    border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
  }

  .page-my_games #invitesTable td::before {
    display: none;
  }

  .page-my_games #invitesTable td:nth-child(1) { grid-area: when; }
  .page-my_games #invitesTable td:nth-child(2) {
    grid-area: court;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }
  .page-my_games #invitesTable td:nth-child(4) { grid-area: level; }
  .page-my_games #invitesTable td:nth-child(5) { grid-area: status; }
  .page-my_games #invitesTable td:nth-child(6) { grid-area: action; }
  .page-my_games #invitesTable td:nth-child(7) { grid-area: calendar; border-bottom: none; }

  .page-my_games #invitesTable td:nth-child(4),
  .page-my_games #invitesTable td:nth-child(5),
  .page-my_games #invitesTable td:nth-child(6),
  .page-my_games #invitesTable td:nth-child(7) {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }

  .page-my_games #invitesTable td:nth-child(4)::before,
  .page-my_games #invitesTable td:nth-child(5)::before {
    display: none;
  }
  .page-my_games #invitesTable td:nth-child(6)::before { content: "Action"; display: block; }
  .page-my_games #invitesTable td:nth-child(7)::before { content: "Calendar"; display: block; }

  .page-my_games #invitesTable td:nth-child(3),
  .page-my_games #ownedTable td:nth-child(6) {
    background: #fbfdff;
  }

  .page-my_games #invitesTable td:nth-child(4),
  .page-my_games #invitesTable td:nth-child(5),
  .page-my_games #ownedTable td:nth-child(4),
  .page-my_games #ownedTable td:nth-child(5) {
    background: #f8fbff;
    border-bottom-style: solid;
    border-bottom-color: #e7edf7;
  }

  .page-my_games #invitesTable td:nth-child(4),
  .page-my_games #ownedTable td:nth-child(4) {
    border-right: 1px solid #e7edf7;
  }

  .page-my_games #ownedTable tr {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "when when when"
      "court court court"
      "level status calendar"
      "price action action";
    gap: 0;
  }

  .page-my_games #ownedTable td {
    border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
  }

  .page-my_games #ownedTable td::before {
    display: none;
  }

  .page-my_games #ownedTable td:nth-child(1) { grid-area: when; }
  .page-my_games #ownedTable td:nth-child(2) { display: none; }
  .page-my_games #ownedTable td:nth-child(3) {
    grid-area: court;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }
  .page-my_games #ownedTable td:nth-child(4) { grid-area: level; }
  .page-my_games #ownedTable td:nth-child(5) { grid-area: status; }
  .page-my_games #ownedTable td:nth-child(6) { grid-area: price; }
  .page-my_games #ownedTable td:nth-child(7) { grid-area: action; }
  .page-my_games #ownedTable td:nth-child(8) { grid-area: calendar; border-bottom: none; }

  .page-my_games #ownedTable td:nth-child(4),
  .page-my_games #ownedTable td:nth-child(5),
  .page-my_games #ownedTable td:nth-child(6),
  .page-my_games #ownedTable td:nth-child(7),
  .page-my_games #ownedTable td:nth-child(8) {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }

  .page-my_games #ownedTable td:nth-child(4)::before,
  .page-my_games #ownedTable td:nth-child(5)::before {
    display: none;
  }
  .page-my_games #ownedTable td:nth-child(6)::before { content: "Price"; display: block; }
  .page-my_games #ownedTable td:nth-child(7)::before { content: "Action"; display: block; }
  .page-my_games #ownedTable td:nth-child(8)::before { content: "Calendar"; display: block; }

  .page-my_games #invitesTable td:nth-child(6),
  .page-my_games #invitesTable td:nth-child(7),
  .page-my_games #ownedTable td:nth-child(7),
  .page-my_games #ownedTable td:nth-child(8) {
    background: #ffffff;
  }

  .page-my_games #invitesTable td:nth-child(6) .row-actions,
  .page-my_games #ownedTable td:nth-child(7) .row-actions {
    width: 100%;
  }

  .page-my_games #invitesTable td:nth-child(6) .small,
  .page-my_games #ownedTable td:nth-child(7) .small {
    width: 100%;
  }

  .page-my_games #invitesTable td:nth-child(7),
  .page-my_games #ownedTable td:nth-child(8) {
    justify-self: end;
    align-self: center;
    min-width: 128px;
  }

  .page-my_games #invitesTable td:nth-child(7) .small,
  .page-my_games #ownedTable td:nth-child(8) .small {
    width: auto;
    min-width: 128px;
  }

  .page-my_games #invitesTable td:nth-child(7) .calendar-bubble-btn,
  .page-my_games #ownedTable td:nth-child(8) .calendar-bubble-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 0.84rem;
  }

  .page-my_games #invitesTable td:nth-child(4),
  .page-my_games #invitesTable td:nth-child(5),
  .page-my_games #ownedTable td:nth-child(4),
  .page-my_games #ownedTable td:nth-child(5) {
    align-self: center;
    justify-self: start;
    padding-top: 8px;
    padding-bottom: 8px;
    border-right: none;
    background: #ffffff;
  }

  .my-games-court-line {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 4px;
  }

  .my-games-court-label {
    font-size: 0.64rem;
  }

  .my-games-court-value {
    font-size: 0.79rem;
    line-height: 1.15;
  }

  .page-my_games .my-games-date-top {
    gap: 5px;
    font-size: 0.76rem;
    line-height: 1.15;
  }

  .page-my_games .my-games-date-duration {
    font-size: 0.64rem;
    color: #475569;
  }

  .page-my_games .my-games-court-owner {
    font-size: 0.78rem;
  }

  .page-my_games .my-games-court-place {
    font-size: 0.72rem;
    gap: 3px;
  }

  .page-my_games .my-games-court-compact {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    border-radius: 7px;
  }

  .page-my_games .my-games-owner-val {
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .page-my_games .my-games-level-badge,
  .page-my_games .my-games-price-val {
    font-size: 0.68rem;
    min-height: 18px;
    padding: 1px 7px;
  }

  /* Final mobile lock-in for compact Level/Status + Calendar row */
  .page-my_games #invitesTable td:nth-child(4),
  .page-my_games #invitesTable td:nth-child(5),
  .page-my_games #ownedTable td:nth-child(4),
  .page-my_games #ownedTable td:nth-child(5) {
    width: auto;
    justify-self: stretch;
    align-self: stretch;
    display: flex;
    align-items: center;
  }

  .page-my_games #invitesTable td:nth-child(5) .pill,
  .page-my_games #ownedTable td:nth-child(5) .pill {
    width: auto;
  }

  .page-my_games #invitesTable td:nth-child(7),
  .page-my_games #ownedTable td:nth-child(8) {
    justify-self: stretch;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .page-my_games #invitesTable td:nth-child(7) .small,
  .page-my_games #ownedTable td:nth-child(8) .small {
    width: auto;
    min-width: 128px;
  }

  .page-my_games #applicationsTable tr {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "when when when"
      "court court court"
      "owner owner owner"
      "type level status"
      "action action calendar";
    gap: 0;
  }

  .page-my_games #applicationsTable td::before {
    display: none;
  }

  .page-my_games #applicationsTable td:nth-child(1) { grid-area: when; }
  .page-my_games #applicationsTable td:nth-child(2) {
    grid-area: court;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }
  .page-my_games #applicationsTable td:nth-child(3) { grid-area: owner; }
  .page-my_games #applicationsTable td:nth-child(4) {
    grid-area: type;
    display: flex;
    align-items: center;
  }
  .page-my_games #applicationsTable td:nth-child(5) {
    grid-area: level;
    display: flex;
    align-items: center;
  }
  .page-my_games #applicationsTable td:nth-child(6) {
    grid-area: status;
    display: flex;
    align-items: center;
  }
  .page-my_games #applicationsTable td:nth-child(7) {
    grid-area: action;
    display: flex;
    align-items: center;
  }
  .page-my_games #applicationsTable td:nth-child(8) {
    grid-area: calendar;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-bottom: none;
  }

  .page-my_games #applicationsTable td:nth-child(4)::before { content: "Type"; display: block; }
  .page-my_games #applicationsTable td:nth-child(5)::before { content: "Level"; display: block; }
  .page-my_games #applicationsTable td:nth-child(6)::before { content: "Status"; display: block; }
  .page-my_games #applicationsTable td:nth-child(7)::before { content: "Action"; display: block; }
  .page-my_games #applicationsTable td:nth-child(8)::before { content: "Calendar"; display: block; }

  .page-my_games #pendingRequestsTable tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "when when"
      "court court"
      "requester requester"
      "status action";
    gap: 0;
  }

  .page-my_games #pendingRequestsTable td::before {
    display: none;
  }

  .page-my_games #pendingRequestsTable td:nth-child(1) { grid-area: when; }
  .page-my_games #pendingRequestsTable td:nth-child(2) {
    grid-area: court;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }
  .page-my_games #pendingRequestsTable td:nth-child(3) { grid-area: requester; }
  .page-my_games #pendingRequestsTable td:nth-child(4) {
    grid-area: status;
    display: flex;
    align-items: center;
  }
  .page-my_games #pendingRequestsTable td:nth-child(5) {
    grid-area: action;
    display: flex;
    align-items: center;
  }

  .page-my_games #pendingRequestsTable td:nth-child(4)::before { content: "Status"; display: block; }
  .page-my_games #pendingRequestsTable td:nth-child(5)::before { content: "Action"; display: block; }

}

@media (max-width: 850px) {
  .grid-form {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    gap: 6px;
  }

  .day {
    min-height: 95px;
  }

  .event {
    font-size: 0.75rem;
  }
}

@media (max-width: 1000px) {
  .container {
    padding: 12px;
  }

  .nav-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: center;
  }

  .links {
    flex-wrap: wrap;
    gap: 8px;
    width: fit-content;
    justify-content: center;
  }

  .page-tabs {
    justify-content: flex-start;
    gap: 8px;
  }

  .page-menu-dropdown {
    width: 100%;
    justify-content: space-between;
  }

  .page-menu-dropdown select {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .calendar-fab-menu {
    top: 10px;
    right: 10px;
  }

  .topbar {
    flex-direction: row;
    gap: 8px;
    align-items: center;
  }

  .page-title-logo {
    max-width: 120px;
    max-height: 34px;
  }

  .page-title-logo-wrap {
    width: auto;
    justify-content: flex-end;
    margin-top: 0;
  }

  .card {
    padding: 12px;
    border-radius: 10px;
  }

  .calendar-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .calendar-actions {
    flex-wrap: wrap;
  }

  .calendar-actions-left,
  .calendar-actions-right {
    width: 100%;
    justify-content: flex-start;
  }

  .calendar-card {
    overflow-x: hidden;
  }

  .calendar-grid {
    min-width: 700px;
    gap: 4px;
  }

  .calendar-grid.week-feed {
    min-width: 0;
    gap: 8px;
  }

  .calendar-grid.week-feed .day {
    min-height: auto;
    padding: 8px;
  }

  .day {
    min-height: 88px;
    padding: 6px;
  }

  .event {
    font-size: 0.68rem;
    padding: 5px;
  }

  .event .avatar-chip,
  .event .avatar-chip.small {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }

  .event .avatars-row,
  .event .avatars-row.compact {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .event .avatars-row.compact {
    grid-template-columns: none;
  }

  .modal-content {
    width: calc(100% - 12px);
    margin: 3vh auto 0;
    padding: 12px;
    max-height: 94vh;
    overflow-y: auto;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions button,
  .modal-actions .button-link {
    flex: 1 1 130px;
  }

  .game-card-footer .button-link {
    flex: 1 1 auto;
  }

  .search-row {
    flex-direction: column;
  }

  .selected-row,
  .search-result-row,
  .incoming-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .result-teams-preview {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .manage-team-preview {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .result-vs {
    text-align: center;
  }

  .data-table {
    font-size: 0.86rem;
  }

  input {
    font-size: 16px;
  }
}
