/* ===== Страница игры DICE ===== */

.top--game .bell { display: none; }
.top--game .pill.balance { font-size: 15px; }
@media (min-width: 640px) { .app--game { max-width: 760px; } }
.top--game .back { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; }

.game {
  position: relative;
  border-radius: var(--radius);
  background: radial-gradient(circle at 50% 18%, #1b2c50 0%, #121d36 48%, #0e1729 100%);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.85);
  padding: 12px 12px 12px;
}
@media (min-width: 640px) { .game { padding: 22px 24px 20px; } }

.result-row { position: relative; display: flex; align-items: center; justify-content: center; margin: 2px 0 8px; }
.result-row .result { margin: 0; padding: 0 40px; }
.sound {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%); z-index: 5;
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(21,33,58,.8); border: 1px solid var(--border); color: var(--muted);
}
.sound svg { width: 16px; height: 16px; }
.sound .ico-off { display: none; }
.sound.muted .ico-on { display: none; }
.sound.muted .ico-off { display: block; }

/* ---- Сцена и барабан ---- */
.stage {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 0 2px;
}
.drum {
  --cell-w: 62px; --cell-h: 92px; --digit: 40px;
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 14px 26px rgba(0,0,0,.85)) drop-shadow(0 0 22px rgba(63,124,255,.25));
  transition: filter .35s ease;
}
@media (min-width: 640px) { .drum { --cell-w: 82px; --cell-h: 136px; --digit: 54px; } }
.drum.is-spinning { filter: drop-shadow(0 14px 26px rgba(0,0,0,.85)) drop-shadow(0 0 40px rgba(94,147,255,.6)); }
.drum.status-win { filter: drop-shadow(0 14px 26px rgba(0,0,0,.85)) drop-shadow(0 0 42px rgba(47,224,138,.65)); }
.drum.status-lose { filter: drop-shadow(0 14px 26px rgba(0,0,0,.85)) drop-shadow(0 0 36px rgba(255,90,110,.5)); }

