:root {
  --bg-1: #fff7fb;
  --bg-2: #e8fff7;
  --bg-3: #fff4d8;
  --ink: #2f2637;
  --muted: #7d7187;
  --pink: #ff6ea8;
  --pink-dark: #e64b8a;
  --mint: #53dfb9;
  --yellow: #ffd76b;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --shadow: 0 10px 28px rgba(85, 49, 92, 0.08);
  --soft-border: rgba(255, 255, 255, 0.72);
}

* {
  box-sizing: border-box;
}

/* Browser-safe hidden state.
   Some themed cards use display:grid/flex, which can override the native hidden attribute.
   Keep auth/login/logout/profile blocks truly hidden until JS decides they should show. */
[hidden] {
  display: none !important;
}


html,
body {
  width: 100%;
  height: var(--app-height, 100svh);
  min-height: var(--app-height, 100svh);
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 170, 205, 0.55), transparent 26%),
    radial-gradient(circle at 88% 14%, rgba(108, 231, 197, 0.5), transparent 23%),
    radial-gradient(circle at 50% 100%, rgba(255, 216, 113, 0.48), transparent 32%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 52%, var(--bg-3));
  -webkit-font-smoothing: antialiased;
  touch-action: none;
  user-select: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: var(--app-height, 100svh);
  min-height: var(--app-height, 100svh);
  max-height: var(--app-height, 100svh);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(max(8px, env(safe-area-inset-top)) + 12px) 12px calc(max(10px, env(safe-area-inset-bottom)) + var(--browser-bottom-pad, 0px));
  isolation: isolate;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  filter: blur(4px);
  opacity: 0.82;
  pointer-events: none;
}

.app-shell::before {
  width: 180px;
  height: 180px;
  left: -74px;
  bottom: 11%;
  background: rgba(255, 110, 168, 0.2);
}

.app-shell::after {
  width: 210px;
  height: 210px;
  right: -82px;
  top: 22%;
  background: rgba(83, 223, 185, 0.2);
}

.hud {
  width: min(100%, 480px);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  z-index: 3;
}

.back-button,
.brand-pill,
.score-card,
.next-card {
  min-height: 60px;
  display: flex;
  align-items: center;
  border: 1px solid var(--soft-border);
  background: var(--glass);
  box-shadow: 0 8px 22px rgba(68, 41, 80, 0.07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.back-button {
  min-width: 64px;
  justify-content: center;
  gap: 0;
  padding: 7px;
  border-radius: 24px;
  color: var(--ink);
  position: relative;
  overflow: hidden;
}

.back-button::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 27%, rgba(255, 255, 255, 0.95), transparent 24%),
    linear-gradient(145deg, rgba(255, 105, 158, 0.34), rgba(255, 216, 113, 0.18) 48%, rgba(83, 223, 185, 0.26));
}

.back-button::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 13px;
  width: 13px;
  height: 8px;
  border-radius: 80% 20% 80% 20%;
  background: #59c96d;
  transform: rotate(24deg);
  opacity: .92;
}

.back-arrow {
  position: relative;
  z-index: 1;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #ff6ea8, #ff9d35);
  font-size: 25px;
  line-height: 1;
  font-weight: 1000;
  transform: translateX(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 6px 14px rgba(230,75,138,.22);
}

.back-button:active {
  transform: scale(0.985);
}

.brand-pill {
  gap: 8px;
  padding: 8px 10px;
  border-radius: 22px;
}

.brand-icon-only {
  justify-content: center;
  padding: 8px;
}

.brand-pill img {
  flex: 0 0 auto;

}

.brand-pill strong,
.score-card strong {
  display: block;
  line-height: 1;
}

.brand-pill strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-pill span,
.score-card span,
.next-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.score-card {
  justify-content: center;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 20px;
}

.score-card strong {
  margin-top: 2px;
  font-size: clamp(30px, 11vw, 44px);
  letter-spacing: -0.06em;
}

.next-card {
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 20px;
}

.next-card img {
  width: 34px;
  height: 34px;
  object-fit: contain;

}

.game-stage {
  position: relative;
  width: min(100%, 480px);
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 10px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.2)),
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.92), transparent 34%);
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.danger-label {
  position: absolute;
  left: 50%;
  top: 18.9%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 999px;
  color: rgba(218, 55, 96, 0.76);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(255, 99, 139, 0.22);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
  pointer-events: none;
  opacity: 0.86;
}

.screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(255, 245, 250, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.screen-overlay.is-visible {
  display: flex;
}

.panel {
  width: min(100%, 430px);
  max-height: min(calc(var(--app-height, 100svh) - 28px), 780px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72)),
    radial-gradient(circle at top left, rgba(255, 126, 178, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(83, 223, 185, 0.18), transparent 28%);
  box-shadow: 0 28px 90px rgba(73, 40, 87, 0.22);
}

.loading-panel,
.hero-panel {
  padding: 34px 24px 26px;
  text-align: center;
}

.hero-panel .primary-btn {
  margin-top: 12px;
}

.leave-panel {
  padding: 28px 22px 22px;
  text-align: center;
}

.leave-badge {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 110, 168, 0.18), rgba(83, 223, 185, 0.18));
  border: 1px solid rgba(255,255,255,.82);
  font-size: 28px;
}

.leave-panel .secondary-btn {
  margin-top: 10px;
}

.hero-wordmark,
.loading-wordmark {
  display: block;
  width: min(82vw, 330px);
  height: auto;
  margin: 0 auto 6px;
}

.panel h1,
.panel h2 {
  margin: 10px 0 4px;
  line-height: 0.96;
  letter-spacing: -0.08em;
}

.panel h1 {
  font-size: clamp(44px, 13vw, 68px);
}

.panel h2 {
  font-size: clamp(34px, 10vw, 48px);
}

.panel p {
  margin: 8px auto 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.primary-btn,
.secondary-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 18px;
  border-radius: 19px;
  font-weight: 1000;
  letter-spacing: -0.02em;
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  box-shadow: 0 16px 34px rgba(230, 75, 138, 0.28);
}

.secondary-btn {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 26px rgba(71, 46, 85, 0.12);
}

.primary-btn:active,
.secondary-btn:active {
  transform: scale(0.985);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.loader-bar {
  width: 100%;
  height: 10px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.loader-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--mint));
  animation: loaderMove 1.1s ease-in-out infinite alternate;
}

@keyframes loaderMove {
  from { transform: translateX(-18%); }
  to { transform: translateX(160%); }
}

.mini-leaderboard {
  margin-top: 18px;
  display: grid;
  gap: 7px;
}

.mini-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-weight: 900;
}

.mini-row span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
}


.mini-row em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-king {
  min-height: 62px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .76), rgba(255,255,255,.52)),
    radial-gradient(circle at 15% 20%, rgba(255, 216, 113, .32), transparent 36%);
}

.king-crown {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 216, 113, .44);
  font-size: 18px;
}

.game-over-panel {
  padding: 18px;
}

.game-over-head {
  text-align: center;
  padding: 10px 4px 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ff8abd, #ffb85f);
  font-size: 12px;
  font-weight: 1000;
  box-shadow: 0 10px 22px rgba(255, 105, 158, 0.24);
}

