/* Premium betting HUD. This file intentionally scopes every rule to gameplay. */

.device.is-playing .bet-dock {
  --bet-pad: clamp(14px, 1.2vw, 24px);
  --bet-section-gap: clamp(8px, 0.8vw, 14px);
  --bet-card-gap: clamp(7px, 0.7vw, 12px);
  overflow: hidden;
  border: 1px solid rgba(218, 170, 70, 0.45);
  border-radius: 14px;
  background: rgba(18, 10, 5, 0.82);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 220, 140, 0.08);
  backdrop-filter: blur(8px);
  isolation: isolate;
}

.device.is-playing .bet-dock > .panel-frame-img {
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  object-fit: fill;
  opacity: 0.5;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.25));
}

.device.is-playing .bet-inner {
  height: calc(100% - 20px);
  margin: 10px;
  padding: var(--bet-pad);
  gap: var(--bet-section-gap);
  overflow: hidden;
  border: 1px solid rgba(233, 190, 91, 0.16);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(63, 39, 20, 0.18), rgba(18, 10, 5, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 226, 158, 0.05);
  backdrop-filter: none;
}

.device.is-playing .bet-title,
.device.is-playing .amount-title {
  flex: 0 0 auto;
  letter-spacing: 0;
}

.device.is-playing .timer-bar {
  flex: 0 0 2px;
  background: rgba(214, 164, 56, 0.2);
}

.device.is-playing .faces-row {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 270px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--bet-card-gap);
}

.device.is-playing .face-bet {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  gap: 2px;
  padding: clamp(5px, 0.7vh, 8px) 4px;
  overflow: hidden;
  border: 1px solid rgba(190, 137, 45, 0.68);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.97), rgba(235, 224, 203, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 5px 12px rgba(0, 0, 0, 0.22);
}

.device.is-playing .face-bet .tile-bg {
  display: none;
}

.device.is-playing .face-bet .face-die {
  flex: 0 1 auto;
  width: clamp(34px, 5vh, 50px);
  height: clamp(34px, 5vh, 50px);
  object-fit: contain;
  object-position: center;
}

.device.is-playing .face-meta {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 1;
}

.device.is-playing .face-meta b {
  font-family: var(--font-display);
  font-size: 1.45em;
}

.device.is-playing .face-meta i {
  margin-top: 2px;
  color: #8b571d;
  font-size: 0.8em;
}

.device.is-playing .face-bet.is-selected {
  border-color: #f2c34f;
  box-shadow:
    inset 0 0 0 1px rgba(255, 231, 155, 0.85),
    0 0 14px rgba(242, 187, 57, 0.48),
    0 6px 14px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

.device.is-playing .amounts {
  flex: 0 0 auto;
  gap: clamp(5px, 0.55vw, 8px) clamp(8px, 0.8vw, 12px);
}

.device.is-playing .amounts button {
  width: 100%;
  min-height: clamp(34px, 4.8vh, 46px);
  border-radius: 50%;
  color: #ffe29a;
  filter: none;
}

.device.is-playing .amounts button .chip-bg {
  inset: 50% auto auto 50%;
  width: min(100%, 48px);
  height: min(100%, 48px);
  transform: translate(-50%, -50%);
}

.device.is-playing .amounts button.is-on {
  color: #2a1608;
  filter: drop-shadow(0 0 8px rgba(240, 190, 62, 0.46));
}

.device.is-playing .bet-total {
  flex: 0 0 auto;
  width: 100%;
  min-height: 30px;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 5px clamp(8px, 0.8vw, 12px);
  border-top: 1px solid rgba(226, 177, 65, 0.18);
  border-bottom: 1px solid rgba(226, 177, 65, 0.12);
  color: #f2d58a;
}

.device.is-playing .bet-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffe6a1;
}

.device.is-playing .bet-value img {
  width: 17px;
  height: 17px;
}

.device.is-playing .actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(5px, 0.65vh, 8px);
}

