.word-shuffle-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.word-shuffle-title {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.word-shuffle-title h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.035em;
}

.word-shuffle-title p {
  margin: 6px 0 0;
  color: var(--shuffle-muted);
  font-size: clamp(13px, 1.5vw, 16px);
  font-weight: 850;
}

.word-shuffle-back,
.word-shuffle-restart {
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--shuffle-ink);
  padding: 12px 18px;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.word-shuffle-back:hover,
.word-shuffle-restart:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.16);
}

.word-shuffle-back--desktop {
  display: none;
}

.word-shuffle-hud {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1.15fr;
  gap: 11px;
  margin-bottom: 15px;
}

.word-shuffle-stat {
  position: relative;
  overflow: hidden;
  padding: 13px 15px;
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff, #eef7ff);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.word-shuffle-stat::after {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 3px;
  border-radius: 999px;
  background: rgba(0, 186, 255, 0.38);
}

.word-shuffle-stat span {
  display: block;
  color: var(--shuffle-muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.word-shuffle-stat strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(22px, 3.4vw, 32px);
  line-height: 1;
  font-weight: 950;
}

.word-shuffle-timer {
  --timer-color: var(--shuffle-blue);
  color: var(--timer-color);
  background: linear-gradient(145deg, #ffffff, #e6f8ff);
}

.word-shuffle-timer::after {
  background: var(--timer-color);
}

.word-shuffle-timer.is-warm {
  --timer-color: #f59e0b;
}

.word-shuffle-timer.is-hot {
  --timer-color: var(--shuffle-red);
  animation: wordShuffleUrgent 0.5s ease-in-out infinite alternate;
}

.word-shuffle-learn-card {
  grid-column: 1 / -1;
  overflow: hidden;
  max-height: 0;
  min-height: 0;
  margin: 0;
  padding: 0 18px;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff, #f2fff7);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.11);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.2s ease, padding 0.2s ease;
}

.word-shuffle-learn-card.is-visible {
  max-height: 260px;
  padding: 15px 18px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.word-shuffle-learn-card--tray {
  display: none;
}

.word-shuffle-learn-label {
  display: block;
  margin-bottom: 5px;
  color: var(--shuffle-green);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.word-shuffle-learn-card h3 {
  margin: 0;
  font-size: 27px;
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
}

.word-shuffle-learn-card p {
  margin: 7px 0 0;
  color: #166534;
  font-weight: 900;
}

.word-shuffle-learn-card em {
  display: block;
  margin-top: 8px;
  color: var(--shuffle-muted);
  font-style: normal;
  font-weight: 750;
}

.word-shuffle-next {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 16px;
  padding: 11px 14px;
  color: #fff;
  background: var(--shuffle-green);
  box-shadow: 0 12px 26px rgba(34, 197, 94, 0.24);
  font-weight: 950;
  cursor: pointer;
}

@media (max-width: 900px) {
  .word-shuffle-top {
    gap: 8px;
    margin-bottom: 7px;
  }

  .word-shuffle-logo {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    font-size: 23px;
  }

  .word-shuffle-title {
    gap: 9px;
  }

  .word-shuffle-title h2 {
    font-size: 22px;
    letter-spacing: -0.025em;
  }

  .word-shuffle-title p {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.15;
  }

  .word-shuffle-back {
    padding: 8px 11px;
    font-size: 12px;
  }

  .word-shuffle-hud {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 7px;
  }

  .word-shuffle-stat {
    padding: 7px 7px;
    border-radius: 14px;
  }

  .word-shuffle-stat::after {
    left: 8px;
    right: 8px;
    height: 2px;
  }

  .word-shuffle-stat span {
    font-size: 8px;
    letter-spacing: 0.04em;
  }

  .word-shuffle-stat strong {
    margin-top: 2px;
    font-size: 17px;
  }

  .word-shuffle-timer strong {
    font-size: 24px;
  }

  .word-shuffle-learn-card--hud {
    display: none;
  }

  .word-shuffle-learn-card--tray {
    position: absolute;
    inset: 12px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-height: none;
    margin: 0;
    padding: 0 16px;
    text-align: center;
  }

  .word-shuffle-learn-card--tray.is-visible {
    max-height: none;
    padding: 14px 16px;
  }

  .word-shuffle-learn-card h3 {
    font-size: 24px;
  }

  .word-shuffle-learn-card p {
    margin-top: 5px;
  }

  .word-shuffle-learn-card em {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.25;
  }

  .word-shuffle-next {
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 14px;
  }
}

@media (min-width: 901px) {
  .word-shuffle-top {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    width: 100%;
    align-items: flex-start;
    margin-bottom: 0;
  }

  .word-shuffle-title {
    align-items: flex-start;
    width: 100%;
  }

  .word-shuffle-title h2 {
    max-width: none;
    white-space: nowrap;
    font-size: clamp(26px, 1.7vw, 34px);
    line-height: 0.98;
  }

  .word-shuffle-title p {
    max-width: none;
    width: 100%;
    font-size: 13px;
    line-height: 1.25;
  }

  .word-shuffle-back--top {
    display: none;
  }

  .word-shuffle-back--desktop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: clamp(14px, 1.3vw, 22px);
    bottom: clamp(14px, 1.3vw, 22px);
    z-index: 3;
    padding: 11px 16px;
    width: auto;
    min-width: 92px;
    max-width: calc(clamp(360px, 24vw, 430px) - 44px);
    border-radius: 999px;
  }

  .word-shuffle-hud {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 11px;
    min-height: 0;
    margin: 0;
    align-self: start;
  }

  .word-shuffle-stat {
    padding: 12px 14px;
    border-radius: 18px;
  }

  .word-shuffle-stat strong {
    font-size: clamp(28px, 2.4vw, 40px);
  }

  .word-shuffle-timer {
    order: -1;
  }

  .word-shuffle-timer strong {
    font-size: clamp(40px, 3.8vw, 64px);
  }

  .word-shuffle-learn-card {
    min-height: 0;
    margin: 0;
    padding-left: 15px;
    padding-right: 15px;
  }

  .word-shuffle-learn-card.is-visible {
    padding-top: 15px;
    padding-bottom: 15px;
  }

  .word-shuffle-learn-card h3 {
    font-size: clamp(22px, 1.6vw, 28px);
  }
}
