/* Estilos para Ruleta de sorteos, números al azar, dados y moneda */
.rs-panel {
  margin-top: 18px;
}

/* --- Pestaña 1: Ruleta --- */
.rs-wheel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

@media (max-width: 720px) {
  .rs-wheel-layout {
    grid-template-columns: 1fr;
  }
}

.rs-wheel-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.rs-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

.rs-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: manipulation;
}

.rs-spin-btn {
  width: 100%;
  max-width: 280px;
  font-size: 1.08rem;
  padding: 12px 22px;
}

.rs-winner-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--primary-50);
  border: 2px solid var(--primary);
  text-align: center;
  animation: rsPop .25s ease-out;
}

.rs-winner-name {
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  font-weight: 800;
  color: var(--primary);
  margin: 4px 0 10px;
  word-break: break-word;
}

.rs-items-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--muted);
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Pestaña 2: Número al azar --- */
.rs-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.rs-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
}

.rs-error {
  color: var(--bad);
  font-weight: 600;
  font-size: .95rem;
}

.rs-history {
  margin-top: 16px;
  display: grid;
  gap: 6px;
}

.rs-hist-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
}

.rs-hist-vals {
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  text-align: right;
}

/* --- Pestaña 3: Dados --- */
.rs-dice-count {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rs-dice-count .btn {
  min-width: 44px;
  padding: 8px 12px;
}

.rs-dice-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding: 22px 12px;
  margin-top: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 124px;
  align-items: center;
}

.rs-die {
  width: 74px;
  height: 74px;
  padding: 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
}

.rs-die.rolling {
  animation: rsShake .36s ease-in-out;
}

.rs-pip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
}

.rs-pip.on {
  background: var(--text);
}

.rs-pip.center-one {
  width: 15px;
  height: 15px;
  background: var(--accent);
}

/* --- Pestaña 4: Cara o cruz --- */
.rs-coin-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 10px 8px;
  perspective: 700px;
}

.rs-coin {
  width: 144px;
  height: 144px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  border: 6px solid #d97706;
  background: radial-gradient(circle at 32% 30%, #fef3c7, #f59e0b 68%, #b45309 100%);
  color: #451a03;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18), inset 0 0 0 4px rgba(255, 255, 255, .35);
  transition: transform .6s cubic-bezier(.22, 1, .36, 1);
  transform-style: preserve-3d;
}

.rs-coin.cruz {
  border-color: #6366f1;
  background: radial-gradient(circle at 32% 30%, #eef2ff, #a5b4fc 68%, #4338ca 100%);
  color: #1e1b4b;
}

.rs-coin.flipping {
  animation: rsCoinFlip .62s cubic-bezier(.22, .61, .36, 1);
}

.rs-coin-symbol {
  font-size: 2.3rem;
  line-height: 1;
}

.rs-coin-text {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-top: 4px;
}

@keyframes rsPop {
  0% { transform: scale(.94); opacity: .5; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes rsShake {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-14deg) scale(1.06); }
  50% { transform: rotate(12deg) scale(.96); }
  75% { transform: rotate(-8deg) scale(1.03); }
  100% { transform: rotate(0deg) scale(1); }
}

@keyframes rsCoinFlip {
  0% { transform: rotateY(0deg) translateY(0); }
  45% { transform: rotateY(540deg) translateY(-22px) scale(1.08); }
  100% { transform: rotateY(1080deg) translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .rs-winner-box, .rs-die.rolling, .rs-coin.flipping {
    animation: none !important;
  }
}

@media (max-width: 420px) {
  .rs-die {
    width: 64px;
    height: 64px;
    padding: 8px;
  }
  .rs-pip {
    width: 10px;
    height: 10px;
  }
  .rs-pip.center-one {
    width: 13px;
    height: 13px;
  }
}
