/* /css/games.css
   Стилі для сторінок /functional/games/* і блока /blocks/games.php
*/

.vm-card{
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  box-shadow:0 6px 18px rgba(0,0,0,.04);
}

.vm-divider{
  height:1px;
  background:rgba(0,0,0,.08);
}

/* =========================
   Roulette: mobile-first UI
========================= */

.rw-page{ min-width:0; }

/* ✅ Balance under nav buttons */
.rw-balance-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  background:rgba(255,255,255,.92);
}

.rw-balance-left{ min-width:0; }
.rw-balance-label{ font-size:12px; color:rgba(0,0,0,.55); margin-bottom:2px; }

.rw-balance-value-sm{
  font-size:18px;           /* ✅ в 2 рази менше */
  font-weight:900;
  line-height:1.05;
}
.rw-balance-unit{
  font-size:12px;
  color:rgba(0,0,0,.55);
  font-weight:700;
  margin-left:6px;
}

.rw-balance-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.rw-topup-hint{
  font-size:12px;
  color:rgba(0,0,0,.55);
  white-space:nowrap;
}

/* ✅ Compact bet settings card */
.rw-bet-card{
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  background:#fff;
  padding:12px;
}

.rw-bet-head{
  font-weight:800;
  margin-bottom:8px;
}

.rw-bet-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
}

@media (min-width: 768px){
  .rw-bet-grid{
    grid-template-columns: 1fr 1fr;
    gap:12px;
  }
  .rw-bet-amount{ grid-column: 1 / -1; }
}

.rw-bet-type{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
}

/* ✅ Buttons under wheel */
.rw-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.rw-btn-spin{
  flex:1 1 220px;
}

.rw-msg.ok .alert{ border-radius:12px; }
.rw-msg.bad .alert{ border-radius:12px; }
.rw-msg.warn .alert{ border-radius:12px; }

/* ✅ History card */
.rw-history-card{
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  background:#fff;
  padding:12px;
}

/* =========================
   Wheel
========================= */

.rw-wheel-area{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  --rw-size: 420px;
  padding-top:10px;
  padding-bottom:10px;
}

/* ✅ Make wheel smaller on phones */
.rw-wheel-shell{
  width:min(420px, 100%);
  max-width:420px;
  aspect-ratio:1/1;
  border-radius:50%;
  padding:10px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), rgba(255,255,255,0) 42%),
    radial-gradient(circle at 70% 70%, rgba(0,0,0,.24), rgba(0,0,0,0) 52%),
    conic-gradient(from 0deg,
      #fff2b8,
      #caa84a,
      #ffe89b,
      #a77f28,
      #fff2b8);
  box-shadow:
    0 18px 48px rgba(0,0,0,.20),
    inset 0 0 0 2px rgba(255,255,255,.24),
    inset 0 0 0 7px rgba(0,0,0,.10);
  display:flex;
  align-items:center;
  justify-content:center;
}

@media (min-width: 576px){
  .rw-wheel-shell{ max-width: 480px; }
}
@media (min-width: 768px){
  .rw-wheel-shell{ max-width: 560px; padding:11px; }
}
@media (min-width: 992px){
  .rw-wheel-shell{ max-width: 680px; padding:12px; }
}
@media (min-width: 1400px){
  .rw-wheel-shell{ max-width: 720px; }
}

/* Wheel */
.rw-wheel{
  width:100%;
  height:100%;
  border-radius:50%;
  border: clamp(8px, calc(var(--rw-size) / 60), 12px) solid #0f1012;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.08),
    inset 0 0 0 16px rgba(0,0,0,.10),
    0 10px 22px rgba(0,0,0,.18);
  transform: rotate(0deg);
  position:relative;
  overflow:hidden;
  --rw-rot: 0deg;
  will-change: transform;
  backface-visibility: hidden;
}

/* separators + vignette */
.rw-wheel::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  pointer-events:none;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(255,255,255,.20) 0 .8deg,
      transparent .8deg var(--rw-seg, 12deg)
    ),
    radial-gradient(circle at 50% 50%,
      rgba(255,255,255,.00) 0 58%,
      rgba(0,0,0,.18) 75%,
      rgba(0,0,0,.40) 100%);
  opacity:.78;
  mix-blend-mode: overlay;
}

/* inner ring */
.rw-wheel::after{
  content:"";
  position:absolute;
  inset: clamp(18px, calc(var(--rw-size) / 28), 26px);
  border-radius:50%;
  border:2px solid rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 10px rgba(0,0,0,.08);
  pointer-events:none;
}

/* ✅ Inner pointer */
.rw-inner-pointer{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  width:0;
  height:0;
  z-index:10;
  pointer-events:none;
}

.rw-inner-pointer::before{
  content:"";
  position:absolute;
  left:50%;
  top: calc(-1 * clamp(78px, calc(var(--rw-size) / 4.8), 112px));
  transform: translateX(-50%);
  width:5px;
  height: clamp(56px, calc(var(--rw-size) / 6.3), 78px);
  border-radius:6px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,.05)),
    linear-gradient(180deg, #f7e7a1, #caa84a);
  box-shadow: 0 8px 14px rgba(0,0,0,.25);
}