.leaderboard-box,
.submit-form {
  padding: 12px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.56);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.section-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.leaderboard-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 7px 10px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.leaderboard-row.is-empty {
  color: var(--muted);
}

.rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 216, 113, 0.36);
  font-weight: 1000;
  font-size: 13px;
}

.player-name {
  min-width: 0;
}

.player-name strong,
.player-name span {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player-name strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.player-name span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.player-score {
  font-weight: 1000;
  letter-spacing: -0.04em;
}


.leaderboard-toggle {
  width: 100%;
  min-height: 38px;
  margin-top: 9px;
  border-radius: 14px;
  color: var(--pink-dark);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 1000;
}

.play-again-cta {
  margin-top: 14px;
  box-shadow: 0 18px 40px rgba(230, 75, 138, 0.34);
}

.submit-form {
  display: none;
  margin-top: 12px;
}

.submit-form.is-visible {
  display: block;
}

.submit-form label {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.submit-form input {
  width: 100%;
  height: 48px;
  margin-top: 5px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.9);
  outline: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.submit-form input:focus {
  border-color: rgba(255, 110, 168, 0.58);
  box-shadow: 0 0 0 4px rgba(255, 110, 168, 0.12);
}

.form-message {
  min-height: 20px;
  font-size: 12px;
  font-weight: 900;
}

@media (min-width: 760px) {
  html,
  body {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .app-shell {
    width: min(440px, calc(100vw - 36px));
    height: min(840px, calc(var(--app-height, 100svh) - 36px));
    min-height: min(840px, calc(var(--app-height, 100svh) - 36px));
    max-height: min(840px, calc(var(--app-height, 100svh) - 36px));
    padding: 18px 14px;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: 0 22px 80px rgba(67, 42, 82, .16);
    background:
      radial-gradient(circle at 12% 18%, rgba(255, 170, 205, 0.38), transparent 28%),
      radial-gradient(circle at 88% 14%, rgba(108, 231, 197, 0.36), transparent 26%),
      linear-gradient(160deg, rgba(255,247,251,.88), rgba(232,255,247,.86) 52%, rgba(255,244,216,.88));
  }

  .hud,
  .game-stage {
    width: 100%;
    max-width: 412px;
  }

  .game-stage {
    max-height: none;
    border-radius: 30px;
  }

  .screen-overlay {
    position: absolute;
    inset: 0;
    border-radius: 34px;
  }
}

@media (max-width: 370px) {
  .hud {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
  }

  .back-button,
  .brand-pill,
  .score-card {
    min-height: 56px;
    border-radius: 20px;
  }

  .score-card strong {
    font-size: clamp(28px, 10vw, 40px);
  }

  .panel {
    border-radius: 28px;
  }
}


/* V12: mobile keyboard + desktop frame polish */
input {
  user-select: text;
  -webkit-user-select: text;
  font-size: 16px;
}

body.keyboard-open {
  touch-action: pan-y;
}

body.keyboard-open .screen-overlay.is-visible {
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(8px, env(safe-area-inset-top)) 14px 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.keyboard-open .game-over-panel {
  width: min(100%, 430px);
  max-height: none;
  overflow: visible;
  border-radius: 28px;
  padding: 14px;
  margin: 0 auto 12px;
}

body.keyboard-open .game-over-head {
  padding: 6px 4px 10px;
}

body.keyboard-open .leaderboard-box {
  max-height: 178px;
  overflow: auto;
}

body.keyboard-open .submit-form input {
  height: 46px;
}

body.keyboard-open .play-again-cta {
  margin-top: 10px;
}

@media (min-width: 760px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    height: 100%;
    overflow: auto;
    padding: 0;
  }

  body {
    min-height: 100vh;
    min-height: 100dvh;
    background:
      radial-gradient(circle at 20% 16%, rgba(255, 170, 205, 0.32), transparent 28%),
      radial-gradient(circle at 80% 18%, rgba(108, 231, 197, 0.28), transparent 26%),
      linear-gradient(160deg, #fff9fc, #f1fffb 54%, #fff7df);
  }

  .app-shell {
    width: min(390px, calc(100vw - 88px));
    height: min(760px, calc(100vh - 88px));
    height: min(760px, calc(100dvh - 88px));
    min-height: 620px;
    max-height: 760px;
    margin: auto;
    padding: 16px 13px;
    border-radius: 38px;
    flex: 0 0 auto;
    box-shadow: 0 30px 110px rgba(67, 42, 82, .18), inset 0 1px 0 rgba(255,255,255,.72);
    border: 1px solid rgba(255,255,255,.82);
  }

  .hud,
  .game-stage {
    width: 100%;
    max-width: none;
  }

  .hud {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
  }

  .back-button,
  .score-card {
    min-height: 56px;
  }

  .score-card strong {
    font-size: 40px;
  }

  .game-stage {
    margin-top: 10px;
    border-radius: 32px;
  }

  .panel {
    width: min(100%, 360px);
    max-height: calc(100% - 26px);
  }

  .hero-wordmark,
  .loading-wordmark {
    width: min(280px, 78vw);
  }
}

@media (min-width: 1120px) and (min-height: 780px) {
  .app-shell {
    width: 400px;
    height: 780px;
  }
}


/* V13: desktop performance frame + game-over actions */
.back-home-cta {
  margin-top: 10px;
  min-height: 48px;
  color: #7b617f;
  background: rgba(255, 255, 255, 0.78);
}

.auto-home-note {
  margin: 8px auto 0 !important;
  color: rgba(125, 113, 135, 0.72) !important;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

@media (min-width: 760px) {
  html,
  body {
    width: 100% !important;
    height: 100% !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
  }

  body {
    touch-action: auto !important;
    background:
      radial-gradient(circle at 18% 14%, rgba(255, 170, 205, 0.30), transparent 26%),
      radial-gradient(circle at 82% 18%, rgba(108, 231, 197, 0.28), transparent 25%),
      radial-gradient(circle at 50% 102%, rgba(255, 216, 113, 0.22), transparent 28%),
      linear-gradient(160deg, #fffafd 0%, #f4fffc 54%, #fff8e8 100%) !important;
  }

  .app-shell {
    width: clamp(370px, 31vw, 430px) !important;
    height: min(840px, calc(100dvh - 48px)) !important;
    min-height: min(720px, calc(100dvh - 48px)) !important;
    max-height: calc(100dvh - 48px) !important;
    margin: 0 !important;
    padding: 16px 14px !important;
    border-radius: 38px !important;
    overflow: hidden !important;
    flex: none !important;
    contain: layout paint style !important;
    transform: translateZ(0);
    box-shadow: 0 34px 110px rgba(67, 42, 82, 0.16), inset 0 1px 0 rgba(255,255,255,0.72) !important;
  }

  .hud {
    width: 100% !important;
    max-width: none !important;
    grid-template-columns: 58px minmax(0, 1fr) !important;
    gap: 10px !important;
    flex: 0 0 auto !important;
  }

  .game-stage {
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin-top: 10px !important;
    border-radius: 32px !important;
    contain: layout paint size !important;
    transform: translateZ(0);
  }

  #gameCanvas {
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  .screen-overlay {
    position: absolute !important;
    inset: 0 !important;
    border-radius: 38px !important;
    padding: 16px !important;
  }

  .panel {
    width: min(100%, 368px) !important;
    max-height: calc(100% - 24px) !important;
  }
}

@media (min-width: 760px) and (max-height: 760px) {
  .app-shell {
    height: calc(100dvh - 28px) !important;
    min-height: 0 !important;
    padding: 12px !important;
  }
  .hud { grid-template-columns: 54px minmax(0, 1fr) !important; }
  .back-button, .score-card { min-height: 52px !important; }
  .score-card strong { font-size: 34px !important; }
}


/* V14: Fruits Drop candy theme + desktop polish */
:root {
  --bg-1: #fff9fd;
  --bg-2: #f6fffe;
  --bg-3: #fff8ea;
  --ink: #392b48;
  --muted: #8a7d96;
  --pink: #ff6da9;
  --pink-dark: #ef418f;
  --orange: #ff9f2f;
  --yellow: #ffd84d;
  --lime: #b9ef3c;
  --violet: #9f67ff;
  --blue: #66d4ff;
  --mint: #67e6c6;
  --glass: rgba(255,255,255,0.74);
  --glass-strong: rgba(255,255,255,0.92);
  --soft-border: rgba(255,255,255,0.84);
  --shadow: 0 16px 40px rgba(104, 69, 118, 0.10);
}
html, body {
  background:
    radial-gradient(circle at 8% 14%, rgba(255, 109, 169, 0.20), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(102, 212, 255, 0.18), transparent 22%),
    radial-gradient(circle at 88% 78%, rgba(185, 239, 60, 0.14), transparent 18%),
    radial-gradient(circle at 16% 84%, rgba(255, 216, 77, 0.18), transparent 24%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 56%, var(--bg-3));
}
.app-shell::before { background: rgba(255, 109, 169, 0.16); }
.app-shell::after { background: rgba(102, 212, 255, 0.14); }
.hud { width: min(100%, 520px); grid-template-columns: 70px minmax(0, 1fr); }
.back-button, .score-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.68));
  border-color: rgba(255,255,255,.90);
  box-shadow: 0 12px 28px rgba(82, 53, 101, 0.08);
}
.back-button {
  min-width: 70px;
  border-radius: 26px;
}
.back-button::before {
  inset: 8px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.95), transparent 22%),
    linear-gradient(145deg, rgba(255, 111, 167, .30), rgba(255, 200, 72, .22) 45%, rgba(102, 212, 255, .20));
}
.back-arrow {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.44), 0 8px 18px rgba(255, 109, 169, .24);
}
.score-card {
  border-radius: 24px;
  padding: 10px 12px;
}
.score-card span {
  color: #8a6b96;
  letter-spacing: 0.15em;
  font-size: 12px;
}
.score-card strong { font-size: clamp(34px, 11vw, 48px); color: #392b48; }
.game-stage {
  width: min(100%, 520px);
  margin-top: 12px;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.68), rgba(255,255,255,.22)),
    radial-gradient(circle at 50% 7%, rgba(255,255,255,.98), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,.14));
  box-shadow: 0 18px 44px rgba(92, 60, 107, .10);
}
.danger-label {
  color: rgba(228, 74, 125, .85);
  background: rgba(255,255,255,.68);
  border-color: rgba(255, 121, 164, .26);
  font-size: 10px;
  letter-spacing: .18em;
}
.screen-overlay { background: rgba(255, 248, 251, 0.34); }
.panel {
  border-radius: 36px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.80)),
    radial-gradient(circle at top left, rgba(255, 109, 169, 0.13), transparent 28%),
    radial-gradient(circle at top right, rgba(102, 212, 255, 0.12), transparent 26%),
    radial-gradient(circle at bottom center, rgba(255, 216, 77, 0.10), transparent 30%);
  box-shadow: 0 28px 80px rgba(84, 53, 98, .18);
}
.loading-panel, .hero-panel {
  padding: 32px 22px 24px;
}
.hero-wordmark, .loading-wordmark {
  display: block;
  width: min(92vw, 520px);
  height: auto;
  margin: 0 auto 12px;
  filter: drop-shadow(0 10px 18px rgba(175, 101, 164, 0.12));
}
.hero-bubbles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 0;
}
.hero-bubbles span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.74));
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 8px 18px rgba(84, 53, 98, .08);
  color: #7d6a90;
  font-size: 12px;
  font-weight: 900;
}
.home-footnote {
  margin-top: 14px !important;
  color: #8f7f99 !important;
  font-size: 12px;
}
.primary-btn, .secondary-btn {
  border-radius: 22px;
  min-height: 56px;
}
.primary-btn {
  background: linear-gradient(135deg, var(--pink), var(--orange) 40%, var(--yellow));
  box-shadow: 0 16px 32px rgba(255, 110, 168, .24);
}
.secondary-btn {
  background: rgba(255,255,255,.82);
}
.loader-bar { background: rgba(255,255,255,.84); }
.loader-bar span { background: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow), var(--mint), var(--blue), var(--violet)); }
.mini-row {
  min-height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.84), rgba(255,255,255,.66));
  box-shadow: 0 10px 20px rgba(84,53,98,.06);
}
.king-crown {
  background: linear-gradient(135deg, rgba(255,215,74,.55), rgba(255,178,64,.28));
}
.badge {
  background: linear-gradient(135deg, var(--pink), var(--orange));
}
.leaderboard-box, .submit-form {
  border-radius: 26px;
  background: rgba(255,255,255,.64);
}
.leaderboard-row, .leaderboard-toggle, .submit-form input {
  background: rgba(255,255,255,.80);
}
.rank {
  background: linear-gradient(135deg, rgba(255, 214, 71, .42), rgba(255, 180, 92, .18));
}
.submit-form input:focus { border-color: rgba(255,109,169,.58); box-shadow: 0 0 0 4px rgba(255,109,169,.11); }
.back-home-cta {
  color: #7a6890;
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.68));
}
.leave-badge {
  background: linear-gradient(135deg, rgba(255,109,169,.16), rgba(102,212,255,.14), rgba(255,216,77,.18));
}
@media (min-width: 760px) {
  html, body {
    overflow: auto !important;
    display: block !important;
    min-height: 100dvh !important;
  }
  body {
    padding: 28px 0 !important;
    background:
      radial-gradient(circle at 18% 14%, rgba(255, 109, 169, 0.18), transparent 24%),
      radial-gradient(circle at 82% 18%, rgba(102, 212, 255, 0.16), transparent 22%),
      radial-gradient(circle at 50% 102%, rgba(255, 216, 77, 0.18), transparent 24%),
      linear-gradient(160deg, #fffafd 0%, #f7fffd 54%, #fff9ef 100%) !important;
  }
  .app-shell {
    width: min(520px, calc(100vw - 72px)) !important;
    height: min(900px, calc(100dvh - 56px)) !important;
    min-height: 760px !important;
    max-height: 900px !important;
    margin: 0 auto !important;
    padding: 18px 16px 16px !important;
    border-radius: 40px !important;
    background:
      radial-gradient(circle at 12% 18%, rgba(255, 109, 169, 0.18), transparent 28%),
      radial-gradient(circle at 88% 14%, rgba(102, 212, 255, 0.16), transparent 26%),
      radial-gradient(circle at 50% 100%, rgba(255, 216, 77, 0.15), transparent 28%),
      linear-gradient(160deg, rgba(255,250,253,.92), rgba(247,255,253,.92) 56%, rgba(255,249,239,.92));
    box-shadow: 0 28px 88px rgba(84, 53, 98, .14), inset 0 1px 0 rgba(255,255,255,.72) !important;
  }
  .hud, .game-stage { width: 100% !important; max-width: none !important; }
  .hud { grid-template-columns: 78px minmax(0, 1fr) !important; gap: 12px !important; }
  .back-button { min-width: 78px; min-height: 62px !important; }
  .score-card { min-height: 62px !important; }
  .score-card strong { font-size: 48px !important; }
  .game-stage {
    flex: 1 1 auto !important;
    min-height: 640px !important;
    border-radius: 36px !important;
  }
  .screen-overlay {
    position: absolute !important;
    inset: 0 !important;
    border-radius: 40px !important;
    padding: 20px !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
  }
  .panel {
    width: min(100%, 420px) !important;
    max-height: calc(100% - 12px) !important;
  }
  .hero-wordmark, .loading-wordmark { width: min(360px, 100%); }
}
@media (min-width: 1080px) {
  .app-shell { width: 540px !important; }
}


/* V15: transparent text logo + cleaner home UI */
.loading-wordmark,
.hero-wordmark {
  width: min(86vw, 420px) !important;
  max-width: 100%;
  object-fit: contain;
  background: transparent !important;
  filter: drop-shadow(0 8px 18px rgba(147, 96, 162, 0.10));
}
.loading-panel,
.hero-panel {
  padding-top: 28px !important;
}
.hero-panel .primary-btn {
  margin-top: 18px;
}
.hero-bubbles { display: none !important; }
.home-footnote {
  margin-top: 12px !important;
  font-size: 11px !important;
  opacity: .92;
}
.back-button {
  min-width: 72px !important;
  border-radius: 28px !important;
  box-shadow: 0 14px 26px rgba(94, 60, 112, 0.10) !important;
}
.back-button::before {
  inset: 7px !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,.96), transparent 22%),
    linear-gradient(145deg, rgba(255, 169, 203, .42), rgba(255, 209, 122, .28) 44%, rgba(116, 217, 60, .18) 72%, rgba(77, 199, 247, .16));
}
.back-button::after {
  width: 15px !important;
  height: 9px !important;
  right: 10px !important;
  top: 12px !important;
  background: linear-gradient(135deg, #9be44a, #61c857) !important;
  opacity: 1 !important;
}
.back-arrow {
  width: 44px !important;
  height: 44px !important;
  border-radius: 17px !important;
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  font-size: 28px !important;
  background: linear-gradient(135deg, #ff6da9, #ff9824 58%, #ffc839) !important;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.48), 0 8px 18px rgba(255,109,169,.28) !important;
}
.primary-btn {
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: -0.03em;
  font-weight: 1000;
  text-shadow: 0 1px 0 rgba(255,255,255,.18);
}
@media (max-width: 420px) {
  .primary-btn { font-size: 20px; }
}

/* V16: final Fruits Drop visual cleanup + safer mobile/desktop viewport framing */
html,
body,
.app-shell {
  overscroll-behavior: none;
}

.screen-overlay {
  height: var(--app-height, 100svh);
  min-height: var(--app-height, 100svh);
  padding: calc(max(12px, env(safe-area-inset-top)) + 6px) 16px calc(max(14px, env(safe-area-inset-bottom)) + var(--browser-bottom-pad, 0px) + 6px) !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.panel {
  scrollbar-width: thin;
}

.hero-panel,
.loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-wordmark,
.loading-wordmark {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  mix-blend-mode: normal;
}

.hero-panel #playButton {
  min-height: 62px;
  border-radius: 26px;
  font-size: clamp(20px, 5.4vw, 24px);
  line-height: 1;
}

.primary-btn,
.secondary-btn,
.leaderboard-toggle,
.back-button {
  -webkit-tap-highlight-color: transparent;
}

.primary-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.primary-btn::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 6px;
  height: 42%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0));
  pointer-events: none;
}

