:root {
  --fondo: #14161a;
  --panel: #22262e;
  --texto: #f2f2f2;
  --suave: #b9bec8;
  --acento: #ffd166;
  --radio: 0.75rem;
  --toque: 2.75rem;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--fondo);
  color: var(--texto);
}
a {
  color: var(--acento);
}
button,
select,
input:not([type='checkbox']) {
  min-height: var(--toque);
  padding: 0 1rem;
  font: inherit;
  color: inherit;
  background: var(--panel);
  border: 1px solid #5a6170;
  border-radius: var(--radio);
}
button {
  background: var(--acento);
  border-color: var(--acento);
  color: var(--fondo);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}
button.suave {
  background: transparent;
  border-color: #5a6170;
  color: var(--texto);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
:where(a, button, label):active {
  opacity: 0.75;
}
:focus-visible,
label:has(:focus-visible) {
  outline: 3px solid #7ab4e6;
  outline-offset: 2px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #333;
}
nav {
  display: flex;
  gap: 1rem;
}
nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--toque);
}
nav a[aria-current='page'] {
  font-weight: 700;
}
main {
  padding: 1rem 1rem 2rem;
}
h1 {
  font-size: 1.4rem;
}
.entrar {
  max-width: 22rem;
  margin: 4rem auto;
}
.entrar form,
.entrar label {
  display: grid;
  gap: 0.75rem;
}
.error {
  color: #ff9a90;
  font-weight: 600;
}
.filtro {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rejilla li {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}
.rejilla label {
  position: relative;
  display: block;
  overflow: hidden;
  border: 4px solid transparent;
  border-radius: var(--radio);
  cursor: pointer;
}
.rejilla label:has(:checked) {
  border-color: var(--acento);
}
.rejilla input {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  accent-color: var(--acento);
}
.rejilla img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  background: #000;
  border-radius: calc(var(--radio) - 4px);
}
.rejilla a {
  font-size: 0.85rem;
}
.guardar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
  margin: 1rem -1rem -2rem;
  padding: 0.75rem 1rem;
  background: var(--fondo);
  border-top: 1px solid #333;
}
.guardar p {
  align-self: center;
  margin: 0;
  color: var(--suave);
}
.guardar label {
  display: grid;
  flex: 1 1 10rem;
  gap: 0.25rem;
}
dialog {
  max-width: 96vw;
  max-height: 94vh;
  padding: 0.75rem;
  color: inherit;
  background: var(--fondo);
  border: 1px solid #444;
  border-radius: var(--radio);
}
dialog::backdrop {
  background: #000c;
}
dialog img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  margin-top: 0.75rem;
}
.oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 40rem) {
  .rejilla {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .guardar p {
    flex-basis: 100%;
  }
}

details summary {
  display: flex;
  align-items: center;
  min-height: var(--toque);
  cursor: pointer;
}
