.dice-body {
  background: #0d202b;
}

.dice-stage {
  display: grid;
  gap: 0.9rem;
}

.dice-panel {
  position: relative;
  min-height: 24rem;
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  background:
    radial-gradient(circle at 72% 18%, rgba(221, 69, 69, 0.18), transparent 28rem),
    #0b1c28;
  border: 0;
  box-shadow: none;
}

.dice-stake-row {
  margin-top: 0.8rem;
}

.dice-profit-row {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.dice-body .bet-action {
  background: #1f7ae0;
  color: #fff;
}

.dice-result {
  display: grid;
  place-items: center;
  width: min(10rem, 28vw);
  aspect-ratio: 1;
  border-radius: 0.7rem;
  background: #dd4545;
  color: #fff;
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 950;
  box-shadow: 0 20px 48px rgba(221, 69, 69, 0.28);
}

.dice-result.win {
  background: #18d777;
  color: #06150f;
  box-shadow: 0 20px 48px rgba(24, 215, 119, 0.22);
}

.dice-result.loss {
  background: #dd4545;
}

.dice-result.is-empty {
  background: #243f4d;
  color: transparent;
  box-shadow: none;
}

.dice-roll-display {
  display: grid;
  gap: 2.2rem;
  width: 100%;
  align-self: center;
}

.dice-result-label {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.dice-result-label strong {
  font-size: clamp(2.1rem, 8vw, 5rem);
  line-height: 0.95;
  font-weight: 950;
}

.dice-track {
  position: relative;
  height: 6.25rem;
  padding-top: 1.9rem;
}

.dice-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 2.05rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #243f4d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.loss-range,
.target-range {
  position: absolute;
  top: 2.05rem;
  height: 1.35rem;
  border-radius: 999px;
}

.loss-range {
  background: #ff2854;
}

.target-range {
  background: #18d777;
  box-shadow: 0 0 18px rgba(24, 215, 119, 0.28);
}

.target-handle {
  position: absolute;
  top: 1.32rem;
  left: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.85rem;
  border-radius: 0.35rem;
  background: #438de2;
  color: #2d6db7;
  font-size: 0.85rem;
  font-weight: 950;
  transform: translateX(-50%);
  box-shadow: 0 8px 16px rgba(67, 141, 226, 0.28);
}

.target-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.55rem;
  width: 0.82rem;
  height: 0.82rem;
  background: #3d5667;
  transform: translateX(-50%) rotate(45deg);
}

.roll-marker {
  position: absolute;
  top: 0.62rem;
  left: 50%;
  z-index: 2;
  width: 1.15rem;
  height: 4rem;
  border-radius: 999px;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.55);
  transition: left 0.75s cubic-bezier(0.12, 0.76, 0.2, 1);
}

.roll-marker.instant,
.roll-marker.no-animation {
  transition: none;
}

.roll-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.55rem;
  width: 0.75rem;
  height: 0.75rem;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
}

.track-slider {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 4.5rem;
  opacity: 0;
  cursor: ew-resize;
}

.track-ticks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  color: #b6c6d1;
  font-size: 0.8rem;
  font-weight: 800;
}

.dice-bottom-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0.9rem;
  border-radius: 0.45rem;
  background: #203946;
}

.dice-bottom-controls label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  color: #9fd7f3;
  font-size: 0.88rem;
  font-weight: 850;
}

.dice-bottom-controls input,
.dice-inline-input {
  min-width: 0;
  min-height: 2.55rem;
  border-radius: 0.4rem;
  border: 1px solid #3d5b6e;
  background: #0b1c28;
  color: #fff;
  font-weight: 900;
}

.dice-bottom-controls input {
  width: 100%;
}

.dice-inline-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.dice-inline-input input {
  min-height: 2.4rem;
  border: 0;
  background: transparent;
}

.dice-inline-input .icon-button,
.dice-inline-input span {
  margin-right: 0.35rem;
  color: #c4d8e5;
}

.basic-auto-rules {
  display: grid;
  gap: 0.8rem;
}

.basic-auto-rules[hidden] {
  display: none;
}

.strategy-builder {
  display: grid;
  gap: 0.45rem;
  padding: 0.55rem;
  border-radius: 0.45rem;
  background: #162d3a;
}

.strategy-builder[hidden] {
  display: none;
}

.strategy-play-view,
.strategy-edit-view,
.strategy-manager {
  display: grid;
  gap: 0.45rem;
}

.strategy-play-view[hidden],
.strategy-edit-view[hidden] {
  display: none;
}

.strategy-play-view label,
.strategy-manager label {
  display: grid;
  gap: 0.25rem;
  color: #9fd7f3;
  font-size: 0.78rem;
  font-weight: 900;
}

.strategy-play-view select,
.strategy-manager select,
.strategy-manager input {
  width: 100%;
  min-height: 2.25rem;
  border-radius: 0.35rem;
  border: 1px solid #3d5b6e;
  background: #0b1c28;
  color: #fff;
  font-weight: 800;
}

.strategy-condition-summary {
  display: grid;
  gap: 0.4rem;
  color: #9fd7f3;
  font-size: 0.78rem;
  font-weight: 900;
}

.strategy-condition-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.strategy-chip {
  min-width: 2.35rem;
  min-height: 2.15rem;
  border: 0;
  border-radius: 0.35rem;
  background: #496a7c;
  color: #fff;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.strategy-chip.matched {
  background: #18d777;
  color: #06150f;
  box-shadow: 0 0 0 2px rgba(24, 215, 119, 0.25);
}

.strategy-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.strategy-edit-view .strategy-buttons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.strategy-buttons .button,
.add-condition-button {
  min-height: 2.2rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.35rem;
  font-size: 0.78rem;
}

.strategy-rows {
  display: grid;
  gap: 0.55rem;
}

.strategy-builder-head,
.strategy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.2rem 4.8rem 1.9rem;
  gap: 0.35rem;
  align-items: center;
}

.strategy-builder-head {
  padding: 0 0.15rem;
  color: #9fd7f3;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.strategy-row {
  grid-template-areas:
    "condition action value remove"
    "threshold action value remove";
}

.strategy-condition {
  grid-area: condition;
}

.strategy-threshold {
  grid-area: threshold;
}

.strategy-action {
  grid-area: action;
}

.strategy-value {
  grid-area: value;
}

.remove-strategy-row {
  grid-area: remove;
  min-width: 1.9rem;
  padding: 0;
  font-size: 1rem;
}

.strategy-row select,
.strategy-row input {
  width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  border-radius: 0.35rem;
  border: 1px solid #3d5b6e;
  background: #0b1c28;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
}

.strategy-threshold.is-hidden {
  visibility: hidden;
}

.strategy-value.is-hidden {
  visibility: hidden;
}

.dice-game-layout.stats-open {
  grid-template-columns: 18rem 18rem minmax(0, 1fr);
}

@media (max-width: 980px) {
  .dice-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: auto;
  }

  .dice-result {
    width: min(9rem, 52vw);
  }

  .dice-bottom-controls {
    grid-template-columns: 1fr;
  }
}
