.word-shuffle-stage {
  position: relative;
  border-radius: 34px;
  background:
    linear-gradient(145deg, #123247, #1e5e78 55%, #0f3448),
    radial-gradient(circle at 22% 14%, rgba(255, 255, 255, 0.14), transparent 32%);
  box-shadow:
    0 26px 60px rgba(15, 23, 42, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 -10px 0 rgba(0, 0, 0, 0.12);
  padding: clamp(14px, 2vw, 20px);
}

.word-shuffle-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #dff7ff;
}

.word-shuffle-stage-kicker {
  color: rgba(223, 247, 255, 0.72);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.word-shuffle-stage-name {
  margin-top: 3px;
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 950;
}

.word-shuffle-stage-tag {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  color: #07314a;
  background: #93f5ff;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.11);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.word-shuffle-slots {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(7px, 1.1vw, 10px);
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 26px;
  background: rgba(0, 21, 35, 0.22);
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, 0.12);
}

.word-shuffle-slot {
  width: clamp(42px, 6.8vw, 64px);
  height: clamp(50px, 7.5vw, 72px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #d8eff9);
  color: #123247;
  font-size: clamp(24px, 4vw, 37px);
  font-weight: 950;
  box-shadow:
    inset 0 0 0 3px rgba(147, 245, 255, 0.56),
    inset 0 -6px 0 rgba(15, 23, 42, 0.07),
    0 11px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.word-shuffle-slot.is-filled {
  background: linear-gradient(180deg, #ffffff, #d8eff9);
  box-shadow:
    inset 0 0 0 3px rgba(147, 245, 255, 0.7),
    inset 0 -6px 0 rgba(15, 23, 42, 0.07),
    0 11px 20px rgba(0, 0, 0, 0.18);
  animation: wordShuffleSnap 0.24s ease;
}

.word-shuffle-stage.is-solved .word-shuffle-slot.is-filled {
  background: linear-gradient(180deg, #dcfce7, #86efac);
  box-shadow:
    inset 0 0 0 3px rgba(34, 197, 94, 0.72),
    inset 0 -6px 0 rgba(21, 128, 61, 0.18),
    0 14px 28px rgba(34, 197, 94, 0.24);
}

.word-shuffle-slot.is-magnetic {
  transform: scale(1.07) translateY(-2px);
  box-shadow:
    inset 0 0 0 4px rgba(0, 186, 255, 0.8),
    0 0 0 5px rgba(0, 186, 255, 0.22),
    0 18px 34px rgba(0, 186, 255, 0.22);
}

.word-shuffle-slot.is-wrong {
  background: linear-gradient(180deg, #fee2e2, #fca5a5);
  box-shadow:
    inset 0 0 0 3px rgba(239, 68, 68, 0.72),
    0 14px 28px rgba(239, 68, 68, 0.24);
  animation: wordShuffleSlotWrong 0.36s ease;
}

.word-shuffle-table {
  position: relative;
  z-index: 1;
  min-height: clamp(330px, 43vh, 430px);
  border-radius: 30px;
  overflow: hidden;
  touch-action: none;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.16), transparent 24%),
    radial-gradient(circle at 82% 78%, rgba(255, 255, 255, 0.11), transparent 28%),
    linear-gradient(145deg, #75d7f7 0%, #32b6e1 42%, #1593c7 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    inset 0 -12px 0 rgba(0, 0, 0, 0.08);
}

.word-shuffle-table::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 24px;
  pointer-events: none;
  border: 2px dashed rgba(255, 255, 255, 0.22);
}

@media (max-width: 900px) {
  .word-shuffle-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 8px;
    border-radius: 22px;
  }

  .word-shuffle-stage-head {
    align-items: center;
    margin-bottom: 5px;
  }

  .word-shuffle-stage-kicker {
    display: none;
  }

  .word-shuffle-stage-name {
    margin-top: 0;
    font-size: 15px;
  }

  .word-shuffle-stage-tag {
    display: none;
  }

  .word-shuffle-slots {
    flex: 0 0 auto;
    gap: 5px;
    padding: 6px;
    margin-bottom: 7px;
    border-radius: 18px;
  }

  .word-shuffle-slot {
    width: clamp(32px, 10vw, 48px);
    height: clamp(38px, 11vw, 54px);
    border-radius: 14px;
  }

  .word-shuffle-table {
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 20px;
  }

  .word-shuffle-table::before {
    inset: 10px;
    border-radius: 17px;
  }

  .word-shuffle-stage.is-solved .word-shuffle-table .word-shuffle-letter {
    opacity: 0;
    pointer-events: none;
  }
}

@media (min-width: 901px) {
  .word-shuffle-stage {
    grid-column: 2;
    grid-row: 1 / 4;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: clamp(16px, 1.35vw, 24px);
    overflow: visible;
  }

  .word-shuffle-stage-head {
    flex: 0 0 auto;
    margin-bottom: clamp(10px, 1vw, 16px);
  }

  .word-shuffle-stage-kicker {
    font-size: 12px;
  }

  .word-shuffle-stage-name {
    font-size: clamp(20px, 1.6vw, 30px);
  }

  .word-shuffle-stage-tag {
    padding: 10px 15px;
    font-size: 13px;
  }

  .word-shuffle-slots {
    flex: 0 0 auto;
    gap: clamp(8px, 0.75vw, 13px);
    padding: clamp(10px, 1vw, 16px);
    margin-bottom: clamp(12px, 1vw, 18px);
  }

  .word-shuffle-slot {
    width: clamp(48px, 4.2vw, 78px);
    height: clamp(56px, 4.8vw, 86px);
    font-size: clamp(28px, 2.9vw, 48px);
  }

  .word-shuffle-table {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }
}
