/* OMCS CTF — hoja de estilos principal. Sin CDNs, sin estilos en línea (CSP). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/Inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/Inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/Inter-700.woff2") format("woff2"); }

:root {
  /* Paleta (contraste verificado WCAG AA sobre --bg y --surface) */
  --bg: #0F1416;
  --surface: #161E21;
  --surface-2: #1D272B;
  --surface-3: #25333A;
  --border: #2C3B41;
  --text: #E8EEF0;
  --text-muted: #9DB0B6;
  --accent: #4BBAB5;          /* turquesa del logo */
  --accent-strong: #6FD3CE;
  --accent-ink: #0B1F1E;      /* texto sobre turquesa */
  --ink: #1D1D1B;             /* texto sobre superficies claras */
  --paper: #F6F8F8;
  --blue: #5B9BE6;            /* armadillo — defensa */
  --blue-deep: #1E4F8C;
  --purple: #B98AE0;          /* tlacuache — inteligencia */
  --purple-deep: #5B2A7A;
  --red: #F2665E;             /* reptil — ataque */
  --red-deep: #8E1A16;
  --ok: #5BD08A;
  --warn: #F2C14E;
  --danger: #FF6B6B;
  --gold: #F2C14E;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--font); font-feature-settings: "ss01", "cv11";
}
img, svg, picture { max-width: 100%; height: auto; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: #9BE7E3; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); }
h2 { font-size: 1.25rem; }
h1 .icon, h2 .icon { color: var(--accent); vertical-align: -0.12em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-3); padding: .1em .35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; border-radius: 4px; }

.sprite { display: none; }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { left: 8px; }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.no-print { }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.container-wide { width: 100%; max-width: 1500px; margin: 0 auto; padding: 0 1.25rem; }
.main { flex: 1; padding-top: 2rem; padding-bottom: 3rem; }
.main:focus { outline: none; }

