@font-face { font-family: Nunito; font-weight: 700; font-display: block; src: url(fonts/nunito-cyr-700.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Nunito; font-weight: 700; font-display: block; src: url(fonts/nunito-lat-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Nunito; font-weight: 800; font-display: block; src: url(fonts/nunito-cyr-800.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Nunito; font-weight: 800; font-display: block; src: url(fonts/nunito-lat-800.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
body { font-family: Nunito, system-ui, sans-serif; font-weight: 700; color: #5b2a3c;
  background: #f6d9e3 url(img/bg-v.jpg) center / cover no-repeat; }
@media (min-aspect-ratio: 1/1) { body { background-image: url(img/bg-h.jpg); } }
svg { width: 100%; height: 100%; }
svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
button { font-family: inherit; color: inherit; }
canvas { display: block; }

#app { height: 100%; display: flex; flex-direction: column; }
#bar { display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 8px; padding: 10px 10px 4px; }
.card { border-radius: 18px; background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 6px 18px rgba(120,50,80,.16), inset 0 1px 0 #fff; backdrop-filter: blur(6px); }
#scoreBox { padding: 4px 16px; min-width: 120px; text-align: center; line-height: 1.05; }
#score { font-size: 30px; font-weight: 800; color: #e2366f; letter-spacing: .3px; }
#best { font-size: 12px; opacity: .8; white-space: nowrap; }
#nextBox { display: flex; flex-direction: column; align-items: center; padding: 3px 10px 2px; }
#nextBox .lbl { font-size: 11px; opacity: .75; line-height: 1; }
#nextCv { width: 40px; height: 40px; }
.lbl { font-size: 12px; opacity: .75; }
.tile { width: 46px; height: 46px; padding: 11px; border: 1px solid rgba(255,255,255,.9); border-radius: 15px; color: #c22a5f; cursor: pointer;
  background: linear-gradient(180deg, #fff, #ffe3ec); box-shadow: 0 5px 14px rgba(120,50,80,.2), inset 0 1px 0 #fff; }
.tile:active { transform: translateY(1px); filter: brightness(.96); }

#stage { flex: 1; min-height: 0; position: relative; }
#cv { width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

#foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 10px 12px; }
#ladderBox { padding: 5px 10px; }
#ladderCv { width: 300px; height: 40px; }
.adbtn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px; border: 0; border-radius: 16px; cursor: pointer;
  font-size: 18px; font-weight: 800; color: #4a2600;
  background: linear-gradient(180deg, #ffd96b 0%, #ffb627 55%, #f59a00 100%);
  box-shadow: 0 5px 0 #c97600, 0 8px 18px rgba(120,50,80,.25), inset 0 2px 0 rgba(255,255,255,.6); }
.adbtn svg { width: 26px; height: 26px; flex: none; }
.adbtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #c97600, 0 4px 10px rgba(120,50,80,.25); }
.adbtn:disabled { filter: grayscale(.85) brightness(.85); cursor: default; opacity: .7; }

/* оверлеи */
.overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 10; background: rgba(90,30,60,.45); backdrop-filter: blur(4px); }
.overlay.show { display: flex; }
#start { background: #f6d9e3 url(img/bg-v.jpg) center / cover no-repeat; overflow-y: auto; touch-action: pan-y; align-items: flex-start; }
@media (min-aspect-ratio: 1/1) { #start { background-image: url(img/bg-h.jpg); } }
#start { scrollbar-width: none; } #start::-webkit-scrollbar { display: none; }
#start::before { content: ""; position: fixed; inset: 0; background: rgba(255,240,245,.35); pointer-events: none; }
.menu { position: relative; width: min(94vw, 440px); margin: auto; padding: 2vh 0 3vh; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero { width: min(70vw, 300px); aspect-ratio: 3 / 2; margin-bottom: -14px; }
.hero canvas { width: 100%; height: 100%; }
.menu h1 { line-height: .95; filter: drop-shadow(0 3px 0 #fff) drop-shadow(0 8px 16px rgba(160,60,100,.35)); }
.menu .t1 { display: block; font-size: clamp(40px, 11vw, 60px); font-weight: 800; color: #6b2d45; }
.menu .t2 { display: block; font-size: clamp(44px, 12vw, 66px); font-weight: 800;
  background: linear-gradient(180deg, #ff7eb0, #ff2f77); -webkit-background-clip: text; background-clip: text; color: transparent; }
.menu p { font-size: 15px; line-height: 1.3; color: #5b2a3c; max-width: 360px; text-shadow: 0 1px 0 #fff; }
.menu .how { font-size: 13px; opacity: .85; }
.menuBest { font-size: 17px; font-weight: 800; color: #c22a5f; padding: 6px 18px; border-radius: 14px; background: rgba(255,255,255,.7); }
.big { border: 0; border-radius: 20px; padding: 15px 60px; font-size: 25px; font-weight: 800; color: #fff; cursor: pointer; min-width: 240px;
  background: linear-gradient(180deg, #ff8fbd 0%, #ff4d8d 55%, #f0276f 100%); text-shadow: 0 2px 0 rgba(150,20,70,.45);
  box-shadow: 0 6px 0 #b6134f, 0 12px 24px rgba(160,40,90,.35), inset 0 2px 0 rgba(255,255,255,.5); }
.big:active { transform: translateY(3px); box-shadow: 0 3px 0 #b6134f, 0 6px 12px rgba(160,40,90,.35); }
.big:disabled { opacity: .55; cursor: default; }
.link { border: 0; background: none; font-size: 15px; font-weight: 800; color: #c22a5f; text-decoration: underline; cursor: pointer; display: none; }
.link.show { display: inline; }
.chain { padding: 8px 12px 10px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
#chainCv { width: 100%; height: 52px; }

.card.win { position: relative; padding: 52px 26px 26px; width: min(88vw, 360px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #fff 0%, #fff1f6 100%); box-shadow: 0 24px 60px rgba(60,10,40,.45), 0 0 0 6px rgba(255,255,255,.35); }
.crown { position: absolute; left: 50%; top: -46px; width: 92px; height: 92px; transform: translateX(-50%); color: #ffb627;
  filter: drop-shadow(0 4px 0 #d78500) drop-shadow(0 8px 14px rgba(120,50,80,.35)); animation: crownIn .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes crownIn { from { transform: translateX(-50%) scale(0) rotate(-30deg); } }
.card h2 { font-size: 28px; font-weight: 800; line-height: 1.05; color: #6b2d45; }
.res { line-height: 1; }
.res .lbl { font-size: 13px; }
#overScore { font-size: 46px; font-weight: 800; color: #e2366f; }
#overBest { font-size: 22px; font-weight: 800; color: #6b2d45; }
.tag { display: none; padding: 5px 14px; border-radius: 12px; font-size: 14px; font-weight: 800; color: #4a2600;
  background: linear-gradient(180deg, #ffe08a, #ffbf3a); animation: tagIn .4s ease-out; }
.tag.show { display: block; }
@keyframes tagIn { from { transform: scale(.4); opacity: 0; } }
.card.win .big { margin-top: 6px; padding: 14px 40px; min-width: 0; }

/* горизонтальный экран: панели по бокам стакана */
@media (min-aspect-ratio: 1/1) and (min-width: 820px) {
  #app { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: 100%; }
  #bar { grid-column: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 12px; padding: 16px 18px 16px 10px; }
  #bar .tile { order: 3; }
  #scoreBox { order: 1; padding: 10px 22px; min-width: 170px; }
  #score { font-size: 40px; }
  #best { font-size: 14px; }
  #nextBox { order: 2; padding: 8px 18px 6px; }
  #nextBox .lbl { font-size: 13px; }
  #nextCv { width: 56px; height: 56px; }
  #stage { grid-column: 2; width: min(60vw, 100vh); }
  #foot { grid-column: 3; flex-direction: column; justify-content: center; align-items: flex-start; padding: 16px 10px 16px 18px; gap: 14px; }
  #ladderBox { padding: 8px 10px; }
  #ladderCv { width: 64px; height: 420px; }
  #ladderBox.wide #ladderCv { width: 140px; }
}
@media (max-width: 380px) { #scoreBox { min-width: 100px; padding: 3px 10px; } #score { font-size: 26px; } .tile { width: 42px; height: 42px; padding: 10px; } #ladderCv { width: 270px; height: 36px; } }
@media (max-height: 600px) and (max-aspect-ratio: 1/1) { .hero { display: none; } .menu .how { display: none; } #bar { padding-top: 6px; } #foot { padding-bottom: 6px; } }

/* монеты, бустеры, коллекция, подарок, соцкнопки, кросс-промо */
.coin { display: inline-block; width: 1em; height: 1em; border-radius: 50%; vertical-align: -.12em; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff6b0 0 18%, #ffd23b 40%, #f0a000 100%); box-shadow: inset 0 -2px 0 rgba(160,90,0,.45), 0 1px 2px rgba(120,60,0,.3); }
.chip { display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 18px; font-weight: 800; color: #8a4b00; }
.chip .coin { width: 22px; height: 22px; }
#boosts { display: flex; gap: 16px; }
.boost { position: relative; display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 16px 0 10px; border: 0; border-radius: 16px; cursor: pointer;
  font-size: 15px; font-weight: 800; color: #6b2d45; background: linear-gradient(180deg, #fff, #ffe3ec);
  box-shadow: 0 5px 0 #e7a3bd, 0 8px 16px rgba(120,50,80,.2), inset 0 1px 0 #fff; }
.boost .ic { font-size: 26px; line-height: 1; }
.boost .cnt { position: absolute; right: -8px; top: -9px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; font-size: 13px; line-height: 24px;
  color: #fff; background: #ff3d7f; box-shadow: 0 2px 0 #b6134f; }
.boost .cnt.coin { width: auto; height: 24px; border-radius: 12px; color: #6a3a00; vertical-align: 0; }
.boost .cnt.ad { background: #ffb627; box-shadow: 0 2px 0 #c97600; color: #4a2600; }
.boost:active { transform: translateY(3px); box-shadow: 0 2px 0 #e7a3bd; }
.boost:disabled { opacity: .55; cursor: default; }
.boost.on { background: linear-gradient(180deg, #ff8fbd, #ff4d8d); color: #fff; animation: pulse .8s infinite alternate; }
@keyframes pulse { to { transform: scale(1.06); } }
.menuStats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.menuStats .menuBest { font-size: 15px; display: inline-flex; align-items: center; gap: 5px; }
.promo { display: none; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; text-align: left; font-size: 13px; line-height: 1.25; color: #5b2a3c; cursor: pointer; font-weight: 700; }
.promo.show { display: flex; }
.promo b { font-size: 16px; color: #2f6fe0; }
.promo .pic { width: 52px; height: 52px; flex: none; border-radius: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.overRow { display: flex; gap: 10px; }
.overRow > span { display: flex; flex-direction: column; align-items: center; min-width: 120px; padding: 8px; border-radius: 14px; background: rgba(255,143,189,.14); line-height: 1.15; }
.overRow small { font-size: 11px; opacity: .75; }
.overRow b { font-size: 15px; color: #6b2d45; }
#overCv { width: 34px; height: 34px; }
.coin.big2 { width: 30px; height: 30px; margin: 2px; }
.vkrow { display: flex; gap: 8px; }
.soc { border: 0; border-radius: 14px; padding: 10px 16px; font-size: 15px; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #5b9dff, #2f6fe0); box-shadow: 0 4px 0 #1d4fae; }
.soc:active { transform: translateY(2px); box-shadow: 0 2px 0 #1d4fae; }
.ribbon { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 9px 26px; border-radius: 14px; font-size: 22px; font-weight: 800; color: #fff;
  background: linear-gradient(180deg, #ff8fbd, #ff2f77); box-shadow: 0 5px 0 #b6134f, 0 10px 20px rgba(160,40,90,.35); }
#found .card.win, #gift .card.win { padding-top: 40px; }
.rays { position: relative; width: 190px; height: 190px; }
.rays::before { content: ""; position: absolute; inset: -24px; border-radius: 50%; animation: spin 8s linear infinite;
  background: repeating-conic-gradient(rgba(255,190,40,.55) 0 10deg, transparent 10deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%); mask: radial-gradient(circle, #000 25%, transparent 70%); }
.rays canvas { position: relative; width: 190px; height: 190px; animation: popIn .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes popIn { from { transform: scale(0) rotate(-30deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
.info { font-size: 15px; line-height: 1.3; }
.big small { font-size: 16px; opacity: .95; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; width: 100%; }
.days i { font-style: normal; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 10px; font-size: 11px; background: rgba(255,143,189,.15); }
.days i b { font-size: 15px; }
.days i.got { opacity: .45; }
.days i.now { background: linear-gradient(180deg, #ffe08a, #ffbf3a); color: #4a2600; transform: scale(1.12); box-shadow: 0 3px 0 #d78500; }
.note { font-size: 12px; opacity: .75; }
@media (min-aspect-ratio: 1/1) and (min-width: 820px) {
  #coinBox { order: 1; font-size: 22px; padding: 10px 18px; }
  #boosts { flex-direction: column; }
}
@media (max-width: 380px) { .chip { font-size: 15px; padding: 6px 8px; } .boost { height: 44px; padding: 0 12px 0 8px; } }
