* {
  box-sizing: border-box;
  border: none;
}

html {
  font-family: sans-serif;
  font-size: 13px;
}

body {
  margin: 0;
  background: #e5e5e5;
  color: black;
}

::selection {
  background-color: black;
  color: white;
}

::-moz-selection {
  background-color: black;
  color: white;
}

/* ==================== NAVEGACIÓN ==================== */
nav {
  position: fixed;
  display: flex;
  width: 100%;
  justify-content: space-between;
  top: 0;
  padding: 8px 16px;
  background-color: white;
  z-index: 6;
  color: black;
}

.title {
  color: black;
}

.item-wrapper {
  display: flex;
  align-items: center;
}

li {
  list-style: none;
  margin-left: 1rem;
}

a {
  text-decoration: none;
  color: #a4a4a4;
  font-size: 13px;
}

.menuButton {
  display: none;
  padding: 0;
}

.hidden-menu {
  position: fixed;
  flex-direction: column;
  align-content: flex-end;
  width: 100%;
  z-index: 5;
  transition: 1s;
  display: none;
  top: 34px;
}

.hidden-menu .item {
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-decoration: none;
  color: var(--darkgray);
  padding: 8px 16px;
  margin-bottom: 2px;
  background-color: white;
}
/* ==================== TÍTULO ==================== */
.title-img {
  width: 25%;
  margin: 50px 16px 24px 16px;
}

/* ==================== ARTÍCULO ==================== */
.article {
  position: relative;
  font-size: 13px;
  z-index: 1;
  margin: 16px;
  width: 60%;
  background: white;
}

h1 {
  font-size: 13px;
  font-weight: 400;
  padding: 8px 16px;
  background: white;
  border-bottom: 2px solid #e5e5e5;
  margin: 0;
}

p {
  padding: 8px 16px;
  margin: 0;
}

p.lede {
  padding: 0;
}

.minimize-button {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid #ccc;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 10px;
  background: white;
}

.minimize-button:hover {
  background: #f0f0f0;
}

/* ==================== PESTAÑA MINIMIZADA ==================== */
.article-tab {
  position: fixed;
  z-index: 10000;
  right: 96px;
  bottom: 16px;
  display: flex;
  color: black;
  background: #a4a4a4;
  padding: 8px;
  cursor: pointer;
}

.article-tab:hover {
  background: #8c8c8c;
}

.article-tab span {
  font-size: 14px;
  font-weight: 500;
}

@media (max-width: 1024px) {
  .item-wrapper {
    display: none;
  }

  .menuButton {
    display: block;
    border: none;
    cursor: pointer;
    background: none;
  }

  .article {
    display: none;
    width: 100%;
    background: white;
    position: absolute;
    top: 34px;
    margin: 0;
    z-index: 100;
  }

  .article-tab {
    display: none !important;
  }

}

/* ==================== JUEGO ==================== */
.layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.game-window {
  position: relative;
  margin: 16px;
  background: white;
  flex: 1;
  min-width: 280px;
}

@media (max-width: 1024px) {
  .layout {
    display: block;
  }
  .game-window {
    top: 34px;
    margin: 0;
    width: 100%;
  }
}

.game-body {
  padding: 8px 16px;
}

.lede {
  color: #a4a4a4;
  margin: 0 0 12px;
  line-height: 1.5;
}

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

.status strong {
  color: black;
  font-weight: 700;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

label.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a4a4a4;
  cursor: pointer;
  user-select: none;
}
label.check input {
  accent-color: black;
  width: 13px;
  height: 13px;
}

button {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid #ccc;
  background: white;
  color: black;
  padding: 6px 12px;
  cursor: pointer;
}
button:hover {
  background: #f0f0f0;
}
button:focus-visible,
.tile:focus-visible {
  outline: 2px solid black;
  outline-offset: 2px;
}
button.primary {
  background: black;
  border-color: black;
  color: white;
}
button.primary:hover {
  background: #333;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 480px) {
  .board {
    grid-template-columns: repeat(3, 1fr);
  }
}

.slot {
  position: relative;
  aspect-ratio: 3 / 2;
  background: #fafafa;
  border: 1px dashed #e5e5e5;
}

.tile {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: white;
  border: 1px solid #e5e5e5;
  cursor: pointer;
}
.tile.selected {
  border: 2px solid black;
}
.tile.correct {
  border-color: #a4a4a4;
}
.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile .badge {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  color: white;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.board:not(.show-numbers) .badge {
  display: none;
}

.stage-area {
  display: none;
}
.stage-area.visible {
  display: block;
}
.stage {
  width: 100%;
  aspect-ratio: 3/2;
  margin: 0 0 12px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
}
.stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  .tile,
  .slot {
    transition: none;
  }
}

@media (max-width: 1024px) {
  .item-wrapper {
    display: none;
  }

  .menuButton {
    display: block;
    border: none;
    cursor: pointer;
    background: none;
  }

  .title-img {
    width: 100%;
    margin: 50px 0 16px;
    padding: 0 16px;
  }

  .article {
    display: none;
    width: 100%;
    background: white;
    position: absolute;
    top: 34px;
    margin: 0;
    z-index: 100;
  }

  .article-tab {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .game-window {
    top: 34px;
    margin: 0;
    width: 100%;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls-right {
    width: 100%;
    justify-content: space-between;
  }

  .board {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}

.article-toggle-bar {
  display: none;
  position: relative;
  background: white;
}

@media (max-width: 1024px) {
  .article-toggle-bar {
    display: block;
    margin-top: 34px;
  }
}