/* ---------- Encabezado ---------- */
.site-header { background: rgba(15, 20, 22, .92); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(6px); }
.header-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 68px; flex-wrap: wrap; padding-top: .4rem; padding-bottom: .4rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand img { width: 168px; height: auto; display: block; }
.main-nav { flex: 1; }
.main-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a, .admin-nav a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .75rem; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none; font-weight: 500;
}
.main-nav a:hover, .admin-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current="page"], .admin-nav a[aria-current="page"] { color: var(--accent-strong); background: rgba(75, 186, 181, .12); }
.user-box { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.user-alias { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.inline-form { display: inline; margin: 0; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--border); color: var(--text-muted); font-size: .875rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; padding-top: 1.25rem; padding-bottom: 1.25rem; }

/* ---------- Botones ---------- */
.btn {
  --b: var(--surface-3); --c: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .62rem 1.05rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--b); color: var(--c); font: 600 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:hover { filter: brightness(1.08); color: var(--c); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { --b: var(--accent); --c: var(--accent-ink); }
.btn-primary:hover { --b: var(--accent-strong); }
.btn-ghost { --b: transparent; --c: var(--text); border-color: var(--border); }
.btn-ghost:hover { --b: var(--surface-2); }
.btn-danger { --b: transparent; --c: var(--danger); border-color: rgba(255, 107, 107, .5); }
.btn-danger:hover { --b: rgba(255, 107, 107, .12); }
.btn-sm { padding: .4rem .7rem; font-size: .875rem; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Tarjetas, alertas, insignias ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 1rem; }
.alert .icon { margin-top: .15em; }
.alert-success { background: rgba(91, 208, 138, .1); border-color: rgba(91, 208, 138, .45); color: #BFF0D2; }
.alert-error { background: rgba(255, 107, 107, .1); border-color: rgba(255, 107, 107, .45); color: #FFD0D0; }
.alert-warning { background: rgba(242, 193, 78, .1); border-color: rgba(242, 193, 78, .45); color: #FBE6B4; }
.alert-info { background: rgba(75, 186, 181, .1); border-color: rgba(75, 186, 181, .45); color: #CDEFED; }
.flashes { padding-top: 1rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-3); color: var(--text); white-space: nowrap; }
.badge-accent { background: rgba(75, 186, 181, .18); color: var(--accent-strong); }
.badge-ok { background: rgba(91, 208, 138, .16); color: var(--ok); }
.badge-off { background: rgba(157, 176, 182, .14); color: var(--text-muted); }
.badge-warn { background: rgba(242, 193, 78, .16); color: var(--warn); }

/* Familias de categoría: siempre con ícono + nombre, nunca sólo color */
.cat { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .85rem; padding: .15rem .55rem; border-radius: 999px; border: 1px solid; }
.cat-offensive { color: var(--red); border-color: rgba(242, 102, 94, .5); background: rgba(242, 102, 94, .08); }
.cat-defensive { color: var(--blue); border-color: rgba(91, 155, 230, .5); background: rgba(91, 155, 230, .08); }
.cat-intel { color: var(--purple); border-color: rgba(185, 138, 224, .5); background: rgba(185, 138, 224, .08); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; font-weight: 500; }
.field small { color: var(--text-muted); font-weight: 400; }
input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; padding: .65rem .8rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: 400 1rem/1.4 var(--font);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid rgba(75, 186, 181, .35); outline-offset: 0; }
input[readonly] { color: var(--text-muted); }
input[type="file"] { color: var(--text-muted); }
.input-code { font: 600 1.6rem/1 var(--mono); letter-spacing: .3em; text-align: center; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: 1rem 0; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; accent-color: var(--accent); }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 1.25rem; }
.form-grid .form-actions { grid-column: 1 / -1; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--text-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: var(--surface-2); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; }

/* ---------- Mascotas ---------- */
.mascot { display: block; }
.mascot img { display: block; width: 100%; height: auto; }
.mascot-blue { --m: var(--blue); }
.mascot-purple { --m: var(--purple); }
.mascot-red { --m: var(--red); }

/* ---------- Inicio ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; min-height: calc(100vh - 240px); }
.hero-logo { width: min(520px, 100%); height: auto; display: block; margin-bottom: 1.25rem; }
.hero-title { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem); margin-bottom: .4rem; }
.hero-sub { color: var(--text-muted); font-size: 1.1rem; margin: 0 0 1rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.lead { font-size: 1.15rem; }
.state-pill { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: .9rem; margin: 0 0 1rem; }
.state-pill .dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--text-muted); }
.state-running .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(91, 208, 138, .6); animation: pulse 2s infinite; }
.state-paused .dot { background: var(--warn); }
.state-before .dot { background: var(--accent); }
.state-ended .dot { background: var(--red); }
.countdown { background: linear-gradient(135deg, rgba(75, 186, 181, .14), rgba(75, 186, 181, .03)); border: 1px solid rgba(75, 186, 181, .35); border-radius: var(--radius); padding: 1.1rem 1.4rem; max-width: 540px; }
.countdown-label { margin: 0; color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; }
.countdown-value { margin: .3rem 0; font: 700 clamp(1.8rem, 1.2rem + 2.6vw, 3rem)/1.1 var(--font); font-variant-numeric: tabular-nums; color: var(--accent-strong); display: flex; gap: .8rem; flex-wrap: wrap; }
.countdown-value .unit { display: inline-flex; flex-direction: column; align-items: center; min-width: 2.6ch; }
.countdown-value .unit small { font-size: .75rem; font-weight: 600; color: var(--text-muted); letter-spacing: .06em; text-transform: uppercase; }
.countdown-at { margin: 0; display: flex; align-items: center; gap: .4rem; color: var(--text-muted); font-size: .9rem; }
/* Columnas proporcionales al ancho/alto de cada ilustración (608×720, 522×720,
   720×684): así las tres se escalan a la misma altura. */
.hero-mascots { display: grid; grid-template-columns: .84fr .73fr 1.05fr; gap: 1rem; align-items: end; }
.mascot-card { margin: 0; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--m) 22%, transparent), transparent 70%); border-radius: var(--radius); padding: .5rem; text-align: center; }
.mascot-card figcaption { margin-top: .5rem; font-weight: 700; color: var(--m); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.mascot-lg img { max-height: 300px; width: auto; margin: 0 auto; }

/* ---------- Autenticación ---------- */
.auth-wrap { display: flex; align-items: center; justify-content: center; gap: 2rem; flex-wrap: wrap; min-height: 60vh; }
.auth-mascot { width: min(260px, 60vw); filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
.auth-card { width: min(420px, 100%); margin: 0; }
.auth-card-wide { width: min(720px, 100%); }
.enroll-grid { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; align-items: start; }
.qr-box { background: #fff; border-radius: var(--radius-sm); padding: .5rem; }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-box .qr-dark, .qr-box path { fill: #000; }
.secret { font-size: 1.05rem; letter-spacing: .08em; word-break: break-all; background: var(--bg); padding: .6rem; border-radius: var(--radius-sm); border: 1px dashed var(--border); }

/* ---------- Páginas con mascota lateral ---------- */
.page-with-mascot { display: grid; grid-template-columns: 1fr 240px; gap: 2rem; align-items: start; }
.side-mascot { position: sticky; top: 100px; }
.prose { max-width: 75ch; }
.prose p, .prose li { color: var(--text); }
.prose ol, .prose ul { padding-left: 1.4rem; }
.prose li { margin: .3rem 0; }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--border); padding: .4rem .6rem; }
.prose pre { background: var(--bg); padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; border: 1px solid var(--border); }
.prose pre code { background: none; padding: 0; }
.rules-box { max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.25rem; background: var(--bg); }

/* ---------- Errores ---------- */
.error-page { display: flex; gap: 2rem; align-items: center; justify-content: center; flex-wrap: wrap; min-height: 55vh; }
.error-mascot { width: min(260px, 60vw); }
.error-code { font: 800 4rem/1 var(--font); color: var(--accent); margin: 0; }

/* ---------- Panel admin ---------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; flex: 1; padding-top: 1.5rem; padding-bottom: 3rem; }
.admin-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; position: sticky; top: 90px; }
.admin-nav a { width: 100%; }
.admin-main { min-width: 0; }
.admin-main:focus { outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.actions, .action-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.action-row form { margin: 0; }
.danger-zone { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed rgba(255, 107, 107, .4); max-width: 520px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .2rem; }
.stat-label { color: var(--text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--text-muted); font-size: .85rem; }
.code-sample { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; font: .9rem/1.5 var(--mono); overflow-x: auto; }

/* ---------- Animaciones (discretas) ---------- */
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(91, 208, 138, .55); } 70% { box-shadow: 0 0 0 8px rgba(91, 208, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(91, 208, 138, 0); } }
@keyframes run-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes float-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.anim-run img { animation: run-bob .9s ease-in-out infinite; }
.hero-mascots .mascot-card { animation: float-in .6s ease both; }
.hero-mascots .mascot-card:nth-child(2) { animation-delay: .12s; }
.hero-mascots .mascot-card:nth-child(3) { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-mascots { order: -1; max-width: 520px; }
  .mascot-lg img { max-height: 180px; }
  .page-with-mascot { grid-template-columns: 1fr; }
  .side-mascot { display: none; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav ul { flex-direction: row; flex-wrap: wrap; position: static; }
  .admin-nav a { width: auto; }
  .enroll-grid { grid-template-columns: 1fr; }
  .qr-box { max-width: 240px; }
}
@media (max-width: 640px) {
  .brand img { width: 132px; }
  .main-nav a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .main-nav a { padding: .55rem; }
  .user-box .btn span, .user-alias span { display: none; }
  .card { padding: 1.1rem; }
  .auth-mascot { width: 150px; }
}

/* ---------- Retos (F2) ---------- */
.cat-section { margin-bottom: 2rem; }
.cat-title { display: flex; align-items: center; gap: .75rem; font-size: 1.1rem; }
.chal-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.chal-card {
  --fam: var(--accent);
  display: flex; flex-direction: column; gap: .4rem; height: 100%; padding: 1rem 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--fam);
  color: var(--text); text-decoration: none; transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
}
.fam-offensive .chal-card { --fam: var(--red); }
.fam-defensive .chal-card { --fam: var(--blue); }
.fam-intel .chal-card { --fam: var(--purple); }
.chal-card:hover { transform: translateY(-2px); background: var(--surface-2); color: var(--text); }
.chal-card.is-solved { background: linear-gradient(180deg, rgba(91, 208, 138, .1), var(--surface) 60%); border-color: rgba(91, 208, 138, .45); border-top-color: var(--ok); }
.chal-card.is-locked { opacity: .75; }
.chal-name { font-weight: 700; font-size: 1.02rem; }
.chal-points { font: 700 1.5rem/1 var(--font); font-variant-numeric: tabular-nums; color: var(--accent-strong); }
.chal-points small { font-size: .8rem; color: var(--text-muted); }
.chal-meta { display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: .85rem; gap: .5rem; }
.chal-meta .icon { vertical-align: -0.15em; }
.chal-status { font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.chal-status.ok { color: var(--ok); }
.chal-status.lock { color: var(--text-muted); }
.fb { color: var(--red); display: inline-flex; align-items: center; gap: .25rem; }
.diff { font-weight: 600; }
.diff-facil { color: var(--ok); }
.diff-media { color: var(--warn); }
.diff-dificil { color: var(--red); }
.diff-experto { color: var(--purple); }

.chal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.chal-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 1rem; }
.chal-side .card { margin: 0; }
.chal-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.chal-head h1 { margin: .5rem 0 .25rem; }
.chal-value { font: 800 2.2rem/1 var(--font); color: var(--accent-strong); margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.chal-value small { display: block; font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.chal-section { border-top: 1px solid var(--border); margin-top: 1.5rem; padding-top: 1.25rem; }
.chal-section h2 { font-size: 1.05rem; }
.endpoint-list, .file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.endpoint { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem; }
.cmd { display: flex; align-items: center; gap: .5rem; width: 100%; }
.cmd code { flex: 1; padding: .5rem .7rem; overflow-x: auto; white-space: pre; }
.file-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.sha { width: 100%; color: var(--text-muted); overflow-wrap: anywhere; }
.sha code { background: none; padding: 0; }
.hint { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: .75rem; }
.hint-locked { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0; }
.solved-box { color: var(--ok); font-weight: 600; display: flex; gap: .4rem; align-items: flex-start; margin: 0; }
.solved-box .icon { margin-top: .2em; }
.fb-badge { margin: .6rem 0 0; font-weight: 700; }
.result { border-radius: var(--radius); padding: 1rem; text-align: center; border: 1px solid var(--border); background: var(--surface); animation: float-in .35s ease both; }
.result-correct { border-color: rgba(91, 208, 138, .55); background: rgba(91, 208, 138, .08); }
.result-incorrect { border-color: rgba(185, 138, 224, .55); background: rgba(185, 138, 224, .08); }
.result-rate_limited { border-color: rgba(91, 155, 230, .55); }
.result-title { font-weight: 800; font-size: 1.15rem; margin: .25rem 0; display: flex; justify-content: center; gap: .4rem; align-items: center; }
.result-mascot { max-width: 160px; margin: 0 auto; }
@keyframes jump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-14px); } }
.anim-jump img { animation: jump .8s ease-in-out 3; }

