/* 2.14: контекст партии, тихие уведомления и единая карточная поверхность.
   Базовые токены остаются в style.css; здесь только компоненты нового UX. */
body {
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
p {
  line-height: 1.5;
}
.muted,
.page-heading > p {
  color: var(--muted);
}
.site-links .plus-link,
.plus-product .product-tag {
  color: var(--violet);
}
#header,
#nav {
  background: var(--bg);
}

.round-summary {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.round-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.round-summary .identity {
  min-width: 0;
}
.round-summary p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.point-gained {
  color: var(--accent);
  font-size: 24px;
}
.table-note.compact {
  padding: 8px 0;
  text-align: left;
  border: 0;
  background: transparent;
}
.table-note.compact strong {
  font-size: 16px;
}
.table-note.compact p {
  margin-top: 4px;
  font-size: 14px;
}

.other-answers {
  padding: 16px;
  background: var(--paper);
  border-radius: 12px;
}
.other-answers > summary {
  font-size: 14px;
  padding: 8px 0;
  min-height: 44px;
}

#game-nav {
  display: none;
}
.room-player-list {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.room-player-list .player {
  width: 100%;
  min-width: 0;
}
.room-player-list .identity {
  flex: 1;
  min-width: 0;
}
#toasts {
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 32px));
  gap: 0;
  top: auto;
  bottom: 24px;
  left: auto;
  right: 24px;
}
#toasts .toast {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px 8px 8px 16px;
  align-items: center;
  display: flex;
  border: 1px solid #505661;
  border-radius: 12px;
  background: #252930;
  color: var(--ink);
  font-size: 14px;
}
#toasts .toast-content {
  padding: 8px 0;
  min-height: 44px;
  flex: 1;
  line-height: 1.4;
  text-align: left;
}
#toasts .toast-close {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}
#toasts .achievement-toast {
  border-color: #80619f;
}
.daily {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px 24px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.daily h2 {
  font-size: 24px;
  margin: 4px 0;
}
.daily p {
  margin: 8px 0 0;
  font-size: 14px;
}
.daily > button {
  grid-column: 2;
  grid-row: 1;
}
.daily-week {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}
.daily-week summary {
  font-size: 14px;
  padding: 12px 0;
}
.daily-days {
  margin-top: 12px;
  width: 100%;
}
.award-highlights {
  display: grid;
  gap: 24px;
  margin: 0 0 32px;
}
.award-highlights h2 {
  font-size: 20px;
  margin-bottom: 12px;
}
.highlight-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.compact-award.achievement {
  padding: 16px;
  grid-template-columns: 1fr;
  gap: 12px;
}
.compact-award .achievement-icon {
  display: none;
}
.compact-award h3 {
  font-size: 16px;
  line-height: 1.4;
}
.compact-award .award-state {
  display: none;
}
.achievement {
  background: var(--paper);
  border: 1px solid var(--line);
}
.achievement:not(.unlocked) {
  background: color-mix(in srgb, var(--rarity-color, #a4aebb) 5%, var(--paper));
}
.achievement.unlocked {
  background: color-mix(
    in srgb,
    var(--rarity-color, #a4aebb) 12%,
    var(--paper)
  );
  border-color: color-mix(
    in srgb,
    var(--rarity-color, #a4aebb) 40%,
    var(--line)
  );
}
.rarity-common {
  --rarity-color: #a4aebb;
}
.rarity-uncommon {
  --rarity-color: #80bb98;
}
.rarity-rare {
  --rarity-color: #80b4ec;
}
.rarity-epic {
  --rarity-color: #bc95dd;
}
.rarity-legendary {
  --rarity-color: #d3b670;
}
.achievement p {
  font-size: 14px;
  line-height: 1.5;
}
.achievement h3 {
  line-height: 1.4;
}
.award-series {
  align-self: start;
  background: var(--paper);
  border-radius: 16px;
  min-width: 0;
}
.award-series > .achievement {
  border-radius: 16px 16px 0 0;
}
.award-series > details {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 16px 16px;
}
.award-series > details > summary {
  padding: 12px 16px;
  min-height: 44px;
  font-size: 14px;
}
.award-levels {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}
.award-levels .achievement {
  padding: 12px;
  grid-template-columns: 1fr;
}
.award-levels .achievement-icon {
  display: none;
}
.award-levels h3 {
  font-size: 16px;
}
.preview-tabs {
  display: flex;
  gap: 4px;
  margin: 24px 0 16px;
  border-bottom: 1px solid var(--line);
}
.preview-tabs button {
  flex: 1;
  padding: 12px;
  border-radius: 8px 8px 0 0;
}
.preview-tabs button[aria-selected="true"] {
  background: var(--paper-raised);
  box-shadow: inset 0 -2px var(--accent);
}
.preview-scenes {
  display: block;
}
.preview-scenes > section {
  min-height: 200px;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
}
.preview-scenes > section[hidden] {
  display: none;
}
.preview-scenes .message {
  padding: 0;
}
.profile-look {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}
.profile-look > .identity {
  font-size: 24px;
}
.profile-look .identity-avatar {
  width: 56px;
  height: 56px;
}
.shop-purchase {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}
.chat-unread-line {
  padding: 8px 12px;
  text-align: center;
  color: var(--accent);
  background: #d7fe390b;
  font-size: 12px;
  border-block: 1px solid #d7fe3920;
  margin: 12px 0;
}
#messages .message-bubble > p {
  font-size: 14px;
  line-height: 1.4;
}
#messages .message header {
  align-items: baseline;
}
#messages .message time {
  font-size: 12px;
  color: #a8acb4;
}
#messages .system-message {
  padding: 4px 12px;
  margin: 8px auto;
  min-height: 0;
}
#messages .system-message p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
body:not(.is-auth) #chat-panel .chat-empty {
  padding: 24px 16px;
  min-height: 0;
}
@media (min-width: 1121px) {
  /* Главная использует общую правую колонку из pages.css:
     чат и реклама закреплены вместе по всей высоте контента. */
  .home-layout .launch-panel {
    align-self: stretch;
  }
  .home-layout .home-content {
    padding-top: 16px;
  }
  .home-content > .landing-rules {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .home-content > .landing-faq {
    grid-template-columns: minmax(200px, 0.65fr) minmax(0, 1.35fr);
  }
}
@media (max-width: 1120px) {
  .highlight-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #toasts {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 760px) {
  body.game-focus #nav {
    display: none;
  }
  body.game-focus #game-nav {
    display: flex;
    position: fixed;
    z-index: 70;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: calc(64px + env(safe-area-inset-bottom));
    padding: 4px 16px calc(4px + env(safe-area-inset-bottom));
    gap: 8px;
    background: #121418;
    border-top: 1px solid var(--line);
  }
  #game-nav button {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    background: transparent;
    border: 0;
    font-size: 12px;
    padding: 4px;
  }
  #game-nav .active {
    color: var(--accent);
  }
  #game-nav [data-chat-badge] {
    position: absolute;
    top: 2px;
    left: 55%;
    background: var(--accent);
    color: var(--bg);
    padding: 1px 5px;
    border-radius: 12px;
    font-size: 12px;
  }
  body.chat-open #game-nav {
    display: none;
  }

  .round-summary {
    margin-top: 12px;
    padding-top: 10px;
  }
  .other-answers {
    margin-top: 16px;
    padding: 8px 12px;
  }
  #toasts,
