/* Shared components: buttons, inputs, cards, badges, avatars, chips, the top bar, log & chat,
   dialogs (bottom sheets on phones: phone.css), toasts, the phone sheets' own parts. */

/* ------------------------------------------------------------------------ */
/* Buttons & inputs                                                           */
/* ------------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--row);
  color: var(--text);
  font: 500 14px var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:hover:not(:disabled) { background: var(--row-hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-accent { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); }

.btn-outline { background: transparent; border-color: rgba(234, 240, 244, 0.24); }
.btn-outline:hover:not(:disabled) { background: rgba(234, 240, 244, 0.06); border-color: rgba(234, 240, 244, 0.42); }

.btn-outline-accent { background: transparent; border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn-outline-accent:hover:not(:disabled) { background: var(--accent-soft); }
.btn-outline-accent:disabled { border-color: rgba(234, 240, 244, 0.2); color: var(--muted); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: rgba(234, 240, 244, 0.06); color: var(--text); }

.btn-lg { min-height: 48px; padding: 0 20px; border-radius: 14px; font-size: 15px; }
.btn-sm { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn-xs { gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 9px; font-size: 12px; }
.btn-icon { width: 40px; padding: 0; }
.btn-block { width: 100%; }
.btn.is-chosen { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55); }
.btn-outline.is-chosen { box-shadow: none; border-color: var(--danger); color: var(--danger-text); }
/* «Вы отказались»: the answer stays readable while the button does nothing more. */
.btn-outline.is-chosen:disabled { opacity: 1; cursor: default; }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
  font: 500 13px var(--font);
  cursor: pointer;
  transition: background-color .15s;
}
.chip-btn:hover { background: #24475F; }

.input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--field);
  color: var(--text);
  font: 400 15px var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #5F7686; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(244, 183, 64, 0.18); }

.select {
  width: auto;
  min-width: 150px;
  padding-right: 38px;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239FB3C2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-inline { flex-direction: row; align-items: center; gap: 10px; }
.field-label { font-size: 13px; color: var(--muted); }

.icon { flex: none; }

/* ------------------------------------------------------------------------ */
/* Cards, badges, avatars                                                     */
/* ------------------------------------------------------------------------ */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 10px;
}
.card-title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.title-count { display: inline-block; min-width: 20px; margin-left: 8px; padding: 1px 6px; border-radius: 999px; background: rgba(234, 240, 244, 0.1); color: var(--text-2); font: 600 11px var(--font); text-align: center; vertical-align: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(234, 240, 244, 0.1);
  color: #D5E0E8;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-accent { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.badge-warn { background: rgba(224, 82, 74, 0.2); color: var(--danger-text); }
.badge-off { background: rgba(224, 82, 74, 0.12); color: var(--danger-text); }
/* «Благородный разбойник»: the robber spares this player (an icon; the explanation is in the tooltip). */
.badge-spared { padding-left: 6px; padding-right: 6px; background: rgba(77, 184, 116, 0.16); color: #9FDDB5; }
.badge-spared .badge-label { display: none; }
/* «Правила этой партии» */
.rules-facts { margin: 0 0 14px; padding-left: 18px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.rules-variant { padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--row); }
.rules-variant + .rules-variant { margin-top: 10px; }
.rules-variant h3 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 500; font-size: 15px; color: var(--accent-text); }
.rules-variant-short { margin: 0 0 6px; font-weight: 500; }
.rules-variant ul { margin: 0 0 6px; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.rules-variant li + li { margin-top: 4px; }
.rules-variant .muted { margin: 0; }

.avatar {
  display: inline-flex;
  width: var(--size, 36px);
  height: var(--size, 36px);
  flex: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ground);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ring, transparent);
  color: #10202B;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}
.avatar-neutral { background: #2A5470; color: var(--text); --ring: rgba(234, 240, 244, 0.18); }
.avatar-empty { background: transparent; border: 2px dashed rgba(234, 240, 244, 0.18); }
.avatar-wrap { position: relative; display: inline-flex; }
.offline-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--danger);
}

/* A bot plays this seat (a computer player, or an offline person handed to a bot): robot mark on the avatar. */
.bot-mark {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: #2A5470;
  color: var(--text);
}
.player-row.is-takeover .bot-mark { background: var(--accent); color: var(--accent-ink); }
.badge-bot { background: rgba(159, 179, 194, 0.16); color: var(--text-2); }
.badge-takeover { background: var(--accent-soft); color: var(--accent-text); }

