/* ===== Casino Fichas - Estilos compartidos ===== */
:root {
  --bg-0: #05060c;
  --bg-1: #0a0e1a;
  --card-bg: rgba(22, 27, 41, 0.82);
  --card-border: rgba(255, 255, 255, 0.08);
  --btn-bg: rgba(30, 36, 54, 0.9);
  --btn-bg-hover: rgba(44, 52, 78, 0.95);
  --btn-border: rgba(255, 255, 255, 0.10);
  --text: #f1f3f8;
  --text-dim: #aab0c0;
  --gold: #f2c14e;
  --green: #16a34a;
  --green-soft: #1f9d6b;
  --red: #7f2b2b;
  --red-hover: #9a3434;
  --teal: #14b8a6;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(120, 60, 180, 0.18), transparent 60%),
    radial-gradient(900px 600px at 85% 80%, rgba(40, 90, 180, 0.16), transparent 60%),
    radial-gradient(700px 500px at 60% 30%, rgba(200, 60, 90, 0.10), transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-0));
}

/* Fichas/luces de fondo (decorativo, generado por JS) */
.bg-chips {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-chips .chip {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.5;
  box-shadow: 0 0 24px currentColor, inset 0 0 12px rgba(255,255,255,0.25);
  border: 4px dashed rgba(255, 255, 255, 0.35);
  animation: floatChip linear infinite;
}
@keyframes floatChip {
  0%   { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-40px) rotate(360deg); }
}

/* ===== Tarjeta central ===== */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 32px 30px;
}
.card.narrow { max-width: 400px; }

.title {
  text-align: center;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 22px;
}
.subtitle { text-align: center; color: var(--text-dim); margin-bottom: 22px; font-size: 0.95rem; }

/* Aviso contraseña */
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(242, 193, 78, 0.08);
  border: 1px solid rgba(242, 193, 78, 0.22);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-dim);
  font-size: 0.92rem;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 20px;
}
.notice .warn-ico { font-size: 1.3rem; }
.notice b { color: var(--gold); }

.divider { height: 1px; background: var(--card-border); margin: 18px 0; }

/* ===== Botones ===== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
}
.btn:hover { background: var(--btn-bg-hover); border-color: rgba(255,255,255,0.2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .ico { font-size: 1.15rem; }

.btn-casino {
  margin-bottom: 18px;
  background: linear-gradient(180deg, rgba(40,48,72,0.95), rgba(28,34,52,0.95));
  font-size: 1.05rem;
}
.btn-logout { background: var(--red); border-color: rgba(255,120,120,0.18); margin-top: 18px; }
.btn-logout:hover { background: var(--red-hover); }
.btn-primary { background: linear-gradient(180deg, var(--green-soft), var(--green)); border-color: rgba(255,255,255,0.15); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }

/* Grid 2x2 */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 4px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 10px;
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.98rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
  min-height: 120px;
}
.tile:hover { background: var(--btn-bg-hover); border-color: rgba(255,255,255,0.2); transform: translateY(-2px); }
.tile .tico { font-size: 1.8rem; }

/* ===== Formularios ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 7px; }
.input {
  width: 100%;
  padding: 14px 14px;
  background: rgba(10, 14, 24, 0.7);
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.18s ease;
}
.input:focus { border-color: rgba(120, 160, 255, 0.5); }
.input::placeholder { color: #6b7282; }

.balance {
  text-align: center;
  margin-bottom: 18px;
}
.balance .lbl { color: var(--text-dim); font-size: 0.85rem; }
.balance .amount { font-size: 2.2rem; font-weight: 800; color: var(--gold); }

.amounts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.amounts .chip-amt {
  flex: 1 1 28%;
  padding: 10px;
  text-align: center;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  background: var(--btn-bg);
  cursor: pointer;
  font-weight: 600;
}
.amounts .chip-amt:hover { background: var(--btn-bg-hover); }

.account-box {
  background: rgba(10, 14, 24, 0.6);
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.account-box .row { display: flex; justify-content: space-between; padding: 6px 0; }
.account-box .row span:first-child { color: var(--text-dim); }
.account-box .copy { color: var(--teal); cursor: pointer; font-size: 0.85rem; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-dim); text-decoration: none; font-size: 0.95rem; margin-bottom: 8px;
}
.back-link:hover { color: var(--text); }

.toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(20, 25, 40, 0.96);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 14px 20px; border-radius: 12px;
  z-index: 100; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.ok { border-color: rgba(34,197,94,0.4); }
.toast.err { border-color: rgba(220,80,80,0.5); }

/* Ayuda flotante */
.help-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, #16b8a8, #0e8f83);
  color: #fff; border: none; border-radius: 999px;
  padding: 12px 18px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 30px rgba(20,184,166,0.35);
  text-decoration: none;
}
.help-fab:hover { filter: brightness(1.08); }

.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
}
.status-pendiente { background: rgba(242,193,78,0.15); color: var(--gold); }
.status-aprobado  { background: rgba(34,197,94,0.15); color: #4ade80; }
.status-rechazado { background: rgba(220,80,80,0.15); color: #f87171; }

/* ===== Admin ===== */
.admin-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.admin-head .title { margin: 0; text-align: left; }
.menu-grid { display: flex; flex-direction: column; gap: 12px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--card-border); }
table.data th { color: var(--text-dim); font-weight: 600; }
.mini-btn { padding: 6px 12px; font-size: 0.82rem; border-radius: 8px; border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--text); cursor: pointer; }
.mini-btn.ok { background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.4); }
.mini-btn.no { background: rgba(220,80,80,0.18); border-color: rgba(220,80,80,0.4); }
.hidden { display: none !important; }

/* ===== Vista Transferencias (admin) ===== */
.tf-controls { display: flex; gap: 10px; margin-bottom: 16px; }
.tf-controls .input { flex: 1; }
.tf-tab {
  padding: 12px 18px; border-radius: 12px; border: 1px solid var(--btn-border);
  background: var(--btn-bg); color: var(--text); font-weight: 700; cursor: pointer;
}
.tf-tab.active { background: linear-gradient(180deg, #3b82f6, #2563eb); border-color: rgba(255,255,255,0.2); }
.tf-list { display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.tf-empty {
  border: 1px solid var(--btn-border); border-radius: 12px; background: rgba(10,14,24,0.5);
  padding: 34px 16px; text-align: center; color: var(--text-dim);
}
.tf-item {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--btn-border); border-radius: 12px; background: var(--btn-bg);
  padding: 14px 16px;
}
.tf-monto { font-size: 1.25rem; font-weight: 800; color: var(--gold); min-width: 92px; }
.tf-info { flex: 1; }
.tf-info .tf-sub { color: var(--text-dim); font-size: 0.82rem; margin-top: 2px; }
.tf-pager { display: flex; align-items: center; justify-content: center; gap: 18px; font-weight: 700; }
.tf-pager .mini-btn { padding: 10px 18px; font-size: 1rem; }
.mini-btn:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 420px) {
  .card { padding: 24px 18px; }
  .title { font-size: 1.6rem; }
  .tf-controls { flex-wrap: wrap; }
}
