/* Compact home mode hub - SA-2026.08.23.32 */
.join-form-account-fields[hidden] {
  display: none !important;
}

.home-auth-gate {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.home-auth-gate > span {
  display: none;
}

.home-auth-gate:has(#open-auth-button[hidden]) {
  display: none;
}

.home-auth-gate #open-auth-button:not([hidden]) {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(72, 215, 239, 0.44);
  border-radius: 12px;
  color: #bff8ff;
  background: linear-gradient(100deg, rgba(22, 73, 103, 0.78), rgba(14, 35, 59, 0.92));
  font-weight: 900;
  letter-spacing: 0.08em;
}

#home-core-modes {
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

#join-form,
.home-primary-links {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

#home-core-modes > button,
.home-primary-links > button,
.home-mode-catalog > button {
  min-width: 0;
  overflow: hidden;
}

#home-core-modes > button > span,
.home-primary-links > button > span,
.home-mode-catalog > button > span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

#home-core-modes strong,
#home-core-modes small,
.home-primary-links strong,
.home-primary-links small,
.home-mode-catalog strong,
.home-mode-catalog small {
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.home-game-modes-button {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(92, 225, 226, 0.48);
  border-radius: 12px;
  color: #e9ffff;
  background: radial-gradient(circle at 88% 50%, rgba(191, 255, 72, 0.16), transparent 34%), linear-gradient(110deg, rgba(10, 61, 80, 0.94), rgba(14, 30, 53, 0.94));
  text-align: left;
  cursor: pointer;
}

.home-game-modes-button::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(#35d9ff, #c8ff45);
}

.home-game-modes-button span,
.home-game-modes-button strong,
.home-game-modes-button small {
  display: block;
}

.home-game-modes-button strong {
  color: #f3ffff;
  font-size: 0.86rem;
  letter-spacing: 0.075em;
}

.home-game-modes-button small {
  margin-top: 4px;
  color: #83c9d4;
  font-size: 0.59rem;
  letter-spacing: 0.045em;
}

.home-game-modes-button b {
  color: #c8ff45;
  font-size: 1.55rem;
  line-height: 1;
  transition: transform 180ms ease;
}

.home-game-modes-button:hover b,
.home-game-modes-button:focus-visible b {
  transform: rotate(90deg);
}

.home-game-modes-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(70, 213, 235, 0.3);
  border-radius: 22px;
  color: #edfaff;
  background: radial-gradient(circle at 92% 0%, rgba(190, 255, 70, 0.14), transparent 30%), radial-gradient(circle at 0% 100%, rgba(35, 193, 228, 0.14), transparent 38%), #091324;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), inset 0 1px rgba(255, 255, 255, 0.06);
}

.home-game-modes-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  animation: home-mode-dialog-in 220ms cubic-bezier(.2, .8, .2, 1);
}

.home-game-modes-dialog::backdrop {
  background: rgba(2, 8, 18, 0.78);
  backdrop-filter: blur(8px);
}

.home-game-modes-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #dffbff;
  background: rgba(4, 14, 28, 0.72);
  font-size: 1.3rem;
  cursor: pointer;
}

.home-game-modes-header {
  padding: 30px 68px 22px 30px;
  border-bottom: 1px solid rgba(87, 210, 230, 0.14);
}

.home-game-modes-header .eyebrow {
  color: #5de6ed;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.home-game-modes-header h2 {
  margin: 8px 0 6px;
  color: #f5fbff;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
}

.home-game-modes-header p {
  margin: 0;
  color: #8da4b6;
  font-size: 0.86rem;
}

.home-mode-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.home-mode-catalog > button:not([hidden]) {
  width: 100%;
  min-height: 84px;
  margin: 0;
}

.home-mode-catalog .private-game-rules:not([hidden]) {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  text-align: center;
}

body.home-mode-dialog-open {
  overflow: hidden;
}

@keyframes home-mode-dialog-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .home-game-modes-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
    border-radius: 17px;
  }

  .home-game-modes-header {
    padding: 23px 58px 17px 18px;
  }

  .home-mode-catalog {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 14px;
  }

  .home-mode-catalog > button:not([hidden]) {
    min-height: 68px;
  }

  .home-game-modes-button small {
    max-width: 250px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .home-game-modes-dialog {
    width: min(900px, calc(100vw - 18px));
    max-height: calc(100dvh - 12px);
  }

  .home-game-modes-dialog[open] {
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
    grid-template-rows: 1fr;
  }

  .home-game-modes-header {
    padding: 26px 24px;
    border-right: 1px solid rgba(87, 210, 230, 0.14);
    border-bottom: 0;
  }

  .home-mode-catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }

  .home-mode-catalog > button:not([hidden]) {
    min-height: 64px;
  }
}
