/* «Играть» choice: site-wide modal (dialog#play-choice, public/js/play-choice.js) and the /play page. */

html.pc-lock { overflow: hidden; }

dialog.pc-dialog {
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: min(820px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: var(--grad-surface), var(--surface-solid);
  color: var(--ink);
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  overscroll-behavior: contain;
}
dialog.pc-dialog[open] { display: flex; flex-direction: column; animation: pc-in 340ms var(--ease) both; }
dialog.pc-dialog.is-closing { animation: pc-out 200ms ease both; }
dialog.pc-dialog::backdrop { background: rgba(4, 3, 6, 0.68); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in 240ms ease both; }
dialog.pc-dialog.is-closing::backdrop { animation: pc-fade-out 200ms ease both; }
dialog.pc-dialog::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(241, 217, 166, 0.55), transparent);
  pointer-events: none;
}
@keyframes pc-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
@keyframes pc-out { to { opacity: 0; transform: translateY(10px) scale(0.985); } }
@keyframes pc-fade-out { to { opacity: 0; } }

.pc-dialog .pc { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.pc { --pc-x: 24px; }
.pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px var(--pc-x) 0; }
.pc-head .eyebrow { margin: 0 0 6px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; }
.pc-title { margin: 0; font-family: var(--display); font-size: 32px; font-weight: 600; line-height: 1.05; color: var(--ink); }
.pc-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -4px -8px 0 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, transform 200ms var(--ease);
}
.pc-close .ico { width: 18px; height: 18px; }
.pc-close:hover { color: var(--gold-2); border-color: var(--line-2); transform: rotate(90deg); }
.pc-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.pc-create { display: grid; gap: 12px; padding: 18px var(--pc-x) 18px; border-bottom: 1px solid var(--line); }
.pc-new { min-height: 56px; font-size: 16px; }
.pc-new-game { font-weight: 600; opacity: 0.8; }
.pc-games { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-game {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 4px 13px 4px 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 200ms var(--ease);
}
.pc-game img { flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line-2); }
.pc-game:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-1px); }
.pc-game.is-on { color: var(--gold-2); border-color: rgba(217, 183, 122, 0.6); background: rgba(217, 183, 122, 0.1); }
.pc-game:focus-visible, .pc-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.pc-open { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.pc-open-head { display: flex; align-items: center; gap: 10px; padding: 16px var(--pc-x) 10px; }
.pc-open-title { margin: 0; font-family: var(--sans); font-size: 11px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.pc-live { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.pc-live i { width: 7px; height: 7px; border-radius: 50%; background: #5fcf98; box-shadow: 0 0 8px #5fcf98; }
.pc-list { display: grid; gap: 8px; align-content: start; padding: 0 var(--pc-x) 6px; }
.pc-dialog .pc-list { overflow-y: auto; min-height: 120px; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }

.pc-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 9px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, transform 220ms var(--ease);
  animation: pc-row-in 320ms var(--ease) both;
}
.pc-row:nth-child(2) { animation-delay: 30ms; }
.pc-row:nth-child(3) { animation-delay: 60ms; }
.pc-row:nth-child(n + 4) { animation-delay: 90ms; }
@keyframes pc-row-in { from { opacity: 0; transform: translateY(6px); } }
.pc-row:hover { border-color: var(--line-2); background: var(--surface-hi); transform: translateY(-1px); }
.pc-row.is-focus { border-color: rgba(217, 183, 122, 0.34); }
.pc-cover { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: #110d12; box-shadow: 0 0 0 1px var(--line); }
.pc-main { display: grid; gap: 5px; min-width: 0; }
.pc-name { overflow: hidden; font-size: 15px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.pc-gname { color: var(--ink-2); }
.pc-phase { display: inline-flex; align-items: center; gap: 5px; }
.pc-phase i { width: 6px; height: 6px; border-radius: 50%; background: #5fcf98; box-shadow: 0 0 6px #5fcf98; }
.pc-phase.is-soon i { background: #f3b857; box-shadow: 0 0 6px #f3b857; }
.pc-phase.is-live i { background: #ff5d7d; box-shadow: 0 0 6px #ff5d7d; }
.pc-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 6px; background: rgba(217, 183, 122, 0.1); color: var(--gold); }
.pc-badge .ico { width: 13px; height: 13px; }
.pc-badge.pc-adult { background: rgba(229, 72, 107, 0.14); color: var(--cran); font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em; }
.pc-side { display: grid; justify-items: end; gap: 4px; }
.pc-faces { display: flex; }
.pc-faces img { width: 22px; height: 22px; margin-left: -6px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--surface-solid); background: #110d12; }
.pc-faces img:first-child { margin-left: 0; }
.pc-seats { color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-seats b { color: var(--ink); }
.pc-go {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  background: var(--grad-gold);
  color: #1d1418;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.pc-go.is-watch { background: transparent; color: var(--ink-2); box-shadow: 0 0 0 1px var(--line-2) inset; }

.pc-empty { margin: 0; padding: 22px 18px; border: 1px dashed var(--line-2); border-radius: var(--r-md); color: var(--ink-2); font-size: 14px; line-height: 1.5; text-align: center; }
.pc-skel { display: grid; gap: 8px; }
.pc-skel i { display: block; height: 72px; border-radius: var(--r-md); background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-hi) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: pc-shimmer 1.3s linear infinite; opacity: 0.6; }
@keyframes pc-shimmer { to { background-position: -200% 0; } }
.pc-demos { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; padding: 10px var(--pc-x) 20px; font-size: 13px; }
.pc-demos small { color: var(--muted); font-size: 12px; }
.pc-demos[hidden] { display: none; }
.pc-dialog .pc-list { padding-bottom: 18px; }
.pc-dialog .pc-list:has(+ .pc-demos:not([hidden])) { padding-bottom: 6px; }

/* /play page (no-JS fallback / direct visit) */
.pc-page { max-width: 640px; }
.pc-sheet { padding: 6px 0 10px; border-radius: var(--r-xl); }

@media (max-width: 640px) {
  dialog.pc-dialog {
    width: 100vw;
    max-height: calc(100dvh - 24px);
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  dialog.pc-dialog[open] { animation: pc-sheet-in 360ms var(--ease) both; }
  dialog.pc-dialog.is-closing { animation: pc-sheet-out 220ms ease both; }
  dialog.pc-dialog .pc-head::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: 4px;
    background: var(--line-2);
  }
  .pc { --pc-x: 16px; }
  .pc-head { padding-top: 22px; }
  .pc-title { font-size: 27px; }
  .pc-create { padding-top: 14px; padding-bottom: 14px; }
  .pc-new { min-height: 52px; }
  .pc-games { flex-wrap: nowrap; margin: 0 calc(var(--pc-x) * -1); padding: 2px var(--pc-x); overflow-x: auto; scrollbar-width: none; }
  .pc-games::-webkit-scrollbar { display: none; }
  .pc-game { flex: none; }
  .pc-row { grid-template-columns: 46px minmax(0, 1fr) auto auto; gap: 10px; padding-right: 8px; }
  .pc-cover { width: 46px; height: 46px; }
  .pc-faces img:nth-child(n + 3) { display: none; }
  .pc-go { height: 30px; padding: 0 11px; font-size: 12.5px; }
}
@keyframes pc-sheet-in { from { transform: translateY(100%); } }
@keyframes pc-sheet-out { to { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  dialog.pc-dialog[open], dialog.pc-dialog.is-closing, .pc-row { animation-duration: 1ms; }
}
