/* KittyGum v3 «Чёрная вишня и шампанское золото»
   База: чёрная вишня. Акцент: шампанское золото (металл). Второй акцент: гранат (градус, страсть).
   Заголовки Roboto, текст Montserrat. Упаковка как у мобильного приложения: на телефоне на весь экран,
   на десктопе приложение по центру. */
:root {
  --head: "Roboto", system-ui, sans-serif;
  --font: "Montserrat", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --bg: #0B0508;
  --bg-2: #140A0E;
  --glass: rgba(255, 240, 225, 0.045);
  --glass-2: rgba(255, 240, 225, 0.08);
  --line: rgba(240, 214, 170, 0.14);
  --line-strong: rgba(240, 214, 170, 0.32);
  --text: #F7EFE6;
  --muted: #A99A90;

  --gold: #D8B47A;
  --gold-hi: #F6E5C0;
  --gold-lo: #9C7444;
  --gold-metal: linear-gradient(135deg, #F7E6C2 0%, #D8B47A 28%, #A47A47 52%, #E9CF9C 74%, #C29A5E 100%);
  --garnet: #8E1638;
  --garnet-hi: #C8325C;
  --garnet-glass: linear-gradient(150deg, #D84A71 0%, #A11D44 38%, #5C0A22 100%);
  --ink: #170A0E;
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); }
body { font-family: var(--font); font-size: 15px; line-height: 22px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--gold); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

/* Живой фон: два медленных пятна света и зерно */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; animation: drift 18s var(--ease) infinite alternate; }
.ambient i:nth-child(1) { width: 520px; height: 520px; left: -160px; top: -120px; background: #6E0F2E; }
.ambient i:nth-child(2) { width: 460px; height: 460px; right: -180px; top: 30%; background: #5A3A16; animation-duration: 22s; }
.ambient i:nth-child(3) { width: 380px; height: 380px; left: 20%; bottom: -200px; background: #3B0A1E; animation-duration: 26s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.15); } }
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 200; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Оболочка приложения */
.app { position: relative; max-width: 440px; min-height: 100dvh; margin: 0 auto; padding: 0 0 calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .app { margin: 32px auto; min-height: 860px; border-radius: 44px; background: rgba(20, 10, 14, 0.6); box-shadow: 0 0 0 1px var(--line), 0 60px 160px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 240, 220, 0.08); overflow: hidden; }
  .side-note { position: fixed; left: calc(50% - 560px); top: 50%; transform: translateY(-50%); width: 280px; }
}
.side-note { display: none; }
@media (min-width: 1200px) { .side-note { display: block; } }
.side-note h2 { font-weight: 300; font-size: 48px; line-height: 52px; letter-spacing: -0.02em; }
.side-note h2 b { font-weight: 500; background: var(--gold-metal); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side-note p { color: var(--muted); margin-top: 16px; }
.side-note .gp { display: inline-flex; align-items: center; gap: 10px; margin-top: 24px; padding: 10px 16px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; line-height: 18px; }
.side-note .gp b { display: block; font-size: 15px; }

/* Верхняя панель */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 20px 12px; background: linear-gradient(var(--bg) 40%, transparent); }
@media (min-width: 900px) { .topbar { background: linear-gradient(rgba(20, 10, 14, 0.95) 40%, transparent); } }
.mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-metal); color: var(--ink); font: 700 14px/1 var(--head); letter-spacing: 0.02em; box-shadow: 0 6px 20px rgba(216, 180, 122, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.brand { font: 500 18px/24px var(--head); letter-spacing: 0.01em; margin-right: auto; }
.brand small { display: block; font: 500 11px/14px var(--font); color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); transition: transform 400ms var(--spring), background-color 300ms var(--ease); }
.icon-btn:hover { background: var(--glass-2); }
.icon-btn:active { transform: scale(0.9); }
.vip-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font: 600 12px/16px var(--font); letter-spacing: 0.06em; color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--line-strong); background: rgba(216, 180, 122, 0.08); }