.primary-btn:hover,
.secondary-btn:hover,
.leaderboard-toggle:hover,
.back-button:hover {
  filter: saturate(1.04) brightness(1.01);
}

.mini-leaderboard {
  width: 100%;
}

.mini-king {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  padding: 12px;
  border-radius: 22px;
}

.home-footnote {
  user-select: text;
  -webkit-user-select: text;
}

@media (max-width: 759px) {
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hud,
  .game-stage {
    width: 100%;
    max-width: 520px;
  }

  .panel {
    width: min(100%, 430px);
  }

  .hero-wordmark,
  .loading-wordmark {
    width: min(88vw, 390px) !important;
    margin-bottom: 10px !important;
  }
}

@media (max-width: 759px) and (max-height: 740px) {
  .loading-panel,
  .hero-panel {
    padding: 22px 18px 18px !important;
  }

  .hero-wordmark,
  .loading-wordmark {
    width: min(78vw, 315px) !important;
    margin-bottom: 4px !important;
  }

  .hero-panel #playButton {
    min-height: 56px;
    margin-top: 12px;
  }

  .mini-leaderboard {
    margin-top: 12px;
  }

  .mini-row {
    min-height: 56px;
    padding: 9px 10px;
  }

  .home-footnote {
    margin-top: 8px !important;
  }
}