/* ---------- Formularios de admin ---------- */
.fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.1rem .25rem; margin: 0 0 1.25rem; }
.fieldset legend { padding: 0 .4rem; font-weight: 700; color: var(--accent-strong); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }
.check-grid .check { margin: .35rem 0; }
.endpoint-form { display: grid; grid-template-columns: 1fr 1.3fr 90px 1.4fr 1.6fr auto auto; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.hint-form { display: grid; grid-template-columns: 1fr 110px 90px auto; gap: .6rem; align-items: end; margin-bottom: .8rem; }
.hint-form .field { margin: 0; }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 1rem; align-items: end; }
.table-compact th, .table-compact td { padding: .4rem .5rem; }
.data-cell { max-width: 420px; overflow-wrap: anywhere; color: var(--text-muted); }
tr.act-ok td:nth-child(4) code { color: var(--ok); }
tr.act-bad td:nth-child(4) code { color: var(--danger); }
.pager { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.stat-value.small-value { font-size: 1.15rem; }
.danger-zone-card { border-color: rgba(255, 107, 107, .35); }

@media (max-width: 1000px) {
  .chal-layout { grid-template-columns: 1fr; }
  .chal-side { position: static; order: -1; }
  .endpoint-form { grid-template-columns: 1fr 1fr; }
  .hint-form { grid-template-columns: 1fr 1fr; }
  .hint-form textarea { grid-column: 1 / -1; }
}
.file-list li .inline-form { margin-left: auto; }

/* ---------- Progreso y puntuación (F3) ---------- */
.mini-timeline { width: 100%; height: auto; display: block; }
.mini-timeline .axis { stroke: var(--border); stroke-width: 1; }
.mini-timeline .axis-label { fill: var(--text-muted); font: 12px var(--font); }
.mini-timeline .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.plain-list, .pending-list { margin: 0; padding-left: 1.2rem; }
.plain-list li, .pending-list li { margin: .3rem 0; }
.pending-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 1.5rem; }
.stat-value small { font-size: .9rem; font-weight: 600; }
tr.changed td { background: rgba(242, 193, 78, .08); }
.check-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .3rem; }
.check-list li { display: flex; gap: .5rem; align-items: center; }
.check-list .ok .icon { color: var(--ok); }
.check-list .bad { color: var(--danger); }