.conn { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn-open .conn-dot { background: var(--ok); }
.conn-connecting .conn-dot { background: var(--accent); animation: blink 1s ease-in-out infinite; }
.conn-closed .conn-dot { background: var(--danger); }
.conn-closed { color: var(--danger-text); }

.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(234, 240, 244, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; flex: none; }

/* Resource chips (trade offers, summaries) */
.res-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.res-chip-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.15);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px 12px; }

.res-tile {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12);
}
.res-tile-sm { width: 38px; height: 38px; border-radius: 9px; }

/* ------------------------------------------------------------------------ */
/* Top bar                                                                    */
/* ------------------------------------------------------------------------ */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}
.topbar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-logo { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .08em; }
.brand-sub { color: var(--muted); font-size: 13px; }

.room-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 16px;
  border: 1px solid rgba(234, 240, 244, 0.12);
  border-radius: 999px;
  background: var(--card);
  font-size: 13px;
}
.room-code { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .14em; }

/* Log & chat */
.feed-card { display: flex; flex-direction: column; gap: 10px; padding: 6px 16px 14px; }
.feed-card .card-head { padding-top: 10px; padding-bottom: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(234, 240, 244, 0.1); }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: -1px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 500 14px var(--font);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }
.badge-count {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.feed-body { display: flex; flex-direction: column; min-height: 0; }
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  margin: 0;
  padding: 2px 4px;
  overflow-y: auto;
  list-style: none;
  font-size: 13px;
  line-height: 1.4;
  scrollbar-width: thin;
  scrollbar-color: #2A4558 transparent;
}
.log-item { display: flex; align-items: baseline; gap: 8px; }
.log-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; transform: translateY(-1px); }
.log-text { color: #B7C6D1; overflow-wrap: anywhere; }
.log-text b { color: var(--text); font-weight: 600; }
.log-turn { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted-2); font-size: 12px; white-space: nowrap; }
.log-turn::after { content: ''; flex: 1; height: 1px; background: rgba(234, 240, 244, 0.1); }
.log-turn-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.log-list > .log-turn:first-child { margin-top: 0; }

