/* ============================================================
   auctions.css — Casa de Subastas (pujas en vivo)
   Mobile-first, GPU-friendly, respeta prefers-reduced-motion
   ============================================================ */

.auctions-page { max-width: 880px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.ac-board {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius, 14px);
  padding: 1.1rem;
}
.ac-board-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.ac-board-title { font-family: var(--font-d, serif); font-size: 1.05rem; color: var(--gold); letter-spacing: 0.05em; }
.ac-board-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
.ac-create-toggle {
  border: 1px solid rgba(245,200,66,0.4); background: rgba(245,200,66,0.08);
  color: var(--gold); font-weight: 700; font-size: 0.8rem;
  border-radius: 9px; padding: 0.45rem 0.85rem; cursor: pointer; white-space: nowrap;
  transition: background var(--transition, .2s);
}
.ac-create-toggle:hover { background: rgba(245,200,66,0.16); }

/* ── Formulario de creación ── */
.ac-create-form {
  display: flex; flex-direction: column; gap: 0.8rem;
  background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 0.9rem; margin-bottom: 1rem;
}
.ac-field { display: flex; flex-direction: column; gap: 0.3rem; }
.ac-field label { font-size: 0.74rem; color: var(--muted); font-weight: 600; }
.ac-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.ac-input {
  width: 100%; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 9px;
  padding: 0.55rem 0.7rem; color: var(--text); font-size: 0.85rem;
  font-family: inherit;
}
.ac-input:focus { outline: none; border-color: var(--gold); }