.cap {
  width: 28px; height: calc(var(--cell-h) + 18px);
  background: linear-gradient(180deg, #0e1525 0%, #243556 26%, #1b2842 50%, #243556 74%, #0e1525 100%);
  border: 1px solid rgba(110,175,255,.5);
  display: flex; flex-direction: column; justify-content: space-evenly;
  padding: 8px 4px; position: relative;
  box-shadow: inset 0 0 14px rgba(63,124,255,.45), 0 0 16px rgba(63,124,255,.35);
}
@media (min-width: 640px) { .cap { width: 38px; padding: 10px 5px; } }
.cap-l { border-radius: 16px 6px 6px 16px; margin-right: -2px; }
.cap-r { border-radius: 6px 16px 16px 6px; margin-left: -2px; }
.cap i {
  display: block; height: 14px; border-radius: 4px;
  background: linear-gradient(180deg, #162238 0%, #0d1424 100%);
  border: 1px solid rgba(114,186,255,.7);
  box-shadow: 0 0 10px rgba(94,147,255,.8), inset 0 0 6px rgba(94,147,255,.45);
}
@media (min-width: 640px) { .cap i { height: 18px; } }

.drum-body {
  position: relative; display: flex; align-items: center;
  height: var(--cell-h);
  background: linear-gradient(180deg, #0a0f1c 0%, #1b253b 22%, #253350 50%, #1b253b 78%, #0a0f1c 100%);
  border-top: 1px solid rgba(135,190,255,.28);
  border-bottom: 1px solid rgba(135,190,255,.28);
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(0,0,0,.78);
}
.reel { position: relative; width: var(--cell-w); height: var(--cell-h); overflow: hidden; border-right: 1px solid rgba(255,255,255,.06); }
.reel:last-of-type { border-right: none; }
.strip { will-change: transform; }
.cell {
  width: var(--cell-w); height: var(--cell-h);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--digit); font-weight: 800; color: #fff; letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(255,255,255,.28), 0 0 22px rgba(94,147,255,.35);
}
.comma {
  position: absolute; left: 50%; top: 54%; transform: translate(-50%, -10%);
  font-size: calc(var(--digit) * .85); font-weight: 900; color: #fff; line-height: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,.7), 0 0 16px rgba(94,147,255,.45);
  pointer-events: none; z-index: 3;
}
.shading {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(180deg, rgba(7,11,20,.92) 0%, rgba(15,22,38,.25) 26%, rgba(255,255,255,.04) 50%, rgba(15,22,38,.25) 74%, rgba(7,11,20,.92) 100%);
}
.floor {
  position: relative; width: 70%; max-width: 340px; height: 22px; margin-top: -4px;
  display: flex; justify-content: space-around; align-items: center; pointer-events: none; z-index: 1;
}
.floor::before {
  content: ''; position: absolute; inset: -6px -30px;
  background: radial-gradient(ellipse at center, rgba(63,124,255,.34) 0%, rgba(63,124,255,.08) 52%, transparent 75%);
  filter: blur(8px);
}
.beam { width: 56px; height: 20px; background: linear-gradient(180deg, rgba(94,147,255,.55) 0%, rgba(63,124,255,0) 100%); filter: blur(6px); }
.beam-l { transform: perspective(100px) rotateX(45deg) skewX(-18deg); }
.beam-r { transform: perspective(100px) rotateX(45deg) skewX(18deg); }

/* ---- Строка результата ---- */
.result {
  text-align: center; font-size: 12px; font-weight: 600; color: var(--muted);
  min-height: 18px; margin: 2px 0 8px; transition: color .2s;
}
.result.win { color: var(--green); }
.result.lose { color: var(--red); }

/* ---- Панель управления ---- */
.ctrl {
  display: grid; gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "pct bet"
    "slider slider"
    "toggle toggle"
    "quick quick"
    "coef win"
    "spin spin";
}
@media (min-width: 640px) {
  .ctrl {
    gap: 12px 16px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas:
      "pct slider coef"
      "bet toggle win"
      ". quick ."
      "spin spin spin";
  }
}
.a-pct { grid-area: pct; } .a-bet { grid-area: bet; } .a-slider { grid-area: slider; }
.a-toggle { grid-area: toggle; } .a-quick { grid-area: quick; } .a-coef { grid-area: coef; }
.a-win { grid-area: win; } .a-spin { grid-area: spin; }

.field {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 0; min-height: 46px; padding: 0 12px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 12px;
  cursor: text; transition: border-color .2s, box-shadow .2s;
}
@media (min-width: 640px) { .field { min-height: 56px; padding: 0 18px; } }
.field:focus-within { border-color: rgba(63,124,255,.55); box-shadow: 0 0 0 3px rgba(63,124,255,.14); }
.f-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.f-input {
  flex: 1 1 0; width: 0; min-width: 0; background: transparent; border: 0; outline: 0;
  font: inherit; font-size: 15px; font-weight: 800; color: var(--text); text-align: right;
  appearance: textfield; -moz-appearance: textfield;
}
.f-input::-webkit-outer-spin-button, .f-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.f-input:disabled { color: var(--muted); }
.f-group { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex: 1 1 0; min-width: 0; }
.f-value { font-size: 15px; font-weight: 800; }
.coin-sm { width: 16px; height: 16px; flex: 0 0 auto; }

.a-slider { display: flex; align-items: center; padding: 2px 4px; }
.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 7px; border-radius: 999px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue) var(--p, 50%), #eef2ff var(--p, 50%), #eef2ff 100%);
}
.range.mode-more { background: linear-gradient(90deg, #eef2ff 0%, #eef2ff var(--p, 50%), var(--blue) var(--p, 50%), var(--blue) 100%); }
.range:disabled { opacity: .65; cursor: not-allowed; }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue-2); border: 2px solid #9dbcff; box-shadow: 0 0 12px rgba(63,124,255,.9); cursor: pointer;
}
.range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--blue-2); border: 2px solid #9dbcff; box-shadow: 0 0 12px rgba(63,124,255,.9); cursor: pointer; }

.toggle {
  display: grid; grid-template-columns: 1fr 1fr; height: 40px; padding: 3px;
  background: #121b2f; border: 1px solid var(--border); border-radius: 999px;
}
.toggle button {
  border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  transition: background .2s, color .2s;
}
.toggle button.is-active { background: var(--card-3); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.toggle button:disabled { opacity: .7; cursor: not-allowed; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button {
  height: 40px; border-radius: 10px; background: var(--card-3); border: 1px solid var(--border);
  color: #aab6d3; font-size: 13px; font-weight: 700; transition: background .15s, color .15s, transform .1s;
}
.quick button:hover:not(:disabled) { background: #2a3f6b; color: #fff; }
.quick button:active:not(:disabled) { transform: translateY(1px); }
.quick button:disabled { opacity: .6; cursor: not-allowed; }

.a-spin { width: 100%; margin-top: 2px; }
@media (min-width: 640px) { .a-spin { width: auto; min-width: 220px; justify-self: center; margin-top: 6px; } }
.a-spin:disabled { opacity: .75; cursor: not-allowed; }

/* ---- Тестовая панель (только с ?debug=1) ---- */
.debug {
  margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: rgba(21,33,58,.7); border: 1px dashed rgba(140,170,230,.3);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12px; color: var(--muted);
}
.debug[hidden] { display: none; }
.debug input {
  width: 110px; height: 32px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; outline: none;
}
.debug input:focus { border-color: var(--blue); }