.chat-item { display: flex; flex-direction: column; gap: 2px; }
.chat-meta { display: flex; align-items: baseline; gap: 8px; }
.chat-name { color: var(--text-2); font-weight: 600; }
.chat-time { color: var(--muted-2); font-size: 11px; }
.chat-text { color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-system { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(234, 240, 244, 0.05); color: var(--text-2); font-size: 12px; }
.chat-system .icon { flex: none; align-self: center; color: var(--accent); }
.chat-system span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.feed-empty { padding: 16px 0; color: var(--muted-2); text-align: center; }
.chat-form { display: flex; gap: 8px; }
.chat-form .btn-icon { width: 44px; min-height: 44px; }


/* ------------------------------------------------------------------------ */
/* Modals                                                                     */
/* ------------------------------------------------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 12, 18, 0.62);
  backdrop-filter: blur(3px);
  animation: fadeIn .15s ease-out;
}
.modal {
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid rgba(234, 240, 244, 0.12);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: pop .18s ease-out;
}
.modal:focus { outline: none; }
.modal-wide { width: min(660px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 16px 6px 24px; }
.modal-title { margin: 6px 0 0; font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.modal-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { display: flex; flex-direction: column; gap: 14px; padding: 10px 24px 18px; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; border-top: 1px solid var(--line); }
.modal-text { margin: 0; color: var(--text-2); }
.modal-note { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; }
.pick-counter { margin-right: auto; color: var(--muted); font-size: 14px; }
.trade-done { display: flex; align-items: center; gap: 8px; margin-right: auto; color: var(--ok); font-size: 14px; font-weight: 500; }
.trade-done .res-chip { color: var(--text); }
.trade-done .icon { flex: none; }
.pick-counter.is-done { color: var(--ok); }
.waiting-host { font-size: 14px; }

.stepper-list { display: flex; flex-direction: column; gap: 6px; }
.stepper-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 6px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--row);
  transition: border-color .15s;
}
.stepper-row.is-active { border-color: var(--accent-line); }
.stepper-label { display: flex; flex-direction: column; min-width: 0; font-weight: 500; }
.stepper-label small { color: var(--muted); font-size: 12px; font-weight: 400; }
.stepper { display: flex; align-items: center; gap: 6px; }
.btn-step { width: 36px; min-height: 36px; border-radius: 10px; background: #1F4058; }
.btn-step:hover:not(:disabled) { background: #28506B; }
.stepper-value { min-width: 24px; font-family: var(--font-display); font-weight: 700; font-size: 16px; text-align: center; }

.res-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.res-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 6px 4px 8px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.res-option:hover:not(:disabled) { background: rgba(234, 240, 244, 0.05); }
.res-option.is-selected { border-color: var(--accent); background: rgba(244, 183, 64, 0.1); }
.res-option:disabled { opacity: .35; cursor: not-allowed; }
.res-option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  max-width: 76px;
  height: 64px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12);
}
.res-option-card b { font-family: var(--font-display); font-size: 16px; line-height: 1; }
.res-option-name { color: var(--text-2); font-size: 12px; }
.res-option small { color: var(--muted); font-size: 11px; }
.res-option.is-selected small { color: var(--accent-text); }

.tabs-modal { margin-top: -2px; }
.trade-section { display: flex; flex-direction: column; gap: 8px; }
.trade-label { display: flex; align-items: baseline; gap: 10px; margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.trade-label small { color: var(--muted-2); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.trade-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-height: 60px; padding: 10px 14px; border-radius: 14px; background: var(--row); }
.trade-count { margin-left: auto; color: var(--muted); font-size: 13px; }
.offer-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.victim-list { display: flex; flex-direction: column; gap: 8px; }
.victim {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--row);
  color: var(--text);
  font: 500 15px var(--font);
  text-align: left;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.victim:hover { border-color: var(--accent); background: var(--row-hover); }
.victim-name { flex: 1 1 auto; min-width: 0; }
.victim-cards { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }

.winner-banner { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid rgba(244, 183, 64, 0.35); border-radius: 18px; background: rgba(244, 183, 64, 0.1); }
.winner-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.score-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.score-row { display: grid; grid-template-columns: 18px 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px 10px 12px; border-radius: 14px; background: var(--row); }
.score-row.is-winner { box-shadow: inset 0 0 0 1px rgba(244, 183, 64, 0.55); }
.score-rank { color: var(--muted); font-family: var(--font-display); font-size: 13px; text-align: center; }
.score-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 600; }
.score-details { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.score-cards { margin-top: 4px; color: var(--muted); font-size: 12px; }
.score-vp { display: flex; flex-direction: column; align-items: flex-end; }
.score-vp b { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; }
.score-vp small { margin-top: 4px; color: var(--muted); font-size: 11px; }


/* ------------------------------------------------------------------------ */
/* Toasts                                                                     */
/* ------------------------------------------------------------------------ */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 12px 18px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #1B3446;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-size: 14px;
  pointer-events: auto;
  cursor: pointer;
  animation: toastIn .2s ease-out;
  transition: opacity .25s, transform .25s;
}
.toast-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.toast-error { border-color: rgba(224, 82, 74, 0.55); }
.toast-error .toast-dot { background: var(--danger); }
.toast-success .toast-dot { background: var(--ok); }
.toast.leaving { opacity: 0; transform: translateY(6px); }
.toast.bump { animation: bump .3s ease-out; }

/* «Правила этой партии»: long text — the body scrolls, the title and the buttons stay. The desktop
   height only on desktop: on phones the sheet keeps the phone block's --vvh / safe-area height. */
.modal-rules { overflow: hidden; }
@media (min-width: 1024px) { .modal-rules { max-height: calc(100vh - 40px); } }
.modal-rules .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; gap: 0; }
.modal-rules .rules-facts { margin-bottom: 14px; }