@media (min-width: 760px) {
  html,
  body {
    width: 100% !important;
    height: 100% !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
  }

  body {
    touch-action: auto !important;
  }

  .app-shell {
    width: clamp(390px, 38vw, 520px) !important;
    height: clamp(640px, calc(100dvh - 40px), 860px) !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 40px) !important;
    margin: 0 auto !important;
    padding: 16px 14px !important;
    border-radius: 40px !important;
  }

  .hud {
    grid-template-columns: 74px minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .back-button {
    min-width: 74px !important;
    min-height: 60px !important;
  }

  .score-card {
    min-height: 60px !important;
  }

  .game-stage {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-top: 12px !important;
  }

  .screen-overlay {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 40px !important;
    padding: 18px !important;
  }

  .panel {
    width: min(100%, 420px) !important;
    max-height: calc(100% - 12px) !important;
  }

  .hero-wordmark,
  .loading-wordmark {
    width: min(370px, 100%) !important;
  }
}

@media (min-width: 760px) and (max-height: 700px) {
  .app-shell {
    width: clamp(360px, 35vw, 470px) !important;
    height: calc(100dvh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    padding: 12px !important;
  }

  .hud {
    grid-template-columns: 64px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .back-button,
  .score-card {
    min-height: 54px !important;
  }

  .back-button {
    min-width: 64px !important;
  }

  .score-card strong {
    font-size: 38px !important;
  }
}


/* V17: final logo/home/form clarity cleanup */
.loading-panel,
.hero-panel {
  padding-top: 28px;
}

.hero-wordmark,
.loading-wordmark {
  width: min(94vw, 460px) !important;
  max-width: 100%;
  margin: 0 auto 14px;
  filter: drop-shadow(0 10px 18px rgba(175, 101, 164, 0.14));
}

.loading-panel .loader-bar {
  margin-top: 14px;
}

.home-footnote {
  margin-top: 12px !important;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #8b7b96 !important;
}

.mini-row {
  grid-template-columns: 40px minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: center;
}

.mini-copy {
  min-width: 0;
  display: block;
  text-align: left;
}

.mini-copy strong,
.mini-copy em {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-copy strong {
  font-size: 13px;
  line-height: 1.1;
}

.mini-copy em {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.mini-score {
  min-width: 64px;
  justify-self: end;
  text-align: center;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255,255,255,0.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
  color: #392b48;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.submit-form {
  background: rgba(255,255,255,0.84) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.submit-form input {
  background: #ffffff !important;
  color: #2f2637 !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 2px 8px rgba(77, 48, 92, 0.05) !important;
}

.submit-form input::placeholder {
  color: #94859f;
  opacity: 1;
}

.submit-form input,
.submit-form input::placeholder,
.submit-form label {
  -webkit-font-smoothing: antialiased;
}

.submit-form input:-webkit-autofill,
.submit-form input:-webkit-autofill:hover,
.submit-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #2f2637;
  transition: background-color 5000s ease-in-out 0s;
  box-shadow: 0 0 0 1000px #fff inset, 0 2px 8px rgba(77, 48, 92, 0.05) !important;
}

@media (max-width: 480px) {
  .hero-wordmark,
  .loading-wordmark {
    width: min(95vw, 420px) !important;
  }

  .mini-row {
    grid-template-columns: 36px minmax(0, 1fr) 62px;
    padding: 10px;
  }

  .mini-copy strong {
    font-size: 12px;
  }

  .mini-copy em {
    font-size: 10px;
  }

  .mini-score {
    min-width: 56px;
    font-size: 20px;
    padding: 9px 6px;
  }
}

/* V18: Top 3-only leaderboard + cleaner save/restore flow */
.leaderboard-box .section-title span {
  color: #8b7596;
  white-space: nowrap;
}

.top-three-list {
  gap: 8px;
}

.top-three-row {
  min-height: 48px;
  grid-template-columns: 40px minmax(0, 1fr) minmax(58px, auto);
  border-radius: 18px;
}

.top-three-row.rank-1 {
  min-height: 56px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.74)),
    radial-gradient(circle at 12% 25%, rgba(255, 216, 77, .34), transparent 34%);
  box-shadow: 0 10px 22px rgba(107, 74, 118, 0.08);
}

.top-three-row.rank-1 .rank {
  width: 32px;
  height: 32px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 216, 77, .66), rgba(255, 166, 62, .28));
}