.device.is-playing .btn-place,
.device.is-playing .btn-clear {
  width: 92%;
  min-height: clamp(42px, 5.4vh, 52px);
  border-radius: 8px;
}

.device.is-playing .btn-place {
  background: linear-gradient(180deg, #f8d979, #ca9229);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.device.is-playing .btn-clear {
  border: 1px solid rgba(220, 169, 60, 0.62);
  background: rgba(17, 10, 6, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 224, 149, 0.05);
}

.device.is-playing .action-frame {
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  object-fit: contain;
  object-position: center;
}

.device.is-playing .btn-place .action-frame {
  opacity: 0.72;
}

.device.is-playing .btn-clear .action-frame {
  opacity: 0.58;
}

@media (min-width: 933px) and (max-height: 850px) {
  .device.is-playing .bet-dock {
    --bet-pad: clamp(12px, 1vw, 17px);
    --bet-section-gap: clamp(5px, 0.65vh, 8px);
    --bet-card-gap: clamp(6px, 0.65vw, 9px);
  }

  .device.is-playing .bet-inner {
    height: calc(100% - 16px);
    margin: 8px;
  }

  .device.is-playing .faces-row {
    max-height: 220px;
  }

  .device.is-playing .amounts button {
    min-height: 34px;
  }

  .device.is-playing .btn-place,
  .device.is-playing .btn-clear {
    min-height: 42px;
  }
}

@media (max-width: 932px) and (orientation: landscape) {
  .device.is-playing .bet-dock {
    --bet-pad: clamp(5px, 1.8vh, 8px);
    --bet-section-gap: clamp(2px, 0.8vh, 4px);
    --bet-card-gap: 3px;
    border-radius: 8px;
  }

  .device.is-playing .bet-dock > .panel-frame-img {
    inset: 1px;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    opacity: 0.38;
  }

  .device.is-playing .bet-inner {
    height: calc(100% - 8px);
    margin: 4px;
    padding: var(--bet-pad);
    gap: var(--bet-section-gap);
    border-radius: 6px;
  }

  .device.is-playing .bet-title,
  .device.is-playing .amount-title {
    font-size: clamp(0.56rem, 2.4vh, 0.66rem);
  }

  .device.is-playing .faces-row {
    flex: 0 0 clamp(78px, 22vh, 96px);
    max-height: none;
    gap: var(--bet-card-gap);
  }

  .device.is-playing .face-bet {
    min-height: 0;
    padding: 1px 2px;
    border-radius: 4px;
  }

  .device.is-playing .face-bet .face-die {
    width: clamp(21px, 6.4vh, 25px);
    height: clamp(21px, 6.4vh, 25px);
  }

  .device.is-playing .face-meta {
    font-size: clamp(0.46rem, 2vh, 0.56rem);
  }

  .device.is-playing .amounts {
    gap: 2px 4px;
  }

  .device.is-playing .amounts button {
    min-height: clamp(24px, 7vh, 30px);
    font-size: clamp(0.56rem, 2.4vh, 0.66rem);
  }

  .device.is-playing .amounts button .chip-bg {
    width: min(100%, 30px);
    height: min(100%, 30px);
  }

  .device.is-playing .bet-total {
    min-height: 20px;
    padding: 2px 5px;
    font-size: clamp(0.5rem, 2.2vh, 0.6rem);
  }

  .device.is-playing .bet-value {
    gap: 3px;
  }

  .device.is-playing .bet-value img {
    width: 12px;
    height: 12px;
  }

  .device.is-playing .actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .device.is-playing .btn-place,
  .device.is-playing .btn-clear {
    width: 94%;
    min-height: clamp(24px, 6.8vh, 29px);
  }

  .device.is-playing .action-text b {
    font-size: clamp(0.62rem, 2.8vh, 0.75rem);
  }

  .device.is-playing .action-text small {
    display: none;
  }
}
