:root {
  --bg: #0b0810;
  --bg-2: #15101e;
  --card: #1c1527;
  --line: #2e2340;
  --text: #f3ecff;
  --muted: #a99bc0;
  --orange: #ff7a1a;
  --orange-2: #ffa149;
  --purple: #8b5cf6;
  --purple-2: #b794ff;
  --green: #3ddc84;
  --red: #ff4d6d;
  --radius: 14px;
  --display: 'Creepster', 'Impact', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(139, 92, 246, .22), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(255, 122, 26, .14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: var(--orange-2); }
.hidden { display: none !important; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }

header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 16px 6px; max-width: 1100px; margin: 0 auto;
}
.brand { font-family: var(--display); font-size: clamp(30px, 8vw, 46px); letter-spacing: 1px; margin: 0;
  color: var(--orange); text-shadow: 0 0 18px rgba(255, 122, 26, .45), 0 2px 0 #4b1d00; line-height: 1; }
.brand small { display: block; font-family: var(--body); font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--purple-2); text-shadow: none; margin-top: 6px; }

.banner {
  border-radius: var(--radius); padding: 14px 16px; margin: 10px 0 16px;
  background: var(--card); border: 1px solid var(--line); display: flex; gap: 12px; align-items: center;
}
.banner .icon { font-size: 28px; flex: none; }
.banner strong { display: block; }
.banner.warn { border-color: rgba(255, 122, 26, .55); background: linear-gradient(135deg, rgba(255, 122, 26, .15), var(--card)); }
.banner.ok { border-color: rgba(61, 220, 132, .45); background: linear-gradient(135deg, rgba(61, 220, 132, .12), var(--card)); }
.banner.info { border-color: rgba(139, 92, 246, .5); background: linear-gradient(135deg, rgba(139, 92, 246, .16), var(--card)); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.tile {
  position: relative; border-radius: var(--radius); overflow: hidden; background: var(--card);
  border: 1px solid var(--line); cursor: pointer; padding: 0; color: inherit; text-align: left; font: inherit;
  transition: transform .15s ease, border-color .15s ease;
}
.tile:active { transform: scale(.98); }
.tile:hover { border-color: var(--purple); }
.tile img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #000; }
.tile .meta { padding: 8px 10px 10px; }
.tile .num { font-family: var(--display); color: var(--orange); font-size: 22px; line-height: 1; }
.tile .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.voted { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
.tile .badge { position: absolute; top: 8px; right: 8px; background: var(--green); color: #00210f;
  font-weight: 700; font-size: 12px; padding: 4px 8px; border-radius: 99px; }

.btn {
  appearance: none; border: 0; border-radius: 12px; padding: 14px 18px; font: inherit; font-weight: 700;
  cursor: pointer; color: #1b0a00; background: linear-gradient(180deg, var(--orange-2), var(--orange));
  box-shadow: 0 6px 20px rgba(255, 122, 26, .3); width: 100%; font-size: 17px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.purple { background: linear-gradient(180deg, var(--purple-2), var(--purple)); color: #12002e; box-shadow: 0 6px 20px rgba(139, 92, 246, .3); }
.btn.danger { background: var(--red); color: #fff; box-shadow: none; }
.btn.small { width: auto; padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1; }

/* Modal / lightbox */
.modal { position: fixed; inset: 0; background: rgba(5, 3, 8, .92); z-index: 50; display: flex;
  align-items: center; justify-content: center; padding: 16px; }
.modal .box { width: 100%; max-width: 560px; max-height: 100%; overflow: auto; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.modal img.big { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 12px; background: #000; }
.modal h2 { margin: 12px 0 4px; }
.modal .close { position: absolute; top: 12px; right: 14px; background: none; border: 0; color: var(--text);
  font-size: 34px; cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--card);
  border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; z-index: 60; max-width: 92vw;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.toast.err { border-color: var(--red); }

.muted { color: var(--muted); }
.center { text-align: center; }
footer.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 16px; }

/* Formularios */
label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=password], select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font: inherit;
}
input[type=file] { width: 100%; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h2 { margin: 0 0 10px; font-size: 18px; color: var(--orange-2); }
.progress { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); margin-top: 10px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--purple), var(--orange)); transition: width .15s; }

@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: .85; } 50% { opacity: .55; } 55% { opacity: .9; } }
.flicker { animation: flicker 4s infinite; }