body.game-focus #toasts,
body.game-focus:not(.has-hand-controls) #toasts {
    top: calc(var(--header-h) + 8px);
    bottom: auto;
    left: 16px;
    right: 16px;
    width: auto;
  }
  body.chat-open #toasts {
    top: calc(env(safe-area-inset-top) + 72px);
    bottom: auto;
  }
  .highlight-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .compact-award.achievement {
    grid-template-columns: minmax(0, 1fr);
  }
  .compact-award .award-top {
    margin-bottom: 4px;
  }
  .award-highlights {
    gap: 24px;
  }
  .award-highlights > section:nth-child(2) .highlight-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .daily {
    padding: 16px;
    gap: 12px;
  }
  .daily h2 {
    font-size: 20px;
  }
  .daily > button {
    font-size: 14px;
    padding-inline: 12px;
  }
  .daily-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .daily-day {
    min-width: 0;
  }
  .daily-day b {
    flex-wrap: wrap;
  }
}
@media (max-width: 359px) {

  .daily {
    grid-template-columns: 1fr;
  }
  .daily > button {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }
  
}
@media (prefers-reduced-motion: reduce) {
  .point-gained,
.round-summary {
    animation: none;
  }
}
.today-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.today-strip > div {
  display: grid;
  gap: 4px;
}
.today-strip strong {
  font-size: 14px;
}
.today-strip small {
  color: var(--muted);
  font-size: 14px;
}
.today-strip button {
  flex: none;
  min-height: 44px;
  padding: 8px 16px;
}
@media (max-width: 760px) {
  .award-highlights .highlight-list,
.award-highlights > section:nth-child(2) .highlight-list {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(82%, 280px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
  }
  .highlight-list .achievement {
    scroll-snap-align: start;
  }
  .compact-award .award-top {
    display: none;
  }
  .compact-award .achievement-meta small {
    display: none;
  }
  .today-strip {
    gap: 8px;
  }
}
#chat-panel,
#chat-form {
  background: #101216;
}
#chat-panel .chat-header {
  background: var(--paper);
}
#chat-form .chat-input {
  background: var(--paper-raised);
  border-color: var(--line);
}
#chat-emojis {
  background: var(--paper-raised);
}
body:not(.is-auth) #chat-new {
  display: none;
}
.preview-scenes button:disabled {
  opacity: 1;
  cursor: default;
}
/* Магазин 2.15: два семейства товаров, крупные цели выбора, итог рядом с CTA. */
.paid-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.paid-product {
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.paid-product h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}
.paid-product p,
.paid-product ul {
  margin: 0;
}
.paid-product .paid-intro {
  font-size: 16px;
  line-height: 1.5;
  min-height: 48px;
}
.paid-product .product-benefits {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
}
.paid-product .product-benefits li {
  align-items: flex-start;
}
.paid-options {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.paid-options legend {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}
.paid-options > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.paid-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  min-height: 76px;
  padding: 10px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  background: var(--paper);
}
.paid-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.paid-option:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.paid-option.selected {
  border-color: #d7fe39;
  background: #d7fe3912;
}
.paid-option strong {
  font-size: 14px;
  line-height: 1.3;
}
.paid-option span,
.paid-option small {
  font-size: 12px;
  line-height: 1.4;
}
.paid-option small {
  color: #d7fe39;
}
.paid-summary {
  min-height: 86px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.paid-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.paid-price strong {
  font-size: 28px;
  line-height: 1.2;
  color: var(--text);
}
.paid-price del,
.paid-price span,
.paid-duration {
  font-size: 13px;
  color: var(--muted);
}
.paid-price span {
  flex-basis: 100%;
}
.sale-notice {
  font-size: 13px;
  line-height: 1.5;
  color: #d7fe39;
}
.checkout-review {
  display: grid;
  gap: 16px;
}
.checkout-review p,
.checkout-review h3 {
  margin: 0;
}
.checkout-price {
  font-size: 28px;
  font-weight: 700;
}
.checkout-terms {
  font-size: 14px;
  line-height: 1.5;
}
.checkout-terms a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.payment-return-page {
  padding: 0 20px 40px;
}
.payment-return-page #header {
  max-width: 960px;
  margin: auto;
}
.payment-result {
  max-width: 640px;
  margin: 40px auto;
  padding: 32px;
}
.payment-result h1 {
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.2;
}
.payment-result p {
  font-size: 16px;
  line-height: 1.6;
}
.payment-result .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.receipt-details {
  display: grid;
  gap: 16px;
  padding: 24px 0;
  border-block: 1px solid var(--line);
}
.receipt-details > div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
}
.receipt-details dt {
  color: var(--muted);
}
.receipt-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.profile-purchases .list-row {
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 1000px) and (min-width: 761px) {
  .paid-products {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .paid-products {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .paid-product {
    padding: 20px;
    gap: 16px;
  }
  .paid-product .paid-intro {
    min-height: 0;
  }
  .payment-return-page {
    padding-inline: 16px;
  }
  .payment-result {
    margin: 24px auto;
    padding: 20px;
  }
  .receipt-details > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .payment-result .actions > * {
    width: 100%;
    text-align: center;
  }
}
/* Явно перекрываем старые общие правила .products и dl. */
.products.paid-products > article {
  gap: 14px;
}
.products.paid-products article h2 {
  margin: 0;
  font-size: 24px;
}
.products.paid-products .product-benefits {
  flex: none;
  min-height: 84px;
  align-content: start;
}
.products.paid-products .paid-summary {
  min-height: 104px;
}
.payment-return-page #header {
  position: static;
  inset: auto;
  width: 100%;
}
.payment-return-page #header .brand span {
  display: inline;
}
.payment-return-page .receipt-details {
  grid-template-columns: minmax(0, 1fr);
}
.payment-result {
  margin-top: 24px;
}
.payment-result > p {
  margin-block: 16px;
}
@media (max-width: 600px) {
  .products.paid-products > article {
    padding: 20px;
  }
  .products.paid-products .product-benefits {
    min-height: 0;
  }
  .products.paid-products .paid-intro {
    min-height: 0;
  }
}

