.session-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 237, 226, 0.98);
  z-index: 40;
  overflow: hidden;
}

.session-gate__backdrop-icon {
  position: absolute;
  color: rgba(197, 163, 91, 0.08);
  font-family: var(--font-display);
  line-height: 1;
  user-select: none;
}

.session-gate__backdrop-icon--rook {
  top: 40px;
  right: 44px;
  font-size: 80px;
  transform: rotate(10deg);
}

.session-gate__backdrop-icon--queen {
  top: 36px;
  left: 38px;
  font-size: 90px;
  transform: rotate(-10deg);
}

.session-gate__backdrop-icon--knight {
  bottom: 44px;
  right: 56px;
  font-size: 82px;
  transform: rotate(16deg);
}

.session-gate__backdrop-icon--bishop {
  bottom: 36px;
  left: 34px;
  font-size: 88px;
  transform: rotate(-14deg);
}

.session-gate__card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 34px 28px 26px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(102, 82, 56, 0.08);
}

.session-gate__brand {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 22px;
}

.brand-badge--gate {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 20px;
  background: transparent;
  color: var(--gold);
}

.session-gate__brand h2 {
  font-size: 48px;
  line-height: 0.92;
}

.session-gate__eyebrow {
  color: var(--text-soft);
}

.session-gate__copy {
  max-width: 290px;
  color: var(--text-soft);
  line-height: 1.5;
}

.session-gate__field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.session-gate__field > span {
  font-size: 12px;
  color: var(--text-soft);
}

.session-gate__actions {
  display: grid;
}

.session-gate__actions button {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  transition: opacity 120ms ease;
}

.session-gate__actions button[data-pending="true"] {
  opacity: 0.72;
  cursor: progress;
  position: relative;
  padding-right: 38px;
}

.session-gate__actions button[data-pending="true"]::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: 0.7;
  animation: session-gate-spin 720ms linear infinite;
}

.session-gate__actions button:disabled:not([data-pending="true"]) {
  opacity: 0.55;
  cursor: not-allowed;
}

@keyframes session-gate-spin {
  to { transform: rotate(360deg); }
}

#join-room {
  background: #fffdf9;
  border-color: rgba(211, 102, 80, 0.42);
  color: var(--warn);
}

.session-gate__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  margin: 12px 0;
}

.session-gate__divider::before,
.session-gate__divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.session-gate__error {
  min-height: 18px;
  margin-bottom: 4px;
  color: var(--warn);
}

.overlay-dialog__body,
.promotion-dialog form {
  width: min(470px, calc(100vw - 30px));
  padding: 26px 28px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.overlay-dialog--compact .overlay-dialog__body {
  width: min(410px, calc(100vw - 30px));
}

.dialog-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(197, 163, 91, 0.12);
  font-size: 24px;
  color: var(--gold);
}

.dialog-icon--warn {
  color: var(--warn);
  background: rgba(211, 102, 80, 0.1);
}

.overlay-dialog__body h3,
.promotion-dialog h3 {
  font-size: 28px;
  line-height: 0.95;
}

.overlay-dialog__copy,
.promotion-dialog p {
  max-width: 280px;
  color: var(--text-soft);
  line-height: 1.5;
}

.overlay-dialog__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.overlay-dialog__actions button {
  min-width: 116px;
}

.dialog-meta {
  display: grid;
  gap: 2px;
}

.dialog-meta__line {
  font-size: 14px;
}

.dialog-meta__line--soft {
  color: var(--text-soft);
}

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

.promotion-option {
  min-height: 84px;
  padding: 10px 8px;
  border-radius: 12px;
  border-color: rgba(102, 82, 56, 0.16);
  background: #f4ece1;
  color: var(--text);
  flex-direction: column;
  gap: 6px;
}

.promotion-option__label {
  font-size: 11px;
  font-weight: 700;
}

.invite-field {
  width: 100%;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 55;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 24px));
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(102, 82, 56, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 999px;
  background: rgba(102, 82, 56, 0.18);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast__icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.toast__message {
  min-width: 0;
  font-size: 13px;
}

.toast__close {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
}

.toast--success {
  background: #edf6f0;
  border-color: rgba(92, 138, 103, 0.18);
}

.toast--success::before {
  background: rgba(92, 138, 103, 0.7);
}

.toast--success .toast__icon {
  color: var(--green);
}

.toast--warning,
.toast--error {
  background: #fff3ee;
  border-color: rgba(211, 102, 80, 0.16);
}

.toast--warning::before,
.toast--error::before {
  background: rgba(211, 102, 80, 0.7);
}

.toast--warning .toast__icon,
.toast--error .toast__icon {
  color: var(--warn);
}
