/* Мини-игры: «Башня» и «Слово дня». Общие кнопки и шрифты — из style.css. */
html:has(body.mini) { overflow: auto; height: auto; min-height: 100%; overscroll-behavior: auto; }
/* body не должен быть своим скроллером, иначе колесо мыши не прокручивает страницу */
body.mini { overflow-x: clip; overflow-y: visible; overscroll-behavior: auto; height: auto; min-height: 100%; background: #0b0807; }
#miniBg { position: fixed; inset: 0; z-index: 0; background: url(/sprites/bg-night.webp) center 30% / cover no-repeat, #0b0807; }
#miniBg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgba(8, 5, 4, .35), rgba(8, 5, 4, .88) 75%), linear-gradient(180deg, rgba(8, 5, 4, .6), transparent 30%, rgba(8, 5, 4, .7)); }
.mini-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .55rem clamp(.8rem, 3vw, 2.4rem); padding-right: 13rem; background: rgba(14, 10, 9, .82); border-bottom: 1px solid rgba(214, 177, 106, .22); backdrop-filter: blur(8px); }
.mini-top img { display: block; height: 2.2rem; width: auto; }
.mini-top nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.mini-link { color: #e3cfa2; text-decoration: none; font-weight: 700; font-size: .85rem; padding: .4rem .7rem; border-radius: 8px; white-space: nowrap; }
.mini-link:hover { background: rgba(214, 177, 106, .12); color: #ffe3a6; }
.mini-link.on { background: rgba(214, 177, 106, .16); color: #ffe3a6; }
body.mini .acc-chip { z-index: 30; }
.mini-main { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; padding: 1.2rem clamp(.6rem, 3vw, 2rem) 2.5rem; }
.mini-head { text-align: center; margin-bottom: .9rem; }
.mini-head .kicker { color: #e4b46e; font: 800 .68rem var(--sans); letter-spacing: .3em; text-transform: uppercase; }
.mini-head h1 { font: 700 clamp(1.9rem, 4vw, 2.8rem) / 1.05 var(--serif); margin: .3rem 0 .25rem; color: #fff0d0; }
.mini-head p { margin: 0; color: #cdbb9c; font-size: .9rem; max-width: 34rem; line-height: 1.45; }
.mini-note { margin: .5rem 0 0; font-size: .82rem; color: #e9c98a; }
.mini-note a { color: #ffe3a6; }
.mini-panel { background: linear-gradient(180deg, rgba(22, 16, 13, .92), rgba(10, 8, 7, .95)); border: 1px solid rgba(214, 177, 106, .3); border-radius: 20px; box-shadow: 0 30px 70px rgba(0, 0, 0, .55); }
.coin-i { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -.17em; background: url(/casino/coin.webp) center / contain no-repeat; }

/* ---------------- Башня ---------------- */
.tw-wrap { width: min(30rem, 100%); display: grid; gap: .7rem; }
.tw-hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem; padding: .65rem .9rem; }
.tw-hud .h-l, .tw-hud .h-r { font-size: .78rem; color: #b8a888; line-height: 1.3; }
.tw-hud .h-r { text-align: right; }
.tw-hud b { color: #ffe3a6; font-size: .95rem; }
.tw-score { font: 900 2.4rem / 1 var(--serif); color: #fff0d0; text-align: center; min-width: 3ch; text-shadow: 0 2px 18px rgba(255, 200, 110, .35); }
.tw-score small { display: block; font: 700 .6rem var(--sans); letter-spacing: .25em; text-transform: uppercase; color: #a89c88; margin-top: .2rem; }
.tw-pips { display: flex; align-items: center; justify-content: center; gap: .3rem; padding: .55rem .8rem; flex-wrap: wrap; }
.tw-pips .lbl { font-size: .74rem; color: #b8a888; margin-right: .3rem; }
.tw-pips i { width: .85rem; height: .85rem; border-radius: 3px; border: 1px solid rgba(214, 177, 106, .45); background: rgba(255, 255, 255, .04); transform: rotate(45deg); transition: background .25s, box-shadow .25s, transform .25s; }
.tw-pips i.on { background: linear-gradient(135deg, #ffe7a6, #c9932e); border-color: #ffe7a6; box-shadow: 0 0 10px rgba(255, 210, 120, .6); }
.tw-pips i.pop { transform: rotate(45deg) scale(1.5); }
.tw-pips .goal { margin-left: .4rem; font-weight: 800; color: #ffd76a; font-size: .85rem; }
.tw-stage { position: relative; height: min(68vh, 40rem); min-height: 24rem; overflow: hidden; border-radius: 20px; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.tw-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 20px; }
.tw-float { position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; font: 900 1.4rem var(--serif); color: #ffe7a6; text-shadow: 0 2px 14px rgba(0, 0, 0, .8), 0 0 18px rgba(255, 200, 110, .6); animation: twFloat 1s var(--ease) forwards; white-space: nowrap; }
.tw-float.coin { font-size: 1.8rem; color: #ffd76a; }
@keyframes twFloat { from { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.08); } to { opacity: 0; transform: translate(-50%, -50px) scale(1); } }
.tw-over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1.5rem; text-align: center; background: radial-gradient(ellipse at center, rgba(12, 8, 6, .72), rgba(12, 8, 6, .9)); border-radius: 20px; animation: twIn .35s var(--ease); cursor: default; }
@keyframes twIn { from { opacity: 0; } }
.tw-over h2 { margin: 0; font: 700 1.9rem var(--serif); color: #fff0d0; }
.tw-over p { margin: 0; color: #d6c4a6; font-size: .92rem; line-height: 1.5; max-width: 22rem; }
.tw-over .big { font: 900 3.4rem / 1 var(--serif); color: #ffe3a6; }
.tw-over .row { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; font-size: .85rem; color: #b8a888; }
.tw-over .row b { display: block; color: #fff0d0; font-size: 1.15rem; }
.tw-over .btn { min-width: 12rem; }
.tw-hint { text-align: center; color: #a89c88; font-size: .8rem; }
.tw-sound { position: absolute; right: .6rem; top: .6rem; z-index: 3; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid rgba(214, 177, 106, .35); background: rgba(14, 10, 9, .6); cursor: pointer; font-size: 1rem; }

/* ---------------- Слово дня ---------------- */
.wd-wrap { width: min(32rem, 100%); display: grid; gap: .8rem; }
.wd-bar { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .6rem .9rem; font-size: .82rem; color: #b8a888; flex-wrap: wrap; }
.wd-bar b { color: #ffe3a6; font-variant-numeric: tabular-nums; }
.wd-grid { display: grid; grid-template-rows: repeat(6, 1fr); gap: .4rem; width: min(19.5rem, 88vw); margin: .3rem auto; }
.wd-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.wd-row.shake { animation: wdShake .45s; }
@keyframes wdShake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.wd-cell { aspect-ratio: 1; display: grid; place-items: center; font: 800 clamp(1.4rem, 6vw, 1.9rem) var(--sans); text-transform: uppercase; color: #fff4dc; border: 2px solid rgba(214, 177, 106, .22); border-radius: 8px; background: rgba(255, 255, 255, .03); transition: border-color .12s; perspective: 400px; }
.wd-cell.filled { border-color: rgba(243, 217, 155, .7); animation: wdPop .12s; }
@keyframes wdPop { 50% { transform: scale(1.1); } }
.wd-cell.m0, .wd-cell.m1, .wd-cell.m2 { border-color: transparent; }
.wd-cell.m0 { background: #3a332d; color: #cbbfae; }
.wd-cell.m1 { background: linear-gradient(180deg, #d9a93f, #a97a1f); color: #1c1206; }
.wd-cell.m2 { background: linear-gradient(180deg, #3fa46a, #22764a); color: #f2fff6; }
.wd-cell.flip { animation: wdFlip .5s ease both; }
@keyframes wdFlip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.wd-row.win .wd-cell { animation: wdJump .5s ease both; }
@keyframes wdJump { 40% { transform: translateY(-14px); } 70% { transform: translateY(3px); } }
.wd-kb { display: grid; gap: .35rem; user-select: none; -webkit-user-select: none; }
.wd-kr { display: flex; justify-content: center; gap: .25rem; }
.wd-k { flex: 1 1 0; max-width: 2.5rem; min-width: 0; height: 3.1rem; border: 0; border-radius: 7px; background: #5a4f45; color: #fff4dc; font: 800 .95rem var(--sans); text-transform: uppercase; cursor: pointer; touch-action: manipulation; padding: 0; transition: background .2s, transform .08s; }
.wd-k:active { transform: scale(.94); }
.wd-k.wide { max-width: 4rem; flex: 1.6 1 0; font-size: .8rem; }
.wd-k.m0 { background: #2b2520; color: #7f746a; }
.wd-k.m1 { background: #c3922f; color: #1c1206; }
.wd-k.m2 { background: #2f8d57; color: #f2fff6; }
.wd-msg { min-height: 1.4rem; text-align: center; font-weight: 700; color: #ffe3a6; }
.wd-result { padding: 1rem 1.1rem; text-align: center; display: grid; gap: .45rem; }
.wd-result h2 { margin: 0; font: 700 1.5rem var(--serif); color: #fff0d0; }
.wd-result p { margin: 0; color: #d6c4a6; font-size: .9rem; }
.wd-stats { display: flex; justify-content: center; gap: 1.3rem; font-size: .75rem; color: #a89c88; }
.wd-stats b { display: block; font: 800 1.3rem var(--sans); color: #fff0d0; }
.wd-gate { padding: 1.4rem 1.2rem; text-align: center; display: grid; gap: .7rem; justify-items: center; }
.wd-gate p { margin: 0; color: #d6c4a6; }
.wd-help { font-size: .8rem; color: #a89c88; line-height: 1.5; padding: .7rem 1rem; }
.wd-help span { display: inline-block; width: 1rem; height: 1rem; border-radius: 3px; vertical-align: -.2rem; margin-right: .25rem; }

@media (max-width: 640px) {
  .mini-top { padding-right: .8rem; flex-wrap: wrap; gap: .4rem; }
  .mini-top img { height: 1.8rem; }
  .mini-main { padding-bottom: 6rem; }
  .tw-stage { height: 62vh; min-height: 20rem; }
  .wd-k { height: 2.9rem; font-size: .85rem; }
}

/* ---------------- главная: блок «Мини-игры» ---------------- */
.mini-col { display: grid; gap: .55rem; padding: 1rem .9rem; border-radius: 20px; background: linear-gradient(180deg, rgba(20, 15, 12, .92), rgba(10, 8, 7, .95)); border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(0, 0, 0, .55); animation: rise .8s var(--ease) both; }
.mini-col h3 { margin: 0; font-family: var(--serif); font-size: 1.15rem; color: #f3e3bd; display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.mini-col h3 small { font: 500 .75rem var(--sans); color: var(--muted); }
.mini-col .mc-list { display: grid; gap: .55rem; }
.mc-item { position: relative; display: grid; grid-template-columns: 3.2rem 1fr; gap: .7rem; align-items: center; padding: .65rem .7rem; border-radius: 14px; text-decoration: none; color: inherit; background: rgba(255, 255, 255, .04); border: 1px solid rgba(214, 177, 106, .25); transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; overflow: hidden; }
.mc-item:hover { border-color: var(--gold); background: rgba(214, 177, 106, .09); transform: translateX(-2px); box-shadow: 0 0 22px rgba(214, 177, 106, .2); }
.mc-ico { width: 3.2rem; height: 3.2rem; border-radius: 12px; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, #3b2c1c, #150f0b); border: 1px solid rgba(214, 177, 106, .3); }
.mc-ico svg { width: 2.3rem; height: 2.3rem; }
.mc-item b { display: block; font-size: .98rem; color: #fff0d0; }
.mc-item small { display: block; font-size: .74rem; color: var(--muted); line-height: 1.35; margin-top: .1rem; }
.mc-item .mc-pay { display: inline-block; margin-top: .3rem; font-size: .72rem; font-weight: 800; color: #ffd76a; }
.mc-item.done .mc-pay { color: #7fd59f; }
/* широкий экран: справа своя колонка, как «Сейчас играют» слева; уже — полоса над карточками игр */
#miniStrip { margin-bottom: 1.2rem; }
#miniStrip .mc-list { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
#miniCol { display: none; }
@media (min-width: 1700px) {
  .menu-wrap { width: min(128rem, 100%); }
  .menu-body { grid-template-columns: 17.5rem minmax(0, 1fr) 16rem; }
  #miniCol { display: grid; position: sticky; top: 1rem; }
  #miniStrip { display: none; }
}

/* ---------------- картинки мини-игр (sprites/mg-*.webp) ---------------- */
body.mini-wd #miniBg { background: url(/sprites/mg-wordle-bg.webp) center / cover no-repeat, #0b0807; }
body.mini-wd #miniBg::after { background: radial-gradient(ellipse at 50% 55%, rgba(8, 5, 4, .2), rgba(8, 5, 4, .8) 80%), linear-gradient(180deg, rgba(8, 5, 4, .65), transparent 30%, rgba(8, 5, 4, .6)); }
body.mini-tw #miniBg { background: url(/sprites/mg-tower-bg.webp) center 70% / cover no-repeat, #070f19; filter: blur(6px) brightness(.7); transform: scale(1.05); }
.wd-cell { background: url(/sprites/mg-wordle-tile.webp) center / 100% 100% no-repeat; border: 0; border-radius: 10px; color: #fff1d2; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
.wd-cell.filled { border: 0; filter: brightness(1.25) drop-shadow(0 0 6px rgba(255, 210, 130, .35)); }
.wd-cell.m0, .wd-cell.m1, .wd-cell.m2 { border: 3px solid #b98d43; box-shadow: inset 0 0 0 1px rgba(255, 230, 170, .35), 0 3px 8px rgba(0, 0, 0, .5); text-shadow: none; filter: none; }
.wd-cell.m0 { background: linear-gradient(180deg, #3a312a, #241e19); }
.wd-cell.m1 { background: linear-gradient(180deg, #e0b04a, #a97a1f); }
.wd-cell.m2 { background: linear-gradient(180deg, #45ad72, #22764a); }
.mc-ico.img { background: center / cover no-repeat; padding: 0; overflow: hidden; font-size: 1.6rem; }
.mc-ico.img svg { display: none; }

/* ---------------- рейтинг мини-игр ---------------- */
.mini-layout { display: grid; grid-template-columns: minmax(0, auto); justify-content: center; gap: 1.2rem; width: 100%; }
.mini-layout > .tw-wrap, .mini-layout > .wd-wrap { justify-self: center; }
@media (min-width: 1000px) { .mini-layout { grid-template-columns: minmax(0, 32rem) 17rem; align-items: start; } .mini-top-col { position: sticky; top: 4.5rem; } }
.mini-top-col { padding: 1rem .9rem; display: grid; gap: .5rem; align-content: start; width: min(32rem, 100%); justify-self: center; }
.mini-top-col h3 { margin: 0; font: 700 1.15rem var(--serif); color: #f3e3bd; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.mini-top-col h3 small { font: 500 .72rem var(--sans); color: var(--muted); }
.mt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.mt-list li { display: grid; grid-template-columns: 1.8rem 1fr auto; align-items: center; gap: .5rem; padding: .4rem .55rem; border-radius: 10px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .05); }
.mt-list .pl { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .78rem; color: #cdbb9c; background: rgba(255, 255, 255, .06); }
.mt-list .p1 .pl { background: linear-gradient(180deg, #ffe7a6, #c9932e); color: #1a1003; }
.mt-list .p2 .pl { background: linear-gradient(180deg, #e8e8ea, #9a9ca3); color: #17181b; }
.mt-list .p3 .pl { background: linear-gradient(180deg, #e7a46f, #9a5a2c); color: #1a0c03; }
.mt-list .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .88rem; color: #fff0d0; }
.mt-list .nm i { font-style: normal; font-size: .68rem; color: #1a1003; background: #e3c27a; padding: .05rem .35rem; border-radius: 6px; margin-left: .2rem; }
.mt-list .nm small { display: block; font-weight: 500; font-size: .7rem; color: var(--muted); }
.mt-list b { font: 800 1.05rem var(--sans); color: #ffe3a6; font-variant-numeric: tabular-nums; }
.mt-list li.me { border-color: rgba(227, 194, 122, .6); background: rgba(214, 177, 106, .1); }
.mt-list li.gap { display: block; text-align: center; background: none; border: 0; padding: 0; color: var(--muted); }
.mt-empty, .mt-foot { margin: 0; font-size: .8rem; color: var(--muted); text-align: center; }

/* ---------------- Трюм ---------------- */
body.mini-hd #miniBg { background: url(/sprites/mg-hold-bg.webp) center / cover no-repeat, #0b0807; }
body.mini-hd #miniBg::after { background: radial-gradient(ellipse at 50% 50%, rgba(8, 5, 4, .1), rgba(8, 5, 4, .7) 85%), linear-gradient(180deg, rgba(8, 5, 4, .55), transparent 30%, rgba(8, 5, 4, .5)); }
.mini-layout > .hd-wrap { justify-self: center; }
.hd-wrap { width: min(30rem, 100%); display: grid; gap: .7rem; }
.hd-stage { position: relative; padding: .9rem; display: grid; gap: .9rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.hd-board { --n: 8; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; padding: 6.2%; border-radius: 10px; aspect-ratio: 1;
  background: url(/sprites/mg-hold-board.webp) center / cover, linear-gradient(180deg, #2a1d14, #17100b); box-shadow: inset 0 0 0 2px rgba(214, 177, 106, .35), inset 0 6px 24px rgba(0, 0, 0, .6); }
.hd-cell { aspect-ratio: 1; border-radius: 5px; background: rgba(0, 0, 0, .38); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 230, 170, .05); transition: background .12s, box-shadow .12s, transform .12s, opacity .2s; }
.box { --col: #d6b16a; border-radius: 5px; background: url(/sprites/mg-crate.webp) center / cover, linear-gradient(160deg, color-mix(in srgb, var(--col) 100%, #fff 18%), color-mix(in srgb, var(--col) 100%, #000 30%));
  background-blend-mode: multiply, normal; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -3px 0 rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(0, 0, 0, .35), 0 2px 4px rgba(0, 0, 0, .4); }
.c1 { --col: #c9474f; } .c2 { --col: #e08b3d; } .c3 { --col: #e3c05d; } .c4 { --col: #3f9e8f; } .c5 { --col: #4f7fc4; } .c6 { --col: #9a5fb0; } .c7 { --col: #6fae4e; }
.hd-cell.pv { background: rgba(255, 230, 170, .35); box-shadow: inset 0 0 0 2px rgba(255, 230, 170, .7); }
.hd-cell.pv-line { box-shadow: inset 0 0 0 2px #ffe7a6, 0 0 10px rgba(255, 220, 140, .6); }
.hd-cell.box.pv-line { filter: brightness(1.25); }
.hd-cell.drop { animation: hdDrop .18s ease-out; }
@keyframes hdDrop { from { transform: scale(1.15); } }
.hd-cell.clear { animation: hdClear .38s ease-in forwards; }
@keyframes hdClear { 30% { filter: brightness(2.2); transform: scale(1.08); } to { filter: brightness(2.5); transform: scale(.2); opacity: 0; } }
.hd-tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; min-height: 6.5rem; }
.hd-slot { display: grid; place-items: center; min-height: 6.5rem; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px dashed rgba(214, 177, 106, .2); cursor: grab; touch-action: none; }
.hd-slot.lift .hd-piece { opacity: .25; }
.hd-slot.nofit .hd-piece { filter: grayscale(.9) brightness(.55); }
.hd-piece { --cell: clamp(.9rem, 4.2vw, 1.35rem); --gap: 2px; display: grid; grid-template-columns: repeat(var(--c), var(--cell)); grid-template-rows: repeat(var(--r), var(--cell)); gap: var(--gap); pointer-events: none; }
.hd-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .6)); }
.hd-ghost .hd-piece { --cell: var(--gcell); --gap: var(--ggap); }
.hd-tools { display: flex; justify-content: space-between; align-items: center; }
.hd-tools .btn.arm { border-color: #e0606a; color: #ffb3a8; }
.hd-sound { position: static; }
.tw-float.err { font-size: 1rem; color: #ffb3a8; }
/* телефон: поле и ящики должны помещаться на экране вместе */
@media (max-width: 640px) {
  body.mini-hd .mini-main { padding-top: .5rem; }
  body.mini-hd .mini-head { margin-bottom: .4rem; }
  body.mini-hd .mini-head .kicker, body.mini-hd .mini-head > p:not(.mini-note) { display: none; }
  body.mini-hd .mini-head h1 { font-size: 1.5rem; margin: 0; }
  body.mini-hd .hd-wrap { gap: .45rem; }
  body.mini-hd .tw-hud { padding: .35rem .7rem; }
  body.mini-hd .tw-score { font-size: 1.7rem; }
  body.mini-hd .tw-pips { padding: .35rem .6rem; }
  body.mini-hd .hd-stage { padding: .55rem; gap: .55rem; }
  body.mini-hd .hd-board { gap: 2px; }
  body.mini-hd .hd-slot { min-height: 5.2rem; }
  body.mini-hd .hd-tray { min-height: 5.2rem; }
  body.mini-hd .tw-hint { display: none; }
  body.mini-hd .acc-chip { display: none; }
}

.mt-list .nm .mt-fish { width: 2.6rem; height: 1.6rem; object-fit: contain; vertical-align: -.35rem; margin-right: .3rem; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