.top-three-row.rank-1 .player-name strong {
  font-size: 15px;
}

.top-three-row .player-score {
  justify-self: end;
  min-width: 56px;
  text-align: right;
  font-size: 17px;
}

.submit-form .section-title {
  align-items: flex-start;
}

.submit-form .section-title strong {
  font-size: 17px;
}

.submit-form .section-title span {
  padding-top: 2px;
  white-space: nowrap;
}

.submit-form label {
  position: relative;
}

.field-hint {
  display: block;
  margin-top: 2px;
  color: #9a8ca6;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.restore-note {
  margin: 9px 2px 0 !important;
  color: #8f7f99 !important;
  font-size: 11px !important;
  line-height: 1.32 !important;
  font-weight: 850 !important;
  text-align: left;
}

.form-message {
  margin-top: 7px !important;
  text-align: left;
}

@media (max-width: 380px) {
  .top-three-row {
    grid-template-columns: 36px minmax(0, 1fr) minmax(48px, auto);
    gap: 7px;
    padding: 7px 8px;
  }

  .top-three-row .player-score {
    min-width: 48px;
    font-size: 15px;
  }

  .submit-form .section-title {
    display: block;
  }

  .submit-form .section-title span {
    display: block;
    margin-top: 2px;
  }
}

/* V21: danger warning flash + safer active-game UX */
.danger-label.is-alert {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(255, 31, 91, 0.96), rgba(255, 125, 39, 0.92));
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 55, 100, 0.16), 0 0 24px rgba(255, 31, 91, 0.46);
  opacity: 1;
  animation: dangerLinePulse 0.42s ease-in-out infinite alternate;
}

@keyframes dangerLinePulse {
  from { transform: translateX(-50%) scale(0.98); filter: brightness(1); }
  to { transform: translateX(-50%) scale(1.06); filter: brightness(1.12); }
}


/* V22: clearer game-over score typography */
#finalScoreTitle {
  font-family: "Arial Rounded MT Bold", "SF Pro Rounded", "Trebuchet MS", system-ui, -apple-system, sans-serif;
  letter-spacing: -0.015em !important;
  word-spacing: 0.06em;
  line-height: 1.08 !important;
  font-weight: 950;
  font-size: clamp(32px, 9.5vw, 46px);
  color: #362846;
  text-rendering: geometricPrecision;
}

.game-over-head #finalScoreTitle {
  margin-top: 8px;
  margin-bottom: 4px;
}

/* V25: fruitsdrop.fun footer links */
.home-footer {
  width: 100%;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.home-footer .home-footnote {
  margin: 0 !important;
  text-align: center;
  line-height: 1.25;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.footer-links a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(116, 92, 130, 0.11);
  background: rgba(255, 255, 255, 0.58);
  color: #75627f;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1;
  text-decoration: none;
  letter-spacing: 0.015em;
  box-shadow: 0 8px 18px rgba(84, 53, 98, 0.06);
  -webkit-tap-highlight-color: transparent;
}

.footer-links a:active {
  transform: translateY(1px);
}

@media (max-width: 759px) and (max-height: 740px) {
  .home-footer {
    margin-top: 8px;
    gap: 6px;
  }

  .footer-links {
    gap: 5px;
  }

  .footer-links a {
    min-height: 28px;
    padding: 6px 8px;
    font-size: 10px;
  }
}

/* V26: Google login account menu + Google save card */
.hud {
  grid-template-columns: 64px minmax(0, 1fr) 64px;
}

.hud-menu-spacer {
  min-height: 60px;
}

.account-menu-wrap {
  position: absolute;
  top: calc(max(8px, env(safe-area-inset-top)) + 12px);
  right: 12px;
  z-index: 50;
}

.menu-button {
  width: 64px;
  min-width: 64px;
  height: 60px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 13px 14px;
  border-radius: 24px;
  border: 1px solid var(--soft-border);
  background:
    radial-gradient(circle at 28% 24%, rgba(255,255,255,.96), transparent 25%),
    linear-gradient(145deg, rgba(255, 110, 168, 0.78), rgba(255, 184, 95, 0.74) 52%, rgba(83, 223, 185, 0.62));
  box-shadow: 0 8px 22px rgba(68, 41, 80, 0.12), inset 0 1px 0 rgba(255,255,255,.54);
  -webkit-tap-highlight-color: transparent;
}

.menu-button span {
  width: 27px;
  height: 5px;
  display: block;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 0 rgba(79, 43, 91, 0.12), inset 0 1px 0 rgba(255,255,255,.45);
}

.menu-button:active {
  transform: scale(.985);
}

.menu-button[aria-expanded="true"] {
  filter: brightness(1.04);
}

.account-menu {
  position: absolute;
  top: 68px;
  right: 0;
  width: min(318px, calc(100vw - 28px));
  padding: 12px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.84);
  background:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.82)),
    radial-gradient(circle at 0% 0%, rgba(255, 110, 168, .18), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(83, 223, 185, .2), transparent 32%);
  box-shadow: 0 24px 70px rgba(64, 38, 78, .24);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.account-menu-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.account-menu-card strong {
  font-size: 18px;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.account-menu-card p,
.account-menu-message {
  margin: 0;
  color: #857391;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.34;
}

.account-menu-badge,
.account-avatar.fallback {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,.95), transparent 24%),
    linear-gradient(135deg, rgba(255, 110, 168, .28), rgba(255, 216, 113, .22), rgba(83, 223, 185, .24));
  border: 1px solid rgba(255,255,255,.88);
  font-size: 25px;
  box-shadow: 0 10px 22px rgba(93, 57, 105, .1);
}

