.alphabet-page {
  padding: 18px 0 20px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
}

.alphabet-page .container {
  width: min(100% - 48px, 1180px);
}

.alphabet-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: #65708b;
  font-size: 0.72rem;
  font-weight: 800;
}

.alphabet-breadcrumbs a {
  color: #586783;
  text-decoration: none;
}

.alphabet-breadcrumbs > span {
  width: 6px;
  height: 6px;
  border-top: 2px solid #a7b3c8;
  border-right: 2px solid #a7b3c8;
  transform: rotate(45deg);
}

.alphabet-game-top {
  display: grid;
  grid-template-columns: 160px 1fr 260px;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.alphabet-title {
  text-align: center;
}

.alphabet-title h1 {
  margin: 0 0 6px;
  color: #101936;
  font-family: "Fredoka", "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.alphabet-title p {
  margin: 0;
  color: #394563;
  font-size: 0.9rem;
  font-weight: 800;
}

.alphabet-back,
.exit-btn,
.sound-btn,
.random-letter-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #dfe8f5;
  border-radius: 10px;
  background: #fff;
  color: #101936;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(8, 42, 96, 0.06);
}

.alphabet-back {
  width: 92px;
}

.alphabet-back svg,
.exit-btn svg,
.sound-btn svg,
.random-letter-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alphabet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

.sound-btn {
  width: 42px;
  padding: 0;
  border-color: #146cf2;
  background: #146cf2;
  color: #fff;
}

.exit-btn {
  padding: 0 22px;
  border-color: #f04d70;
  background: #f04d70;
  color: #fff;
}

.alphabet-layout {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr) 164px;
  gap: 18px;
  align-items: start;
}

.alphabet-stats,
.letters-panel {
  display: grid;
  gap: 10px;
}

.stat-card,
.letters-panel {
  border: 1px solid #d9c9ff;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbf9ff, #ffffff);
  box-shadow: 0 10px 24px rgba(68, 34, 140, 0.07);
}

.stat-card {
  padding: 14px;
}

.stat-card h2,
.letters-panel h2 {
  margin: 0 0 12px;
  color: #6c36dc;
  font-size: 0.84rem;
  font-weight: 900;
}

.stat-card p {
  margin: 0;
  color: #101936;
  font-size: 0.74rem;
  font-weight: 900;
}

.stat-progress {
  height: 16px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e3dff0;
}

.stat-progress span {
  display: block;
  width: 7%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22b95b, #44c86d);
}

.stat-big {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.35rem !important;
}

.stat-big span {
  color: #ffbf17;
}

.goal-letter {
  min-width: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  margin-left: 5px;
  border-radius: 8px;
  background: #7b4ce1;
  color: #fff;
}

.alphabet-main {
  min-width: 0;
}

.alphabet-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #dfe8f5;
  border-radius: 12px;
  background: #4bc7ff;
  box-shadow: 0 14px 30px rgba(8, 42, 96, 0.08);
}

.alphabet-game-shell,
.embedded-phaser-game {
  display: block;
  width: 100%;
  aspect-ratio: 1536 / 1024;
  background: #4bc7ff;
}

.alphabet-game-shell {
  position: relative;
  overflow: hidden;
}

.alphabet-game-shell canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.game-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #39c3ff 0%, #b8f0ff 50%, #8de05f 100%);
  color: #12346f;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.game-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.game-loading-card {
  width: min(420px, 90%);
  text-align: center;
  padding: 30px 28px;
  border: 2px solid rgba(255, 246, 214, 0.35);
  border-radius: 24px;
  background: rgba(8, 40, 32, 0.5);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
}

.game-loading-stars {
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: #ffdb54;
  color: #4b3b00;
  font-weight: 900;
}

.game-loading-title {
  margin-bottom: 18px;
  font-size: 1.2rem;
  font-weight: 900;
}

.game-loading-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 246, 214, 0.22);
}

.game-loading-bar {
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffdb54, #fff6d6);
  transition: width 0.25s ease;
}

.game-loading-text {
  margin-top: 12px;
  color: rgba(255, 246, 214, 0.84);
  font-size: 0.9rem;
}

.letters-panel {
  padding: 16px 14px;
}

.letters-panel h2 {
  color: #101936;
  text-align: center;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.letter-grid span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #dfe8f5;
  border-radius: 50%;
  background: #fff;
  color: #101936;
  font-size: 0.78rem;
  font-weight: 900;
}

.letter-grid span.done {
  background: #7b4ce1;
  color: #fff;
}

.letter-grid span.current {
  box-shadow: 0 0 0 4px rgba(123, 76, 225, 0.16);
  transform: translateY(-1px);
}

.random-letter-btn {
  width: 100%;
  margin-top: 12px;
  border-color: #7b4ce1;
  color: #6c36dc;
  box-shadow: none;
}

.alphabet-page .skill-highlights {
  padding-top: 18px;
}

@media screen and (max-width: 1120px) {
  .alphabet-game-top,
  .alphabet-layout {
    grid-template-columns: 1fr;
  }

  .alphabet-actions,
  .alphabet-back {
    justify-self: center;
  }

  .alphabet-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .letter-grid {
    grid-template-columns: repeat(9, 1fr);
  }
}

@media screen and (max-width: 760px) {
  .alphabet-page .container {
    width: min(100% - 24px, 1180px);
  }

  .alphabet-stats {
    grid-template-columns: 1fr 1fr;
  }

  .alphabet-actions {
    flex-wrap: wrap;
  }

  .letter-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
