/* Multi Diversión · estilos de la web y del panel de administración */
:root {
  --bg-top: #1a0b3d;
  --bg-mid: #2e1270;
  --bg-bottom: #0b2150;
  --card: rgba(255, 255, 255, 0.07);
  --card-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.7);
  --text-faint: rgba(255, 255, 255, 0.45);
  --gold: #ffc83d;
  --gold-dark: #e08a00;
  --pink: #ff5da2;
  --cyan: #39d5ff;
  --green: #3ddc97;
  --red: #ff5a6e;
  --radius: 20px;
  --font: 'Fredoka', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg-bottom) 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* estrellas */
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(1.5px 1.5px at 12% 18%, #fff8, transparent),
    radial-gradient(1px 1px at 72% 12%, #fff9, transparent), radial-gradient(1.2px 1.2px at 40% 62%, #fff6, transparent),
    radial-gradient(1px 1px at 88% 72%, #fff8, transparent), radial-gradient(1.4px 1.4px at 25% 85%, #fff5, transparent),
    radial-gradient(1px 1px at 58% 35%, #fff7, transparent), radial-gradient(1px 1px at 6% 50%, #fff6, transparent),
    radial-gradient(1.3px 1.3px at 93% 40%, #fff7, transparent);
  z-index: 0;
}

a {
  color: var(--cyan);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 17px;
  border: 0;
  border-radius: 16px;
  padding: 14px 22px;
  cursor: pointer;
  text-decoration: none;
  color: #3a1a00;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:active {
  transform: scale(0.97);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: none;
}

.btn.cyan {
  background: linear-gradient(135deg, var(--cyan), #2867d8);
  color: #fff;
}

.btn.red {
  background: linear-gradient(135deg, var(--red), #a8172a);
  color: #fff;
}

.btn.green {
  background: linear-gradient(135deg, var(--green), #129a63);
  color: #04281a;
}

.btn.small {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 12px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* ---------- Web pública ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
}

.brand .planet {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe07a, #ff8a3d 45%, #c2185b);
  box-shadow: 0 0 0 4px rgba(57, 213, 255, 0.35);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 40px 0 60px;
}

.hero .kicker {
  color: var(--cyan);
  letter-spacing: 6px;
  font-weight: 700;
  font-size: 16px;
}

.hero h1 {
  font-size: clamp(44px, 7vw, 76px);
  color: var(--gold);
  text-shadow: 0 6px 24px rgba(255, 93, 162, 0.55);
  margin: 6px 0 14px;
}

.hero p {
  font-size: 19px;
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 540px;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.phone {
  justify-self: center;
  width: 280px;
  height: 560px;
  border-radius: 44px;
  padding: 14px;
  background: #0b0420;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 8px rgba(255, 255, 255, 0.04);
}

.phone .screen {
  height: 100%;
  border-radius: 32px;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-mid) 55%, var(--bg-bottom));
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.phone .mini-title {
  text-align: center;
  font-weight: 700;
  color: var(--gold);
  font-size: 26px;
  margin: 6px 0 8px;
}

.phone .mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.phone .mini-card {
  border-radius: 16px;
  padding: 12px 10px;
  min-height: 92px;
  font-weight: 700;
  font-size: 14px;
}

.phone .mini-card span {
  display: block;
  font-size: 30px;
  margin-bottom: 6px;
}

.phone .mini-wheel {
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(135deg, #ffb938, #ff3d7f);
  font-weight: 700;
  font-size: 14px;
}

.section {
  padding: 40px 0;
}

.section h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 10px;
}

.section .lead {
  color: var(--text-dim);
  font-size: 18px;
  max-width: 720px;
  margin: 0 0 26px;
}

.games {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.game {
  border-radius: 24px;
  padding: 22px;
  min-height: 230px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.game::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.game .emoji {
  font-size: 46px;
}

.game h3 {
  font-size: 24px;
  margin: 10px 0 6px;
}

.game p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.45;
}

.g-chess {
  background: linear-gradient(135deg, #5b7cfa, #2a2e8c);
}
.g-parchis {
  background: linear-gradient(135deg, #ffb938, #f0532d);
}
.g-chinchon {
  background: linear-gradient(135deg, #ff5d8f, #9b1b6b);
}
.g-bolos {
  background: linear-gradient(135deg, #2ee59d, #0e8a8a);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature .icon {
  font-size: 34px;
}

.feature h3 {
  font-size: 21px;
  margin: 10px 0 6px;
}

.feature p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.5;
}

.wheel-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.wheel-table td {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.steps {
  counter-reset: paso;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.step {
  position: relative;
  padding-top: 52px;
}

.step::before {
  counter-increment: paso;
  content: counter(paso);
  position: absolute;
  top: 16px;
  left: 20px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #3a1a00;
  background: var(--gold);
}

.step p {
  color: var(--text-dim);
  line-height: 1.5;
  margin: 6px 0 0;
}

.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 17px;
}

.faq p {
  color: var(--text-dim);
  line-height: 1.55;
  margin: 10px 0 2px;
}

.footer {
  padding: 30px 0 40px;
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 30px;
}

.footer a {
  color: var(--text-dim);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .phone {
    display: none;
  }
  .games {
    grid-template-columns: 1fr 1fr;
  }
  .features,
  .steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .games {
    grid-template-columns: 1fr;
  }
}

/* ---------- Panel de administración ---------- */
.center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login {
  width: 100%;
  max-width: 400px;
}

.login h1 {
  font-size: 30px;
  margin: 10px 0 4px;
}

.field {
  display: block;
  margin: 14px 0;
}

.field span {
  display: block;
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 6px 4px;
}

input,
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
}

select option {
  color: #111;
}

.error {
  color: var(--red);
  font-size: 14px;
  min-height: 20px;
}

.ok-msg {
  color: var(--green);
  font-size: 14px;
}

.admin {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  background: rgba(0, 0, 0, 0.28);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  margin: 0 6px 18px;
}

.tab {
  font-family: inherit;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tab.active {
  background: var(--gold);
  color: #3a1a00;
}

.sidebar .me {
  margin-top: auto;
  font-size: 13px;
  color: var(--text-faint);
  padding: 10px 8px;
  word-break: break-all;
}

.main {
  padding: 24px 28px 60px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.topbar h1 {
  font-size: 28px;
}

.muted {
  color: var(--text-dim);
}

.faint {
  color: var(--text-faint);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.kpi {
  padding: 16px 18px;
}

.kpi .label {
  color: var(--text-dim);
  font-size: 14px;
}

.kpi .value {
  font-size: 30px;
  font-weight: 700;
  margin-top: 4px;
}

.kpi .sub {
  color: var(--text-faint);
  font-size: 13px;
  margin-top: 2px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.chart-card h3 {
  font-size: 17px;
  margin-bottom: 12px;
}

.chart-box {
  position: relative;
  height: 260px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar input,
.toolbar select {
  width: auto;
  flex: 1;
  min-width: 180px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

table.data th {
  text-align: left;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.25);
  padding: 12px 14px;
  white-space: nowrap;
  cursor: default;
}

table.data th.sortable {
  cursor: pointer;
}

table.data td {
  padding: 11px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  white-space: nowrap;
}

table.data tr.clickable {
  cursor: pointer;
}

table.data tr.clickable:hover td {
  background: rgba(255, 255, 255, 0.05);
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
}

.pill.gold {
  background: var(--gold);
  color: #3a1a00;
}
.pill.red {
  background: var(--red);
  color: #fff;
}
.pill.cyan {
  background: var(--cyan);
  color: #04263a;
}
.pill.green {
  background: var(--green);
  color: #04281a;
}
.pill.grey {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text);
}

.coin {
  color: var(--gold);
  font-weight: 700;
}

.pos {
  color: var(--green);
  font-weight: 700;
}

.neg {
  color: var(--red);
  font-weight: 700;
}

/* Ventana de detalle */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(5, 0, 20, 0.72);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 50;
}

.modal-back.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 640px;
  background: linear-gradient(180deg, #3b1b86, #1d0e4a);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 24px;
}

.modal .head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 36px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid var(--gold);
}

.modal .close {
  margin-left: auto;
}

.info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 16px 0;
  font-size: 15px;
}

.info div span {
  display: block;
  color: var(--text-faint);
  font-size: 12px;
}

.box {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 16px;
  padding: 14px;
  margin-top: 12px;
}

.box h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.row input {
  width: auto;
  flex: 1;
  min-width: 110px;
}

.tx-list {
  max-height: 240px;
  overflow-y: auto;
  font-size: 14px;
}

.tx-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120px);
  background: #1d0e4a;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 600;
  transition: transform 0.25s ease;
  z-index: 60;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .admin {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar .brand,
  .sidebar .me {
    display: none;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 18px 14px 50px;
  }
}