/* Кнопки */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer; padding: 16px 28px; border-radius: 18px; font: 600 15px/22px var(--font); letter-spacing: 0.02em; transition: transform 500ms var(--spring), box-shadow 300ms var(--ease), filter 300ms var(--ease); }
.btn-gold { background: var(--gold-metal); color: var(--ink); box-shadow: 0 14px 34px rgba(216, 180, 122, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(0, 0, 0, 0.18); }
.btn-gold::after { content: ""; position: absolute; top: 0; bottom: 0; width: 60%; left: -80%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent); transform: skewX(-20deg); animation: sheen 4.5s var(--ease) infinite; }
@keyframes sheen { 0%, 60% { left: -80%; } 100% { left: 130%; } }
.btn-gold:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 20px 44px rgba(216, 180, 122, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.btn:active { transform: scale(0.96); }
.btn-glass { background: var(--glass); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-glass:hover { background: var(--glass-2); }
.btn[disabled] { pointer-events: none; filter: saturate(0.6) brightness(0.8); }

/* Стеклянная карточка с золотой кромкой */
.glass { background: var(--glass); border-radius: 28px; box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 240, 220, 0.06); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }

.label { font: 600 11px/14px var(--font); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.gold-text { background: var(--gold-metal); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Градус: гранатовые капли */
.heat { display: inline-flex; gap: 3px; }
.heat i { width: 7px; height: 12px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: rgba(255, 240, 225, 0.14); }
.heat[data-l="1"] i:nth-child(-n+1), .heat[data-l="2"] i:nth-child(-n+2), .heat[data-l="3"] i:nth-child(-n+3), .heat[data-l="4"] i:nth-child(-n+4) { background: linear-gradient(#E0557C, #8E1638); box-shadow: 0 0 8px rgba(200, 50, 92, 0.6); }

/* Нижняя навигация как в приложении */
.tabbar { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; width: min(calc(100% - 24px), 416px); display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px; border-radius: 26px; background: rgba(24, 12, 17, 0.72); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); box-shadow: inset 0 0 0 1px var(--line), 0 20px 50px rgba(0, 0, 0, 0.6); }
@media (min-width: 900px) { .tabbar { position: absolute; } }
.tabbar a { display: grid; justify-items: center; gap: 4px; padding: 8px 0 6px; border-radius: 18px; color: var(--muted); font: 600 11px/14px var(--font); transition: color 300ms var(--ease), background-color 300ms var(--ease); }
.tabbar a[aria-current="page"] { color: var(--gold-hi); background: rgba(216, 180, 122, 0.10); }
.tabbar svg { width: 22px; height: 22px; }

/* Появление */
.rise { opacity: 0; transform: translateY(24px); animation: rise 900ms var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ===== Объёмный кубик =====
   .die: подпрыгивание и тень; .cube: вращение; .core: тёмное «тело» внутри, закрывает щели скруглённых граней. */
.die { --s: 132px; position: relative; width: var(--s); height: var(--s); perspective: 1000px; }
.die .cube { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-24deg) rotateY(32deg); transition: transform 1600ms cubic-bezier(0.16, 1, 0.3, 1); }
.die .face, .die .core { position: absolute; inset: 0; backface-visibility: hidden; }
.die .face { border-radius: 24%; display: grid; place-items: center; text-align: center; padding: 14%; font: 700 15px/19px var(--font); letter-spacing: 0.01em; }
.die .core { border-radius: 8%; }
.die .f0 { transform: translateZ(calc(var(--s) / 2)); }
.die .f1 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.die .f2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.die .f3 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.die .f4 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.die .f5 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.die .c0 { transform: translateZ(calc(var(--s) / 2 - 7px)); }
.die .c1 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2 - 7px)); }
.die .c2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2 - 7px)); }
.die .c3 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2 - 7px)); }
.die .c4 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2 - 7px)); }
.die .c5 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2 - 7px)); }

