:root {
  --bg1: #0f1218;
  --bg2: #0b0e13;
  --text: #e9eef5;
  --muted: #a3acb8;
  --accent: #2ecc71;
  --gold: #d4af37;
  --danger: #e74c3c;
}

* {
  user-select: none;
}

html,
body {
  height: 100%;
  margin: 0;
  background: #000;
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu,
    'Helvetica Neue', Arial;
  position: fixed;
  inset: 0;
  display: block;
  pointer-events: auto;
}

#c {
  pointer-events: auto;
}

#game-screen,
.dock-panel {
  user-select: none;
}

.controls .panel {
  pointer-events: auto;
}

button {
  border: 0;
  font-weight: 700;
  font-size: 22px;
  background-color: rgba(0, 0, 0, 0);
  color: #fff;
  cursor: pointer;
  padding: 0;
}

button:disabled {
  opacity: 0.55;
  filter: grayscale(0.35);
  cursor: not-allowed;
}

#rollBtn {
  width: 60px;
  height: 46px;
  background-image: url(src/images/diceIcon.png);
  background-size: cover;
  pointer-events: auto;
  transition: transform 0.1s ease-in-out;
}

#rollBtn:hover {
  transform: scale(1.1);
}

#rollBtn.hold {
  background-image: url('src/images/holdDiceIcon.png');
  background-size: 88% 100%;
  background-repeat: no-repeat;
  background-position: center;
}

#newGameBtn:hover {
  color: green;
}

input[type='number'] {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  width: 100%;
}

.flash {
  animation: flash 1.3s ease;
}

@keyframes flash {
  0% {
    filter: brightness(1);
  }
  30% {
    filter: brightness(1.7);
  }
  100% {
    filter: brightness(1);
  }
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  background: rgba(18, 22, 30, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 22px;
  min-width: 300px;
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: 0.2s ease;
}

.modal.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.modal h2 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: 0.4px;
  color: #cfd6e0;
}

.modal .sum {
  font-weight: 800;
}

.modal .actions {
  margin-top: 12px;
}

.handline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* gap: 48px; */
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  flex-direction: column;
}

.handline b {
  font-size: 15px;
}

.handline b.winner {
  color: var(--accent);
}

.handline b.loser {
  color: var(--danger);
}

.icons {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 27px;
  color: white;
}

.result {
  font-size: 22px;
  font-weight: 900;
  margin: 10px 0 6px;
}

.result.win {
  color: var(--accent);
}

.result.lose {
  color: var(--danger);
}

.camhint {
  position: fixed;
  left: 16px;
  bottom: 16px;
  color: var(--muted);
  background: rgba(18, 22, 30, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  border-radius: 10px;
}

.dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  pointer-events: none;
  z-index: 10;
  width: 100%;
  display: flex;
  justify-content: center;
}

.dock-panel {
  pointer-events: auto;
  display: flex;
  gap: 12px;
  width: auto;
  padding: 10px 12px;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.dock .actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-self: end;
}

#playerBet {
  display: flex;
  flex-direction: row;
}

.dock .actions button {
  padding: 10px 18px;
  font-weight: 700;
  border-radius: 12px;
}

.dock .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  min-width: 0;
  justify-content: center;
}

.dock .hint {
  position: absolute;
  bottom: 100%;
  align-self: center;
  justify-self: end;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: var(--muted);
}

.dock .chip input[type='number'] {
  margin-left: 6px;
}

.chip {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px 6px;
  border-radius: 10px;
  width: 25%;
  white-space: nowrap;
  height: 40px;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  min-width: 0;
  justify-content: center;
}

.settingsMenu {
  display: flex;
  justify-content: center;
  position: absolute;
  width: 100%;
  top: 1%;
  left: 0;
}

.settings > span {
  display: flex;
  justify-content: center;
  flex-direction: column;
  width: auto;
}
.settings > span p {
  margin: 0;
}
.chip strong {
  color: var(--text);
  font-weight: 800;
}

.dock .stats .volume {
  order: -10;
}

#muteBtn:focus-visible {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 6px rgba(46, 204, 113, 0.08);
  z-index: 40;
}

#volumeSlider {
  appearance: none;
  -webkit-appearance: none;
  writing-mode: bt-lr;
  transform: translateX(-150%) rotate(-90deg);
  transform-origin: center;
  width: 140px;
  height: 24px;
  margin: 0;
  background: transparent;
  outline: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.volume:hover #volumeSlider,
.volume:focus-within #volumeSlider {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-150%) rotate(-90deg) translateY(0);
  box-shadow: 0 8px 30px rgba(10, 12, 16, 0.45),
    inset 0 0 18px rgba(212, 175, 55, 0.06);
}

#volumeSlider:focus-visible {
  outline: none;
  box-shadow: 0 0 0 8px rgba(212, 175, 55, 0.12);
}

#volumeSlider::-webkit-slider-runnable-track {
  height: 8px;
  background: linear-gradient(
    90deg,
    rgba(212, 175, 55, 0.95),
    rgba(46, 204, 113, 0.95)
  );
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(212, 175, 55, 0.95);
  margin-top: -4px;
}

#volumeSlider::-moz-range-track {
  height: 8px;
  background: linear-gradient(
    90deg,
    rgba(212, 175, 55, 0.95),
    rgba(46, 204, 113, 0.95)
  );
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#volumeSlider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(212, 175, 55, 0.95);
}

@media (max-width: 980px) {
  .dock-panel {
    gap: 10px;
  }
  .dock .hint {
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
}

@media (max-width: 720px) {
  .dock-panel {
    flex-direction: column-reverse;
  }
  .dock .actions button {
    width: 100%;
  }
  .dock {
    width: 100%;
  }
  .dock .hint {
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }
  .dock .stats .volume {
    order: -10;
  }
}
