/* Home, "returning to the room…" and the lobby (desktop; phones: phone.css). */

/* ------------------------------------------------------------------------ */
/* Home / lobby / connecting                                                  */
/* ------------------------------------------------------------------------ */

.home-screen, .center-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
  background: radial-gradient(1100px 620px at 50% -12%, rgba(28, 83, 117, 0.55), transparent 70%), var(--ground);
}
.home-card { display: flex; flex-direction: column; gap: 16px; width: min(440px, 100%); padding: 28px; border-radius: 24px; }
.home-art { width: 150px; align-self: center; margin: -4px 0 -6px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35)); }
.home-brand { text-align: center; }
.brand-logo-xl { margin: 0; font-size: 34px; letter-spacing: .12em; }
.home-brand p { margin: 6px 0 0; }
.home-actions { display: flex; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: rgba(234, 240, 244, 0.12); }
.join-row { display: flex; gap: 10px; }
.input-code { flex: 1 1 0; min-height: 48px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .3em; text-align: center; text-transform: uppercase; }
.input-code::placeholder { letter-spacing: .3em; }
.home-foot { display: flex; justify-content: center; }

.connecting-card { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 32px; text-align: center; }
.connecting-card p { margin: 0; max-width: 340px; }
.connecting-card > .icon { color: var(--accent); }
.row-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.lobby-screen { display: flex; flex-direction: column; gap: 20px; max-width: 1120px; min-height: 100vh; margin: 0 auto; padding: 16px 24px 24px; }
.lobby-main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); align-items: start; gap: 20px; }
.lobby-card { display: flex; flex-direction: column; gap: 24px; padding: 24px; border-radius: 24px; }
.lobby-room { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.lobby-room-text { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.lobby-room p { margin: 0; }
.lobby-room .home-art { flex: none; width: 150px; margin: 0; }
.lobby-code { font-family: var(--font-display); font-weight: 700; font-size: 56px; letter-spacing: .16em; line-height: 1.05; }
.lobby-players { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lobby-player { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 14px 6px 10px; border: 1px solid transparent; border-radius: 14px; background: var(--row); }
.lobby-player.is-empty { border: 1px dashed var(--line-2); background: transparent; }
.lobby-player.is-offline .avatar { opacity: .55; }
.lobby-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.lobby-spectators { display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
/* Bots in the lobby: robot avatar, "бот · обычный" under the name, a remove button for the host. */
.avatar-bot { color: var(--text-2); }
.lobby-name-col { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.lobby-sub { color: var(--muted); font-size: 12px; }
.lobby-remove { flex: none; width: 34px; min-height: 34px; margin-right: -8px; }
/* The host's «Убрать» next to another person: the same ghost button as a bot's, with its word. */
.lobby-remove.lobby-remove-person { width: auto; gap: 5px; padding: 0 10px; color: var(--muted); }
.lobby-remove.lobby-remove-person:hover { color: var(--text); }
.lobby-add-bot { flex-wrap: wrap; gap: 10px 12px; padding-right: 8px; }
.lobby-free { flex: 1 1 auto; min-width: 0; font-size: 14px; }
.lobby-add-bot-btn { flex: none; gap: 7px; }
.seg { display: inline-flex; flex: none; padding: 3px; border-radius: 12px; background: var(--ground); }
.seg-option { min-height: 30px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 500 13px var(--font); cursor: pointer; }
.seg-option:hover { color: var(--text); }
.seg-option.is-active { background: var(--chip); color: var(--text); font-weight: 600; }
/* "Тема: Катан / ПАСАН" in the room card (the host switches it, the others see it). */
.lobby-theme { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.lobby-theme-label { min-width: 56px; color: var(--muted); font-size: 13px; }
.lobby-theme-value { padding: 4px 10px; border-radius: 9px; background: var(--chip); color: var(--text); font-size: 13px; font-weight: 600; }
.lobby-theme-seg .seg-option[data-theme="pasan"] { letter-spacing: .06em; }
.lobby-layout { flex-wrap: wrap; row-gap: 4px; }
.lobby-layout-hint { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.seg-option:disabled { cursor: default; opacity: .55; }
.seg-option:disabled:hover { color: var(--muted); }
.seg-option.is-active:disabled:hover { color: var(--text); }
.lobby-hint { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 0 4px; color: var(--muted); font-size: 13px; }
.lobby-hint .icon { flex: none; color: var(--muted-2); }
.lobby-hint.is-active { padding: 8px 12px; border: 1px solid var(--accent-line); border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.lobby-hint.is-active .icon { color: var(--accent); }
.lobby-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.lobby-controls p { margin: 0; }
.waiting { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.lobby-screen .feed-card { padding-bottom: 16px; }
.lobby-screen .feed-list { height: 360px; max-height: none; }

/* The right column of the lobby (desktop): the chat, then «Варианты правил». */
.lobby-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lobby-variants { padding: 18px 20px 16px; border-radius: 24px; }
.lobby-variants .card-head { padding: 0 0 12px; }
.variant-rules-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; text-decoration: none; }
.variant-group + .variant-group { margin-top: 12px; }
.variant-group-title { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.variant-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.variant-row { padding: 8px 4px 8px 12px; border: 1px solid transparent; border-radius: 14px; background: var(--row); }
.variant-row.is-on { border-color: var(--accent-line); background: var(--accent-soft); }
.variant-line { display: flex; align-items: flex-start; gap: 4px; }
.variant-label { display: flex; flex: 1 1 auto; align-items: flex-start; gap: 10px; min-width: 0; cursor: pointer; }
.variant-row.is-readonly .variant-label { cursor: default; }
.variant-check {
  flex: none; width: 20px; height: 20px; margin: 1px 0 0; border: 0; border-radius: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Crect x='1' y='1' width='20' height='20' rx='5' fill='%230F2433' stroke='%237F96A6' stroke-width='2'/%3E%3C/svg%3E") center / 20px no-repeat;
  -webkit-appearance: none; appearance: none; cursor: inherit;
}
.variant-check:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Crect x='0' y='0' width='22' height='22' rx='6' fill='%23F4B740'/%3E%3Cpath d='M5.5 11.5 L9.5 15.5 L16.5 7' fill='none' stroke='%231F1606' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.variant-check:disabled:not(:checked) { opacity: .7; }
.variant-row.is-readonly .variant-check:checked { filter: saturate(.75); }
a.btn { text-decoration: none; }
a.btn:hover { color: var(--text); }
.variant-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.variant-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; font-size: 14px; }
.variant-bonus { padding: 1px 7px; border-radius: 8px; background: var(--chip); color: var(--text-2); font-size: 11px; font-weight: 500; }
.variant-short { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.variant-row.is-on .variant-short { color: var(--text-2); }
.variant-help-btn { flex: none; width: 34px; min-height: 34px; margin-top: -4px; color: var(--muted); }
.variant-help-btn.is-open { color: var(--accent); }
.variant-help { margin: 8px 8px 2px 28px; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.variant-help p { margin: 0 0 6px; }
.variant-note { margin: 10px 2px 0; }
.lobby-vp-bonus { color: var(--accent-text); font-size: 13px; font-weight: 500; white-space: nowrap; }
.home-rules { display: inline-flex; align-items: center; gap: 6px; margin-left: 18px; font-size: 13px; font-weight: 500; text-decoration: none; }

/* Laptop screens: the lobby fits without scrolling too. */
@media (min-width: 1024px) and (max-height: 800px) {
  .lobby-screen { gap: 14px; padding-top: 10px; padding-bottom: 14px; }
  .lobby-card { gap: 18px; padding: 20px 24px; }
  .lobby-code { font-size: 48px; }
  .lobby-player { min-height: 44px; padding-top: 3px; padding-bottom: 3px; }
  .lobby-player .avatar { width: 34px; height: 34px; }
  .lobby-room .home-art { width: 120px; }
  .lobby-controls { padding-top: 16px; }
}

/* Invitation links have one name field and one clear join action. */
.invite-title { margin: 0; text-align: center; color: var(--text-2); font-size: 16px; }
.invite-error { margin: 0; padding: 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); line-height: 1.5; }
.invite-back { align-self: center; color: var(--muted); font-size: 13px; text-underline-offset: 3px; }
.invite-join .btn { width: 100%; }
