:root {
  --bg: #12151a;
  --card: #1c2129;
  --text: #f3f5f7;
  --muted: #9fb0c7;
  --accent: #6ea8ff;
  --good: #3ecf8e;
  --bad: #ff6b7a;
  --line: #2a3140;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Calibri, system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #243044 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.2rem;
}
.brand { font-weight: 700; color: var(--text); font-size: 1.1rem; }
nav a { margin-left: 1rem; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem 1.8rem;
  box-shadow: 0 10px 40px #0006;
}
h1 { margin-top: 0; font-size: 1.7rem; }
h2 { margin-top: 2rem; font-size: 1.15rem; color: var(--muted); }
.lead { color: var(--muted); line-height: 1.5; }
.note { color: var(--muted); font-size: 0.92rem; margin-top: 1.4rem; }
.meta { color: var(--muted); line-height: 1.7; }
.token code {
  display: inline-block;
  background: #0e1218;
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  word-break: break-all;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #081018 !important;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  text-decoration: none !important;
}
.btn.ghost {
  background: transparent;
  color: var(--text) !important;
  border: 1px solid var(--line);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.alert {
  background: #243044;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin: 0.8rem 0 1rem;
}
.alert.bad {
  background: #2b171b;
  border-color: #5a2430;
  color: #ffc9cf;
}

.form label { display: block; margin-bottom: 0.8rem; color: var(--muted); }
.form input {
  display: block; width: 100%; max-width: 360px;
  margin-top: 0.35rem; padding: 0.6rem 0.7rem;
  border-radius: 8px; border: 1px solid var(--line);
  background: #0e1218; color: var(--text);
}

.table-wrap { overflow-x: auto; }
/* Listas largas: ~12–15 filas visibles + scroll (cabecera fija) */
.table-scroll {
  max-height: min(28rem, 52vh);
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  margin: 0;
}
.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #151a22;
  box-shadow: 0 1px 0 var(--line);
}
.table-scroll-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.4rem;
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }
.row-ban { background: #2a1518; }
.tiny { font-size: 0.8rem; }
.acts form { display: inline; margin-right: 0.25rem; }
.acts button {
  background: #0e1218;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
  font-size: 0.8rem;
}
.foot {
  margin-top: 1.2rem;
  color: #6f7d92;
  font-size: 0.85rem;
  text-align: center;
}

/* Selector EN/ES en portal de descargas (misma cookie reidlo_lang que la web) */
.portal-lang.lang-switch,
nav .lang-switch {
  display: inline-flex;
  align-items: center;
  margin-left: 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0e1218;
  overflow: hidden;
  vertical-align: middle;
}
nav .lang-btn {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: var(--muted) !important;
  text-decoration: none !important;
  margin-left: 0 !important;
}
nav .lang-btn:hover { color: var(--text) !important; background: rgba(255,255,255,0.06); }
nav .lang-btn.is-active {
  color: #081018 !important;
  background: linear-gradient(135deg, #6ea8ff, #8ec0ff);
}

.game-block { margin: 1.2rem 0 1.6rem; }
.game-block h3 { margin-bottom: 0.35rem; }
.builds { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.builds li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--line);
}
.tag {
  font-size: 0.75rem; padding: 0.1rem 0.4rem; border-radius: 6px;
  background: #2a3140; color: var(--muted);
}
.tag.new { background: #1e3a2f; color: var(--good); }
.tag.tag-lock {
  background: #2a1c1e;
  color: #e0a8b0;
  border: 1px solid #5a3d42;
}

/* —— Mi biblioteca: juegos y archivos en contenedores —— */
.lib-account {
  margin: 0 0 1.75rem;
  padding: 1.15rem 1.25rem 1.2rem;
  border-radius: 14px;
  background: #161b22;
  border: 1px solid var(--line);
}
.lib-account-line { margin: 0 0 0.55rem; }
.lib-account-meta {
  margin: 0 0 0.85rem;
  padding-left: 1.1rem;
}
.lib-hint {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  line-height: 1.5;
}
.lib-section-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.lib-games {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.lib-game {
  border-radius: 16px;
  border: 1px solid #3d3548;
  background: #14181f;
  box-shadow: 0 12px 36px #0005;
  overflow: hidden;
}
/* Título del juego: tono ciruela/vino (no azul) para que destaque el bloque */
.lib-game-head {
  padding: 1.2rem 1.3rem 1.05rem;
  border-bottom: 1px solid #4a3a52;
  background: linear-gradient(135deg, #3a2848 0%, #2a1e36 48%, #241a30 100%);
}
.lib-game-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  line-height: 1.3;
  color: #f4eef8;
}
.lib-game-desc {
  margin: 0 0 0.45rem;
  color: #c4b4d4;
  line-height: 1.45;
  font-size: 0.95rem;
}
.lib-game-count {
  margin: 0;
  font-size: 0.82rem;
  color: #a090b0;
}
.lib-files {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem 1.1rem 1.15rem;
  background: #12161c;
}
.lib-file {
  border-radius: 12px;
  border: 1px solid #2e3540;
  background: #1a1f28;
  padding: 1rem 1.1rem 1.05rem;
  box-shadow: 0 4px 14px #0004;
}
.lib-file-locked {
  border-color: #453840;
  background: #1c181a;
  opacity: 0.95;
}
.lib-file-top { margin-bottom: 0.75rem; }
.lib-file-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.lib-file-name {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
  word-break: break-word;
  line-height: 1.35;
}
.lib-file-meta {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.lib-file-meta span { white-space: nowrap; }
.lib-file-tier {
  margin: 0;
  font-size: 0.88rem;
  color: #a8b8cc;
}
.lib-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}
.lib-file-link {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.lib-file-link summary {
  cursor: pointer;
  color: #8aa0bc;
  user-select: none;
}
.lib-file-link summary:hover { color: var(--accent); }
.lib-file-link code {
  display: block;
  margin-top: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: #0e1218;
  border: 1px solid var(--line);
  word-break: break-all;
  font-size: 0.78rem;
  color: #c5d0e0;
}
.lib-file-locked-note {
  margin: 0;
  font-size: 0.88rem;
  color: #c4a0a8;
}
.lib-logout {
  margin-top: 2rem;
  padding-top: 0.5rem;
}
.tag.status-on {
  background: #1c2a22;
  color: #a8c9b4;
  border: 1px solid #3d5a48;
  font-weight: 600;
}
.tag.status-off {
  background: #2a1c1e;
  color: #d4a8ae;
  border: 1px solid #5a3d42;
  font-weight: 600;
}

/* Admin Subidas — cajas bien separadas */
.up-spacer {
  height: 2.5rem;
}
.up-spacer-sm {
  height: 1.25rem;
}
.up-box {
  border-radius: 16px;
  padding: 1.4rem 1.5rem 1.6rem;
  margin: 0;
  border: 2px solid transparent;
  box-shadow: 0 10px 32px #0006;
}
.up-box-blue {
  background: #182230;
  border-color: #3a5478;
}
.up-box-green {
  background: #18241e;
  border-color: #3a5c48;
}
.up-box-purple {
  background: #221a28;
  border-color: #5a4570;
}
.up-box-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  color: #dce6f2;
  background: rgba(0,0,0,0.35);
}
.up-box-blue .up-box-label {
  background: #2a4060;
  color: #c8daf0;
}
.up-box-green .up-box-label {
  background: #2a4838;
  color: #c4dcc8;
}
.up-box-purple .up-box-label {
  background: #453058;
  color: #e0d0f0;
}
.up-box-title {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.up-box-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 40rem;
}
.up-game-name {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
  margin: 0 0 1rem;
  border-radius: 12px;
  background: #1c2430;
  border: 1px solid #334055;
}
.up-file {
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
  background: rgba(0,0,0,0.28);
}
.up-file:last-child {
  margin-bottom: 0;
}
.up-file-on {
  border: 1px solid #3d5a48;
}
.up-file-off {
  border: 1px solid #5a3d42;
  opacity: 0.95;
}
.up-file-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
.up-file-name {
  margin: 0 0 0.3rem;
  font-size: 1.02rem;
}
.up-file-meta {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.up-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.up-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.up-empty {
  margin: 0;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(0,0,0,0.25);
  color: var(--muted);
  line-height: 1.5;
}
.form select {
  display: block; width: 100%; max-width: 420px;
  margin-top: 0.35rem; padding: 0.55rem 0.6rem;
  border-radius: 8px; border: 1px solid var(--line);
  background: #0e1218; color: var(--text);
}
.form input[type="file"] { margin-top: 0.35rem; color: var(--muted); }