/* Жемчужная кость */
.die.pearl .face {
  color: #3A1A22;
  background:
    radial-gradient(120% 90% at 28% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 45%),
    radial-gradient(140% 120% at 80% 100%, #CDB79C 0%, #EADCC8 45%, #FBF4EA 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), inset 0 -10px 18px rgba(120, 80, 50, 0.28), inset 0 8px 14px rgba(255, 255, 255, 0.9);
}
.die.pearl .core { background: #C9B497; }
/* Гранатовое стекло с золотым текстом */
.die.garnet .face {
  color: var(--gold-hi); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  background:
    radial-gradient(110% 80% at 25% 15%, rgba(255, 210, 225, 0.55), rgba(255, 255, 255, 0) 42%),
    var(--garnet-glass);
  box-shadow: inset 0 0 0 1px rgba(255, 180, 200, 0.35), inset 0 -12px 22px rgba(40, 0, 12, 0.55), inset 0 8px 16px rgba(255, 170, 195, 0.35);
}
.die.garnet .core { background: #4A0819; }
/* Золотая окантовка и мягкий блик на каждой грани */
.die .face::before { content: ""; position: absolute; inset: 5px; border-radius: 20%; padding: 1.5px; background: var(--gold-metal); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.85; pointer-events: none; }
.die .face::after { content: "✦"; position: absolute; top: 12%; left: 50%; transform: translateX(-50%); font-size: 10px; line-height: 1; opacity: 0.7; }
.die.pearl .face::after { color: #B08A55; }
.die.garnet .face::after { color: var(--gold-hi); }
/* Тиснёные надписи: на жемчуге вдавлены, на гранате золотая фольга */
.die.pearl .face { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 -1px 0 rgba(90, 50, 30, 0.25); }
.die.garnet .face { text-shadow: none; }
.die.garnet .face span { background: var(--gold-metal); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5)); }

/* Тень на полу: под нижней видимой кромкой повёрнутого кубика */
.die .floor { position: absolute; left: 4%; right: 4%; bottom: calc(var(--s) * -0.36); height: calc(var(--s) * 0.2); border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.35) 55%, transparent); transition: transform 300ms var(--ease), opacity 300ms var(--ease); }
.die.garnet .floor { background: radial-gradient(closest-side, rgba(0, 0, 0, 0.75), rgba(160, 20, 60, 0.35) 55%, transparent); }
/* Кольцо удара */
.die .impact { position: absolute; left: 50%; bottom: calc(var(--s) * -0.26); width: var(--s); height: calc(var(--s) * 0.24); margin-left: calc(var(--s) / -2); border-radius: 50%; box-shadow: 0 0 0 2px rgba(246, 229, 192, 0.7), 0 0 24px rgba(216, 180, 122, 0.6); opacity: 0; pointer-events: none; }
.die.rolling .impact { animation: impact 1500ms var(--ease) both; }
@keyframes impact { 0%, 58% { opacity: 0; transform: scale(0.4); } 62% { opacity: 1; transform: scale(0.6); } 100% { opacity: 0; transform: scale(1.6); } }
/* Покой: лёгкое парение */
.die .lift { position: absolute; inset: 0; transform-style: preserve-3d; animation: hover 4s ease-in-out infinite alternate; }
.die:nth-child(2) .lift { animation-delay: -2s; }
@keyframes hover { to { transform: translateY(-8px); } }
/* Бросок: подлёт, удар, отскок */
.die.rolling .lift { animation: toss 1500ms cubic-bezier(0.3, 0.7, 0.4, 1) both; }
.die.rolling .floor { animation: toss-floor 1500ms cubic-bezier(0.3, 0.7, 0.4, 1) both; }
@keyframes toss {
  0% { transform: translateY(0) scale(1); }
  12% { transform: translateY(8px) scale(1.04, 0.94); filter: blur(0); }
  25% { filter: blur(1.5px); }
  38% { transform: translateY(-150px) scale(1); filter: blur(0.5px); }
  55% { filter: blur(1.5px); }
  62% { transform: translateY(0) scale(1.06, 0.9); }
  74% { transform: translateY(-30px) scale(1); }
  86% { transform: translateY(0) scale(1.02, 0.97); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes toss-floor { 0% { transform: scale(1); opacity: 1; } 38% { transform: scale(0.45); opacity: 0.35; } 62% { transform: scale(1.1); opacity: 1; } 74% { transform: scale(0.8); } 100% { transform: scale(1); } }

/* Золотые искры при приземлении */
.spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(#FFF6DE, #D8B47A 60%, transparent 70%); pointer-events: none; z-index: 5; }

@media (prefers-reduced-motion: reduce) {
  .ambient i, .die .lift, .btn-gold::after { animation: none !important; }
  .die.rolling .lift, .die.rolling .floor { animation: none !important; }
  .die .cube { transition-duration: 1ms; }
  .rise { animation-duration: 1ms; }
}

/* Внутри макета телефона на сайте: без возрастного окна, бейджа, рамки и боковой подписи */
.embed .age, .embed .mock-badge, .embed .side-note, .embed .ambient { display: none !important; }
.embed body { background: var(--bg); }
.embed .app { margin: 0; border-radius: 0; box-shadow: none; min-height: 100dvh; }
.embed .tabbar, .embed .dock { position: fixed; }
.rate { font: 600 11px/14px var(--font); color: var(--muted); letter-spacing: 0.04em; }
.rate b { font: 500 15px/1 var(--head); margin-right: 1px; }
.mock-badge { position: fixed; right: 12px; top: 72px; z-index: 210; font: 600 11px/14px var(--font); background: var(--gold); color: var(--ink); padding: 4px 8px; border-radius: 6px; opacity: 0.75; }

/* ===== Общее меню и футер сайта (inc/kg_nav.html, inc/kg_footer.html) ===== */
.site-nav { position: sticky; top: 10px; z-index: 60; width: min(calc(100% - 20px), 1200px); margin: 10px auto 0; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 12px; border-radius: 20px; background: rgba(20, 10, 14, 0.62); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%); box-shadow: inset 0 0 0 1px var(--line); }
.site-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.site-links { display: flex; gap: 2px; margin: 0 auto; }
.site-links a { padding: 8px 13px; border-radius: 12px; font: 500 14px/20px var(--font); color: var(--muted); text-decoration: none; transition: color 250ms var(--ease), background-color 250ms var(--ease); }
.site-links a:hover { color: var(--text); background: var(--glass); }
.site-links .vip, .site-drop .vip { color: var(--gold-hi); }
.site-acc { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 14px; background: var(--gold-metal); color: var(--ink); font: 600 13px/18px var(--font); text-decoration: none; }
.site-menu { display: none; position: relative; }
.site-menu summary { list-style: none; cursor: pointer; width: 42px; height: 42px; border-radius: 13px; display: grid; place-content: center; gap: 5px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu summary span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); transition: transform 300ms var(--ease); }
.site-menu[open] summary span:first-child { transform: translateY(3.5px) rotate(45deg); }
.site-menu[open] summary span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.site-drop { position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 20px)); padding: 10px; border-radius: 20px; background: rgba(24, 10, 16, 0.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: inset 0 0 0 1px var(--line-strong), 0 30px 60px rgba(0,0,0,.6); display: grid; gap: 2px; }
.site-drop a { padding: 11px 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: 15px; }
.site-drop a:hover { background: var(--glass); }
.site-drop hr { border: 0; height: 1px; background: var(--line); margin: 6px 4px; }
@media (max-width: 900px) { .site-links { display: none; } .site-acc { margin-left: auto; } .site-acc span { display: none; } .site-acc { padding: 0; width: 42px; height: 42px; justify-content: center; border-radius: 13px; } .site-menu { display: block; } }