/* Sheets' own parts */
.modal-aside { margin-left: auto; align-self: center; color: var(--muted); font-size: 12px; white-space: nowrap; }
.build-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--row);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.build-row.is-active { padding: 9px 13px; border: 2px solid var(--accent); background: rgba(244, 183, 64, 0.12); }
.build-row:disabled { border-color: rgba(234, 240, 244, 0.1); background: #162F41; cursor: not-allowed; }
.build-row:disabled .build-row-name, .build-row:disabled .sheet-cost { opacity: .6; }
.build-row-text { display: flex; flex: 1 1 0; flex-direction: column; gap: 3px; min-width: 0; }
.build-row-name { font: 600 15px var(--font); }
.build-row-sub { color: var(--muted); font: 400 12px/1.35 var(--font); }
.build-row-sub.is-active { color: #EBD9AC; }
.build-row-sub.is-missing { color: #F2A39C; }
.sheet-cost { display: flex; flex: none; gap: 4px; }
.sheet-cost-chip { width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
.sheet-buy { padding-top: 4px; }
.sheet-empty { margin: 0; font-size: 14px; line-height: 1.45; }
.sheet-player { display: flex; align-items: center; gap: 14px; }
.sheet-player-main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 6px; min-width: 0; }
.sheet-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-badges .badge { font-size: 12px; }
.sheet-player-vp { display: flex; flex-direction: column; align-items: flex-end; }
.sheet-player-vp b { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; }
.sheet-player-vp small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.sheet-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sheet-supply { margin: 0; color: var(--text-2); font-size: 14px; }
.sheet-supply b { color: var(--text); font-family: var(--font-display); font-weight: 700; }
.sheet-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--row); }
.sheet-stat b { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.sheet-stat span { color: var(--text-2); font-size: 12px; }
.sheet-stat small { color: var(--accent-text); font-size: 12px; }
/* The player sheet: more cards than a 7 allows; one knight / road away from an award. */
.sheet-stat.is-warn { box-shadow: inset 0 0 0 1px rgba(224, 82, 74, 0.45); }
.sheet-stat.is-warn b, .sheet-stat.is-warn small { color: var(--danger-text); }
.sheet-stat.is-hot { box-shadow: inset 0 0 0 1px var(--accent-line); }
.sheet-stat.is-hot b { color: var(--accent-text); }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; }
.sheet-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; font-size: 14px; }
.sheet-info .conn { font-size: 14px; }
.sheet-items { display: flex; flex-direction: column; gap: 8px; }
.sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--row);
  color: var(--text);
  font: 500 15px var(--font);
  text-align: left;
  cursor: pointer;
}
a.sheet-item { text-decoration: none; }
.sheet-item .icon { flex: none; }
.badge-spared.badge-spared-full .badge-label, .badge-spared-full { padding-left: 8px; padding-right: 8px; }
.sheet-item.is-danger { color: var(--danger-text); border-color: rgba(224, 82, 74, 0.4); background: rgba(224, 82, 74, 0.08); }

/* ПАСАН: the logo gets a star (the names, colors and icons come from terms.js / theme.js). */
:root[data-skin="pasan"] .brand-logo::before { content: '★'; margin-right: .3em; color: var(--accent); font-size: .8em; vertical-align: .08em; }
/* ПАСАН's black oil card would melt into the dark panels: every resource swatch gets a faint light rim. */
:root[data-skin="pasan"] :is(.hand-res, .res-option-card, .res-tile, .res-chip-swatch, .cost-chip, .sheet-cost-chip) {
  box-shadow: inset 0 0 0 1px rgba(234, 240, 244, 0.24);
}

/* Personal language preference: pill trigger and a menu in the browser's top layer. */
.language-picker { display: inline-flex; flex: 0 0 auto; }
.language-trigger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 13px; border: 1px solid var(--line-2); border-radius: 999px;
  font: 600 14px/1 var(--font); color: var(--text); background: var(--row); cursor: pointer;
}
.language-trigger:hover, .language-trigger[aria-expanded="true"] { background: var(--row-hover); }
.language-globe {
  width: 20px; height: 20px; flex: 0 0 auto; background: currentColor;
  mask: url('../assets/icons/globe.svg') center / contain no-repeat;
  -webkit-mask: url('../assets/icons/globe.svg') center / contain no-repeat;
}
.language-menu {
  position: fixed; inset: auto; margin: 0; padding: 7px; box-sizing: border-box;
  border: 1px solid var(--line-2); border-radius: 20px;
  background: var(--card); color: var(--text); box-shadow: 0 12px 36px rgba(0, 0, 0, .3);
}
.language-option {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; min-height: 50px; padding: 12px 14px; border: 0; border-radius: 13px;
  background: transparent; color: var(--text); text-align: left; font: 400 17px/1.4 var(--font); cursor: pointer;
}
.language-option + .language-option { margin-top: 4px; }
.language-option[aria-checked="true"] { font-weight: 600; background: var(--accent-soft); color: var(--accent-text); }
.language-option:hover { background: var(--row-hover); }
.language-option[aria-checked="true"]:hover { background: var(--accent-soft); }
.language-trigger:focus-visible, .language-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-card { position: relative; }
.home-language { position: absolute; top: 14px; right: 14px; z-index: 1; }