/* Достижения: общие размеры действий, читаемые цели и витрина без декоративного шума. */
.award-body { min-width: 0; display: flex; flex-direction: column; }
.award-body h3,
.tracked-goal strong,
.showcase-item strong { overflow-wrap: anywhere; }
.award-remaining { color: var(--accent); font-weight: 600; }
.award-earned-date { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.award-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 16px; }
.award-actions button { min-height: 44px; padding: 8px 12px; font-size: 13px; line-height: 1.4; white-space: normal; }
.award-actions .ui-icon { width: 18px; height: 18px; flex-shrink: 0; }
.award-actions .award-showcase-toggle { width: 44px; padding: 10px; }
.award-actions [aria-pressed="true"] { border-color: var(--accent); }
.award-category-filter { display: flex; align-items: center; gap: 8px; }
.collection-tools { flex-wrap: wrap; gap: 12px; }
.award-section-hint { color: var(--muted); font-size: 13px; line-height: 1.5; margin: -4px 0 16px; }
.award-goal { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.award-goal > .achievement { flex: 1; }
.award-horizon { font-size: 12px; font-weight: 600; color: var(--muted); }
.compact-award.achievement .achievement-icon { display: flex; width: 32px; height: 32px; }
.compact-award .achievement-meta { margin-top: 8px; }
.award-showcase { margin: 0 0 24px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.award-showcase h2,
.award-showcase-public h3 { font-size: 18px; line-height: 1.4; margin: 0; }
.award-showcase h2 small { color: var(--muted); font-size: 13px; font-weight: 400; }
.award-showcase p { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 8px 0 0; }
.award-showcase-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.showcase-item { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.showcase-item > .ui-icon { width: 24px; height: 24px; flex-shrink: 0; }
.showcase-item strong { flex: 1; font-size: 14px; line-height: 1.4; }
.showcase-item .icon-button { flex-shrink: 0; min-width: 44px; min-height: 44px; }
.showcase-item small { display: block; color: var(--muted); margin-top: 4px; }
.award-showcase-public { margin: 24px 0; }
.tracked-goal { display: flex; gap: 16px; align-items: center; padding: 20px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 16px; background: var(--paper); margin: 0 0 24px; }
.tracked-goal > div:first-of-type { flex: 1; min-width: 0; }
.tracked-goal-icon .ui-icon { width: 28px; height: 28px; }
.tracked-goal small,
.tracked-goal strong { display: block; }
.tracked-goal small { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.tracked-goal strong { font-size: 16px; line-height: 1.4; }
.tracked-goal p { margin: 6px 0 8px; font-size: 14px; }
.tracked-goal-actions { display: flex; align-items: center; gap: 8px; }
.achievement-game-result { padding: 16px; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-soft); text-align: left; }
.achievement-game-result small,
.achievement-game-result > span { color: var(--muted); font-size: 13px; }
.achievement-game-result strong { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.achievement-game-result p { margin: 8px 0; }
@media (max-width: 1120px) {
  .award-showcase-list { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {
  .award-category-filter,
.collection-tools .rarity-filter { flex: 1 1 160px; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; }
  .award-category-filter select,
.collection-tools .rarity-filter select { width: 100%; min-width: 0; }
  .tracked-goal { flex-wrap: wrap; padding: 16px; gap: 12px; }
  .tracked-goal-actions { width: 100%; }
  .tracked-goal-actions .secondary { flex: 1; }
  .award-showcase { padding: 16px; }
  .highlight-list .award-goal { scroll-snap-align: start; }
}
.showcase-item { background: color-mix(in srgb, var(--rarity-color, #a4aebb) 8%, var(--paper)); border-color: color-mix(in srgb, var(--rarity-color, #a4aebb) 35%, var(--line)); }
.showcase-item > .ui-icon { color: var(--rarity-color, var(--muted)); }

/* 2.17.1: активные платежи видны сразу, неуспешные попытки не засоряют профиль. */
.payment-order-group + .payment-order-group,
.payment-order-archive {
  margin-top: 18px;
}
.payment-order-group h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}
.payment-order span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.payment-order span small {
  color: var(--muted);
  font-size: 11px;
}
.payment-order-waiting .payment-order {
  border-color: var(--accent);
}
.payment-order-archive > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}
.payment-order-archive > div {
  margin-top: 8px;
}
.payment-check-form {
  margin: 12px 0 0;
}
.payment-checked-at {
  font-size: 11px;
}

/* Общий счёт после начисления очка и доступная мобильная кнопка перехода к ответам. */
.winner-total { color: var(--muted); font-size: var(--text-sm); }
.round-summary > div { flex-wrap: wrap; }

/* Карты и рука: единые размеры и состояния для стола, игрока и ведущего. */

/* Компактный вопрос: таймер и действия в одной строке, текст без встроенных кнопок. */