.account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 20px;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.88);
  box-shadow: 0 10px 22px rgba(93, 57, 105, .13);
}

.google-login-btn {
  position: relative;
  width: 100%;
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px 12px 14px;
  margin-top: 8px;
  border-radius: 22px;
  color: #33263d;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.9)),
    linear-gradient(120deg, rgba(255, 105, 180, .08), rgba(255, 206, 92, .08), rgba(118, 214, 255, .08));
  border: 1px solid rgba(116, 92, 130, .12);
  box-shadow:
    0 16px 34px rgba(72, 43, 86, .14),
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -1px 0 rgba(255,255,255,.58);
  font-weight: 1000;
  letter-spacing: -0.02em;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .18s ease, border-color .18s ease;
}

.google-login-btn::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 21px;
  background: linear-gradient(135deg, rgba(255,255,255,.44), rgba(255,255,255,0) 42%);
  pointer-events: none;
}

.google-login-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 18px 38px rgba(72, 43, 86, .16),
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -1px 0 rgba(255,255,255,.58);
  border-color: rgba(116, 92, 130, .2);
}

.google-login-btn:active {
  transform: scale(.988);
}

.google-login-btn:disabled {
  opacity: .68;
  cursor: wait;
}

.google-mark {
  position: relative;
  z-index: 1;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(255,255,255,.98);
  box-shadow: inset 0 0 0 1px rgba(66, 133, 244, .1), 0 8px 18px rgba(80, 55, 95, .08);
}

.google-mark img {
  width: 22px;
  height: 22px;
  display: block;
}

.google-login-copy {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
}

.google-login-title {
  display: block;
  font-size: 16px;
  font-weight: 1000;
  line-height: 1.12;
  color: #34263f;
}

.google-login-subtitle {
  display: block;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.22;
  color: #8d7a99;
}

.google-login-arrow {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 112, 169, .12), rgba(255, 210, 98, .16));
  color: #7a607f;
  font-size: 18px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}

.menu-logout-btn {
  min-height: 46px;
  margin-top: 8px;
  border-radius: 16px;
}

.account-menu-message {
  min-height: 16px;
  margin-top: 10px;
  text-align: center;
  color: #9a789d;
}

.google-save-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.93), rgba(255,255,255,.82)),
    radial-gradient(circle at 12% 0%, rgba(255,110,168,.16), transparent 36%) !important;
}

.google-save-body {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 6px;
  text-align: left;
}

.google-save-body p {
  margin: 0 !important;
  color: #80708b !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.34 !important;
}

.google-save-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.9), transparent 25%),
    linear-gradient(135deg, rgba(255, 110, 168, .22), rgba(255, 216, 113, .26), rgba(83, 223, 185, .2));
  border: 1px solid rgba(255,255,255,.88);
  font-size: 25px;
}

.google-save-btn {
  margin-top: 12px;
}

@media (max-width: 370px) {
  .hud {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
  }

  .hud-menu-spacer,
  .menu-button {
    width: 54px;
    min-width: 54px;
    height: 56px;
    min-height: 56px;
    border-radius: 20px;
  }

  .menu-button span {
    width: 24px;
    height: 5px;
  }

  .account-menu-wrap {
    right: 12px;
  }
}


.google-save-btn .google-login-title {
  font-size: 15px;
}

@media (max-width: 430px) {
  .google-login-btn {
    min-height: 60px;
    padding: 11px 14px 11px 12px;
    border-radius: 20px;
    gap: 10px;
  }

  .google-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .google-login-title {
    font-size: 15px;
  }

  .google-login-subtitle {
    font-size: 10px;
  }

  .google-login-arrow {
    width: 26px;
    height: 26px;
    font-size: 16px;
  }
}

/* V29: compact challenge friends score share CTA */
.share-score-cta {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 10px;
  padding: 10px 14px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 16% 8%, rgba(255,255,255,.52), transparent 22%),
    linear-gradient(135deg, #ff79a8 0%, #ffb347 48%, #53d8b7 100%);
  box-shadow: 0 15px 30px rgba(255, 129, 146, .2), inset 0 1px 0 rgba(255,255,255,.6);
  font: inherit;
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: -0.02em;
  cursor: pointer;
  transform: translateZ(0);
}

.share-score-cta:active {
  transform: scale(.986) translateZ(0);
}

.share-score-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,.88);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.68), 0 8px 16px rgba(80, 55, 95, .08);
  font-size: 17px;
}

.share-score-message {
  min-height: 15px;
  margin: 5px auto -2px !important;
  text-align: center;
  color: #8f7899 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
}

.share-score-cta + .share-score-message + .back-home-cta {
  margin-top: 8px;
}

@media (max-height: 760px) {
  .share-score-cta {
    min-height: 42px;
    margin-top: 8px;
    border-radius: 18px;
    font-size: 15px;
  }

  .share-score-icon {
    width: 27px;
    height: 27px;
    font-size: 16px;
  }
}


/* V30: compact privacy-safe leaderboard polish + full board inside menu */
.account-menu {
  max-height: min(78svh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.menu-board-button {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 0 10px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 22px;
  color: #352640;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.68)),
    radial-gradient(circle at 12% 18%, rgba(255, 216, 77, .3), transparent 34%),
    radial-gradient(circle at 90% 80%, rgba(83, 223, 185, .2), transparent 30%);
  box-shadow: 0 12px 26px rgba(72, 43, 86, .12), inset 0 1px 0 rgba(255,255,255,.88);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.menu-board-button:active {
  transform: scale(.988);
}

.menu-board-button[aria-expanded="true"] .menu-board-arrow {
  transform: rotate(90deg);
}

.menu-board-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 216, 77, .54), rgba(255, 125, 168, .18));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  font-size: 20px;
}