/* ---------- Scoreboard en vivo y proyector (F4) ---------- */
.live-head { margin-bottom: .75rem; }
.live-countdown { font-variant-numeric: tabular-nums; }
.live-countdown strong { font-size: 1.15rem; color: var(--accent-strong); }
.live-status { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; }
.live-status .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); }
.live-status.is-bad .dot { background: var(--danger); }
.live-status.is-bad { color: var(--danger); }
.me-box { display: flex; gap: .5rem; align-items: center; background: rgba(75, 186, 181, .1); border: 1px solid rgba(75, 186, 181, .4); border-radius: var(--radius-sm); padding: .6rem .9rem; margin-bottom: 1rem; }
.frozen-note { display: flex; gap: .5rem; align-items: center; background: rgba(91, 155, 230, .1); border: 1px solid rgba(91, 155, 230, .45); color: #CFE2FA; border-radius: var(--radius-sm); padding: .6rem .9rem; margin-bottom: 1rem; }
.ann-banner { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; align-items: center; background: linear-gradient(90deg, rgba(185, 138, 224, .14), var(--surface)); border: 1px solid rgba(185, 138, 224, .4); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; }
.ann-mascot img { max-height: 110px; width: auto; }
.ann-list { display: flex; flex-direction: column; gap: .5rem; }
.ann-title { margin: 0; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ann-time { color: var(--text-muted); font-size: .8rem; margin-left: auto; font-variant-numeric: tabular-nums; }
.ann-body { margin: .15rem 0 0; white-space: pre-line; }
.ann-warning .icon, .badge.ann-warning { color: var(--warn); }
.ann-critical .icon, .badge.ann-critical { color: var(--danger); }
.ann-critical { border-left: 3px solid var(--danger); padding-left: .6rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg-btn { background: transparent; color: var(--text-muted); border: 0; padding: .4rem .8rem; font: 600 .85rem var(--font); cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: rgba(75, 186, 181, .18); color: var(--accent-strong); }
.timeline { position: relative; min-height: 120px; }
.tl-svg { display: block; width: 100%; height: auto; }
.tl-grid { stroke: rgba(157, 176, 182, .12); stroke-width: 1; }
.tl-base { stroke: var(--border); stroke-width: 1; }
.tl-tick { stroke: var(--border); }
.tl-axis { fill: var(--text-muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.tl-note { fill: var(--text-muted); font: 600 11px var(--font); }
.tl-freeze { fill: rgba(91, 155, 230, .07); }
.tl-now { stroke: var(--accent-strong); stroke-width: 1.5; stroke-dasharray: 4 4; }
.tl-now-label { fill: var(--accent-strong); }
.tl-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tl-line.is-muted { stroke-width: 1.25; opacity: .7; }
.tl-line.is-me { stroke-width: 3; }
.tl-line.is-hover { stroke-width: 3.5; opacity: 1; }
.tl-fb { fill: var(--red); stroke: var(--surface); stroke-width: 2; }
.tl-label { fill: var(--text); font: 600 11px var(--font); }
.tl-cross { stroke: var(--text-muted); stroke-width: 1; }
.tl-hit { cursor: crosshair; }
.tl-tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .45rem .6rem; display: flex; flex-direction: column; gap: .1rem; font-size: .82rem; box-shadow: var(--shadow); min-width: 150px; z-index: 5; }
.tl-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .6rem; font-size: .82rem; color: var(--text); }
.lg-item { display: inline-flex; align-items: center; gap: .35rem; }
.lg-fb { color: var(--red); }
.swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 3px; flex: none; }
.swatch.is-muted { background: #55666c; }
.swatch.is-empty { background: transparent; border: 1px solid var(--border); }
.live-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.sb-table td.alias { white-space: nowrap; }
.sb-table td.alias .swatch { vertical-align: -0.05em; margin-right: .45rem; }
.sb-table td.alias .badge { margin-left: .4rem; }
.sb-table td.num, .sb-table td.delta { white-space: nowrap; }
.sb-table .num { text-align: right; }
.sb-table .strong { font-weight: 700; }
.sb-table tr.is-me td { background: rgba(75, 186, 181, .1); }
.sb-table tr.top-1 .rank { color: var(--gold); font-weight: 800; }
.sb-table tr.top-2 .rank { color: #C9D4D8; font-weight: 800; }
.sb-table tr.top-3 .rank { color: #D9935A; font-weight: 800; }
.delta .up { color: var(--ok); font-size: .8rem; }
.delta .down { color: var(--danger); font-size: .8rem; }
.delta .same { color: var(--text-muted); }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; max-height: 560px; overflow: auto; }
.feed-item { border-left: 3px solid var(--accent); padding: .35rem .6rem; background: var(--bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.feed-item.fam-offensive { border-left-color: var(--red); }
.feed-item.fam-defensive { border-left-color: var(--blue); }
.feed-item.fam-intel { border-left-color: var(--purple); }
.feed-item.is-fb { background: rgba(242, 102, 94, .08); }
.feed-item.is-new { animation: float-in .5s ease both; }
.feed-time { font-size: .75rem; color: var(--text-muted); }
.feed-body { margin: .1rem 0; }
.feed-chal { color: var(--accent-strong); }
.feed-meta { margin: 0; display: flex; gap: .6rem; align-items: center; font-size: .8rem; flex-wrap: wrap; }
.feed-meta .cat { font-size: .72rem; padding: .05rem .45rem; }
.matrix-wrap { max-height: 70vh; }
.matrix { border-collapse: separate; border-spacing: 0; font-size: .82rem; }
.matrix th, .matrix td { border-bottom: 1px solid var(--border); border-right: 1px solid rgba(44, 59, 65, .5); }
.mx-corner { position: sticky; left: 0; top: 0; z-index: 3; background: var(--surface); text-align: left; padding: .4rem .6rem; vertical-align: bottom; }
.mx-col { position: sticky; top: 0; z-index: 2; background: var(--surface); height: 150px; min-width: 30px; vertical-align: bottom; padding: .3rem 0; border-top: 3px solid var(--accent); }
.mx-col.fam-offensive { border-top-color: var(--red); }
.mx-col.fam-defensive { border-top-color: var(--blue); }
.mx-col.fam-intel { border-top-color: var(--purple); }
.mx-colname { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 140px; overflow: hidden; text-overflow: ellipsis; display: inline-block; font-weight: 600; color: var(--text); }
.mx-row { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: .3rem .6rem; white-space: nowrap; font-weight: 600; }
.matrix tr.is-me .mx-row { color: var(--accent-strong); }
.mx-cell { text-align: center; width: 30px; height: 28px; }
.mx-cell.is-ok { background: rgba(91, 208, 138, .14); }
.mx-cell.is-fb { background: rgba(242, 102, 94, .18); }
.mx-ok { color: var(--ok); font-weight: 800; }
.mx-fb { color: var(--red); }
.mx-legend { display: inline-flex; align-items: center; gap: .3rem; margin-right: 1rem; }
.podium { text-align: center; margin-bottom: 1.5rem; background: radial-gradient(circle at 50% 30%, rgba(242, 102, 94, .18), transparent 60%); border-radius: var(--radius); padding: 1rem; }
.podium-mascot img { max-height: 240px; width: auto; margin: 0 auto; }
.podium-list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; justify-content: center; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.podium-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.5rem; display: flex; flex-direction: column; gap: .25rem; min-width: 160px; }
.podium-1 { order: 2; border-color: var(--gold) !important; padding-top: 2rem !important; }
.podium-2 { order: 1; }
.podium-3 { order: 3; }
.podium-place { font-weight: 800; font-size: 1.4rem; color: var(--gold); }
.podium-alias { font-weight: 700; font-size: 1.2rem; }

/* Proyector */
body.projector { font-size: 18px; }
.board { padding: 1.25rem 2rem 2rem; }
.board-head { display: grid; grid-template-columns: auto 1fr auto; gap: 2rem; align-items: center; margin-bottom: 1rem; }
.board-logo { width: 300px; height: auto; }
.board-event { margin: 0 0 .4rem; font-weight: 700; font-size: 1.4rem; }
.board-cd { display: flex; align-items: center; gap: 1rem; }
.board-cd-mascot img { max-height: 120px; width: auto; }
.board-cd-value { font: 800 3.2rem/1 var(--font); font-variant-numeric: tabular-nums; color: var(--accent-strong); margin: 0; }
.board .muted { margin: 0; }
.board-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; }
.board-table { font-size: 1.15rem; }
.board .feed { max-height: none; }
.board .tl-axis, .board .tl-note { font-size: 13px; }
.board .tl-label { font-size: 13px; }
.fb-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(142, 26, 22, .92), rgba(15, 20, 22, .97) 70%); animation: fb-in .35s ease both; }
.fb-overlay[hidden] { display: none; }
.fb-overlay.is-out { animation: fb-out .4s ease both; }
.fb-inner { text-align: center; }
.fb-mascot img { max-height: 55vh; width: auto; margin: 0 auto; }
.fb-jump img { animation: jump .8s ease-in-out infinite; }
.fb-kicker { font: 900 clamp(2.5rem, 6vw, 5rem)/1 var(--font); color: #FFD9D6; letter-spacing: .04em; margin: 1rem 0 .5rem; display: flex; gap: .75rem; justify-content: center; align-items: center; }
.fb-alias { font: 800 clamp(2rem, 5vw, 4rem)/1.1 var(--font); margin: 0; color: #fff; }
.fb-chal { font-size: clamp(1.2rem, 2.5vw, 2rem); color: #FFD9D6; margin: .5rem 0 0; }
@keyframes fb-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fb-out { to { opacity: 0; } }

@media (max-width: 640px) {
  .sb-table th:last-child, .sb-table td:last-child { display: none; }
}
@media (max-width: 1000px) {
  .live-grid, .board-grid { grid-template-columns: 1fr; }
  .board-head { grid-template-columns: 1fr; }
  .ann-banner { grid-template-columns: 70px 1fr; }
  .ann-mascot img { max-height: 70px; }
}
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 1.25rem; }
.check-list .info .icon { color: var(--text-muted); }