/* Desplegable de duración: tema oscuro + flecha personalizada */
select.ac-input {
  cursor: pointer;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 2.1rem;
  background-color: rgba(255,255,255,0.05);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f5c842' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}
select.ac-input:hover { border-color: rgba(245,200,66,0.5); }
/* Las opciones del popup nativo (fondo oscuro, texto claro) */
select.ac-input option {
  background-color: #14151a;
  color: var(--text);
  padding: 0.5rem;
}

.ac-autocomplete {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: #14151a; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px; overflow: hidden; max-height: 260px; overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.ac-ac-item, .ac-ac-empty {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.7rem; cursor: pointer; font-size: 0.82rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ac-ac-empty { color: var(--muted); cursor: default; }
.ac-ac-item:hover { background: rgba(255,255,255,0.06); }
.ac-ac-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ac-ac-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ac-ac-id { font-size: 0.7rem; color: var(--muted); }
.ac-ac-qty { font-size: 0.7rem; color: var(--gold); font-weight: 700; }
.ac-ac-rarity { font-size: 0.7rem; font-weight: 700; }

.ac-selected {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  background: rgba(245,200,66,0.08); border: 1px solid rgba(245,200,66,0.3);
  border-radius: 9px; padding: 0.5rem 0.7rem; font-size: 0.82rem; color: var(--text);
}
.ac-sel-clear { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.9rem; }

.ac-submit {
  border: none; cursor: pointer; border-radius: 10px;
  padding: 0.7rem; font-weight: 800; font-size: 0.88rem;
  color: #0b0b0c; background: var(--gold);
  box-shadow: 0 0 14px rgba(245,200,66,0.4);
  transition: transform var(--transition, .2s);
}
.ac-submit:hover:not(:disabled) { transform: translateY(-1px); }
.ac-submit:disabled { opacity: 0.6; cursor: default; }

.ac-feedback { font-size: 0.78rem; min-height: 1em; text-align: center; }
.ac-fb-err { color: #f87171; }
.ac-fb-ok  { color: #34d399; }

/* ── Lista de subastas ── */
.ac-empty { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 2rem 1rem; }
.ac-row {
  display: flex; align-items: center; gap: 0.8rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  padding: 0.7rem; margin-bottom: 0.7rem;
  transition: transform var(--transition, .2s);
}
.ac-row.ended { opacity: 0.82; }
.ac-card-thumb {
  position: relative; width: 56px; height: 78px; flex-shrink: 0;
  border: 2px solid; border-radius: 8px; overflow: hidden;
  background: rgba(0,0,0,0.3); display: grid; place-items: center;
}
.ac-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ac-card-rar {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 0.6rem; font-weight: 800; text-align: center;
  background: rgba(0,0,0,0.7); padding: 1px 0;
}
.ac-row-body { flex: 1; min-width: 0; }
.ac-row-name { font-weight: 700; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-row-seller { font-size: 0.72rem; color: var(--muted); margin: 0.1rem 0; }
.ac-row-bid { display: flex; flex-direction: column; }
.ac-bid-val { font-size: 0.92rem; font-weight: 800; color: var(--gold); }
.ac-bid-by { font-size: 0.68rem; color: var(--muted); }
.ac-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; flex-shrink: 0; }
.ac-timer {
  font-size: 0.72rem; font-weight: 700; color: #60a5fa;
  font-variant-numeric: tabular-nums;
}
.ac-timer.ended { color: var(--muted); }

.ac-btn {
  border: none; cursor: pointer; border-radius: 9px;
  padding: 0.45rem 0.8rem; font-weight: 700; font-size: 0.78rem;
  transition: transform var(--transition, .2s), box-shadow var(--transition, .2s);
  white-space: nowrap;
}
.ac-btn-bid { color: #0b0b0c; background: var(--gold); box-shadow: 0 0 10px rgba(245,200,66,0.4); }
.ac-btn-bid:hover { transform: translateY(-1px); box-shadow: 0 0 16px rgba(245,200,66,0.65); }
.ac-btn-bid.leading { background: rgba(52,211,153,0.18); color: #34d399; box-shadow: none; cursor: default; }
.ac-btn-settle { color: #0b0b0c; background: #34d399; box-shadow: 0 0 10px rgba(52,211,153,0.4); }
.ac-btn-settle:hover { transform: translateY(-1px); }
.ac-btn-cancel { background: rgba(255,255,255,0.06); color: var(--muted); }
.ac-btn-cancel:hover { color: #f87171; }
.ac-btn:disabled { opacity: 0.6; cursor: default; }
.ac-mine-tag { font-size: 0.72rem; color: var(--muted); text-align: right; }
.ac-ended-tag { font-size: 0.74rem; color: var(--muted); font-weight: 700; }

/* ── Panel de puja (overlay) ── */
.ac-overlay {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(3px); padding: 1rem;
  animation: acFade 0.2s ease;
}
@keyframes acFade { from { opacity: 0; } to { opacity: 1; } }
.ac-panel {
  width: min(420px, 94vw);
  background: #14151a; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px; padding: 1.1rem; display: flex; flex-direction: column; gap: 0.9rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.ac-panel-header { display: flex; justify-content: space-between; align-items: center; }
.ac-panel-title { font-family: var(--font-d, serif); font-size: 1.05rem; color: var(--gold); }
.ac-close { background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.ac-panel-card { display: flex; gap: 0.8rem; align-items: center; border: 2px solid; border-radius: 10px; padding: 0.7rem; }
.ac-panel-card img { width: 60px; height: 84px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.ac-panel-cardname { font-weight: 800; font-size: 0.95rem; }
.ac-panel-meta { font-size: 0.74rem; color: var(--muted); margin-top: 0.15rem; }
.ac-bid-balance { font-size: 0.74rem; color: var(--muted); margin-top: 0.2rem; }
.ac-quick { display: flex; gap: 0.5rem; }
.ac-quick-btn {
  flex: 1; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04);
  color: var(--text); border-radius: 8px; padding: 0.45rem; font-size: 0.78rem;
  font-weight: 700; cursor: pointer; transition: background var(--transition, .2s);
}
.ac-quick-btn:hover { background: rgba(255,255,255,0.1); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .ac-field-grid { grid-template-columns: 1fr; }
  .ac-row { gap: 0.6rem; padding: 0.6rem; flex-wrap: wrap; }
  .ac-card-thumb { width: 48px; height: 67px; }
  .ac-row-name { font-size: 0.84rem; }
  .ac-row-right { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ac-row, .ac-btn, .ac-submit, .ac-overlay { animation: none; transition: none; }
}
