/* Общие стили страниц игр KittyGum (кубики, правда или действие) */
.app { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
.title { font-weight: 400; font-size: 20px; line-height: 26px; margin-right: auto; text-align: center; flex: 1; }
.stage { padding: 0 16px; display: grid; gap: 12px; }

.players { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pl { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 20px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-weight: 600; transition: all 400ms var(--ease); }
.pl .av { width: 36px; height: 36px; border-radius: 13px; display: grid; place-items: center; font: 500 15px/1 var(--head); background: rgba(255, 240, 225, 0.08); color: var(--text); transition: all 400ms var(--ease); }
.pl small { display: block; font-size: 10px; line-height: 12px; letter-spacing: 0.14em; color: var(--gold); opacity: 0; transition: opacity 300ms var(--ease); }
.pl.on { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong), 0 12px 30px rgba(142, 22, 56, 0.3); background: rgba(216, 180, 122, 0.07); }
.pl.on .av { background: var(--gold-metal); color: var(--ink); box-shadow: 0 6px 16px rgba(216, 180, 122, 0.3); }
.pl.on small { opacity: 1; }

/* Форма «Кто играет?» */
.who { padding: 14px; border-radius: 22px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 10px; }
.who[hidden], .players[hidden] { display: none; }
.who-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.who input { min-width: 0; font: 600 15px/22px var(--font); padding: 12px 14px; border-radius: 14px; border: 0; background: rgba(255, 240, 225, 0.06); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.who input:focus { outline: 2px solid var(--gold-hi); outline-offset: 1px; }
.who .btn { padding: 12px 18px; border-radius: 14px; }
.skip-names { justify-self: start; border: 0; background: none; color: var(--muted); font: 600 12px/16px var(--font); cursor: pointer; padding: 2px 4px; }
.skip-names:hover { color: var(--text); }
@media (max-width: 420px) { .who-row { grid-template-columns: 1fr 1fr; } .who .btn { grid-column: 1 / -1; } }
/* Рейтинг игры */
.rating { display: grid; gap: 22px; padding: 22px; border-radius: 30px; background: radial-gradient(120% 140% at 0% 0%, rgba(216, 180, 122, 0.10), transparent 55%), var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.rate-sum { display: grid; gap: 8px; }
.rate-big { display: flex; align-items: baseline; gap: 4px; }
.rate-big b { font: 300 56px/1 var(--head); letter-spacing: -0.03em; }
.rate-big span { font: 400 20px/1 var(--head); color: var(--muted); }
.rate-bar { height: 6px; border-radius: 6px; background: rgba(255, 240, 225, 0.08); overflow: hidden; }
.rate-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gold-metal); transition: width 900ms var(--ease); }
.rate-count { font-size: 13px; color: var(--muted); }
.rate-vote { display: grid; gap: 10px; }
.rate-btns { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.rate-btns button { aspect-ratio: 1; min-width: 0; border: 0; cursor: pointer; border-radius: 10px; font: 600 14px/1 var(--font); color: var(--muted); background: rgba(255, 240, 225, 0.05); box-shadow: inset 0 0 0 1px var(--line); transition: background-color 200ms var(--ease), color 200ms var(--ease), transform 300ms var(--spring); }
.rate-btns button:active { transform: scale(0.9); }
.rate-btns button.lit { color: var(--ink); background: var(--gold-metal); box-shadow: 0 4px 14px rgba(216, 180, 122, 0.25); }
.rate-btns button.mine { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.rate-msg { font-size: 13px; color: var(--muted); min-height: 18px; }
.rate-msg.ok { color: var(--gold-hi); }
/* SEO‑текст и вопросы под игрой */
.seo { display: grid; gap: 28px; padding: 26px 22px; border-radius: 30px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 14px; line-height: 22px; }
.seo h2 { color: var(--text); font-weight: 300; font-size: 26px; line-height: 30px; letter-spacing: -0.01em; margin: 0 0 12px; }
.seo h3 { color: var(--text); font-weight: 500; font-size: 16px; line-height: 22px; margin: 22px 0 8px; }
.seo p { margin: 0; }
.seo ol, .seo ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.seo ol li::marker { color: var(--gold); font-weight: 600; }
.seo-heat { list-style: none; padding: 0 !important; }
.seo-heat b { color: var(--text); font-weight: 600; }
.seo-cols { display: grid; gap: 4px 28px; }
.seo-faq dl { margin: 0; display: grid; gap: 14px; }
.seo-faq dt { color: var(--text); font-weight: 600; }
.seo-faq dd { margin: 4px 0 0; }
.heat-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 5px; border-radius: 20px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.hp { border: 0; cursor: pointer; padding: 9px 4px 8px; border-radius: 15px; background: transparent; display: grid; justify-items: center; gap: 6px; font: 600 11px/14px var(--font); color: var(--muted); transition: all 400ms var(--ease); }
.hp:active { transform: scale(0.94); }
.hp[aria-pressed="true"] { color: var(--ink); background: var(--gold-metal); box-shadow: 0 8px 20px rgba(216, 180, 122, 0.25); }
.hp[aria-pressed="true"] .heat i { background: rgba(23, 10, 14, 0.25); box-shadow: none; }
.hp[aria-pressed="true"] .heat[data-l="1"] i:nth-child(-n+1), .hp[aria-pressed="true"] .heat[data-l="2"] i:nth-child(-n+2) { background: var(--ink); }
.note { font-size: 13px; line-height: 18px; color: var(--muted); text-align: center; display: none; }
.note.show { display: block; }
.note a { color: var(--gold-hi); font-weight: 600; }

/* Сцена с кубиками */
.table { position: relative; border-radius: 34px; padding: 70px 0 54px; min-height: 380px; overflow: hidden; background: radial-gradient(120% 90% at 50% 100%, rgba(142, 22, 56, 0.45), transparent 60%), linear-gradient(#170A10, #0D0609); box-shadow: inset 0 0 0 1px var(--line), inset 0 -30px 60px rgba(0, 0, 0, 0.5); }
.table::before { /* бархатная поверхность стола */ content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%; background: linear-gradient(transparent, rgba(110, 15, 46, 0.25)); border-top: 1px solid rgba(240, 214, 170, 0.06); }
.table::after { /* верхний свет */ content: ""; position: absolute; left: 50%; top: -120px; width: 320px; height: 240px; margin-left: -160px; background: radial-gradient(closest-side, rgba(246, 229, 192, 0.18), transparent); pointer-events: none; }
.dice-row { position: relative; z-index: 1; display: flex; justify-content: center; gap: 34px; transition: opacity 400ms var(--ease); }
/* 3D‑сцена поверх стола; CSS‑кубики остаются, пока модель грузится или если нет WebGL */
.d3 { position: absolute; inset: 0; z-index: 2; opacity: 0; transition: opacity 600ms var(--ease); }
.d3 canvas { width: 100%; height: 100%; display: block; }
.table.three .d3 { opacity: 1; }
.table.three .dice-row { opacity: 0; }
.dice-row .die { --s: 132px; }
@media (max-width: 400px) { .dice-row .die { --s: 112px; } .dice-row { gap: 30px; } }

.task { text-align: center; min-height: 92px; margin-bottom: 6px; }
.task p { font: 300 30px/34px var(--head); letter-spacing: -0.02em; margin-top: 8px; transition: opacity 300ms var(--ease), transform 600ms var(--ease), filter 600ms var(--ease); }
.task .how { font: 600 13px/18px var(--font); letter-spacing: 0.04em; color: var(--gold-hi); margin-top: 10px; display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(216, 180, 122, 0.1); box-shadow: inset 0 0 0 1px var(--line); }
.task .how:empty { display: none; }
.task p.wait { opacity: 0; transform: translateY(12px); filter: blur(8px); }

.timer { justify-self: center; display: flex; align-items: center; gap: 12px; padding: 6px 18px 6px 6px; border-radius: 999px; }
.timer[hidden] { display: none; }
.ring { width: 40px; height: 40px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .bg { stroke: rgba(255, 240, 225, 0.1); }
.ring .fg { stroke: url(#gold); stroke-linecap: round; stroke-dasharray: 107; transition: stroke-dashoffset 1000ms linear; }
.timer .t { font: 500 18px/1 var(--head); font-variant-numeric: tabular-nums; }
.timer .m { color: var(--muted); font-size: 13px; }

.history .label { display: block; margin: 0 4px 10px; }
.history ul { list-style: none; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.history li { font-size: 13px; line-height: 18px; padding: 7px 12px 7px 7px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); display: flex; align-items: center; gap: 8px; animation: rise 600ms var(--ease) both; }
.history li b { width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center; font: 500 11px/1 var(--head); background: rgba(216, 180, 122, 0.16); color: var(--gold-hi); }
.history .empty { color: var(--muted); font-size: 13px; margin: 0 4px; }
.ad { padding: 14px; border-radius: 20px; text-align: center; font-size: 11px; line-height: 16px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* Кнопка идёт сразу после задания с нормальным отступом и «прилипает» к низу экрана при прокрутке */
.dock { position: sticky; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 50; width: 100%; }
/* ПК: обычная страница сайта без рамки «телефона», игра слева, управление справа */
@media (min-width: 900px) {
  .app { max-width: 1180px; margin: 0 auto; min-height: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; padding: 0 24px 64px; }
  .topbar { background: none; padding: 24px 0 20px; }
  .title { font-size: 28px; line-height: 34px; text-align: left; }
  /* Сцена во всю ширину; задание и кнопка лежат на ней внизу по центру */
  .topbar { padding: 16px 0 12px; }
  .stage { padding: 0; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: center;
    grid-template-areas: "table table table" "players heat heat" "note note note" "timer timer timer" "history history ad" "rate rate rate" "seo seo seo"; }
  .table { grid-area: table; min-height: 600px; padding: 0; border-radius: 36px; }
  .table::before { height: 50%; background: linear-gradient(transparent, rgba(11, 5, 8, 0.85)); }
  .task { grid-area: table; align-self: end; justify-self: center; z-index: 3; margin-bottom: 118px; text-align: center; min-height: 0; pointer-events: none; }
  .task p { font-size: 40px; line-height: 44px; margin-top: 4px; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6); }
  .task .how { margin-top: 8px; }
  .dock { grid-area: table; align-self: end; justify-self: center; z-index: 3; margin-bottom: 28px; position: static; transform: none; width: 360px; }
  .dock .btn { padding: 16px; }
  /* одна плотная панель управления под сценой */
  /* строка управления: два равных стеклянных блока на всю ширину */
  .players { grid-area: players; align-self: stretch; padding: 6px; border-radius: 22px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
  .players .pl { background: transparent; box-shadow: none; padding: 10px 14px 10px 10px; }
  .players .pl.on { background: rgba(216, 180, 122, 0.08); box-shadow: inset 0 0 0 1px var(--line-strong); }
  .heat-pick { grid-area: heat; align-self: stretch; }
  .heat-pick .hp { padding: 12px 6px 10px; }
  .note { grid-area: note; margin: -2px 0 0; }
  .who { grid-column: 1 / 3; grid-row: 2; align-self: stretch; grid-template-columns: auto 1fr auto; align-items: center; padding: 8px 8px 8px 18px; }
  .who-row { grid-template-columns: 1fr 1fr auto; }
  .who:not([hidden]) ~ .heat-pick { grid-column: 3; grid-row: 2; }
  .who:not([hidden]) ~ .timer { display: none; }
  .timer { grid-area: timer; justify-self: center; }
  .history { grid-area: history; } .history .label { margin-bottom: 8px; }
  .ad { grid-area: ad; width: 300px; }
  .rating { grid-area: rate; grid-template-columns: 260px 1fr; gap: 40px; align-items: center; padding: 28px 36px; }
  .rate-btns { gap: 8px; } .rate-btns button { font-size: 16px; border-radius: 12px; }
  .seo { grid-area: seo; margin-top: 12px; padding: 36px 40px; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: start; }
  .seo-cols { grid-template-columns: 1fr 1fr; }
  .seo-faq { padding-left: 40px; box-shadow: inset 1px 0 0 var(--line); }
}
.dock .btn { width: 100%; padding: 20px; font-size: 16px; border-radius: 22px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(4, 1, 3, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity 300ms var(--ease); z-index: 60; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 105%); width: 100%; max-width: 440px; z-index: 61; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 34px 34px 0 0; background: rgba(26, 13, 19, 0.96); box-shadow: inset 0 1px 0 var(--line-strong); max-height: 86dvh; overflow: auto; transition: transform 600ms var(--ease); }
.open .sheet-bg { opacity: 1; pointer-events: auto; }
.open .sheet { transform: translate(-50%, 0); }
.grip { width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 240, 225, 0.2); margin: 0 auto 18px; }
.sheet h2 { font-weight: 300; font-size: 30px; line-height: 34px; }
.sheet .hint { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.sheet fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.sheet legend { font-weight: 600; margin-bottom: 10px; }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.names input { min-width: 0; font: 600 15px/22px var(--font); padding: 13px 16px; border-radius: 16px; border: 0; background: var(--glass); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg label, .opts label { cursor: pointer; text-align: center; padding: 10px 12px; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; line-height: 18px; font-weight: 600; transition: all 300ms var(--ease); }
.seg input, .opts input { position: absolute; opacity: 0; }
.seg label:has(input:checked) { background: var(--gold-metal); color: var(--ink); box-shadow: none; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts label:has(input:checked) { color: var(--muted); background: transparent; text-decoration: line-through; }
.seg label:has(input:focus-visible), .opts label:has(input:focus-visible) { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

/* Мягкая подсказка про VIP внутри игры: появляется раз в несколько ходов под заданием */
.upsell { display: flex; align-items: center; gap: 12px; margin: 14px auto 0; max-width: 420px; padding: 10px 10px 10px 14px; border-radius: 18px; text-align: left; color: var(--text); background: linear-gradient(120deg, rgba(142, 22, 56, 0.35), rgba(216, 180, 122, 0.12)); box-shadow: inset 0 0 0 1px var(--line-strong); animation: rise 600ms var(--ease) both; pointer-events: auto; }
.upsell[hidden] { display: none; }
.upsell .up-ico { width: 34px; height: 34px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--gold-metal); color: var(--ink); font-size: 16px; }
.upsell b { display: block; font: 600 14px/18px var(--font); }
.upsell small { display: block; font: 500 12px/16px var(--font); color: var(--muted); }
.upsell .up-cta { margin-left: auto; padding: 8px 12px; border-radius: 12px; background: var(--gold-metal); color: var(--ink); font: 700 12px/16px var(--font); white-space: nowrap; }
.note a { white-space: nowrap; }
