/* PokéLocke Garden v16.17 · cross-page visual polish */

body.v1539-app-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.v1539-app-page > .v1539-topbar {
  flex: 0 0 auto;
}

body.v1539-app-page > main {
  flex: 1 0 auto;
}

body.v1539-app-page > .v1539-footer {
  margin-top: auto !important;
}

body.v11-page :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid #ffcb2f !important;
  outline-offset: 3px !important;
}

/* Rangliste: leere Kategorien bleiben klar lesbar und kompakt. */
body.v1607-leaderboard-page :is(.v1607-podium-empty, .v1607-podium-loading) {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 22px !important;
  border: 1px solid #8eb9d8 !important;
  border-radius: 15px;
  background: rgba(250, 253, 255, .92) !important;
  color: #315d80 !important;
  box-shadow: inset 0 1px 0 #fff, 0 8px 22px rgba(27, 84, 126, .06);
  font-weight: 800;
  text-align: center;
}

body.v1607-leaderboard-page .v1607-podium-empty::before {
  content: "◇";
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  height: 30px;
  border-radius: 10px;
  background: #e5f2fb;
  color: #176da2;
  font-size: 17px;
}

body.v1607-leaderboard-page .v11-board-empty {
  min-height: 118px;
  margin: 0 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 24px !important;
  border: 1px dashed #8eb9d8 !important;
  border-radius: 14px;
  background: rgba(250, 253, 255, .9) !important;
  color: #315d80 !important;
  font-weight: 800;
  text-align: center;
}

body.v1607-leaderboard-page .v11-board-empty::before {
  content: "—";
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  background: #dceefa;
  color: #176da2;
}

/* Community: dasselbe Trainer-Rang-System wie auf der Trainerkarte. */
.v1610-prestige-card > span.v1617-rank-badge {
  width: 66px !important;
  height: 66px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.v1610-prestige-card > span.v1617-rank-badge img {
  display: block;
  width: 66px;
  height: 66px;
  object-fit: contain;
  filter: drop-shadow(0 7px 7px rgba(22, 55, 85, .2));
}

/* Spielstände: ruhigere Hierarchie und klar gruppierte Zusammenfassung. */
body.v1539-theme-saves .v14-saves-shell {
  padding-top: 38px !important;
}

body.v1539-theme-saves .v14-page-head {
  align-items: center;
  margin-bottom: 18px;
}

body.v1539-theme-saves .v14-page-head h1 {
  margin: 10px 0 8px;
  font-size: clamp(40px, 4.2vw, 52px);
}

body.v1539-theme-saves .v14-page-head p {
  max-width: 720px;
  font-size: 13px;
}

body.v1539-theme-saves .v14-saves-summary {
  gap: 0 !important;
  margin-bottom: 18px;
  padding: 7px;
  border: 1px solid #bfd6e8;
  border-radius: 16px;
  background: rgba(255, 255, 255, .82) !important;
  box-shadow: 0 9px 24px rgba(23, 74, 114, .06);
}

body.v1539-theme-saves .v14-saves-summary span {
  flex: 1 1 150px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0;
  border: 0 !important;
  border-right: 1px solid #d9e7f2 !important;
  border-radius: 0 !important;
  background: transparent !important;
  text-align: center;
}

body.v1539-theme-saves .v14-saves-summary span:last-child {
  border-right: 0 !important;
}

/* Randomizer: keine unnötige leere Bühne unter dem eigentlichen Werkzeug. */
body.v11-randomizer-page .v11-engine-frame {
  height: clamp(500px, calc(100dvh - 300px), 590px) !important;
  min-height: 500px !important;
}

@media (max-width: 760px) {
  body.v1607-leaderboard-page :is(.v1607-podium-empty, .v1607-podium-loading) {
    min-height: 76px;
    padding: 15px !important;
  }

  .v1610-prestige-card > span.v1617-rank-badge,
  .v1610-prestige-card > span.v1617-rank-badge img {
    width: 58px !important;
    height: 58px !important;
  }

  body.v1539-theme-saves .v14-saves-shell {
    padding-top: 18px !important;
  }

  body.v1539-theme-saves .v14-page-head h1 {
    margin: 7px 0;
    font-size: 36px !important;
  }

  body.v1539-theme-saves .v14-saves-summary {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1px !important;
    padding: 6px;
    background: #d9e7f2 !important;
  }

  body.v1539-theme-saves .v14-saves-summary span {
    min-height: 44px;
    padding: 8px 5px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: rgba(255, 255, 255, .95) !important;
  }

  body.v1539-theme-saves .v14-saves-summary span:first-child {
    grid-column: 1 / -1;
    background: #f4f9fd !important;
  }

  body.v11-randomizer-page .v11-engine-frame {
    height: clamp(520px, calc(100dvh - 235px), 680px) !important;
    min-height: 520px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.v11-page *,
  body.v11-page *::before,
  body.v11-page *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