.menu-board-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.menu-board-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 1000;
  letter-spacing: -0.025em;
}

.menu-board-copy em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8e7b99;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.menu-board-arrow {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #8a6d92;
  background: rgba(255,255,255,.66);
  font-size: 24px;
  line-height: 1;
  transition: transform .18s ease;
}

.menu-leaderboard-panel {
  padding: 11px;
  margin: 0 0 10px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.84);
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.64)),
    radial-gradient(circle at 0% 0%, rgba(255, 216, 77, .22), transparent 34%);
}

.menu-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.menu-board-head div {
  display: grid;
  gap: 1px;
}

.menu-board-head strong {
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: -0.03em;
}

.menu-board-head span {
  color: #907c99;
  font-size: 11px;
  font-weight: 850;
}

.menu-board-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #7d637f;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.76);
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.menu-leaderboard-list {
  max-height: min(46svh, 360px);
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 2px 0 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.menu-leaderboard-row {
  min-height: 40px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(52px, auto);
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.82);
  background: rgba(255,255,255,.66);
}

.menu-leaderboard-row.rank-1 {
  background:
    linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.62)),
    radial-gradient(circle at 16% 25%, rgba(255, 216, 77, .34), transparent 36%);
}

.menu-leaderboard-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: -0.02em;
}

.menu-rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 216, 113, .35);
  color: #6f5278;
  font-size: 12px;
  font-weight: 1000;
}

.menu-leaderboard-row.rank-1 .menu-rank {
  background: linear-gradient(135deg, rgba(255, 216, 77, .72), rgba(255, 166, 62, .34));
  color: #7a4b10;
}

.menu-score {
  justify-self: end;
  color: #3a2b43;
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: -0.035em;
}

.menu-leaderboard-empty {
  min-height: 112px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  text-align: center;
}

.menu-leaderboard-empty span {
  font-size: 26px;
}

.menu-leaderboard-empty strong {
  font-size: 15px;
  font-weight: 1000;
}

.menu-leaderboard-empty em {
  color: #8e7b99;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.menu-board-note {
  min-height: 14px;
  margin: 8px 2px 0;
  color: #927f9c;
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.leaderboard-box {
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.52)),
    radial-gradient(circle at 10% 14%, rgba(255, 216, 77, .16), transparent 34%);
}

.top-three-list {
  gap: 7px;
}

.top-three-row {
  min-height: 44px;
  grid-template-columns: 38px minmax(0, 1fr) minmax(56px, auto);
  padding: 7px 10px;
  border-radius: 17px;
}

.top-three-row.rank-1 {
  min-height: 50px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.72)),
    radial-gradient(circle at 14% 28%, rgba(255, 216, 77, .42), transparent 38%);
}

.top-three-row.rank-2 {
  background:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,255,255,.62)),
    radial-gradient(circle at 14% 28%, rgba(207, 219, 230, .28), transparent 38%);
}

.top-three-row.rank-3 {
  background:
    linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.6)),
    radial-gradient(circle at 14% 28%, rgba(214, 143, 77, .2), transparent 38%);
}

.top-three-row .rank {
  background: rgba(255, 216, 113, .28);
}

.top-three-row.rank-2 .rank {
  background: rgba(207, 219, 230, .5);
}

.top-three-row.rank-3 .rank {
  background: rgba(214, 143, 77, .24);
}

.top-three-row .player-name strong {
  font-size: 14px;
}

.top-three-row.rank-1 .player-name strong {
  font-size: 15px;
}

.top-three-row .player-score {
  min-width: 54px;
  font-size: 16px;
}


/* V31: gameplay HUD alignment + larger clearer glass tuning */
.app-shell {
  --fd-hud-size: clamp(58px, 15.6vw, 72px);
  --fd-hud-gap: clamp(10px, 2.5vw, 14px);
}

.hud {
  width: min(100%, 520px) !important;
  grid-template-columns: var(--fd-hud-size) minmax(0, 1fr) var(--fd-hud-size) !important;
  gap: var(--fd-hud-gap) !important;
  align-items: stretch !important;
  flex: 0 0 auto !important;
  margin: 0 auto !important;
}

.back-button,
.score-card,
.hud-menu-spacer,
.menu-button {
  height: var(--fd-hud-size) !important;
  min-height: var(--fd-hud-size) !important;
}

.back-button,
.hud-menu-spacer,
.menu-button {
  width: var(--fd-hud-size) !important;
  min-width: var(--fd-hud-size) !important;
}

.back-button,
.menu-button {
  border-radius: clamp(22px, 5.8vw, 28px) !important;
}

.score-card {
  border-radius: clamp(22px, 5.8vw, 30px) !important;
  padding: 8px 10px !important;
}

.score-card span {
  line-height: 1 !important;
}

.score-card strong {
  margin-top: 3px !important;
  line-height: .92 !important;
}

.menu-button {
  position: relative;
  padding: calc(var(--fd-hud-size) * .22) calc(var(--fd-hud-size) * .23) !important;
  align-self: stretch !important;
}

.menu-button span {
  width: calc(var(--fd-hud-size) * .42) !important;
  height: max(4px, calc(var(--fd-hud-size) * .075)) !important;
}

.account-menu-wrap {
  top: calc(max(8px, env(safe-area-inset-top)) + 12px) !important;
  right: 12px !important;
}

.game-stage {
  width: min(100%, 520px) !important;
  margin-top: clamp(10px, 2.4vw, 13px) !important;
  border-radius: clamp(30px, 7vw, 38px) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.76), rgba(255,255,255,.24)),
    radial-gradient(circle at 50% 8%, rgba(255,255,255,.98), transparent 34%),
    radial-gradient(circle at 86% 20%, rgba(102,212,255,.15), transparent 26%),
    radial-gradient(circle at 15% 84%, rgba(255,216,77,.12), transparent 26%) !important;
  box-shadow: 0 18px 46px rgba(92, 60, 107, .12), inset 0 1px 0 rgba(255,255,255,.58) !important;
}

.danger-label {
  padding: 4px 12px !important;
  border-color: rgba(255, 99, 139, 0.30) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 8px 18px rgba(255, 109, 169, .08) !important;
}

@media (min-width: 760px) {
  .app-shell {
    --fd-hud-size: 58px;
    --fd-hud-gap: 10px;
  }

  .account-menu-wrap {
    top: 16px !important;
    right: 13px !important;
  }
}

@media (min-width: 1080px) {
  .app-shell {
    --fd-hud-size: 62px;
    --fd-hud-gap: 12px;
  }

  .account-menu-wrap {
    top: 18px !important;
    right: 16px !important;
  }
}

@media (max-width: 370px) {
  .app-shell {
    --fd-hud-size: 56px;
    --fd-hud-gap: 9px;
  }
}

/* V33: quick full leaderboard CTA under game-over Top 3 */
.view-board-cta {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  margin: 9px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 18px;
  color: #392842;
  background:
    linear-gradient(180deg, rgba(255,255,255,.84), rgba(255,255,255,.62)),
    radial-gradient(circle at 12% 20%, rgba(255, 216, 77, .25), transparent 36%),
    radial-gradient(circle at 88% 70%, rgba(83, 223, 185, .16), transparent 34%);
  box-shadow: 0 10px 24px rgba(83, 55, 96, .1), inset 0 1px 0 rgba(255,255,255,.78);
  -webkit-tap-highlight-color: transparent;
}

