:root {
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  background: #1c1c1c;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(rgb(0 0 0 / 48%), rgb(0 0 0 / 62%)),
    url("../../../assets/images/juegos/juego-1/bck.webp") center / cover fixed;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.game-shell {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.game-card {
  width: min(100%, 780px);
  padding: clamp(1.25rem, 4vw, 2.75rem);
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 1.5rem;
  background: rgb(25 25 25 / 88%);
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 45%);
  backdrop-filter: blur(4px);
}

.game-header {
  margin-bottom: 1.75rem;
  text-align: center;
}

.brand {
  margin: 0 0 1.5rem;
  color: #f5f5f5;
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  line-height: 1;
}

.eyebrow {
  margin: 0 0 0.3rem;
  color: #5da9ff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.35rem;
  color: #f5f5f5;
  font-size: 1.25rem;
  line-height: 1.2;
}

h2 {
  margin-bottom: 1.25rem;
  font-size: 1.35rem;
}

.setup-panel {
  max-width: 440px;
  margin: 0 auto;
}

form label,
legend {
  display: block;
  margin-bottom: 0.5rem;
  color: #bdbdbd;
  font-size: 0.95rem;
  font-weight: 700;
}

input[type="text"] {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid #4a4a4a;
  border-radius: 0.65rem;
  color: #f5f5f5;
  background: #1c1c1c;
}

input[type="text"]:focus {
  border-color: #1877f2;
  outline: 3px solid rgb(24 119 242 / 25%);
}

fieldset {
  margin: 1.5rem 0;
  padding: 0;
  border: 0;
}

.difficulty-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.difficulty-option {
  display: block;
  margin: 0;
  cursor: pointer;
}

.difficulty-option input {
  position: absolute;
  opacity: 0;
}

.difficulty-option span {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.7rem;
  border: 1px solid #4a4a4a;
  border-radius: 0.75rem;
  background: #252525;
  text-align: center;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.difficulty-option strong {
  font-size: 1rem;
}

.difficulty-option small {
  color: #a9a9a9;
  font-size: 0.75rem;
}

.difficulty-option input:checked + span,
.difficulty-option input:focus-visible + span {
  border-color: #1877f2;
  background: rgb(24 119 242 / 25%);
  box-shadow: 0 0 0 2px rgb(24 119 242 / 20%);
  transform: translateY(-2px);
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0.7rem 1.3rem;
  border: 0;
  border-radius: 0.65rem;
  font-weight: 700;
  transition: filter 150ms ease, transform 150ms ease;
}

.primary-button {
  color: #fff;
  background: #1877f2;
}

.setup-panel .primary-button {
  width: 100%;
}

.primary-button:hover,
.secondary-button:hover,
.primary-button:focus-visible,
.secondary-button:focus-visible {
  filter: brightness(1.12);
  outline: 2px solid #fff;
  outline-offset: 2px;
  transform: translateY(-2px);
}

.secondary-button {
  display: block;
  margin: 1.5rem auto 0;
  color: #fff;
  background: rgb(255 255 255 / 14%);
}

.game-info {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.player-display {
  margin-bottom: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.progress-box {
  width: 180px;
  color: #ffe6d4;
  font-size: 0.85rem;
  text-align: right;
}

.progress-track {
  height: 8px;
  margin-top: 0.4rem;
  overflow: hidden;
  border-radius: 1rem;
  background: rgb(255 255 255 / 18%);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #ffc178;
  transition: width 200ms ease;
}

.board-wrap {
  display: flex;
  justify-content: center;
  padding: 0.25rem;
}

.letter-grid {
  display: grid;
  width: min(100%, 560px);
  aspect-ratio: 1;
  gap: 3px;
  padding: 5px;
  border: 3px solid #1877f2;
  border-radius: 0.65rem;
  background: #6f301b;
  box-shadow: 0 0.75rem 1.5rem rgb(0 0 0 / 25%);
  touch-action: none;
  user-select: none;
}

.letter-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 0.2rem;
  color: #32170d;
  background: #fff4e9;
  font-size: clamp(0.7rem, 2.7vw, 1.25rem);
  font-weight: 800;
  transition: background 100ms ease, color 100ms ease;
}

.letter-cell.is-selected {
  color: #fff;
  background: #1877f2;
}

.letter-cell.is-found {
  color: #fff;
  background: #5b9b64;
}

.guess-form {
  margin-top: 1.25rem;
}

.guess-controls {
  display: flex;
  gap: 0.6rem;
}

.guess-controls input {
  flex: 1;
}

.feedback {
  min-height: 1.25rem;
  margin: 0.55rem 0 0;
  color: #ffc178;
  font-size: 0.85rem;
}

.word-list-area {
  margin-top: 0.5rem;
}

.word-list-area h2 {
  margin-bottom: 0.65rem;
  font-size: 1.1rem;
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.word-list li {
  color: #d7d7d7;
  font-size: 0.9rem;
}

.word-list li.is-found {
  color: #5da9ff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.success-panel {
  padding: 1rem 0 0.5rem;
  text-align: center;
}

.success-icon {
  margin-bottom: 0.5rem;
  color: #ffc178;
  font-size: 3rem;
}

.success-panel h2 {
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
}

.success-panel p:not(.success-icon) {
  color: #f4dfd1;
}

@media (max-width: 560px) {
  .game-shell {
    padding: 0.65rem;
  }

  .game-card {
    padding: 1.2rem 0.9rem;
    border-radius: 1rem;
  }

  .difficulty-options {
    grid-template-columns: 1fr;
  }

  .difficulty-option span {
    min-height: 58px;
    flex-direction: row;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    text-align: left;
  }

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

  .progress-box {
    width: 100%;
    text-align: left;
  }

}