.rw-inner-pointer::after{
  content:"";
  position:absolute;
  left:50%;
  top: calc(-1 * clamp(104px, calc(var(--rw-size) / 3.65), 138px));
  transform: translateX(-50%);
  width:0;
  height:0;
  border-left:14px solid transparent;
  border-right:14px solid transparent;
  border-bottom:24px solid #ffcc33;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.28));
}

/* center cap */
.rw-center{
  position:absolute;
  width: clamp(72px, calc(var(--rw-size) / 7.2), 98px);
  height: clamp(72px, calc(var(--rw-size) / 7.2), 98px);
  border-radius:50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(255,255,255,.0) 44%),
    radial-gradient(circle at 70% 70%, rgba(0,0,0,.18), rgba(0,0,0,0) 58%),
    #f5f6f7;
  border: clamp(4px, calc(var(--rw-size) / 120), 6px) solid #0f1012;
  box-shadow: inset 0 0 0 6px rgba(0,0,0,.06), 0 8px 18px rgba(0,0,0,.18);
  z-index:11;
}

/* Numbers ring */
.rw-ring{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
  z-index:6;
}

/* Recessed pockets */
.rw-pocket{
  position:absolute;
  top:50%;
  left:50%;
  width: clamp(28px, calc(var(--rw-size) / 14), 48px);
  height: clamp(22px, calc(var(--rw-size) / 18), 34px);
  margin-left: calc(-1 * clamp(14px, calc(var(--rw-size) / 28), 24px));
  margin-top:  calc(-1 * clamp(11px, calc(var(--rw-size) / 36), 17px));
  border-radius: clamp(8px, calc(var(--rw-size) / 70), 12px);
  border:1px solid rgba(255,255,255,.18);
  box-shadow:
    inset 0 3px 10px rgba(0,0,0,.45),
    inset 0 -2px 6px rgba(255,255,255,.08),
    0 6px 16px rgba(0,0,0,.18);
  display:flex;
  align-items:center;
  justify-content:center;
}

.rw-pocket.red{ background: linear-gradient(180deg, #e45757, #b83434); }
.rw-pocket.black{ background: linear-gradient(180deg, #1f2226, #0f1113); }
.rw-pocket.green{ background: linear-gradient(180deg, #2ac476, #148a4f); }

/* ✅ Gold 3D numbers + counter-rotation */
.rw-pocket-txt{
  display:inline-block;
  font-size: clamp(10px, calc(var(--rw-size) / 55), 14px);
  font-weight:900;
  letter-spacing:.2px;
  line-height:1;
  color:#f7d36b;
  -webkit-text-stroke: .6px rgba(80,55,0,.55);
  text-shadow:
    0 1px 0 rgba(255,244,200,.85),
    0 2px 0 rgba(190,140,20,.85),
    0 3px 0 rgba(140,95,0,.85),
    0 6px 10px rgba(0,0,0,.45);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
  transform: rotate(calc(-1 * var(--rw-rot)));
  transition: transform 4.2s cubic-bezier(.12,.75,.12,1);
  will-change: transform;
  backface-visibility: hidden;
}

/* =========================
   Result modal on wheel
========================= */

.rw-result-modal{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:25;
  background: rgba(0,0,0,.10);
  backdrop-filter: blur(2px);
  opacity:0;
  transform: scale(.98);
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
}

.rw-result-modal.show{
  opacity:1;
  transform: scale(1);
  pointer-events:auto;
}

.rw-result-box{
  width: min(300px, 86%);
  border-radius:16px;
  border:1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
  padding:12px 12px 10px;
  text-align:center;
}

.rw-result-title{
  font-weight:900;
  margin-bottom:10px;
}

.rw-result-body{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  padding-bottom:10px;
}

.rw-result-number .rw-badge{
  width:56px;
  height:44px;
  border-radius:14px;
  font-size:18px;
}

.rw-result-text{
  font-weight:700;
}

.rw-result-text .pos{ color:#1b8a4a; }
.rw-result-text .neg{ color:#c53939; }

.rw-result-close{
  border-radius:12px;
  font-weight:800;
}

/* History list */
.rw-history{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:260px;
  overflow:auto;
  padding-right:4px;
}

.rw-his-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:12px;
  background:#fff;
}

.rw-his-left{
  display:flex;
  align-items:center;
  gap:10px;
}

.rw-his-right{
  font-weight:900;
}
.rw-his-right.pos{ color:#1b8a4a; }
.rw-his-right.neg{ color:#c53939; }

.rw-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:30px;
  border-radius:10px;
  font-weight:900;
  color:#fff;
  letter-spacing:.3px;
}
.rw-badge.red{ background:#d94747; }
.rw-badge.black{ background:#141618; }
.rw-badge.green{ background:#1ea85f; }