/* ==========================================================================
   MOSTRADOR RELM — COMPONENTE CILÍNDRICO GIRATORIO 3D
   Diseñado para E-Realm Platform. Soporta temas Claro/Oscuro y Responsive.
   ========================================================================== */

:root {
  /* Paleta base por defecto (Dark Mode E-Realm) */
  --drum-bg: var(--bg-color, #0d0c1d);
  --drum-card: var(--card-bg, #161b33);
  --drum-line: var(--border-color, #2e2e5c);
  --drum-text: var(--text-color, #f1f1fb);
  --drum-mute: var(--secondary-color, #9a9ac4);
  --drum-accent: #7c6cff;
  --drum-glow: var(--glow-color, rgba(124, 108, 255, 0.5));
  --drum-field: rgba(20, 20, 43, 0.85);
  --drum-tag: rgba(45, 45, 90, 0.92);

  /* Dimensiones adaptativas */
  --tile: 74px;
  --stage-gap: 10px;
  --rows: 4;
  --edge-fade: clamp(24px, 8vw, 200px);
  --drum-max-w: 100%;
  --persp: 900px;
}

[data-theme="light"] {
  --drum-bg: var(--bg-color, #eceef2);
  --drum-card: var(--card-bg, #ffffff);
  --drum-line: var(--border-color, #d3d3ec);
  --drum-text: var(--text-color, #1b1b3a);
  --drum-mute: var(--secondary-color, #6a6a93);
  --drum-accent: #5b4bff;
  --drum-glow: var(--glow-color, rgba(91, 75, 255, 0.4));
  --drum-field: #ffffff;
  --drum-tag: rgba(45, 45, 90, 0.85);
}

/* Móviles muy compactos */
@media (max-width: 359px) {
  :root {
    --tile: 64px;
    --stage-gap: 8px;
    --persp: 800px;
  }
}

/* Tablets (≥ 640px) */
@media (min-width: 640px) {
  :root {
    --tile: 86px;
    --stage-gap: 12px;
    --persp: 1150px;
  }
}

/* PC y Laptops (≥ 1024px) */
@media (min-width: 1024px) {
  :root {
    --tile: 102px;
    --stage-gap: 14px;
    --persp: 1450px;
  }
}

/* Monitores grandes de escritorio (≥ 1440px) */
@media (min-width: 1440px) {
  :root {
    --tile: 110px;
    --stage-gap: 16px;
    --persp: 1650px;
  }
}

/* Contenedor de sección de acceso */
.mostrador-access-section {
  width: 100%;
  max-width: 100%;
  margin: 0.5rem auto 3rem;
  padding: 0;
  position: relative;
  z-index: 5;
}

.drum {
  width: 100%;
  max-width: var(--drum-max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.drum-bar {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 10px;
  position: relative;
  z-index: 99990;
  padding: 0 12px;
}

.drum-search {
  flex: 1;
  position: relative;
}

.drum-search input {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 2px solid var(--drum-line);
  background: var(--drum-field);
  color: var(--drum-text);
  font: inherit;
  font-size: 16px;
  padding: 0 40px 0 42px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .drum-search input {
    height: 50px;
    font-size: 16px;
    padding: 0 44px 0 46px;
  }
}

.drum-search input:focus {
  border-color: var(--drum-accent);
  box-shadow: 0 0 0 4px var(--drum-glow);
}

.drum-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  stroke: var(--drum-mute);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.drum-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--drum-mute);
  font-size: 20px;
  cursor: pointer;
  display: none;
  line-height: 1;
  padding: 0;
}

.drum-clear.on {
  display: block;
}

.drum-search input::-webkit-search-cancel-button,
.drum-search input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.drum-sug {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--drum-card);
  border: 2px solid var(--drum-line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  max-height: min(60vh, 380px);
  overflow-y: auto;
  display: none;
  z-index: 99999;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (max-width: 768px) {
  .drum-sug {
    max-height: min(46vh, 260px);
    border-radius: 14px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, .6);
  }
}

/* ── OCULTAMIENTO TEMPORAL DE ELEMENTOS FLOTANTES INVASORES (WHATSAPP Y CALABAZAS) ── */
body.drum-focus #er-wa-float-btn,
body.drum-focus .float-wa,
body.drum-focus .hw-pumpkin-pile,
body.drum-focus .hw-decorations-container,
body.drum-focus .hw-deco,
body:has(#dq:focus) #er-wa-float-btn,
body:has(#dq:focus) .float-wa,
body:has(#dq:focus) .hw-pumpkin-pile,
body:has(#dq:focus) .hw-decorations-container,
body:has(#dq:focus) .hw-deco {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: opacity 0.25s ease, visibility 0.25s ease !important;
}

.drum-sug.on {
  display: block;
}

.sug-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--drum-text);
}

.sug-item:hover {
  background: rgba(124, 108, 255, .14);
}

.sug-item.sel {
  background: rgba(124, 108, 255, .22);
  outline: 2px solid var(--drum-accent);
  outline-offset: -2px;
}

.sug-ico {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  border: 1px solid var(--drum-line);
}

.sug-ico img:not(.sug-badge) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sug-ico .sug-badge {
  position: absolute !important;
  top: 2px !important;
  right: 2px !important;
  width: 17px !important;
  height: 17px !important;
  max-width: 17px !important;
  max-height: 17px !important;
  border-radius: 50% !important;
  object-fit: contain !important;
  z-index: 5 !important;
  pointer-events: none !important;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .85)) !important;
}

.sug-txt {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sug-name {
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sug-sub {
  font-size: .76rem;
  color: var(--drum-mute);
}

.sug-item mark {
  background: transparent;
  color: var(--drum-accent);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sug-go {
  margin-left: auto;
  flex: none;
  width: 18px;
  height: 18px;
  stroke: var(--drum-mute);
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sug-none {
  padding: 14px;
  color: var(--drum-mute);
  font-size: .9rem;
  text-align: center;
}

.drum-count {
  text-align: center;
  font-size: .85rem;
  color: var(--drum-mute);
  min-height: 1.3em;
  margin-bottom: 8px;
}

.drum-stage {
  position: relative;
  width: 100%;
  height: calc(var(--rows) * (var(--tile) + var(--stage-gap)) + 26px);
  min-height: 180px;
  perspective: var(--persp);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--edge-fade), #000 calc(100% - var(--edge-fade)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--edge-fade), #000 calc(100% - var(--edge-fade)), transparent 100%);
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.drum-stage.drag {
  cursor: grabbing;
}

.drum-stage::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 2px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--drum-glow), transparent);
  opacity: .5;
  pointer-events: none;
}

.drum-ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.d-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tile);
  height: var(--tile);
  margin: calc(var(--tile) / -2) 0 0 calc(var(--tile) / -2);
  display: block;
  text-decoration: none;
  backface-visibility: hidden;
  will-change: transform, opacity;
  -webkit-user-drag: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.d-item:active .d-card {
  transform: scale(0.94);
  border-color: var(--drum-accent);
  box-shadow: 0 0 20px var(--drum-glow);
}

.d-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  border: 2px solid var(--drum-line);
  background: var(--drum-card);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
  transition: transform .28s cubic-bezier(.25, .8, .25, 1), box-shadow .28s, border-color .28s;
}

.d-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), transparent);
  z-index: 2;
  pointer-events: none;
}

.d-ico {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.45rem;
  color: #fff;
}

@media (min-width: 768px) {
  .d-card {
    border-radius: 22px;
  }
  .d-ico {
    font-size: 1.75rem;
  }
}

.d-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: transform .4s ease;
}

.d-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .85));
  transition: transform .25s cubic-bezier(.25, .8, .25, 1);
}

@media (min-width: 768px) {
  .d-badge {
    top: 7px;
    right: 7px;
    width: 35px;
    height: 35px;
  }
}

.d-item:hover .d-badge,
.d-item.act .d-badge {
  transform: scale(1.18);
}

.d-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 3px;
  background: var(--drum-tag);
  color: #fff;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  transform: translateY(100%);
  transition: transform .26s ease;
  z-index: 3;
  border-top: 1px solid var(--drum-line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .d-tag {
    font-size: .78rem;
    padding: 5px 4px;
  }
}

.d-item:hover .d-card {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 0 24px var(--drum-glow);
  border-color: var(--drum-accent);
}

.d-item:hover .d-ico img {
  transform: scale(1.08);
}

.d-item:hover .d-tag {
  transform: translateY(0);
}

.d-item.act .d-card {
  border-color: var(--drum-accent);
  box-shadow: 0 0 22px var(--drum-glow);
}

@media (hover: none) {
  .d-item.act .d-tag {
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .d-card {
    border-radius: 15px;
  }
  .d-tag {
    font-size: .66rem;
  }
}

.drum-empty {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  text-align: center;
  color: var(--drum-mute);
  padding: 24px;
  z-index: 3;
  pointer-events: none;
}

.drum-empty.on {
  display: grid;
}
