/* Экраны вне партии: главная, вход и регистрация, профиль, лобби, игра с ботами, приглашение.
   Стиль тот же, что в игре: карта города фоном, карточка-наклейка, толстый контур, жёсткая тень. */
html.flow-root { height: auto; min-height: 100%; overflow: auto; background: #8FD3F4; }
body.flow { min-height: 100%; height: auto; overflow: auto; background: transparent; }
.flow #stage { position: static; width: auto; height: auto; transform: none; overflow: visible; background: transparent; }

/* Фон: город, чуть приглушённый, с облаками */
.flow-city { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: #8FD3F4 url('/frontend/assets/map/city-map.svg') center 38% / cover no-repeat; }
.flow-city::before { content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 248, 231, .35), rgba(43, 35, 32, .45) 90%); }
.flow-city .clouds i { opacity: .55; }

.flow-page { position: relative; z-index: 1; min-height: 100svh; display: flex; flex-direction: column; align-items: center;
  padding: clamp(18px, 5vh, 56px) 16px 48px; gap: 18px; }
.flow-header { display: flex; justify-content: center; }
.flow-logo { display: inline-block; padding: 8px 22px 10px; color: #fff; text-decoration: none; background: var(--red);
  border: 4px solid var(--ink); border-radius: 18px; box-shadow: 0 7px 0 var(--ink);
  font: 800 clamp(2rem, 6vw, 3rem)/1 var(--display); transform: rotate(-3deg);
  animation: logo-in .7s var(--spring) both, wobble 5s ease-in-out .7s infinite; }
.flow-tagline { margin: -4px 0 0; padding: 4px 14px; background: var(--ink); color: #fff; border-radius: 999px;
  font-weight: 700; font-size: .95rem; transform: rotate(1.5deg); }

/* Карточка с содержимым */
.flow-content { width: min(560px, 100%); padding: 22px 24px 20px; background: var(--cream);
  border: var(--line) solid var(--ink); border-radius: var(--r-card); box-shadow: var(--lift-card);
  animation: pop-in .42s var(--spring) both; }
.flow-content h1 { margin: 0 0 14px; font: 800 clamp(1.5rem, 4vw, 2rem)/1.12 var(--display); letter-spacing: -.02em; outline: none; }
.flow-content p { line-height: 1.45; margin: 8px 0; color: #4A4038; }
.flow-content > * + * { margin-top: 12px; }

/* Кнопки: главная — зелёная, как «Играть», остальные — белые наклейки */
.flow-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin: 14px 0; }
.flow-actions.flow-row, .flow-content .flow-actions:has(.flow-invite) { flex-direction: row; flex-wrap: wrap; }
.flow-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 18px;
  color: #fff; text-decoration: none; background: var(--green-ink); border: var(--line) solid var(--ink); border-radius: var(--r-btn);
  box-shadow: var(--lift); font: 800 1.05rem var(--display); cursor: pointer; text-align: center;
  transition: transform .1s ease, box-shadow .1s ease; }
.flow-button:hover { transform: translateY(-2px); box-shadow: var(--lift-hover); }
.flow-button:active { transform: translateY(3px); box-shadow: var(--lift-press); }
.flow-secondary { background: #fff; color: var(--ink); font: 600 .95rem var(--display); min-height: 46px; box-shadow: 0 4px 0 var(--ink); }
.flow-button[hidden] { display: none; }
.flow-button:disabled { opacity: .55; cursor: default; transform: none; }
.flow-button:focus-visible, .flow-logo:focus-visible, .flow-content a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.flow-button small { display: block; font: 600 .8rem 'Golos Text', system-ui, sans-serif; opacity: .85; }

/* Поля — как в стартовом окне игры */
.flow-form { display: grid; gap: 12px; margin: 12px 0; }
.flow-form > .flow-button { margin-top: 6px; }
.flow-field { display: grid; gap: 5px; font-size: .9rem; font-weight: 700; color: var(--muted); }
.flow-field input, .flow-content select, .flow-invite { width: 100%; min-width: 0; min-height: 46px; padding: 0 12px;
  background: #fff; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 10px; font: 600 1rem 'Golos Text', system-ui, sans-serif; }
.flow-field input:focus-visible, .flow-content select:focus-visible, .flow-invite:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.flow-field input[aria-invalid="true"] { border-color: var(--red-ink); background: #FFF1EE; }
.flow-field-hint, .flow-field-error { font-size: .85rem; font-weight: 500; }
.flow-field-hint { color: var(--muted); }
.flow-field-error { color: var(--red-ink); font-weight: 700; }
.flow-field-error:empty { display: none; }
.flow-invite { flex: 1 1 14rem; }

/* Лобби: места за столом — плашками */
.flow-seats { list-style: none; counter-reset: seat; display: grid; gap: 8px; padding: 0; margin: 12px 0; }
.flow-seats li { counter-increment: seat; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px;
  padding: 10px 12px; background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.flow-seats li::before { content: counter(seat); grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px;
  border: 2px solid var(--ink); border-radius: 50%; font: 800 .9rem var(--display); background: var(--yellow); }
.flow-seats li:nth-child(2)::before { background: #F06595; }
.flow-seats li:nth-child(3)::before { background: var(--green); }
.flow-seats li:nth-child(4)::before { background: var(--blue); }
.flow-seats li select { margin-top: 2px; }

/* Код восстановления — заметная наклейка, которую легко выделить */
.flow-code { display: block; padding: 14px 16px; background: var(--yellow); border: 2.5px dashed var(--ink); border-radius: 12px;
  font: 800 1.25rem/1.3 ui-monospace, Consolas, monospace; letter-spacing: .06em; text-align: center;
  overflow-wrap: anywhere; user-select: all; transform: rotate(-1deg); }

.flow-status { color: var(--muted); min-height: 1.3em; font-weight: 600; }
.flow-status:empty { display: none; }

/* Главная: продолжить партию — жёлтой наклейкой сверху */
.flow-resume:not(:empty) { margin: 4px 0 6px; }
.flow-resume .flow-button { width: 100%; background: var(--yellow); color: var(--ink); flex-direction: column; gap: 2px;
  animation: resume-pulse 1.6s ease-in-out infinite alternate; }
@keyframes resume-pulse { to { box-shadow: 0 5px 0 var(--ink), 0 0 0 6px rgba(255, 210, 31, .5); } }
.flow-account { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-top: 10px; padding-top: 12px; border-top: 2px dashed #D8CDB2; }
.flow-account .flow-button { min-height: 0; padding: 0; background: none; border: 0; box-shadow: none; color: var(--muted);
  font: 700 .95rem 'Golos Text', system-ui, sans-serif; text-decoration: underline; text-underline-offset: 3px; }
.flow-account .flow-button:hover { color: var(--ink); transform: none; }

@media (max-width: 520px) {
  .flow-content { padding: 18px 16px 16px; border-radius: 16px; }
  .flow-page { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-logo, .flow-content, .flow-resume .flow-button { animation: none; }
}

/* Кнопки в ряд — одной высоты и ширины; второстепенные отличаются только цветом */
.flow-secondary { min-height: 52px; box-shadow: var(--lift); }
.flow-content > .flow-actions:not(.flow-account) { flex-direction: row; flex-wrap: wrap; }
.flow-content > .flow-actions:not(.flow-account) > .flow-button { flex: 1 1 12rem; }
.flow-content > .flow-actions:has(> .flow-button:only-child) > .flow-button,
.flow-content > div:first-of-type + .flow-actions { flex-basis: 100%; }