.site-foot { width: min(calc(100% - 32px), 1200px); margin: 64px auto 0; padding: 32px 0 calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 22px; }
.sf-in { display: grid; gap: 28px; }
@media (min-width: 760px) { .sf-in { grid-template-columns: 1.4fr 1fr 1fr; } }
.sf-brand p { margin-top: 12px; max-width: 320px; }
.sf-col { display: grid; gap: 6px; align-content: start; }
.sf-col b { color: var(--text); font-weight: 600; margin-bottom: 4px; }
.sf-col a { color: var(--muted); text-decoration: none; }
.sf-col a:hover { color: var(--gold-hi); }
.sf-bot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; }
/* в играх свой заголовок: кнопка «назад» не нужна, меню уже есть */
.site-nav ~ .app .topbar > .icon-btn:first-child { visibility: hidden; }

/* Рекламный блок (inc/kg_ad.html): аккуратная рамка, пустой блок не занимает места */
.kg-ad { width: 100%; max-width: 980px; margin: 8px auto; padding: 12px; border-radius: 22px; background: rgba(255, 240, 225, 0.03); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 8px; }
.kg-ad-l { font: 600 10px/14px var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); opacity: .8; }
.kg-ad-l a { color: var(--gold); text-decoration: none; }
.kg-ad-b { min-height: 0; border-radius: 14px; overflow: hidden; }
.kg-ad:has(.kg-ad-b:empty) { display: none; }

/* Горизонтальный блок в сетке игр: всегда на всю ширину под игрой, а не в узкой колонке */
.stage > .kg-ad, .stage > .ad { grid-area: auto / 1 / auto / -1 !important; width: 100%; max-width: 980px; justify-self: center; }
/* Вертикальный блок (inc/kg_ad_rail.html) */
.kg-vad { display: grid; gap: 8px; padding: 10px; border-radius: 20px; background: rgba(255, 240, 225, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.kg-vad[hidden] { display: none; }
.kg-vad-rail { position: fixed; z-index: 30; right: 20px; top: 96px; width: 180px; max-height: calc(100vh - 120px); overflow: hidden; }
.kg-vad-side { width: 100%; }

/* SEO‑блок без колонки вопросов — во всю ширину, без пустой правой половины */
.seo:not(:has(.seo-faq)) { grid-template-columns: 1fr !important; }