.view-board-cta:active {
  transform: scale(.99);
}

.view-board-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 216, 77, .56), rgba(255, 184, 95, .25));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.76);
  font-size: 18px;
}

.view-board-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  text-align: left;
}

.view-board-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.view-board-copy em {
  color: #8c7798;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
}

.view-board-arrow {
  justify-self: end;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #805f84;
  background: rgba(255,255,255,.68);
  font-size: 22px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}

@media (max-height: 760px) {
  .view-board-cta {
    min-height: 42px;
    margin-top: 7px;
    padding: 7px 9px;
    border-radius: 16px;
  }

  .view-board-icon {
    width: 31px;
    height: 31px;
    border-radius: 12px;
    font-size: 16px;
  }

  .view-board-copy strong {
    font-size: 13px;
  }
}

/* V34: dedicated full leaderboard page + cleaner account menu + larger glass polish */
.account-menu {
  max-height: min(58svh, 420px) !important;
}

.account-login-card {
  justify-items: stretch !important;
  gap: 0 !important;
  text-align: left !important;
}

.account-login-card .google-login-btn {
  margin-top: 0 !important;
}

.menu-board-button {
  margin-bottom: 10px !important;
}

.menu-board-button .menu-board-arrow {
  transform: none !important;
}

.leaderboard-page-screen {
  padding: calc(max(8px, env(safe-area-inset-top)) + 8px) 12px calc(max(12px, env(safe-area-inset-bottom)) + var(--browser-bottom-pad, 0px));
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 110, 168, .23), transparent 26%),
    radial-gradient(circle at 88% 20%, rgba(102, 212, 255, .22), transparent 27%),
    radial-gradient(circle at 50% 94%, rgba(255, 216, 113, .23), transparent 32%),
    rgba(255, 248, 251, .76);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.leaderboard-page-panel {
  width: min(100%, 520px);
  max-height: min(86svh, 760px);
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 4vw, 24px);
  overflow: hidden;
  border-radius: clamp(30px, 7vw, 40px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,255,255,.82)),
    radial-gradient(circle at 10% 0%, rgba(255, 216, 77, .20), transparent 34%),
    radial-gradient(circle at 90% 4%, rgba(83, 223, 185, .18), transparent 32%);
  box-shadow: 0 26px 80px rgba(64, 38, 78, .22), inset 0 1px 0 rgba(255,255,255,.82);
}

.leaderboard-page-header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.leaderboard-back-btn {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 21px;
  background:
    radial-gradient(circle at 28% 24%, rgba(255,255,255,.96), transparent 25%),
    linear-gradient(145deg, rgba(255, 110, 168, .86), rgba(255, 184, 95, .82));
  box-shadow: 0 12px 26px rgba(255, 109, 169, .22), inset 0 1px 0 rgba(255,255,255,.52);
  color: #fff;
  font-size: 28px;
  font-weight: 1000;
  line-height: 1;
}

.leaderboard-back-btn:active {
  transform: scale(.985);
}

.leaderboard-page-header div {
  min-width: 0;
}

.leaderboard-kicker {
  display: block;
  color: #9a789d;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.leaderboard-page-header h2 {
  margin: 1px 0 0;
  color: #352640;
  font-size: clamp(28px, 7vw, 42px);
  line-height: .96;
  letter-spacing: -0.05em;
}

.leaderboard-page-header p {
  margin: 4px 0 0;
  color: #8c7798;
  font-size: 13px;
  font-weight: 900;
}

.leaderboard-hero-strip {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  margin-bottom: 13px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.86);
  background:
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.62)),
    radial-gradient(circle at 12% 24%, rgba(255, 216, 77, .32), transparent 36%),
    radial-gradient(circle at 92% 82%, rgba(83, 223, 185, .16), transparent 34%);
  box-shadow: 0 12px 28px rgba(72, 43, 86, .09), inset 0 1px 0 rgba(255,255,255,.86);
}

.leaderboard-hero-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 216, 77, .72), rgba(255, 143, 96, .24));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.68);
  font-size: 25px;
}

.leaderboard-hero-strip strong {
  display: block;
  color: #362742;
  font-size: 17px;
  font-weight: 1000;
  letter-spacing: -0.03em;
}

.leaderboard-hero-strip p {
  margin: 2px 0 0;
  color: #8e7b99;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.28;
}

.leaderboard-page-list {
  flex: 1 1 auto;
  min-height: 180px;
  display: grid;
  align-content: start;
  gap: 8px;
  margin: 0;
  padding: 2px 2px 2px 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-page-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(64px, auto);
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.82);
  background: rgba(255,255,255,.68);
  box-shadow: 0 8px 18px rgba(80, 55, 95, .055);
}

.leaderboard-page-row.rank-1 {
  min-height: 54px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.68)),
    radial-gradient(circle at 16% 30%, rgba(255, 216, 77, .46), transparent 38%);
}

.leaderboard-page-row.rank-2 {
  background:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,255,255,.64)),
    radial-gradient(circle at 16% 30%, rgba(207, 219, 230, .36), transparent 38%);
}

.leaderboard-page-row.rank-3 {
  background:
    linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.62)),
    radial-gradient(circle at 16% 30%, rgba(214, 143, 77, .24), transparent 38%);
}

.page-rank {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #6f5278;
  background: rgba(255, 216, 113, .34);
  font-size: 14px;
  font-weight: 1000;
}

.leaderboard-page-row.rank-1 .page-rank {
  color: #7a4b10;
  background: linear-gradient(135deg, rgba(255, 216, 77, .82), rgba(255, 166, 62, .38));
}

.leaderboard-page-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #352640;
  font-size: 15px;
  font-weight: 1000;
  letter-spacing: -0.025em;
}

.page-score {
  justify-self: end;
  color: #392b48;
  font-size: 17px;
  font-weight: 1000;
  letter-spacing: -0.04em;
}

.leaderboard-page-empty {
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255,255,255,.62);
  text-align: center;
}

.leaderboard-page-empty span {
  font-size: 34px;
}

.leaderboard-page-empty strong {
  font-size: 18px;
  font-weight: 1000;
}

.leaderboard-page-empty em {
  color: #8e7b99;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.leaderboard-page-message {
  min-height: 16px;
  margin: 10px 2px 0;
  color: #927f9c;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

@media (max-height: 720px) {
  .leaderboard-page-panel {
    max-height: 88svh;
    padding: 14px;
  }

  .leaderboard-page-header {
    grid-template-columns: 48px minmax(0, 1fr);
    margin-bottom: 10px;
  }

  .leaderboard-back-btn {
    width: 48px;
    height: 48px;
    border-radius: 18px;
  }

  .leaderboard-hero-strip {
    margin-bottom: 10px;
    padding: 9px 10px;
  }

  .leaderboard-page-row {
    min-height: 44px;
    padding: 7px 10px;
  }
}
