/* The entrance is an illuminated atlas; campaign HUD styles stay independent. */
.lobby {
  isolation: isolate;
  /* The menu scrolls (the player's exception to the no-scroll rule), so the bar shows. */
  scrollbar-width: auto;
  scrollbar-color: #a9945a #0b1d26;
  scrollbar-gutter: stable;
  padding: 32px max(24px, env(safe-area-inset-right)) 32px max(24px, env(safe-area-inset-left));
  background: #101e24;
  color: #e9ddc3;
}

/* Campaign preparation shares the entrance's palette and backdrop, and since
   1 November 2026 its head too: the title, Mute, EN | TR and the name are laid
   out exactly as on the entrance on every screen of the menu (the player asked
   for one header, not a smaller one per screen). */
.lobby .setup-grid { gap: 22px; }
.setup-group { min-width: 0; margin: 0; padding: 18px; border: 1px solid #a9945a55; border-radius: 3px; }
.setup-group legend { padding: 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.09em; }
.setup-world { grid-column: 1 / -1; }
.setup-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.setup-hint { font-size: 12px; line-height: 1.65; opacity: 0.85; margin: 0 0 16px; }
.setup-group .field { min-width: 0; }
.setup-group .input { width: 100%; min-width: 0; min-height: 44px; }
.setup-group .field-check { min-height: 44px; align-items: center; margin: 6px 0; }
.setup-group input[type="checkbox"] { width: 18px; height: 18px; accent-color: #927338; flex-shrink: 0; }
.campaign-settings .setup-grid { margin-top: 18px; }
.campaign-settings .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.campaign-settings .card-foot { margin-top: 20px; }
.campaign-settings .card-foot .btn { min-height: 46px; }
.lobby.menu-in-room .lobby-card { background: #14262eef; border-color: #a9945a77; color: #e9ddc3; padding: 26px; border-radius: 4px; }
.menu-in-room .menu-card-index { display: block; margin-bottom: 14px; }
.menu-in-room .card-head h2 { color: #f0e2c1; font-size: 24px; }
.menu-in-room .muted, .menu-in-room .theatre-hint { color: #b8bdb4; }
.menu-in-room .btn, .menu-in-room .chip-btn { background: #26383f; border-color: #a9945a66; color: #e9ddc3; min-height: 44px; border-radius: 3px; }
.menu-in-room .btn-primary, .menu-in-room .theatre-chip.is-active { background: #cbb078; color: #17272d; border-color: #d4bb7e; }
.menu-in-room .btn:disabled { opacity: 0.45; }
.faction-intro { font: italic 22px/1.5 Georgia, serif; color: #d2bc88; margin: 8px 0; }
.menu-in-room .theatre-bar { padding: 4px 0 4px; gap: 8px; }
/* The parchment palette's host tag (#6a5010 on a faint gold) all but vanished on
   the room's dark card; the menu's own light-on-dark tag colours instead. */
.menu-in-room .tag-host { background: #c8ad7333; color: #e3cb92; border: 1px solid #c8ad7355; }
.menu-in-room .theatre-note { padding: 12px 16px; border-left: 2px solid #cbb078; background: #ffffff05; line-height: 1.7; }
.menu-in-room .theatre-head { color: #d2bc88; margin-top: 22px; padding-bottom: 8px; border-bottom: 1px solid #a9945a33; }
.menu-in-room .faction-card { background: #21363fd9; color: #e9ddc3; border: 1px solid #a9945a55; border-top: 3px solid var(--faction); border-radius: 3px; }
.menu-in-room .faction-card.is-tile { padding: 16px 10px; gap: 10px; min-height: 130px; }
.menu-in-room .faction-card.is-tile .faction-occupant { color: #b8bdb4; opacity: 1; }
.menu-in-room .faction-grid { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; }
.menu-in-room .faction-card:hover:not(:disabled) { background: #314751; border-color: #d4bb7e; }
.menu-in-room .faction-card.is-open { padding: 22px; text-align: left; background: linear-gradient(120deg, #e9ddc3, #cdbc98); color: #263337; }
.menu-in-room .faction-card.is-mine { box-shadow: 0 0 0 2px #d4bb7e; }
.menu-in-room .faction-card.is-open .faction-name { font-size: 22px; }
.menu-in-room .faction-card.is-open :is(.faction-capital, .faction-rivals, .faction-protector, .faction-occupant, .faction-diff) { color: #4a5148; }
.menu-in-room .faction-card.is-open .faction-perk { font-size: 14px; line-height: 1.7; }
.menu-in-room .faction-card.is-open .faction-card-foot { border-top: 1px solid #92733855; padding-top: 16px; gap: 16px; }
.menu-in-room .faction-take { font-style: normal; font-weight: 600; opacity: 1; padding: 9px 14px; background: #20343b; color: #f0e2c1; border-radius: 3px; }
/* The "Your realm" bar is docked to the foot of the window and stays there.
   It is the last thing on the page with nothing after it, so a sticky bottom of
   0 is also where it ends: it never rides up at the end of the scroll. Inside the
   faction card it floated 16 px above the edge and then left with the card. */
.menu-in-room .lobby-actions { position: sticky; bottom: 0; z-index: 3; flex-direction: row; background: #0b1d26; border-top: 1px solid #a9945a77; padding: 14px 20px; margin: 24px -20px 0; box-shadow: 0 -12px 24px #0008; }
.lobby.menu-in-room { padding-bottom: 0; }
.lobby.menu-in-room .lobby-scroll { padding-bottom: 0; }
.seat-summary { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.seat-summary small, .seat-summary strong { display: block; }
.seat-summary small { color: #b8bdb4; font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 4px; }
.seat-summary strong { font: 600 16px/1.4 Georgia, serif; }
.menu-in-room .spectators { border-color: #a9945a33; color: #b8bdb4; padding-top: 16px; }
.menu-in-room .input { background: #0d1d25; color: #f0e2c1; border-color: #a9945a66; }
.menu-in-room .setup-group legend { color: #d2bc88; }
@media (max-width: 600px) {
  .lobby .setup-grid, .lobby .setup-fields { grid-template-columns: minmax(0, 1fr); }
  .setup-group { padding: 14px; }
  .campaign-settings .card-foot { flex-direction: column; align-items: stretch; }
  .lobby.menu-in-room .lobby-card { padding: 16px; }
  .menu-in-room .card-head { flex-wrap: wrap; }
  .menu-in-room .faction-grid { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
  .menu-in-room .faction-card.is-tile { padding: 12px 6px; min-height: 120px; }
  .menu-in-room .faction-card.is-open { padding: 16px; }
  .menu-in-room .faction-card.is-open .faction-name { font-size: 18px; }
  .menu-in-room .lobby-actions { padding: 12px; gap: 8px; margin-inline: -12px; }
  .seat-summary { width: 100%; }
  .menu-in-room .lobby-actions > .btn { flex: 1; }
}
.lobby::before, .lobby::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.lobby::before {
  z-index: -2;
  background:
    linear-gradient(to right, #081923a6, #08192333 55%, transparent),
    linear-gradient(to top, #081923b3, transparent 65%),
    url("menu-warrior-v1.png") center / cover no-repeat;
}
.lobby::after {
  z-index: -1;
  opacity: 0.12;
  background: url("menu-atlas.svg") center / cover no-repeat;
}
.lobby .lobby-scroll {
  width: min(1240px, 100%);
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.lobby-head {
  position: relative;
  min-height: 430px;
  padding: 34px 0 32px;
  margin-bottom: 26px;
  border-bottom: 0;
}
.menu-kicker, .menu-card-index {
  font: 600 10px/1.5 Inter, sans-serif;
  letter-spacing: 0.2em;
  color: #c8ad73;
}
.lobby .lobby-title {
  margin: 18px 0 8px;
  font-size: clamp(56px, 7.6vw, 104px);
  line-height: 1.05;
  letter-spacing: 0.07em;
  color: #f0e2c1;
  text-shadow: 0 4px 30px #0005;
}
.menu-motto {
  margin: 0 0 14px;
  font: italic 24px/1.5 Georgia, serif;
  color: #d2bc88;
}
.lobby .lobby-identity { gap: 12px; }
.lobby .lobby-identity label { color: #b8bdb4; }
/* The connection reads as a line of its own under the name (the player, 31 October 2026). */
.lobby .lobby-identity .lobby-conn { flex-basis: 100%; }
.lobby .lobby-identity .input {
  width: 160px;
  background: #0d191dbb;
  color: #f0e2c1;
  border-color: #a9945a66;
}
.lobby .lobby-conn.is-on { color: #a9c4a6; }
.lobby .lobby-conn.is-off { color: #efad9d; }
.lobby-conn::before { content: "●"; font-size: 8px; margin-right: 7px; }
.lobby:not(.menu-in-room) .lobby-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  /* One row of three doors, one height: at `start` the first card, whose line
     wraps once more, hung 20 px below the other two at 1280x720. */
  align-items: stretch;
}
.lobby .lobby-body > div { min-width: 0; }
.lobby:not(.menu-in-room) .lobby-body > div > .lobby-card { flex: 1 1 auto; }
.lobby:not(.menu-in-room) .lobby-card {
  min-width: 0;
  min-height: 224px;
  padding: 24px;
  border: 1px solid #aa915b66;
  border-radius: 3px;
  background: linear-gradient(135deg, #24343be6, #18272edb);
  color: #e9ddc3;
  box-shadow: inset 0 1px #ffffff08;
}
.lobby:not(.menu-in-room) .card-head {
  align-items: stretch;
  flex-direction: column;
  gap: 18px;
  margin: 10px 0 16px;
}
.lobby:not(.menu-in-room) .card-head h2 { font-size: 21px; color: inherit; }
.lobby:not(.menu-in-room) .card-actions { display: block; }
.lobby:not(.menu-in-room) .card-head .btn { width: 100%; min-height: 44px; }
.lobby:not(.menu-in-room) .btn {
  border-radius: 2px;
  border-color: #a9945a77;
  background: #26383f;
  color: #e9ddc3;
  box-shadow: none;
}
.lobby:not(.menu-in-room) .btn-primary {
  background: #cbb078;
  border-color: #d4bb7e;
  color: #17272d;
  font-weight: 600;
}
.lobby:not(.menu-in-room) .btn:hover { filter: brightness(1.16); }
.lobby :is(button, input, select):focus-visible { outline: 3px solid #e1bd70; outline-offset: 4px; }
.lobby:not(.menu-in-room) .muted { color: #b8bdb4; }
/* **New campaign is a card like the others** (the player, 31 October 2026:
   "new campaign box have different color than join campaign and direct
   battle"). It was a light parchment card with its own dark button; it now
   takes the shared dark card, text and buttons above. Its setup screen follows,
   so the form's labels, fields and legends are lit for a dark ground here. */
.lobby:not(.menu-in-room) .menu-create .field { color: #b8bdb4; }
.lobby:not(.menu-in-room) .menu-create .input { background: #0d1d25; color: #f0e2c1; border-color: #a9945a66; }
.lobby:not(.menu-in-room) .menu-create .input::placeholder { color: #8f9790; opacity: 1; }
.lobby:not(.menu-in-room) .menu-create .setup-group legend { color: #d2bc88; }
/* Contrast on the dark card, worst case its 0.86 fill over a white backdrop:
   the "?" in #b8bdb4 at its 0.75 opacity was 3.7:1, in #e9ddc3 4.9:1; a ticked
   box in #927338 was 2.2:1 against the card, in #cbb078 4.7:1. */
.lobby:not(.menu-in-room) .menu-create .field-help { color: #e9ddc3; }
.lobby:not(.menu-in-room) .menu-create input[type="checkbox"] { accent-color: #cbb078; }
.lobby:not(.menu-in-room) .small { line-height: 1.7; }
.lobby:not(.menu-in-room) .menu-rooms { grid-column: 1 / -1; min-height: 0; padding: 18px 24px; }
.lobby:not(.menu-in-room) .menu-rooms .card-head { flex-direction: row; align-items: center; margin: 0 0 12px; }
.lobby:not(.menu-in-room) .menu-rooms h2 { font-size: 15px; }
.lobby:not(.menu-in-room) .menu-rooms .btn { width: auto; }
.lobby [data-rooms] { overflow-x: auto; }
.lobby:not(.menu-in-room) .room-table th { color: #b8bdb4; }
.lobby:not(.menu-in-room) .room-table .tag { background: #c8ad7322; color: #dfc68f; }
.lobby:not(.menu-in-room) .room-table .tag-running { background: #a9c4a622; color: #b9d4b6; }
.menu-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 24px;
  color: #96a39e;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.menu-footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.menu-in-room .menu-footer { display: none; }
.menu-in-room .lobby-card { color: var(--ink); }
@media (max-width: 800px) {
  .lobby { padding: 24px; }
  .lobby-head { min-height: 410px; }
  .lobby:not(.menu-in-room) .lobby-body { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .lobby:not(.menu-in-room) .lobby-card { min-height: 0; padding: 20px; }
  .lobby:not(.menu-in-room) .card-head { flex-direction: row; align-items: center; gap: 12px; }
  .lobby:not(.menu-in-room) .card-head .btn { width: auto; }
  .menu-footer { flex-direction: column; }
}
@media (max-width: 480px) {
  .lobby { padding: max(20px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); }
  .lobby .lobby-scroll { min-height: 0; }
  .lobby-head { padding-top: 22px; padding-bottom: 24px; min-height: 410px; }
  .lobby::before {
    background:
      linear-gradient(to right, #081923db, #08192366),
      linear-gradient(to top, #08192399, transparent 65%),
      url("menu-warrior-v1.png") 80% center / cover no-repeat;
  }
  .lobby .lobby-identity { position: relative; z-index: 1; padding: 10px; background: #10212de6; border-radius: 3px; }
  .lobby .lobby-title { font-size: clamp(42px, 14vw, 56px); }
  .menu-motto { font-size: 20px; }
  .lobby:not(.menu-in-room) .card-head { align-items: stretch; flex-direction: column; }
  .lobby:not(.menu-in-room) .card-head .btn { width: 100%; }
  .lobby:not(.menu-in-room) .menu-rooms .card-head { flex-wrap: wrap; }
  .lobby .lobby-identity { gap: 9px; }
}

/* The roster and its geographic context share one selection screen. */
.lobby.menu-in-room .lobby-scroll { width: min(1680px, 100%); }
.faction-selection-layout { display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.faction-roster { min-width: 0; }
.faction-atlas { position: sticky; top: 20px; min-width: 0; padding: 24px; margin-top: 18px; border: 1px solid #a9945a77; border-radius: 4px; background: radial-gradient(ellipse at center, #23414a, #102530); box-shadow: inset 0 0 60px #07151b66; }
.faction-atlas h3 { margin: 0 0 12px; color: #e9ddc3; font: 24px/1.3 Georgia, serif; }
.faction-atlas svg { display: block; width: 100%; height: 100%; }
.atlas-main {
  position: relative;
  /* The frame takes the map's own shape (aspect-ratio, set inline) and the map
     runs to it: no sea margin inside the frame (player, 22 November 2026). */
  height: auto;
  max-height: 62vh;
  padding: 0;
  border: 2px solid #c7ac6c;
  border-radius: 3px;
  background: radial-gradient(ellipse at center, #1b3540, #0b1c26);
  box-shadow: 0 3px 14px #06131c66, inset 0 0 0 3px #132630;
  overflow: hidden;
}
.atlas-main::after { content: ""; position: absolute; inset: 4px; border: 1px solid #c7ac6c66; pointer-events: none; }
.atlas-country { cursor: pointer; outline: none; }
.atlas-country[aria-disabled="true"] { cursor: not-allowed; }
.atlas-country[aria-disabled="false"]:hover .atlas-territory,
.atlas-country[aria-disabled="false"]:focus-visible .atlas-territory {
  fill-opacity: 1;
  stroke: #fff0bc;
  stroke-opacity: 1;
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}
.atlas-labels { pointer-events: none; }
.atlas-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
@media (max-width: 1000px) {
  .faction-selection-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .faction-atlas { position: static; grid-row: 1; padding: 16px; }
  .atlas-main { max-height: 300px; }
}
.lobby.menu-in-room .faction-card.is-open { background: linear-gradient(120deg, #e9ddc3, #cdbc98); color: #263337; }

/* **The entrance's title** (lobby.js `playIntro`). The main menu's head is one
   centred composition: Mute / EN | TR in the top row, then the title block
   (kicker, "Thrones", motto), then the name and the connection, then the line
   about the realms — the name above that line, as the player asked
   (31 October 2026). On the first opening of the page the title block stands
   alone and large in the middle of the window, then travels and shrinks into
   its place in the head while the rest of the menu fades in round it: one
   element, animated by transform and opacity only, so there is never a second
   title. It belongs to the head and scrolls with it. A room's lobby and the
   campaign setup wear the same head (1 November 2026). */
.menu-brand { transform-origin: 50% 50%; }
.lobby {
  /* Reserve the scrollbar's gutter on both sides, so the head's centre is the window's. */
  scrollbar-gutter: stable both-edges;
}
.lobby .lobby-head { min-height: 0; }
/* A phone on its side keeps its one-line head (the max-height: 500px block below). */
@media (min-height: 501px) {
  /* The title is centred; the name and the line about the realms stay on the
     left under it, as they always were (the player, 31 October 2026). */
  .lobby .lobby-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .lobby .lobby-head > .lobby-toggles { align-self: flex-end; justify-content: flex-end; }
  .lobby .menu-brand { align-self: center; max-width: 100%; margin-top: 4px; text-align: center; }
  .lobby .lobby-head > .lobby-identity { order: 1; margin-top: 4px; }
}

.lobby.menu-intro-run .lobby-scroll { pointer-events: none; }
.lobby.menu-intro-run :is(.lobby-head > :not(.menu-brand), .menu-footer) { animation: menu-intro-content 3.2s ease-out both; }
/* The body keeps its view fade first in the list, so removing the entrance's
   fade at the end does not restart it. */
.lobby.menu-intro-run:not(.menu-in-room) .lobby-body {
  animation: menu-view-browser 280ms ease-out, menu-intro-content 3.2s ease-out both;
}
@keyframes menu-intro-content {
  0%, 62% { opacity: 0; }
  100% { opacity: 1; }
}

/* A change of view inside the lobby (the menu, a room, the setup) fades its
   body in. Each view has its own animation name so that switching view starts
   one and the rooms table's refresh, which keeps the view, does not. */
.lobby:not(.menu-in-room) .lobby-body { animation: menu-view-browser 280ms ease-out; }
.lobby.menu-in-room .lobby-body { animation: menu-view-room 280ms ease-out; }
@keyframes menu-view-browser { from { opacity: 0; transform: translateY(8px); } }
@keyframes menu-view-room { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  .lobby .lobby-head > *, .lobby .menu-footer, .lobby .lobby-body { animation: none; }
}

/* **The menu's cards let the backdrop through** (the player, 31 October 2026):
   the art shows behind them. A blur behind a translucent
   fill keeps the text on them readable over the bright sunset as well as the
   dark sea. Only the menu itself: the campaign setup and a room's lobby keep
   their solid cards, being forms to be read at length. */
.lobby:not(.menu-in-room) .lobby-card {
  background: linear-gradient(135deg, #24343ba8, #18272e9e);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
@media (prefers-reduced-transparency: reduce) {
  .lobby:not(.menu-in-room) .lobby-card { background: linear-gradient(135deg, #24343be6, #18272edb); }
}

/* **The entrance fits the window** (nothing in the game scrolls, 17 October
   2026). The hero's 430 px floor and a 104 px title made the landing 950 px
   tall in a 768 px window, with the list of open campaigns below the fold.
   Below 1000 px of height the hero gives up its floor and the title follows
   the window's height; the art still fills the screen behind it. */
@media (min-width: 801px) and (max-height: 1000px) {
  .lobby { padding-top: 18px; padding-bottom: 18px; }
  .lobby .lobby-head { min-height: 0; padding: 4px 0 18px; margin-bottom: 14px; }
  .lobby .lobby-title { margin: 6px 0 4px; font-size: clamp(48px, 9vh, 104px); }
}
/* A phone on its side has 390 px of height. The pinned name, the setup's
   title and its Begin button took all of it (the page left for the setup's
   own groups was -50 px), so below 500 px the entrance keeps only the name, at
   a size that leaves the rest for what is being chosen. */
@media (max-height: 500px) {
  .lobby.lobby { padding-top: 6px; padding-bottom: 6px; }
  /* One line: the name, who you are, and Mute / EN | TR at its end. Stacked,
     with the language switch (dc5fdfa) in a row of its own, the head was 120 px
     and the setup's pages had 85 px between it and the Begin button. */
  .lobby .lobby-head {
    min-height: 0; padding: 0 200px 0 0; margin-bottom: 6px;
    display: flex; flex-wrap: wrap; align-items: center; column-gap: 18px;
  }
  .lobby .lobby-head > .lobby-toggles { position: absolute; top: 0; right: 0; }
  .lobby .lobby-title { font-size: 28px; margin: 0; }
  .lobby:not(.menu-in-room) .menu-create > .card-head h2 { font-size: 18px; }
  .lobby .menu-kicker, .lobby .menu-motto { display: none; }
  .lobby .lobby-identity { padding: 4px 8px; }
  .lobby:not(.menu-in-room) .lobby-card { padding: 12px 16px; min-height: 0; }
  .lobby:not(.menu-in-room) .card-head { margin: 4px 0 8px; }
  .campaign-settings .card-foot { margin-top: 8px; }
  /* The setup's groups stack, one column, so the pages cut between their rows.
     Side by side, two groups' rows interleave and the pager can only take them
     as one 94 px row — taller than the page left between the pinned name and
     the Create button, so its last checkbox sat under the screen's foot. */
  .lobby .setup-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .setup-group { padding: 6px 12px 8px; }
  .setup-hint { margin-bottom: 6px; }
  /* The cards' blurbs go first: the title and the button say what each is. */
  .lobby:not(.menu-in-room) .lobby-card > p.muted { display: none; }
}
/* A phone's entrance is paged (ui/fitPages.js): the name and the motto stay,
   the three ways in and the open campaigns turn over beneath them. The hero
   floor would leave no room for a single card under it. */
@media (max-width: 800px) {
  .lobby .lobby-head { min-height: 0; padding: 8px 0 14px; margin-bottom: 12px; }
}

/* "?" beside a campaign setting: its explanation on hover, focus or tap. */
.field-help { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 6px; border: 1px solid currentColor; border-radius: 50%; font: 600 11px/1 var(--font-body, sans-serif); vertical-align: 1px; cursor: help; opacity: 0.75; text-transform: none; letter-spacing: 0; }
.field-help:hover, .field-help:focus-visible, .field-help:focus { opacity: 1; outline: none; }
.field-help-tip { position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 20; display: none; width: max-content; max-width: min(320px, 80vw); transform: translateX(-50%); padding: 10px 12px; background: #0b1d26; color: #e9ddc3; border: 1px solid #a9945a; border-radius: 3px; box-shadow: 0 8px 24px #0009; font: 400 12px/1.55 var(--font-body, sans-serif); text-align: left; white-space: normal; pointer-events: none; }
.field-help:hover .field-help-tip, .field-help:focus .field-help-tip { display: block; }
/* One tip at a time: a tapped "?" keeps focus, so hovering another hides the focused one. */
.lobby:has(.field-help:hover) .field-help:not(:hover) .field-help-tip { display: none; }
.field-help-row { display: block; }
.field-help-row + .field-help-row { margin-top: 6px; }
.field-help-row strong { color: #d2bc88; }

/* Where there is room beside it, Mute / EN | TR leave the title's row: they sit
   in the top corner and the title lands close to the top edge of the window.
   Last in the file so it wins over the height bands above. */
@media (min-height: 501px) and (min-width: 721px) {
  .lobby { padding-top: 10px; }
  .lobby .lobby-head { padding-top: 0; }
  .lobby .lobby-head > .lobby-toggles { position: absolute; top: 0; right: 0; }
  .lobby .menu-brand { margin-top: 0; }
}

/* Wide enough for three columns: the name and the line about the realms in the
   top-left corner, the title in the middle, Mute / EN | TR in the top-right —
   all on the top edge (the player, 31 October 2026). Narrower, the name and the
   line drop under the title, still on the left (the block above). */
@media (min-height: 501px) and (min-width: 1180px) {
  .lobby .lobby-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: 28px;
    align-items: start;
  }
  .lobby .menu-brand { grid-column: 2; grid-row: 1 / span 2; }
  .lobby .lobby-head > .lobby-identity { grid-column: 1; grid-row: 1; margin-top: 10px; flex-wrap: wrap; }
  .lobby .lobby-head > .lobby-toggles { position: static; grid-column: 3; grid-row: 1; justify-self: end; align-self: start; margin-top: 4px; }
}

/* The iOS "Play full screen" guide (js/homeScreen.js). */
.home-guide {
  max-width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0;
  border: 1px solid var(--rule-strong, #88703f); border-radius: 12px;
  background: var(--paper, #f3e8cc); color: var(--ink, #2b2318);
  box-shadow: 0 12px 40px #000a;
}
.home-guide::backdrop { background: #0009; }
.home-guide-card { padding: 20px 22px; }
.home-guide h2 { margin: 0 0 8px; font-family: var(--font-head, Georgia, serif); font-size: 20px; }
.home-guide p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
.home-guide ol { margin: 0 0 12px; padding-left: 22px; font-size: 15px; line-height: 1.5; }
.home-guide li { margin-bottom: 8px; }
.home-guide-icon { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; color: #2f6fd6; }
.home-guide .home-guide-note { font-size: 12px; color: var(--ink-faint, #6b5d45); }
.home-guide .btn { width: 100%; min-height: 44px; }

/* The account corner (ui/account.js, docs/ACCOUNTS.md): Sign in for a guest;
   username, rank badge and progress for a signed-in player. */
.lobby-account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-card { display: grid; gap: 4px; min-width: 0; }
.account-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.account-name { color: #f0e2c1; font: 600 16px/1.2 Georgia, serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-xp { width: 170px; max-width: 100%; height: 5px; border-radius: 3px; background: #0d191dcc; border: 1px solid #a9945a55; overflow: hidden; }
.account-xp i { display: block; height: 100%; background: linear-gradient(90deg, #a9822f, #e6b94f); }
.account-progress { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: #b8bdb4; }
.lobby .account-signout { color: #d8cdb2; }
.rank-badge {
  display: inline-block; padding: 1px 7px; border-radius: 9px; font: 600 10px/16px system-ui, sans-serif;
  letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  color: #1d1609; background: #b59a62; border: 1px solid #00000033;
}
.rank-tier-0 { background: #9a9384; }
.rank-tier-1 { background: #a8a07f; }
.rank-tier-2 { background: #b9a777; }
.rank-tier-3 { background: #c7a95f; }
.rank-tier-4 { background: #d8b04a; }
.rank-tier-5 { background: #e2ba45; box-shadow: 0 0 0 1px #f3d98a inset; }
.rank-tier-6 { background: #b8452f; color: #f8e9c8; }
.rank-tier-7 { background: #6b2a63; color: #f8e9c8; box-shadow: 0 0 0 1px #e6b94f; }
.direct-team-seat .rank-badge, .direct-seat-status .rank-badge { margin-left: 6px; vertical-align: 1px; }
.account-dialog-wrap { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 16px; }
.account-dialog-wrap .overlay-backdrop { position: fixed; }
.overlay-card.account-dialog { width: min(380px, 100%); gap: 10px; padding: 0 18px 16px; background: var(--parchment, #f2e7cd); border: 1px solid var(--gold, #a9945a); }
.account-dialog .overlay-head { margin: 0 -18px; padding: 12px 18px; }
.account-dialog p { margin: 0; }
.account-error { min-height: 1.2em; color: #a2321f; font-size: 13px; }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.account-actions .btn { flex: 1 1 120px; }
@media (max-width: 420px) {
  .account-xp { width: 130px; }
}

/* Account details (13 Nov 2026): the username opens rank, emblem, ladder and battle record. */
button.account-name { background: none; border: 0; padding: 0; text-align: left; max-width: 100%; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
button.account-name:hover, button.account-name:focus-visible { text-decoration-style: solid; }
.account-details { width: min(560px, calc(100vw - 32px)); }
.account-details-body { display: grid; gap: 10px; padding: 8px 16px 14px; }
/* Change password (18 Nov 2026): folded under the record so the panel keeps its size. */
.account-password { padding: 0 16px 14px; }
.account-password > summary { cursor: pointer; font: 13px var(--font-head); }
.account-password form { display: grid; gap: 8px; margin-top: 8px; }
.account-password p { margin: 0; }
.account-details-body h4 { margin: 4px 0 0; font: 13px var(--font-head); }
.account-details-hero { display: flex; align-items: center; gap: 16px; }
.account-details-who { flex: 1; min-width: 0; display: grid; gap: 4px; }
.account-details-who h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-details-rank { margin: 0; font: 600 16px var(--font-head); }
.account-details-who p { margin: 0; }
.account-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.account-stat { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--rule-strong); }
.account-stat strong { font-size: 18px; }
.account-stat span { font-size: 11px; color: var(--ink-faint); text-align: center; }
.account-ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.account-ladder-step { display: grid; justify-items: center; gap: 1px; padding: 4px; font-size: 11px; text-align: center; }
.account-ladder-step small { color: var(--ink-faint); }
.account-ladder-step.is-future { opacity: 0.45; }
.account-ladder-step.is-current { outline: 2px solid var(--ink); font-weight: 700; }
@media (max-width: 480px) {
  .account-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .account-details-hero .rank-emblem { width: 72px; height: 80px; }
}
