.game-over-screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: clamp(12px, 1.8vh, 20px);
  padding: max(18px, env(safe-area-inset-top)) var(--mobile-shell-gutter) max(24px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  text-align: center;
  background: transparent;
}

.game-over__pending {
  min-height: 70vh;
  width: min(100%, 480px);
  margin: auto;
  padding: 24px;
  gap: 20px;
}

.game-over__pending .game-over__title {
  white-space: normal;
}

.game-over__pending .btn {
  width: 100%;
}

.game-over__hud {
  width: var(--mobile-panel-width);
}

.game-over__home {
  background: var(--surface-icon);
}

.game-over__title {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-heading);
  font-size: clamp(24px, 6.4vw, 42px);
  font-weight: 900;
  line-height: 1;
  color: #ffe15c;
  -webkit-text-stroke: 1.5px #d64e25;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 #ff8b33, 0 10px 18px rgba(55, 72, 104, .2);
}

.game-over__score-card {
  position: relative;
  z-index: 1;
  width: var(--mobile-panel-width);
  min-height: clamp(158px, 23vh, 212px);
  display: grid;
  align-content: center;
  padding: clamp(22px, 4vh, 32px) 20px clamp(26px, 4.4vh, 36px);
  border-radius: var(--radius-panel);
  background: var(--surface-panel);
  border: var(--surface-border);
  box-shadow: var(--shadow-game-panel);
}

.game-over__score-label {
  font-family: var(--font-heading);
  font-weight: 900;
  color: #526079;
  text-transform: uppercase;
  font-size: 13px;
}

.game-over__score-value {
  margin-top: 8px;
  font-family: var(--font-heading);
  font-size: clamp(82px, 24vw, 126px);
  font-weight: 900;
  line-height: .88;
  color: #21314a;
}

.game-over__stats {
  position: relative;
  z-index: 1;
  width: var(--mobile-panel-width);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.game-over__stat {
  min-width: 0;
  min-height: 72px;
  display: grid;
  align-content: center;
  padding: 14px 8px;
  border-radius: var(--radius-control);
  background: var(--surface-card);
  box-shadow: var(--surface-inset);
}

.game-over__stat-value {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 900;
  color: #21314a;
  line-height: 1;
}

.game-over__stat-label {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #617089;
  text-transform: uppercase;
}

.game-over__rewards {
  position: relative;
  z-index: 1;
  width: var(--mobile-panel-width);
}

.game-over__rewards-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.game-over__reward {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  box-shadow: inset 0 -3px 0 rgba(36, 51, 70, .08);
  color: #21314a;
  font-family: var(--font-heading);
  font-weight: 900;
}

.game-over__reward-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.game-over__reward-icon .app-icon {
  width: 12px;
  height: 12px;
  color: rgba(33, 49, 74, .68);
}

.game-over__reward-icon--coin {
  background: linear-gradient(135deg, #ffd96b, #f79a2e);
  box-shadow: inset 0 -2px 0 rgba(146, 84, 20, .22);
}

.game-over__reward-icon--xp {
  background: linear-gradient(135deg, #2dc6a1, #1b9bd7);
}

.game-over__reward-icon--difficulty {
  background: linear-gradient(135deg, #b78ef7, #7a4fd0);
  color: #fff;
  font-weight: 900;
}

.game-over__level-up,
.game-over__achievements {
  position: relative;
  z-index: 1;
  width: var(--mobile-panel-width);
  padding: 12px;
  border-radius: var(--radius-control);
  background: var(--surface-card);
  box-shadow: var(--surface-inset);
}

.game-over__level-up-icon,
.game-over__achievement-icon {
  display: none;
}

.game-over__level-up-text,
.game-over__achievements-title,
.game-over__achievement-name {
  font-family: var(--font-heading);
  font-weight: 900;
  color: #21314a;
}

.game-over__achievements-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.game-over__achievement-card {
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: rgba(255, 245, 195, .9);
}

.game-over__actions {
  position: relative;
  z-index: 1;
  width: min(100%, calc(var(--mobile-content-width) - clamp(0rem, 2vw, .75rem)));
}

.game-over__play-again {
  width: 100%;
  min-height: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--radius-control);
  background: var(--gradient-action);
  color: white;
  box-shadow:
    inset 0 5px 0 rgba(255,255,255,.42),
    inset 0 -7px 0 rgba(124, 27, 44, .28),
    0 10px 0 #b9a37f,
    0 19px 24px rgba(44, 50, 78, .28);
  border: 3px solid rgba(255,255,255,.82);
  font-family: var(--font-heading);
  font-size: clamp(24px, 6vw, 31px);
  font-weight: 900;
}

.game-over__play-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: transparent;
  box-shadow: none;
}

.game-over__play-icon .app-icon {
  width: 26px;
  height: 26px;
  color: #fff;
}

.game-over__secondary-actions {
  position: relative;
  z-index: 1;
  width: min(100%, calc(var(--mobile-content-width) - clamp(0rem, 2vw, .75rem)));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.game-over__secondary-btn {
  position: relative;
  min-width: 0;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  background: rgba(255,255,255,.82);
  color: #314564;
  border: 2px solid rgba(255,255,255,.72);
  font-family: var(--font-heading);
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 900;
  box-shadow: 0 9px 18px rgba(43, 61, 91, .14), inset 0 -3px 0 rgba(36, 51, 70, .08);
}

.game-over__secondary-icon {
  position: relative;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
}

.game-over__secondary-icon .app-icon {
  width: 22px;
  height: 22px;
  color: currentColor;
}

.confetti-piece {
  position: fixed;
  top: -10px;
  z-index: var(--z-toast);
  animation: confettiFall 3s ease-in forwards;
  pointer-events: none;
}

@media (min-width: 640px) {
  .game-over-screen {
    gap: clamp(16px, 2dvh, 24px);
    padding: clamp(22px, 3dvh, 34px) var(--mobile-shell-gutter) clamp(28px, 4dvh, 44px);
  }

  .game-over__score-card,
  .game-over__stats,
  .game-over__rewards,
  .game-over__level-up,
  .game-over__achievements {
    width: var(--mobile-panel-width);
  }

  .game-over__score-card {
    min-height: clamp(190px, 25dvh, 260px);
  }

  .game-over__actions,
  .game-over__secondary-actions {
    width: min(100%, calc(var(--mobile-content-width) - clamp(0rem, 2vw, .75rem)));
  }
}
