* {
  box-sizing: border-box;
}

html {
  /* Lock root element to viewport — eliminates any scrollbar shift / right-bias source */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 159, 28, 0.2), transparent 28%),
    radial-gradient(circle at 12% 18%, rgba(151, 77, 255, 0.16), transparent 24%),
    linear-gradient(135deg, #160028, #32105a 52%, #180226);
  color: #ff9f1c;
  text-align: center;
  margin: 0;
  padding: 12px;
  min-height: 100vh;
  min-height: 100dvh;
  /* Width = parent (html), NEVER 100vw — that includes scrollbar width and causes right-bias */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* MAIN CARD */

.game-card {
  position: relative;
  width: 100%;
  max-width: 1350px;
  min-height: calc(100vh - 24px);
  min-height: calc(100dvh - 24px);
  margin: 0 auto;
  background:
    linear-gradient(145deg, rgba(57, 17, 88, 0.97), rgba(28, 5, 45, 0.98)),
    rgba(27, 6, 43, 0.96);
  padding: 22px;
  border-radius: 26px;
  box-shadow:
    0 0 52px rgba(255, 159, 28, 0.24),
    inset 0 1px 0 rgba(255, 214, 160, 0.08);
  border: 1px solid rgba(255, 159, 28, 0.4);
  overflow-x: hidden;
  overflow-y: visible;
}

#lobbyScreen,
#difficultyScreen,
#gameScreen {
  width: 100%;
}

.menu-panel {
  max-width: 1100px;
  margin: 0 auto;
}

/* LOGOS */

.main-logo {
  width: 210px;
  max-width: 56%;
  margin: -28px auto -24px;
  display: block;
  filter: drop-shadow(0 0 18px rgba(255, 159, 28, 0.4));
}

.small-logo {
  width: 128px;
  margin: -14px auto -10px;
  display: block;
  filter: drop-shadow(0 0 14px rgba(255, 159, 28, 0.28));
}

.game-logo {
  width: 92px;
  margin: -12px auto -8px;
  display: block;
  filter: drop-shadow(0 0 12px rgba(255, 159, 28, 0.28));
}

/* Logo as a home button — pointer, subtle hover glow */
.logo-home-btn {
  cursor: pointer;
  transition: filter 0.18s, transform 0.18s;
}
.logo-home-btn:hover {
  filter: drop-shadow(0 0 22px rgba(255, 159, 28, 0.65));
  transform: scale(1.04);
}
.logo-home-btn:active {
  transform: scale(0.97);
}
.logo-home-btn:focus-visible {
  outline: 2px solid rgba(255, 159, 28, 0.7);
  outline-offset: 4px;
  border-radius: 6px;
}

/* TEXT */

h1 {
  color: #ff9f1c;
  font-size: clamp(32px, 5vw, 52px);
  margin: 2px 0 4px;
  letter-spacing: 1px;
  text-shadow: 0 0 18px rgba(255, 159, 28, 0.34);
}

.subtitle {
  color: #ffd4a1;
  margin: 2px 0 12px;
  font-size: clamp(15px, 2vw, 20px);
}

/* LOBBY */

.hero-buttons {
  display: grid;
  gap: 12px;
  max-width: 700px;
  margin: 12px auto;
}

.progression-card,
.stats-progression {
  max-width: 520px;
  margin: 10px auto 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 159, 28, 0.18), transparent 38%),
    linear-gradient(145deg, #2f0a4d, #140022);
  border: 1px solid rgba(255, 159, 28, 0.48);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow:
    0 0 22px rgba(255, 159, 28, 0.16),
    inset 0 1px 0 rgba(255, 214, 160, 0.08);
}

.progression-topline,
.xp-level-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: #ffe0b3;
  font-size: 14px;
}

.progression-topline strong,
.xp-level-row strong {
  color: #ffb84d;
}

.xp-bar {
  height: 10px;
  margin: 9px 0 6px;
  background: rgba(16, 0, 24, 0.9);
  border: 1px solid rgba(255, 159, 28, 0.32);
  border-radius: 999px;
  overflow: hidden;
}

.xp-bar-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff7a18, #ffb84d, #ffe082);
  border-radius: inherit;
  box-shadow: 0 0 16px rgba(255, 184, 77, 0.7);
  transition: width 0.85s ease-out;
}

.progression-meta {
  color: #cda8df;
  font-size: 12px;
}

.big-mode-btn {
  font-size: clamp(21px, 3vw, 30px);
  padding: 21px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ff9f1c, #ffd166 52%, #ff7a18);
  color: #190127;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.34),
    0 0 24px rgba(255, 159, 28, 0.38);
}

.secondary-btn {
  font-size: clamp(17px, 2vw, 22px);
  padding: 15px;
  border-radius: 18px;
  background: linear-gradient(135deg, #43106b, #25053d);
  color: #ffd6a0;
  border: 1px solid rgba(255, 159, 28, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.08);
}

/* DIFFICULTY */

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.difficulty-card {
  position: relative;
  min-height: 175px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 159, 28, 0.2), transparent 46%),
    linear-gradient(145deg, #4b1478, #24063d 72%);
  color: #ffe0b3;
  border: 1px solid rgba(255, 184, 77, 0.54);
  box-shadow:
    0 13px 30px rgba(0, 0, 0, 0.34),
    0 0 22px rgba(255, 159, 28, 0.16),
    inset 0 1px 0 rgba(255, 214, 160, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding-inline: 48px;
}

.difficulty-card:hover {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 200, 87, 0.3), transparent 48%),
    linear-gradient(145deg, #5b198e, #2a0645 72%);
  border-color: rgba(255, 204, 102, 0.84);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.38),
    0 0 34px rgba(255, 159, 28, 0.34);
}

.difficulty-card strong {
  font-size: clamp(24px, 3vw, 34px);
  color: #ff9f1c;
  text-shadow: 0 0 14px rgba(255, 159, 28, 0.34);
}

.stars {
  font-size: 28px;
}

.info-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ff9f1c;
  color: #190127;
  font-weight: bold;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.info-badge:hover::after {
  content: attr(data-info);
  position: absolute;
  right: 0;
  top: 38px;
  width: 240px;
  background: #100018;
  color: #ffd6a0;
  border: 1px solid rgba(255, 159, 28, 0.4);
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.35;
  z-index: 50;
  text-align: left;
}

.calendar-box {
  max-width: 760px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(74px, 1fr));
  gap: 10px;
  margin: 22px auto;
}

.calendar-day {
  min-height: 76px;
  margin: 0;
  padding: 10px 8px;
  background:
    linear-gradient(145deg, rgba(51, 12, 82, 0.94), rgba(17, 0, 27, 0.96));
  color: #ffd6a0;
  border: 1px solid rgba(255, 159, 28, 0.46);
  border-radius: 12px;
  display: grid;
  place-items: center;
  gap: 4px;
}

.calendar-day strong {
  font-size: 24px;
  line-height: 1;
}

.calendar-day.won {
  border-color: rgba(80, 220, 140, 0.7);
}

.calendar-day.lost {
  border-color: rgba(255, 110, 110, 0.72);
}

.calendar-day.empty {
  opacity: 0.82;
}

.collection-box {
  width: min(980px, 94vw);
  /* Allow internal scroll so close button is always reachable */
  max-height: min(92dvh, 92vh);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Tall scrollable modal box (Badges, Titles, Auth, Leaderboard) */
.tall-modal-box {
  max-height: min(92dvh, 92vh);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── Sticky modal close buttons ──────────────────────────────────────────
   Applied to close buttons inside scrollable modals so they stay visible
   at the bottom no matter how long the content is. */
.modal-sticky-close {
  position: sticky;
  bottom: 0;
  z-index: 10;
  width: 100%;
  padding: 10px 0 2px;
  background: linear-gradient(
    to top,
    rgba(27, 4, 46, 1) 70%,
    rgba(27, 4, 46, 0)
  );
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.modal-sticky-close > button {
  min-width: 160px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  background: rgba(255, 159, 28, 0.14);
  border: 1px solid rgba(255, 159, 28, 0.5);
  border-radius: 14px;
  color: #ff9f1c;
  cursor: pointer;
  transition: background 0.15s;
  touch-action: manipulation;
}

.modal-sticky-close > button:hover {
  background: rgba(255, 159, 28, 0.28);
}

.collection-progress {
  color: #ffd6a0;
  font-weight: 900;
  margin: 12px 0;
}

.collection-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.collection-filters button {
  margin: 0;
  padding: 9px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #43106b, #25053d);
  color: #ffd6a0;
  border: 1px solid rgba(255, 159, 28, 0.42);
}

.collection-filters button.active {
  background: linear-gradient(135deg, #ff9f1c, #ffd166);
  color: #190127;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 4px;
}

.collection-card {
  position: relative;
  min-height: 220px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 159, 28, 0.18), transparent 42%),
    linear-gradient(145deg, #2f0a4d, #12001f);
  border: 1px solid rgba(255, 159, 28, 0.5);
  border-radius: 18px;
  padding: 18px 16px 14px;
  color: #ffe0b3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  /* Containment: long names, long builds, long dates stay inside the card */
  overflow: hidden;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow:
    0 0 22px rgba(255, 159, 28, 0.16),
    inset 0 1px 0 rgba(255, 214, 160, 0.08);
}

.collection-card.mystery {
  opacity: 0.55;
  filter: saturate(0.4) brightness(0.75);
  cursor: default;
  pointer-events: none;
}

/* Locked-card internal elements */
.mystery-lock {
  font-size: 26px;
  line-height: 1;
  opacity: 0.7;
}

.mystery-name {
  color: rgba(255, 159, 28, 0.35) !important;
  letter-spacing: 2px;
  font-size: 18px !important;
}

.mystery-rarity {
  opacity: 0.5;
}

.mystery-hint {
  color: rgba(255, 224, 179, 0.4) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Legacy icon class — kept for any old references */
.collection-icon {
  font-size: 28px;
  line-height: 1;
}

.collection-rarity {
  color: #ffb84d;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  /* Stay inside the card — long rarities truncate cleanly */
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* Leave space at top-right for .collection-num absolute element */
  padding-right: 40px;
}

.collection-card h3 {
  color: #ff9f1c;
  font-size: 22px;
  line-height: 1.15;
  margin: 0;
  /* Long player names wrap to 2 lines then truncate */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.collection-card p {
  margin: 0;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
  /* Long build names (e.g. "Basketball Reference Rabbit Hole") fit on 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.collection-meta {
  display: grid;
  gap: 3px;
  color: #cda8df;
  font-size: 12px;
  min-width: 0;
}
.collection-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-card.rarity-common {
  border-color: rgba(238, 244, 255, 0.76);
}

.collection-card.rarity-rare {
  border-color: rgba(83, 169, 255, 0.86);
  box-shadow: 0 0 24px rgba(83, 169, 255, 0.24);
}

.collection-card.rarity-epic {
  border-color: rgba(190, 105, 255, 0.9);
  box-shadow: 0 0 26px rgba(190, 105, 255, 0.28);
}

.collection-card.rarity-legendary {
  border-color: rgba(255, 199, 82, 0.95);
  box-shadow: 0 0 30px rgba(255, 159, 28, 0.34);
}

.collection-card.rarity-mythic {
  border-color: rgba(255, 214, 92, 1);
  box-shadow:
    0 0 36px rgba(255, 184, 77, 0.5),
    0 0 62px rgba(255, 122, 24, 0.2);
}

/* GAME */

.back-btn {
  position: absolute;
  top: 22px;
  left: 22px;
  background: transparent;
  color: #ff9f1c;
  border: 1px solid rgba(255, 159, 28, 0.35);
}

.game-lobby-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 18px;
  left: auto;
  right: 18px;
  z-index: 95;
  min-height: 44px;
  padding: 10px 16px;
  background:
    linear-gradient(135deg, #ff9f1c, #ff6a00);
  color: #190127;
  border: 1px solid rgba(255, 224, 179, 0.82);
  border-radius: 999px;
  box-shadow: 0 0 24px rgba(255, 159, 28, 0.38);
  font-weight: 900;
}

#info,
#streakText,
#guessCounter {
  color: #f6c177;
  margin: 6px 0;
}

#guessCounter {
  font-weight: bold;
  margin-bottom: 12px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 430px;
  border-radius: 14px;
  background: #32105a;
  border: 1px solid rgba(255, 159, 28, 0.38);
  box-shadow:
    0 0 24px rgba(255, 159, 28, 0.12),
    inset 0 1px 0 rgba(255, 214, 160, 0.06);
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  background: #1c0430;
  color: #ffe1b8;
  font-size: clamp(10px, 1vw, 14px);
}

th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #46106f, #2a0645);
  color: #ff9f1c;
  padding: 8px 5px;
  border: 1px solid #4b1b6f;
  z-index: 5;
}

td {
  padding: 6px 4px;
  border: 1px solid #351052;
  text-align: center;
}

tr:nth-child(even) {
  background: #2a0745;
}

.controls {
  margin-top: 20px;
}

.input-wrap {
  position: relative;
  display: inline-block;
}

input {
  padding: 14px;
  width: 300px;
  max-width: 90%;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 159, 28, 0.35);
  outline: none;
  background: linear-gradient(180deg, #1b042e, #11001c);
  color: #ffe4bd;
  box-shadow:
    inset 0 1px 0 rgba(255, 214, 160, 0.06),
    0 0 14px rgba(255, 159, 28, 0.08);
}

input::placeholder {
  color: #9f7aaf;
}

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 54px;
  background: #1c0430;
  border: 1px solid rgba(255, 159, 28, 0.35);
  border-radius: 8px;
  overflow: hidden;
  z-index: 10;
  display: none;
  text-align: left;
}

.suggestion {
  padding: 10px 12px;
  color: #ffd6a0;
  cursor: pointer;
}

.suggestion:hover {
  background: #2f0a4d;
  color: #ff9f1c;
}

/* BUTTONS */

button {
  padding: 13px 20px;
  margin: 8px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff9f1c, #ffbd55);
  color: #190127;
  font-weight: bold;
  box-shadow: 0 0 14px rgba(255, 159, 28, 0.22);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

button:hover {
  background: linear-gradient(135deg, #ffb84d, #ffd166);
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(255, 159, 28, 0.42);
}

#giveUpBtn {
  background: transparent;
  color: #ff9f1c;
  border: 1px solid rgba(255, 159, 28, 0.35);
}

#message {
  font-size: 24px;
  font-weight: bold;
  margin-top: 16px;
  color: #ff9f1c;
}

/* HINTS */

.used-hints {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.used-hint {
  background: linear-gradient(135deg, #43106b, #25053d);
  color: #ffd6a0;
  border: 1px solid rgba(255, 159, 28, 0.35);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 15px;
}

/* MODALS */

.hint-modal {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 159, 28, 0.1), transparent 34%),
    rgba(10, 0, 18, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 100;
  /* Stable against viewport shifts (iOS browser-bar hide/show) */
  height: 100dvh;
  height: 100vh; /* fallback */
  overscroll-behavior: contain;
}

.hint-box {
  width: min(720px, 92vw);
  /* Use dvh so the box stays stable when mobile bars appear/disappear */
  max-height: min(88dvh, 88vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 159, 28, 0.15), transparent 42%),
    linear-gradient(145deg, #43106b, #1b042e);
  border: 1px solid rgba(255, 184, 77, 0.58);
  border-radius: 28px;
  padding: 32px;
  box-shadow:
    0 0 46px rgba(255, 159, 28, 0.28),
    inset 0 1px 0 rgba(255, 214, 160, 0.08);
  animation: popIn 0.18s ease-out;
  position: relative;
}

.hint-box h2 {
  font-size: 36px;
  margin: 0;
  color: #ff9f1c;
}

.hint-subtitle {
  color: #f6c177;
  margin-bottom: 24px;
}

.hint-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 520px;
  margin: 0 auto;
}

.hint-card {
  min-height: 130px;
  background: linear-gradient(145deg, #25053d, #100018);
  color: #ffe1b8;
  border: 1px solid rgba(255, 159, 28, 0.48);
  border-radius: 22px;
  font-size: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 0 18px rgba(255, 159, 28, 0.12);
  /* Touch improvements: eliminate 300ms delay, prevent miss-taps */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  cursor: pointer;
  position: relative;  /* creates stacking context — prevents overlap hit-test bugs */
  z-index: 1;
}

/* Prevent child nodes from swallowing touch events */
.hint-card > *,
.hint-card strong {
  pointer-events: none;
}

.hint-card strong {
  font-size: 20px;
  color: #ff9f1c;
}

.hint-card.used {
  opacity: 0.35;
  cursor: not-allowed;
}

.hint-card:not(.used):hover {
  background: linear-gradient(145deg, #350a55, #180024);
  border-color: rgba(255, 159, 28, 0.7);
}

/* STATS */

.stats-content {
  display: grid;
  gap: 12px;
  margin: 24px auto;
  max-width: 520px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 6px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  background: linear-gradient(135deg, #25053d, #12001f);
  border: 1px solid rgba(255, 159, 28, 0.46);
  padding: 14px 18px;
  border-radius: 14px;
  color: #ffd6a0;
}

.stat-row strong {
  color: #ff9f1c;
}

.badges-title {
  color: #ff9f1c;
  margin: 22px 0 8px;
  text-shadow: 0 0 16px rgba(255, 159, 28, 0.32);
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.badge-chip,
.badge-empty {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 159, 28, 0.2), transparent 38%),
    linear-gradient(145deg, #2f0a4d, #12001f);
  border: 1px solid rgba(255, 159, 28, 0.48);
  border-radius: 14px;
  padding: 12px;
  color: #ffe0b3;
  text-align: left;
  box-shadow: 0 0 16px rgba(255, 159, 28, 0.12);
}

.badge-chip strong {
  display: block;
  color: #ffb84d;
  margin-bottom: 4px;
}

.badge-chip span,
.badge-empty {
  font-size: 13px;
  line-height: 1.35;
}

/* FOOTER CONTROLS */

.shortcut-help {
  color: #9f7aaf;
  font-size: 13px;
  margin-top: 10px;
}

.sound-panel {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 80;
  background:
    linear-gradient(145deg, rgba(42, 7, 69, 0.94), rgba(16, 0, 24, 0.95));
  border: 1px solid rgba(255, 184, 77, 0.54);
  border-radius: 999px;
  padding: 9px 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 0 22px rgba(255, 159, 28, 0.16);
}

.sound-panel button {
  margin: 0;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
}

.sound-label {
  color: #ffd6a0;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.sound-panel input {
  width: 96px;
  padding: 0;
}

.jukebox-panel {
  position: fixed;
  right: 18px;
  bottom: 72px;
  z-index: 80;
  background:
    linear-gradient(145deg, rgba(42, 7, 69, 0.94), rgba(16, 0, 24, 0.95));
  border: 1px solid rgba(255, 159, 28, 0.48);
  box-shadow: 0 0 24px rgba(255, 159, 28, 0.16);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
}

#nowPlaying {
  color: #ffd6a0;
  font-weight: bold;
  font-size: 14px;
}

.mobile-sound-toggle,
.mobile-sound-popup {
  display: none;
}

.mobile-sound-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 95;
  min-width: 54px;
  min-height: 46px;
  padding: 10px 13px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, #ff9f1c, #ff6a00);
  color: #1a0030;
  border: 1px solid rgba(255, 224, 179, 0.82);
  box-shadow: 0 0 22px rgba(255, 159, 28, 0.45);
  font-weight: 900;
}

.mobile-sound-popup {
  position: fixed;
  right: 10px;
  bottom: 68px;
  z-index: 96;
  width: min(330px, calc(100vw - 20px));
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 159, 28, 0.18), transparent 36%),
    linear-gradient(145deg, rgba(50, 11, 78, 0.98), rgba(16, 0, 24, 0.98));
  border: 1px solid rgba(255, 184, 77, 0.62);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 0 28px rgba(255, 159, 28, 0.28);
  text-align: left;
}

.mobile-sound-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffb84d;
  margin-bottom: 8px;
}

.mobile-sound-header button,
.mobile-sound-row button,
.mobile-next-song {
  margin: 0;
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 13px;
}

.mobile-now-playing {
  color: #ffe0b3;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.mobile-next-song {
  width: 100%;
  margin-bottom: 10px;
}

.mobile-sound-row {
  display: grid;
  grid-template-columns: auto 46px 1fr;
  gap: 8px;
  align-items: center;
  color: #ffd6a0;
  font-size: 13px;
  margin-top: 8px;
}

.mobile-sound-row input {
  width: 100%;
  min-height: 34px;
  padding: 0;
  /* Prevent iOS from capturing horizontal slider touch as a scroll gesture */
  touch-action: pan-x;
}

/* Faster tap response on all popup buttons (eliminates 300ms iOS tap delay) */
.mobile-sound-header button,
.mobile-sound-row button,
.mobile-next-song {
  touch-action: manipulation;
}

/* REVEAL */

.reveal-modal {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 159, 28, 0.16), transparent 34%),
    rgba(5, 0, 12, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* TOP-ALIGN (not center) so the card grows downward only — content that
     loads after the initial render (xpBreakdown, badges, async global stat)
     no longer pushes the top edge upward, eliminating the up/down jumping. */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 120;
  /* 100dvh first so iOS Safari's address-bar collapse doesn't trigger reflow.
     `vh` is the fallback for older browsers that don't support dvh. */
  height: 100dvh;
  min-height: 100vh;
  padding: max(24px, env(safe-area-inset-top)) 12px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.reveal-card {
  position: relative;
  width: min(580px, 92vw);
  /* Card scrolls internally when content exceeds viewport — the modal
     itself never resizes / recenters. */
  max-height: calc(100dvh - 48px);
  min-height: 0;                  /* allow short content; no min stretch */
  background:
    radial-gradient(circle at center 26%, rgba(255, 193, 87, 0.34), transparent 40%),
    radial-gradient(circle at 12% 15%, rgba(152, 86, 255, 0.22), transparent 32%),
    linear-gradient(145deg, #4b1478, #100018 72%);
  border: 2px solid rgba(255, 193, 87, 0.86);
  border-radius: 24px;
  padding: 22px 26px 24px;        /* tighter so content fits more often */
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  box-shadow:
    0 0 70px rgba(255, 159, 28, 0.32),
    inset 0 1px 0 rgba(255, 238, 196, 0.12);
  animation: cardReveal 0.65s ease-out;
  will-change: transform, opacity;
  flex-shrink: 0;
}

/* Reserve a stable space for XP breakdown so async badges/callouts
   don't push other content around once they load. */
.reveal-card #xpBreakdown {
  width: 100%;
  min-height: 140px;
}

/* Reserve space for the async global stat line so it doesn't pop in */
.reveal-card #revealGlobalStat {
  min-height: 18px;
}

/* Body scroll lock while reveal is open — JS toggles this class */
body.reveal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.reveal-card.correct {
  animation: cardReveal 0.65s ease-out, hypePulse 1.1s infinite alternate;
}

.reveal-card.lose {
  border-color: rgba(180, 80, 255, 0.55);
}

.reveal-glow {
  position: absolute;
  inset: -120px;
  background:
    conic-gradient(
      from 0deg,
      transparent,
      rgba(255, 207, 87, 0.38),
      transparent,
      rgba(151, 77, 255, 0.24),
      transparent
    );
  animation: spinGlow 4s linear infinite;
  opacity: 0.65;
}

.reveal-logo {
  position: relative;
  width: 112px;
  margin: -4px auto 4px;
  display: block;
  z-index: 2;
  filter: drop-shadow(0 0 18px rgba(255, 159, 28, 0.42));
}

.reveal-card.is-revealing .reveal-logo,
.reveal-card.is-revealing #revealName,
.reveal-card.is-revealing #revealSubtext,
.reveal-card.is-revealing .reveal-details,
.reveal-card.is-revealing .xp-breakdown,
.reveal-card.is-revealing .reveal-actions {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
}

.reveal-card.is-revealing .reveal-badge {
  animation: badgePop 0.42s ease-out both;
}

.reveal-card.show-logo .reveal-logo,
.reveal-card.show-name #revealName,
.reveal-card.show-name #revealSubtext,
.reveal-card.show-details .reveal-details,
.reveal-card.show-details .xp-breakdown,
.reveal-card.show-details .reveal-actions {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.reveal-card.rarity-legendary.show-name #revealName,
.reveal-card.rarity-mythic.show-name #revealName {
  animation: nameFlash 0.58s ease-out both;
}

.reveal-badge {
  position: relative;
  display: block;
  background: linear-gradient(135deg, #ff9f1c, #ffd166);
  color: #190127;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 13px 24px;
  border-radius: 999px;
  margin: 0 auto 12px;
  font-size: clamp(15px, 3vw, 22px);
  line-height: 1;
  box-shadow:
    0 0 0 4px rgba(255, 159, 28, 0.18),
    0 0 34px rgba(255, 159, 28, 0.62);
  z-index: 2;
}

.reveal-card.rarity-common {
  border-color: rgba(238, 244, 255, 0.9);
  box-shadow:
    0 0 56px rgba(238, 244, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.reveal-card.rarity-common .reveal-badge {
  background: linear-gradient(135deg, #f8fbff, #c8d2e4);
  color: #190127;
  box-shadow: 0 0 32px rgba(238, 244, 255, 0.54);
}

.reveal-card.rarity-rare {
  border-color: rgba(83, 169, 255, 0.9);
  box-shadow:
    0 0 62px rgba(83, 169, 255, 0.34),
    inset 0 1px 0 rgba(205, 232, 255, 0.14);
}

.reveal-card.rarity-rare .reveal-badge {
  background: linear-gradient(135deg, #8fd0ff, #2878ff);
  color: #061428;
  box-shadow: 0 0 34px rgba(83, 169, 255, 0.64);
}

.reveal-card.rarity-epic {
  border-color: rgba(190, 105, 255, 0.92);
  box-shadow:
    0 0 66px rgba(190, 105, 255, 0.38),
    inset 0 1px 0 rgba(240, 214, 255, 0.14);
}

.reveal-card.rarity-epic .reveal-badge {
  background: linear-gradient(135deg, #e2a6ff, #8d38ff);
  color: #160022;
  box-shadow: 0 0 36px rgba(190, 105, 255, 0.66);
}

.reveal-card.rarity-legendary {
  border-color: rgba(255, 199, 82, 0.98);
  box-shadow:
    0 0 74px rgba(255, 159, 28, 0.48),
    inset 0 1px 0 rgba(255, 238, 196, 0.16);
}

.reveal-card.rarity-legendary .reveal-badge {
  background: linear-gradient(135deg, #ff9f1c, #ffe082 48%, #ff7a18);
  color: #190127;
  box-shadow: 0 0 42px rgba(255, 184, 77, 0.78);
}

.reveal-card.rarity-mythic {
  border-color: rgba(255, 214, 92, 1);
  animation: cardReveal 0.65s ease-out, hypePulse 1.1s infinite alternate, mythicBorder 2.4s linear infinite;
}

.reveal-card.rarity-mythic .reveal-badge {
  background: linear-gradient(90deg, #ff7a18, #ffe082, #ff9f1c, #fff0a8, #ff7a18);
  background-size: 220% 100%;
  color: #190127;
  animation: mythicBadge 2s linear infinite;
  box-shadow: 0 0 48px rgba(255, 204, 87, 0.9);
}

#revealName {
  position: relative;
  font-size: clamp(28px, 5vw, 48px);
  color: #ff9f1c;
  margin: 6px 0 2px;
  line-height: 1.02;
  z-index: 2;
  text-shadow: 0 0 24px rgba(255, 159, 28, 0.48);
}

#revealSubtext {
  position: relative;
  color: #ffe0b3;
  font-size: 17px;
  font-weight: 800;
  margin: 2px 0 0;
  z-index: 2;
}

.reveal-details {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
  max-width: 520px;
}

.xp-breakdown {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  margin-top: 14px;
}

.xp-panel {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 159, 28, 0.18), transparent 36%),
    rgba(18, 0, 31, 0.84);
  border: 1px solid rgba(255, 159, 28, 0.44);
  border-radius: 16px;
  padding: 12px;
  color: #ffe0b3;
  box-shadow: 0 0 20px rgba(255, 159, 28, 0.14);
}

.new-collection-callout {
  width: fit-content;
  margin: 0 auto 8px;
  background: linear-gradient(135deg, #ff9f1c, #ffe082);
  color: #190127;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 0 22px rgba(255, 184, 77, 0.52);
}

.xp-lines {
  display: grid;
  gap: 4px;
  text-align: left;
  font-size: 13px;
}

.xp-line {
  color: #ffd6a0;
}

.xp-total {
  color: #ffb84d;
  font-weight: 900;
  margin-top: 4px;
}

.result-xp-bar {
  height: 12px;
}

.level-up-popup {
  display: none;
  margin: 10px auto 0;
  width: fit-content;
  background: linear-gradient(135deg, #ff9f1c, #ffe082, #ff7a18);
  color: #190127;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 900;
  box-shadow: 0 0 30px rgba(255, 184, 77, 0.7);
  animation: levelPop 0.45s ease-out both;
}

.level-up-popup.show {
  display: grid;
  gap: 2px;
}

.level-up-popup span {
  font-size: 12px;
}

.round-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.round-badges-title {
  width: 100%;
  color: #ffb84d;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.round-badge {
  background: linear-gradient(135deg, #43106b, #25053d);
  border: 1px solid rgba(255, 159, 28, 0.48);
  border-radius: 999px;
  color: #ffe0b3;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.reveal-pill {
  background: rgba(27, 4, 46, 0.82);
  border: 1px solid rgba(255, 159, 28, 0.48);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #ffe0b3;
  line-height: 1.2;
  white-space: nowrap;
}

/* Tag pills — same size as other pills, only color differs */
.reveal-tag {
  border-color: rgba(168, 85, 247, 0.45);
  color: #d4b8ff;
  background: rgba(80, 10, 120, 0.55);
  text-transform: capitalize;
}

.reveal-actions {
  position: relative;
  z-index: 2;
  margin-top: 18px;
}

/* ANIMATIONS */

.screen-shake {
  animation: screenShake 0.3s ease;
}

@keyframes popIn {
  from {
    transform: scale(0.92);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes cardReveal {
  from {
    transform: translateY(22px) scale(0.78) rotate(-4deg);
    opacity: 0;
  }

  62% {
    transform: translateY(-6px) scale(1.04) rotate(1deg);
    opacity: 1;
  }

  to {
    transform: translateY(0) scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes badgePop {
  from {
    opacity: 0;
    transform: scale(0.72);
    filter: brightness(1);
  }

  70% {
    opacity: 1;
    transform: scale(1.12);
    filter: brightness(1.25);
  }

  to {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes nameFlash {
  from {
    text-shadow: 0 0 10px rgba(255, 159, 28, 0.35);
  }

  50% {
    text-shadow:
      0 0 26px rgba(255, 214, 92, 0.86),
      0 0 48px rgba(255, 159, 28, 0.54);
  }

  to {
    text-shadow: 0 0 24px rgba(255, 159, 28, 0.48);
  }
}

@keyframes levelPop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.88);
  }

  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.06);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spinGlow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes hypePulse {
  from {
    box-shadow:
      0 0 42px rgba(255, 159, 28, 0.45),
      inset 0 1px 0 rgba(255, 238, 196, 0.12);
  }

  to {
    box-shadow:
      0 0 78px rgba(255, 159, 28, 0.72),
      0 0 110px rgba(151, 77, 255, 0.24),
      inset 0 1px 0 rgba(255, 238, 196, 0.16);
  }
}

@keyframes mythicBadge {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 220% 50%;
  }
}

@keyframes mythicBorder {
  0% {
    box-shadow:
      0 0 68px rgba(255, 122, 24, 0.48),
      inset 0 1px 0 rgba(255, 238, 196, 0.16);
  }

  50% {
    box-shadow:
      0 0 92px rgba(255, 214, 92, 0.72),
      0 0 120px rgba(255, 159, 28, 0.32),
      inset 0 1px 0 rgba(255, 238, 196, 0.18);
  }

  100% {
    box-shadow:
      0 0 68px rgba(255, 122, 24, 0.48),
      inset 0 1px 0 rgba(255, 238, 196, 0.16);
  }
}

@keyframes screenShake {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  50% {
    transform: translateX(6px);
  }

  75% {
    transform: translateX(-3px);
  }

  100% {
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-glow,
  .reveal-card.correct,
  .reveal-card.rarity-mythic,
  .reveal-card.rarity-mythic .reveal-badge,
  .reveal-card.is-revealing .reveal-badge,
  .reveal-card.rarity-legendary.show-name #revealName,
  .reveal-card.rarity-mythic.show-name #revealName {
    animation: none;
  }
}

/* DESKTOP DIFFICULTY LAYOUT */

@media (min-width: 900px) {
  .difficulty-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .difficulty-card:nth-child(1) {
    grid-column: 1 / span 2;
  }

  .difficulty-card:nth-child(2) {
    grid-column: 3 / span 2;
  }

  .difficulty-card:nth-child(3) {
    grid-column: 5 / span 2;
  }

  .difficulty-card:nth-child(4) {
    grid-column: 1 / span 2;
  }

  .difficulty-card:nth-child(5) {
    grid-column: 3 / span 2;
  }

  .difficulty-card:nth-child(6) {
    grid-column: 5 / span 2;
  }
}

/* MOBILE */

@media (max-width: 700px) {
  body {
    padding: 8px 8px 74px;
  }

  .game-card {
    min-height: calc(100vh - 16px);
    min-height: calc(100dvh - 16px);
    padding: 58px 12px 12px;
    border-radius: 18px;
  }

  h1 {
    font-size: clamp(28px, 9vw, 38px);
    margin: 0 0 2px;
  }

  .subtitle {
    font-size: 15px;
    margin: 0 0 9px;
  }

  .main-logo {
    width: 142px;
    max-width: 58%;
    margin: -22px auto -20px;
  }

  .small-logo {
    width: 110px;
    margin: -12px auto -8px;
  }

  .game-logo {
    width: 70px;
    margin: -44px auto -8px;
  }

  .reveal-logo {
    width: 124px;
  }

  .hero-buttons {
    gap: 9px;
    margin: 9px auto;
  }

  .progression-card,
  .stats-progression {
    margin: 8px auto 10px;
    padding: 10px;
  }

  .big-mode-btn {
    width: 100%;
    min-height: 58px;
    padding: 18px;
    font-size: 21px;
  }

  .secondary-btn {
    width: 100%;
    min-height: 50px;
    padding: 13px;
    font-size: 17px;
  }

  .difficulty-grid {
    grid-template-columns: 1fr;
  }

  .difficulty-card {
    min-height: 104px;
    border-radius: 18px;
    padding: 16px 54px 16px 18px;
    gap: 8px;
  }

  .difficulty-card .stars {
    font-size: 22px;
  }

  .difficulty-card strong {
    font-size: 24px;
  }

  .info-badge {
    top: 50%;
    right: 14px;
    left: auto;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
  }

  .info-badge:hover::after {
    right: 0;
    left: auto;
    top: 42px;
    width: min(250px, 76vw);
  }

  /* On mobile keep 2-column grid but reduce card height to prevent scroll */
  .hint-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .hint-card {
    min-height: 88px;
    font-size: 28px;
    gap: 6px;
    border-radius: 16px;
    padding: 10px;
  }

  .hint-card strong {
    font-size: 15px;
  }

  .hint-box {
    width: min(94vw, 640px);
    /* Stable height that leaves room for mobile browser bars */
    max-height: min(80dvh, 80vh);
    overflow-y: auto;
    padding: 20px 18px;
    border-radius: 20px;
  }

  .hint-box h2 {
    font-size: 26px;
    margin-bottom: 4px;
  }

  .hint-subtitle {
    margin-bottom: 14px;
    font-size: 13px;
  }

  .back-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    margin: 0;
    min-height: 38px;
    padding: 8px 11px;
    font-size: 13px;
    z-index: 25;
  }

  .game-lobby-btn {
    top: 10px;
    left: auto;
    right: 10px;
    z-index: 95;
    min-height: 40px;
    padding: 8px 13px;
    font-size: 13px;
  }

  .table-wrap {
    max-height: 56vh;
    margin-inline: -4px;
    border-radius: 10px;
  }

  table {
    min-width: 820px;
    font-size: 13px;
  }

  th,
  td {
    padding: 7px 5px;
  }

  #gameScreen {
    padding-top: 2px;
  }

  #modeTitle {
    font-size: 23px;
    margin: 0 0 2px;
  }

  #info,
  #streakText,
  #guessCounter {
    font-size: 13px;
    margin: 3px 0;
  }

  .shortcut-help {
    display: none;
  }

  .controls {
    display: grid;
    gap: 10px;
    margin-top: 14px;
  }

  .input-wrap {
    display: block;
    width: 100%;
  }

  input {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    font-size: 16px;
  }

  .controls button {
    width: 100%;
    min-height: 48px;
    margin: 0;
  }

  .suggestions {
    top: 50px;
    max-height: 210px;
    overflow-y: auto;
  }

  .calendar-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px auto;
  }

  .calendar-day {
    min-height: 64px;
    padding: 8px 6px;
  }

  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 56vh;
  }

  .collection-card {
    min-height: 178px;
    padding: 14px 10px 10px;
    gap: 4px;
  }

  .collection-card h3 {
    font-size: 16px;
    line-height: 1.1;
  }

  .collection-card p { font-size: 12px; }

  .collection-rarity {
    font-size: 10px;
    padding-right: 32px;
  }

  .collection-num {
    font-size: 9px;
    top: 6px;
    right: 8px;
  }

  .collection-meta  { font-size: 11px; gap: 2px; }
  .collection-extra { font-size: 10px; gap: 6px; margin-top: 2px; }

  .collection-filters button {
    padding: 8px 10px;
    font-size: 13px;
  }

  .reveal-card {
    width: 94vw;
    min-height: auto;
    max-height: min(84dvh, 84vh);
    overflow-y: auto;
    padding: 18px 16px;
    border-radius: 22px;
  }

  #revealName {
    font-size: clamp(28px, 10vw, 44px);
  }

  #revealSubtext {
    font-size: 17px;
  }

  .reveal-pill {
    padding: 6px 10px;
    font-size: 12px;
  }

  .xp-breakdown {
    margin-top: 10px;
  }

  .xp-panel {
    padding: 10px;
  }

  .xp-lines {
    font-size: 12px;
  }

  .level-up-popup {
    padding: 8px 12px;
  }

  .sound-panel,
  .jukebox-panel {
    display: none;
  }

  .mobile-sound-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-sound-popup {
    max-height: min(390px, 58vh);
    overflow-y: auto;
  }
}


/* ============================================================
   ACCOUNT GAME HUD
   ============================================================ */

.game-hud {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 20;
}

.hud-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 159, 28, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(55, 10, 85, 0.96), rgba(18, 0, 30, 0.94));
  border: 1px solid rgba(255, 184, 77, 0.5);
  border-radius: 18px;
  padding: 13px 15px;
  cursor: pointer;
  text-align: left;
  min-width: 196px;
  max-width: 255px;
  box-shadow:
    0 0 24px rgba(255, 159, 28, 0.18),
    inset 0 1px 0 rgba(255, 214, 160, 0.08);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hud-btn:hover {
  border-color: rgba(255, 159, 28, 0.62);
  background: rgba(55, 10, 85, 0.95);
  transform: translateY(-1px);
}

.hud-btn.hud-logged-in {
  border-color: rgba(255, 159, 28, 0.55);
}

.hud-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: flex-start;
}

.hud-icon {
  font-size: 19px;
  line-height: 1;
  flex-shrink: 0;
}

.hud-username {
  font-size: 16px;
  font-weight: 700;
  color: #ff9f1c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.hud-action {
  color: #ffe0b3;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hud-meta {
  font-size: 12px;
  color: #cda8df;
  white-space: nowrap;
  line-height: 1.2;
}

.hud-xp-bar {
  height: 5px;
  width: 100%;
  background: rgba(16, 0, 24, 0.75);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}

.hud-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7a18, #ffb84d);
  border-radius: inherit;
  transition: width 0.7s ease-out;
}

/* Push lobby content down so HUD never overlaps the logo on desktop */
#lobbyScreen .menu-panel {
  padding-top: 10px;
}


/* ============================================================
   AUTH MODAL
   ============================================================ */

.auth-box {
  max-width: 430px;
  width: min(94vw, 430px);
  text-align: center;
  padding: 30px;
}

.auth-box h2 {
  text-align: center;
  margin-bottom: 4px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 20px;
  width: 100%;
}

.auth-tab {
  flex: 1;
  padding: 9px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #bbb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.auth-tab:hover {
  background: rgba(255,255,255,0.1);
  color: #eee;
}

.auth-tab.active {
  background: #ff9f1c;
  color: #1a0030;
  border-color: #ff9f1c;
  font-weight: 700;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  align-items: stretch;
  width: 100%;
  margin: 0 auto;
}

.auth-input {
  width: 100%;
  max-width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  color: #f0e4ff;
  font-size: 15px;
  transition: border-color 0.2s;
}

#authFormArea {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.auth-input::placeholder {
  color: #776688;
}

.auth-input:focus {
  outline: none;
  border-color: #ff9f1c;
  background: rgba(255,159,28,0.06);
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: #ff9f1c;
  color: #1a0030;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 4px;
}

.auth-submit-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.auth-error {
  color: #f87171;
  font-size: 13px;
  text-align: center;
  min-height: 1.3em;
  margin: 8px 0 0;
  line-height: 1.4;
}

.auth-close-btn {
  margin-top: 12px;
  width: 100%;
  padding: 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #998aaa;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.auth-close-btn:hover {
  background: rgba(255,255,255,0.09);
  color: #ccc;
}

/* Profile view (logged-in state) */
.auth-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  width: 100%;
}

.auth-avatar {
  font-size: 3rem;
  line-height: 1;
}

.auth-profile h3 {
  margin: 0;
  color: #ff9f1c;
  font-size: 22px;
}

.auth-profile-email {
  color: #776688;
  font-size: 13px;
  margin: 0;
}

.profile-preview-card {
  width: min(100%, 360px);
  min-height: 118px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 159, 28, 0.18), transparent 36%),
    linear-gradient(145deg, #2f0a4d, #12001f);
  border: 2px solid rgba(255, 184, 77, 0.42);
  border-radius: 18px;
  padding: 34px 16px 14px;
  text-align: left;
  box-shadow: 0 0 22px rgba(255, 159, 28, 0.14);
}

.profile-banner-strip {
  position: absolute;
  inset: 0 0 auto;
  height: 28px;
  background: linear-gradient(90deg, #ff9f1c, #6d28d9);
}

.profile-preview-card strong,
.profile-preview-card span,
.profile-preview-card small {
  display: block;
  position: relative;
  z-index: 1;
}

.profile-preview-card strong {
  color: #ffb84d;
  font-size: 18px;
}

.profile-preview-card span {
  color: #ffe0b3;
  font-weight: 800;
  margin-top: 3px;
}

.profile-preview-card small {
  color: #cda8df;
  margin-top: 6px;
}

.profile-preview-card .profile-preview-icon {
  display: block;
  position: relative;
  z-index: 1;
  font-size: 28px;
  line-height: 1;
  margin: 32px 0 2px;
  font-weight: normal;
  color: inherit;
}

.icon-option {
  grid-template-columns: unset;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 14px;
}

.icon-option-emoji {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.icon-option strong,
.icon-option span {
  display: block;
}

.profile-custom-tabs {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.profile-custom-tab {
  margin: 0;
  min-height: 38px;
  padding: 8px 6px;
  border-radius: 10px;
  font-size: 13px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #ffd6a0;
}

.profile-custom-tab.active {
  background: #ff9f1c;
  color: #1a0030;
}

.profile-custom-grid {
  width: min(100%, 360px);
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  padding: 2px;
}

.profile-option {
  margin: 0;
  width: 100%;
  min-height: 58px;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  background: linear-gradient(145deg, #2f0a4d, #160226);
  border: 1px solid rgba(255, 184, 77, 0.34);
  color: #ffe0b3;
}

.profile-option strong,
.profile-option span {
  display: block;
}

.profile-option strong {
  color: #ffb84d;
}

.profile-option span {
  color: #cda8df;
  font-size: 12px;
  margin-top: 3px;
}

.profile-option.locked {
  opacity: 0.62;
  filter: grayscale(0.9);
  color: #b9a7c7;
}

.profile-option.locked strong {
  color: #c6b1d0;
}

.profile-option.locked span {
  color: #9f8aac;
}

.profile-option.selected {
  border-color: #ff9f1c;
  box-shadow: 0 0 18px rgba(255, 159, 28, 0.26);
  color: #fff2d8;
}

.banner-orange-glow {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 159, 28, 0.28), transparent 42%),
    linear-gradient(145deg, #4c136e, #190127) !important;
}

.banner-deep-purple {
  background:
    radial-gradient(circle at 0% 0%, rgba(137, 92, 246, 0.28), transparent 42%),
    linear-gradient(145deg, #341065, #100018) !important;
}

.banner-legendary-gold {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 218, 100, 0.34), transparent 42%),
    linear-gradient(145deg, #5a3507, #180226) !important;
}

.banner-mythic-flare {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 159, 28, 0.38), transparent 38%),
    radial-gradient(circle at 0% 100%, rgba(168, 85, 247, 0.28), transparent 40%),
    linear-gradient(145deg, #511174, #13001f) !important;
}

.border-common { border-color: rgba(230, 230, 240, 0.62) !important; }
.border-rare { border-color: rgba(67, 160, 255, 0.78) !important; }
.border-epic { border-color: rgba(168, 85, 247, 0.82) !important; }
.border-legendary { border-color: rgba(255, 184, 77, 0.92) !important; }
.border-mythic {
  border-color: rgba(255, 215, 90, 0.98) !important;
  box-shadow: 0 0 24px rgba(255, 159, 28, 0.34);
}

/* ============================================================
   ANIMATED BORDERS — lightweight, mobile-friendly
   will-change keeps GPU compositing on a separate layer.
   ============================================================ */

@keyframes rareShimmer {
  0%, 100% {
    border-color: rgba(67, 160, 255, 0.7);
    box-shadow: 0 0 10px rgba(67, 160, 255, 0.25);
  }
  50% {
    border-color: rgba(140, 100, 255, 0.9);
    box-shadow: 0 0 22px rgba(140, 100, 255, 0.42);
  }
}
.border-rare-shimmer {
  animation: rareShimmer 2s ease-in-out infinite;
  will-change: border-color, box-shadow;
}

@keyframes legendaryPulse {
  0%, 100% {
    border-color: rgba(255, 184, 77, 0.75);
    box-shadow: 0 0 10px rgba(255, 184, 77, 0.22);
  }
  50% {
    border-color: rgba(255, 222, 80, 1);
    box-shadow: 0 0 30px rgba(255, 200, 0, 0.55);
  }
}
.border-legendary-pulse {
  animation: legendaryPulse 1.6s ease-in-out infinite;
  will-change: border-color, box-shadow;
}

@keyframes mythicGlow {
  0%   { border-color: rgba(255, 215, 90, 0.9);  box-shadow: 0 0 18px rgba(255, 159, 28, 0.45); }
  33%  { border-color: rgba(190, 100, 255, 0.95); box-shadow: 0 0 22px rgba(168, 85, 247, 0.52); }
  66%  { border-color: rgba(255, 80, 130, 0.9);   box-shadow: 0 0 20px rgba(255, 80, 130, 0.45); }
  100% { border-color: rgba(255, 215, 90, 0.9);  box-shadow: 0 0 18px rgba(255, 159, 28, 0.45); }
}
.border-mythic-glow {
  animation: mythicGlow 3s ease-in-out infinite;
  will-change: border-color, box-shadow;
}

/* ============================================================
   ANIMATED BANNERS
   ============================================================ */

@keyframes fireStreakPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 100, 0, 0.32), inset 0 0 20px rgba(200, 30, 0, 0.07); }
  50%       { box-shadow: 0 0 26px rgba(255, 120, 0, 0.6),  inset 0 0 32px rgba(200, 30, 0, 0.14); }
}
.banner-fire-streak {
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 120, 0, 0.4), transparent 46%),
    radial-gradient(circle at 20% 100%, rgba(200, 30, 0, 0.24), transparent 42%),
    linear-gradient(145deg, #5c1200, #1f0300) !important;
  animation: fireStreakPulse 2s ease-in-out infinite;
  will-change: box-shadow;
}

@keyframes arcadeNeonGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 200, 0.3),  inset 0 0 16px rgba(0, 200, 255, 0.04); }
  50%       { box-shadow: 0 0 24px rgba(0, 255, 200, 0.65), inset 0 0 28px rgba(0, 200, 255, 0.09); }
}
.banner-arcade-neon {
  background:
    radial-gradient(circle at 60% 0%, rgba(0, 255, 200, 0.18), transparent 42%),
    linear-gradient(145deg, #050028, #0e0050) !important;
  border-color: rgba(0, 255, 200, 0.6) !important;
  animation: arcadeNeonGlow 2s ease-in-out infinite;
  will-change: box-shadow;
}

@keyframes collectionMasterPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(80, 220, 30, 0.28), inset 0 0 20px rgba(50, 160, 0, 0.05); }
  50%       { box-shadow: 0 0 26px rgba(80, 220, 30, 0.55), inset 0 0 32px rgba(50, 160, 0, 0.1);  }
}
.banner-collection-master {
  background:
    radial-gradient(circle at 50% 0%, rgba(80, 220, 30, 0.22), transparent 42%),
    linear-gradient(145deg, #0a3200, #04140a) !important;
  animation: collectionMasterPulse 2.5s ease-in-out infinite;
  will-change: box-shadow;
}

/* Sparkle label on animated options in the picker grid */
.animated-option strong::after {
  content: " ✦";
  font-size: 10px;
  opacity: 0.7;
}

.auth-signout-btn {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
  margin-top: 8px;
}

.auth-signout-btn:hover {
  background: rgba(248, 113, 113, 0.28);
}

/* Account button highlight when logged in */
#authBtn.logged-in {
  border-color: #ff9f1c;
  color: #ff9f1c;
}


/* ============================================================
   LEADERBOARD MODAL
   ============================================================ */

.leaderboard-box {
  max-width: 440px;
  width: 95%;
}

.lb-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);   /* equal fractions — no fixed min that overflows */
  gap: 6px;
  margin-bottom: 16px;
}

.lb-tab {
  min-width: 0;                             /* allow shrinking below any prior min-width */
  padding: 8px 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #bbb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}

.lb-tab:hover {
  background: rgba(255,255,255,0.1);
  color: #eee;
}

.lb-tab.active {
  background: #ff9f1c;
  color: #1a0030;
  font-weight: 700;
  border-color: #ff9f1c;
}

.badges-box,
.titles-box {
  width: min(860px, 94vw);
}

.badges-full-grid,
.titles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 4px;
  margin: 18px 0;
}

.badge-card,
.title-card {
  min-height: 142px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 159, 28, 0.12), transparent 38%),
    linear-gradient(145deg, #2f0a4d, #12001f);
  border: 1px solid rgba(255, 159, 28, 0.34);
  border-radius: 14px;
  padding: 14px;
  color: #ffe0b3;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.06);
}

.title-card {
  color: #ffe0b3;
}

.badge-card.locked,
.title-card.locked {
  filter: grayscale(0.9);
  opacity: 0.62;
  color: #b9a7c7;
}

.badge-card.unlocked,
.title-card.unlocked {
  border-color: rgba(255, 184, 77, 0.7);
  box-shadow: 0 0 18px rgba(255, 159, 28, 0.18);
}

.title-card.selected {
  outline: 2px solid #ff9f1c;
}

.badge-card-icon {
  font-size: 25px;
  margin-bottom: 8px;
}

.badge-card strong,
.title-card strong {
  display: block;
  color: #ffb84d;
  margin-bottom: 6px;
}

.title-card.locked strong {
  color: #c6b1d0;
}

.badge-card span,
.title-card span,
.badge-card em,
.title-card em {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.badge-card em,
.title-card em {
  color: #cda8df;
  margin-top: 8px;
  font-style: normal;
  font-weight: 800;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 52vh;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 2px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  font-size: 14px;
}

.lb-row.lb-you {
  border-color: #ff9f1c;
  background: rgba(255, 159, 28, 0.08);
}

.lb-rank {
  color: #665577;
  min-width: 2.6em;
  font-size: 12px;
  text-align: right;
}

.lb-name {
  flex: 1;
  color: #e8d8ff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-value {
  color: #ff9f1c;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.lb-loading {
  text-align: center;
  color: #776688;
  padding: 24px;
  font-size: 14px;
}


/* ============================================================
   REVEAL — COMMUNITY STATS LINE
   ============================================================ */

.reveal-global-stat {
  font-size: 12px;
  color: #998aaa;
  text-align: center;
  min-height: 1.4em;
  margin: 6px 0 2px;
  letter-spacing: 0.01em;
}


/* ============================================================
   MOBILE — Auth + Leaderboard overrides
   ============================================================ */

@media (max-width: 700px) {
  .auth-box,
  .leaderboard-box {
    width: min(94vw, 640px);
  }

  .auth-box {
    padding: 22px 18px;
  }

  #authFormArea,
  .profile-preview-card,
  .profile-custom-tabs,
  .profile-custom-grid {
    max-width: 100%;
    width: 100%;
  }

  .auth-tabs {
    gap: 8px;
  }

  .auth-input,
  .auth-submit-btn,
  .auth-close-btn {
    min-height: 46px;
  }

  .lb-list {
    max-height: 46vh;
  }

  /* Keep all 5 tabs in one row on mobile — short labels (XP/Streak/CP/Mythic/Daily) fit */
  .lb-tabs {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }

  .lb-tab {
    font-size: 11px;
    padding: 7px 2px;
  }

  .badges-full-grid,
  .titles-grid {
    grid-template-columns: 1fr;
    max-height: 58vh;
  }

  /* HUD: shrink to icon + level number so it never overlaps the logo */
  .game-hud {
    top: 10px;
    left: 10px;
  }

  .hud-btn {
    min-width: 0;
    max-width: 106px;
    padding: 7px 9px;
    gap: 2px;
    border-radius: 14px;
  }

  .hud-meta {
    display: block;
    white-space: normal;
    font-size: 10px;
    line-height: 1.15;
  }

  .hud-action {
    display: none;
  }

  .hud-xp-bar {
    width: 70px;
    height: 4px;
  }

  .hud-username {
    font-size: 12px;
    max-width: 72px;
  }

  .hud-icon {
    font-size: 14px;
  }

  .game-card:has(#gameScreen[style*="block"]) .game-hud {
    display: none;
  }
}


/* ============================================================
   LANDSCAPE MOBILE — compact music controls + HUD
   Targets phones/tablets held horizontally (short viewport).
   Desktop (max-height > 500px) is unaffected.
   ============================================================ */

@media (orientation: landscape) and (max-height: 500px) {

  /* HUD: strip everything except icon + username */
  .game-hud {
    top: 5px;
    left: 5px;
  }

  .hud-btn {
    max-width: 78px;
    padding: 4px 7px;
    gap: 1px;
    border-radius: 11px;
  }

  .hud-meta,
  .hud-action,
  .hud-xp-bar {
    display: none;
  }

  .hud-username {
    font-size: 10px;
    max-width: 56px;
  }

  .hud-icon {
    font-size: 11px;
  }

  /* Music toggle: compact pill */
  .mobile-sound-toggle {
    bottom: 6px;
    right: 6px;
    padding: 4px 9px;
    font-size: 11px;
    min-height: 26px;
  }

  /* Popup: narrower, shorter, smaller text */
  .mobile-sound-popup {
    max-height: min(240px, 76vh);
    padding: 7px 9px;
    font-size: 11px;
    right: 5px;
    bottom: 44px;
    width: min(220px, 62vw);
  }

  .mobile-sound-header {
    margin-bottom: 4px;
  }

  .mobile-sound-header strong {
    font-size: 12px;
  }

  .mobile-sound-header button {
    min-height: 24px;
    padding: 0 6px;
    font-size: 12px;
  }

  .mobile-now-playing {
    font-size: 10px;
    margin-bottom: 5px;
  }

  .mobile-next-song {
    min-height: 26px;
    font-size: 11px;
    padding: 3px 9px;
    margin-bottom: 4px;
  }

  .mobile-sound-row {
    gap: 4px;
    margin-top: 3px;
  }

  .mobile-sound-row button {
    min-height: 26px;
    font-size: 11px;
    padding: 0 6px;
  }

  .mobile-sound-row input {
    min-height: 22px;
  }

  .mobile-sound-row label {
    font-size: 10px;
  }
}


/* ============================================================
   COLLECTION 2.0 — Power score + Cards/Sets view switcher
   ============================================================ */

.collection-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #bbaad0;
  margin-bottom: 6px;
}

.coll-count {
  font-weight: 600;
  color: #d4c8e8;
}

.coll-power {
  font-weight: 700;
  color: #ff9f1c;
  letter-spacing: 0.02em;
}

/* Cards / Sets tab switcher */
.collection-view-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.coll-view-tab {
  flex: 1;
  padding: 7px 12px;
  border: 1.5px solid #4a3b6b;
  border-radius: 10px;
  background: transparent;
  color: #a090c0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.coll-view-tab.active,
.coll-view-tab:hover {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.15);
  color: #d4b8f8;
}

/* Card number — top-right corner, never overlaps rarity */
.collection-num {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 10px;
  color: #7766aa;
  font-weight: 600;
  pointer-events: none;
}

.collection-extra {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 11px;
  color: #8877aa;
  min-width: 0;
}
.collection-extra span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Collection card needs relative position for .collection-num */
.collection-card {
  position: relative;
}


/* ============================================================
   COLLECTION SETS — set cards
   ============================================================ */

.collection-sets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

@media (min-width: 600px) {
  .collection-sets-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.set-card {
  background: rgba(42, 28, 72, 0.7);
  border: 1.5px solid #3d2b5e;
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.set-card.set-complete {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
}

.set-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.set-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}

.set-card-info {
  flex: 1;
  min-width: 0;
}

.set-card-info strong {
  display: block;
  font-size: 13px;
  color: #d4c8e8;
  font-weight: 700;
  margin-bottom: 2px;
}

.set-card-info span {
  font-size: 11px;
  color: #7766aa;
  line-height: 1.35;
}

.set-check {
  color: #a855f7;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.set-progress-bar {
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.set-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.set-card.set-complete .set-progress-fill {
  background: linear-gradient(90deg, #a855f7, #f0c040);
}

.set-progress-label {
  font-size: 11px;
  color: #8877aa;
  text-align: right;
}

.set-card.set-complete .set-progress-label {
  color: #a855f7;
  font-weight: 700;
}


/* ============================================================
   ULTRA-RARE ANIMATED COSMETICS
   ============================================================ */

/* --- Mythic Crown border --- */
@keyframes mythicCrownPulse {
  0%   { box-shadow: 0 0 0 2px #a855f7, 0 0 16px 4px rgba(168,85,247,0.4), 0 0 40px 10px rgba(240,192,64,0.12); }
  50%  { box-shadow: 0 0 0 3px #f0c040, 0 0 28px 8px rgba(240,192,64,0.5), 0 0 60px 16px rgba(168,85,247,0.25); }
  100% { box-shadow: 0 0 0 2px #a855f7, 0 0 16px 4px rgba(168,85,247,0.4), 0 0 40px 10px rgba(240,192,64,0.12); }
}

.border-mythic-crown {
  animation: mythicCrownPulse 2.5s ease-in-out infinite;
  will-change: box-shadow;
}

/* --- Galaxy border --- */
@keyframes galaxySpin {
  0%   { box-shadow: 0 0 0 2px #6366f1, 0 0 20px 6px rgba(99,102,241,0.5), 0 0 50px 15px rgba(168,85,247,0.2); border-color: #6366f1; }
  33%  { box-shadow: 0 0 0 2px #a855f7, 0 0 20px 6px rgba(168,85,247,0.5), 0 0 50px 15px rgba(59,130,246,0.2); border-color: #a855f7; }
  66%  { box-shadow: 0 0 0 2px #3b82f6, 0 0 20px 6px rgba(59,130,246,0.5), 0 0 50px 15px rgba(99,102,241,0.2); border-color: #3b82f6; }
  100% { box-shadow: 0 0 0 2px #6366f1, 0 0 20px 6px rgba(99,102,241,0.5), 0 0 50px 15px rgba(168,85,247,0.2); border-color: #6366f1; }
}

.border-galaxy {
  animation: galaxySpin 3.5s linear infinite;
  will-change: box-shadow, border-color;
}

/* --- Flame Streak border --- */
@keyframes flameStreakBorder {
  0%   { box-shadow: 0 0 0 2px #ef4444, 0 0 14px 4px rgba(239,68,68,0.4), 0 0 28px 8px rgba(249,115,22,0.2); }
  50%  { box-shadow: 0 0 0 3px #f97316, 0 0 22px 7px rgba(249,115,22,0.55), 0 0 45px 14px rgba(239,68,68,0.25); }
  100% { box-shadow: 0 0 0 2px #ef4444, 0 0 14px 4px rgba(239,68,68,0.4), 0 0 28px 8px rgba(249,115,22,0.2); }
}

.border-flame-streak {
  animation: flameStreakBorder 1.8s ease-in-out infinite;
  will-change: box-shadow;
}

/* --- Spectrum border --- */
@keyframes spectrumCycle {
  0%   { box-shadow: 0 0 0 2px #ef4444, 0 0 16px 5px rgba(239,68,68,0.4); }
  20%  { box-shadow: 0 0 0 2px #f97316, 0 0 16px 5px rgba(249,115,22,0.4); }
  40%  { box-shadow: 0 0 0 2px #eab308, 0 0 16px 5px rgba(234,179,8,0.4); }
  60%  { box-shadow: 0 0 0 2px #22c55e, 0 0 16px 5px rgba(34,197,94,0.4); }
  80%  { box-shadow: 0 0 0 2px #3b82f6, 0 0 16px 5px rgba(59,130,246,0.4); }
  100% { box-shadow: 0 0 0 2px #ef4444, 0 0 16px 5px rgba(239,68,68,0.4); }
}

.border-spectrum {
  animation: spectrumCycle 4s linear infinite;
  will-change: box-shadow;
}

/* --- Championship banner --- */
@keyframes championshipPulse {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.banner-championship {
  background: linear-gradient(135deg, #1a0a30 0%, #3d2800 40%, #1a0a30 70%, #2d1050 100%);
  background-size: 300% 300%;
  animation: championshipPulse 4s ease infinite;
  will-change: background-position;
}

.banner-championship .profile-banner-strip {
  background: linear-gradient(90deg, #f0c040, #ff9f1c, #f0c040);
  background-size: 200% 100%;
  animation: championshipPulse 2s linear infinite;
}

/* --- Vault banner --- */
@keyframes vaultGlow {
  0%   { box-shadow: inset 0 0 20px rgba(168,85,247,0.15); }
  50%  { box-shadow: inset 0 0 40px rgba(168,85,247,0.35); }
  100% { box-shadow: inset 0 0 20px rgba(168,85,247,0.15); }
}

.banner-vault {
  background: linear-gradient(135deg, #0d0520 0%, #1e0d3a 50%, #0d0520 100%);
  animation: vaultGlow 3s ease-in-out infinite;
  will-change: box-shadow;
}

.banner-vault .profile-banner-strip {
  background: linear-gradient(90deg, #7c3aed, #a855f7, #6d28d9);
  background-size: 200% 100%;
  animation: championshipPulse 2.5s linear infinite;
}

/* --- Sicko Banner --- */
@keyframes sickoBannerFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.banner-sicko-banner {
  background: linear-gradient(135deg, #0a0a14 0%, #1a0a30 35%, #0a1430 70%, #0a0a14 100%);
  background-size: 300% 300%;
  animation: sickoBannerFlow 5s ease infinite;
  will-change: background-position;
}

.banner-sicko-banner .profile-banner-strip {
  background: linear-gradient(90deg, #1e40af, #3b82f6, #6366f1, #3b82f6, #1e40af);
  background-size: 300% 100%;
  animation: sickoBannerFlow 2s linear infinite;
}

/* ============================================================
   NEW ANIMATED BANNERS
   ============================================================ */

/* --- Hardwood Royalty banner (wins-500) --- */
@keyframes hardwoodRoyalty {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.banner-hardwood-royalty {
  background: linear-gradient(135deg, #1a0800 0%, #3d1a00 30%, #6b2e00 55%, #3d1a00 80%, #1a0800 100%);
  background-size: 300% 300%;
  animation: hardwoodRoyalty 4.5s ease infinite;
  will-change: background-position;
}

.banner-hardwood-royalty .profile-banner-strip {
  background: linear-gradient(90deg, #c2410c, #ea580c, #f59e0b, #ea580c, #c2410c);
  background-size: 300% 100%;
  animation: hardwoodRoyalty 2s linear infinite;
}

/* --- Mythic Collector banner (mythic-25) --- */
@keyframes mythicCollectorB {
  0%   { background-position: 0% 50%; box-shadow: inset 0 0 30px rgba(168,85,247,0.2); }
  50%  { background-position: 100% 50%; box-shadow: inset 0 0 60px rgba(168,85,247,0.4); }
  100% { background-position: 0% 50%; box-shadow: inset 0 0 30px rgba(168,85,247,0.2); }
}

.banner-mythic-collector-b {
  background: linear-gradient(135deg, #0d0520 0%, #2d0d50 25%, #4c1d95 50%, #2d0d50 75%, #0d0520 100%);
  background-size: 300% 300%;
  animation: mythicCollectorB 3.5s ease infinite;
  will-change: background-position, box-shadow;
}

.banner-mythic-collector-b .profile-banner-strip {
  background: linear-gradient(90deg, #7c3aed, #a855f7, #e879f9, #a855f7, #7c3aed);
  background-size: 400% 100%;
  animation: hardwoodRoyalty 1.8s linear infinite;
}

/* --- Hall of Fame banner (daily-streak-100) --- */
@keyframes hallOfFameB {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 200%; }
}

.banner-hall-of-fame-b {
  background: linear-gradient(135deg,
    #1a1000 0%, #3d2800 20%, #7a5200 40%,
    #b8860b 50%, #7a5200 60%, #3d2800 80%, #1a1000 100%);
  background-size: 300% 300%;
  animation: hardwoodRoyalty 5s ease infinite;
  will-change: background-position;
}

.banner-hall-of-fame-b .profile-banner-strip {
  background: linear-gradient(90deg, #b8860b, #f0c040, #fffacd, #f0c040, #b8860b);
  background-size: 300% 100%;
  animation: hallOfFameB 2.5s linear infinite;
}

/* --- Cosmic banner (10 hidden sets) --- */
@keyframes cosmicBanner {
  0%   { background-position: 0% 50%; filter: hue-rotate(0deg); }
  50%  { background-position: 100% 50%; filter: hue-rotate(180deg); }
  100% { background-position: 0% 50%; filter: hue-rotate(360deg); }
}

.banner-cosmic {
  background: linear-gradient(135deg,
    #000000 0%, #0d0d2b 15%, #1a0533 30%,
    #0a1a3d 50%, #1a0533 70%, #0d0d2b 85%, #000000 100%);
  background-size: 300% 300%;
  animation: cosmicBanner 6s ease infinite;
  will-change: background-position, filter;
}

.banner-cosmic .profile-banner-strip {
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899, #06b6d4, #6366f1);
  background-size: 400% 100%;
  animation: hardwoodRoyalty 2s linear infinite;
}

/* ============================================================
   NEW BORDERS
   ============================================================ */

/* --- Trophy Frame (non-animated, wins-100) --- */
.border-trophy-frame {
  border: 2px solid #f59e0b;
  box-shadow: 0 0 0 1px rgba(245,158,11,0.4), 0 0 12px 3px rgba(245,158,11,0.25);
}

/* --- Diamond Frame (animated, mythic-50) --- */
@keyframes diamondFrame {
  0%   { box-shadow: 0 0 0 2px #67e8f9, 0 0 16px 5px rgba(103,232,249,0.5), 0 0 40px 12px rgba(59,130,246,0.2); border-color: #67e8f9; }
  33%  { box-shadow: 0 0 0 2px #a5f3fc, 0 0 16px 5px rgba(165,243,252,0.6), 0 0 40px 12px rgba(103,232,249,0.3); border-color: #a5f3fc; }
  66%  { box-shadow: 0 0 0 2px #38bdf8, 0 0 16px 5px rgba(56,189,248,0.5), 0 0 40px 12px rgba(14,165,233,0.2); border-color: #38bdf8; }
  100% { box-shadow: 0 0 0 2px #67e8f9, 0 0 16px 5px rgba(103,232,249,0.5), 0 0 40px 12px rgba(59,130,246,0.2); border-color: #67e8f9; }
}

.border-diamond-frame {
  animation: diamondFrame 2.5s linear infinite;
  will-change: box-shadow, border-color;
}

/* --- Hall of Fame Frame (non-animated, wins-500) --- */
.border-hall-of-fame-frame {
  border: 2px solid #b8860b;
  box-shadow: 0 0 0 1px rgba(184,134,11,0.5), 0 0 14px 4px rgba(240,192,64,0.3), 0 0 30px 8px rgba(184,134,11,0.15);
}

/* --- Commissioner Frame (animated, The Commissioner prestige) --- */
@keyframes commissionerFrame {
  0%   { box-shadow: 0 0 0 2px #e2e8f0, 0 0 16px 5px rgba(226,232,240,0.4), 0 0 40px 12px rgba(148,163,184,0.2); border-color: #e2e8f0; }
  25%  { box-shadow: 0 0 0 2px #f0c040, 0 0 16px 5px rgba(240,192,64,0.5), 0 0 40px 12px rgba(234,179,8,0.25); border-color: #f0c040; }
  50%  { box-shadow: 0 0 0 2px #e2e8f0, 0 0 16px 5px rgba(226,232,240,0.4), 0 0 40px 12px rgba(148,163,184,0.2); border-color: #e2e8f0; }
  75%  { box-shadow: 0 0 0 2px #f0c040, 0 0 16px 5px rgba(240,192,64,0.5), 0 0 40px 12px rgba(234,179,8,0.25); border-color: #f0c040; }
  100% { box-shadow: 0 0 0 2px #e2e8f0, 0 0 16px 5px rgba(226,232,240,0.4), 0 0 40px 12px rgba(148,163,184,0.2); border-color: #e2e8f0; }
}

.border-commissioner-frame {
  animation: commissionerFrame 3s ease-in-out infinite;
  will-change: box-shadow, border-color;
}

/* ============================================================
   CARD CLICKABLE
   ============================================================ */

.card-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-clickable:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(168,85,247,0.35);
}

.card-clickable:active {
  transform: translateY(0) scale(0.99);
}

/* ============================================================
   PLAYER CARD DETAIL MODAL
   ============================================================ */

.player-card-box {
  max-width: 520px;
  width: 94vw;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
}

.pcd-wrap {
  background: linear-gradient(160deg, #0f0a1e 0%, #1a0f35 60%, #0d1a2e 100%);
  border-radius: 14px;
  border: 1px solid rgba(168,85,247,0.3);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.pcd-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(168,85,247,0.15);
}

.pcd-rarity-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(168,85,247,0.2);
  color: #a855f7;
  border: 1px solid rgba(168,85,247,0.4);
}

.pcd-rarity-badge.rarity-common    { color: #9ca3af; background: rgba(156,163,175,0.15); border-color: rgba(156,163,175,0.35); }
.pcd-rarity-badge.rarity-rare      { color: #60a5fa; background: rgba(96,165,250,0.15);  border-color: rgba(96,165,250,0.35);  }
.pcd-rarity-badge.rarity-epic      { color: #c084fc; background: rgba(192,132,252,0.15); border-color: rgba(192,132,252,0.35); }
.pcd-rarity-badge.rarity-legendary { color: #fbbf24; background: rgba(251,191,36,0.15);  border-color: rgba(251,191,36,0.35);  }
.pcd-rarity-badge.rarity-mythic    { color: #f87171; background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.35); }

.pcd-num {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}

.pcd-name-block {
  padding: 16px 20px 10px;
  text-align: center;
}

.pcd-name {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.pcd-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.pcd-career-span {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
  padding: 2px 10px;
  border-radius: 20px;
}

.pcd-big-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px 6px;
}

.pcd-stat-box {
  text-align: center;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 72px;
  flex: 1;
  max-width: 110px;
  border: 1px solid rgba(255,255,255,0.08);
}

.pcd-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.pcd-stat-lbl {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.pcd-bars {
  padding: 8px 20px 10px;
}

.pcd-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.pcd-bar-lbl {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  width: 32px;
  flex-shrink: 0;
}

.pcd-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.pcd-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

.pcd-bar-val {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

.pcd-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 4px 20px;
}

.pcd-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  padding: 8px 20px;
}

.pcd-info-row {
  display: flex;
  flex-direction: column;
  font-size: 11px;
}

.pcd-info-row span:first-child {
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 10px;
}

.pcd-info-row span:last-child {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 12px;
}

.pcd-coll-stats {
  padding: 8px 20px 10px;
  background: rgba(168,85,247,0.05);
  border-top: 1px solid rgba(168,85,247,0.1);
}

.pcd-coll-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  padding: 2px 0;
}

.pcd-coll-row strong {
  color: #a855f7;
  font-weight: 700;
}

.pcd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 20px 14px;
}

.pcd-tag {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 2px 8px;
}

.modal-close-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 10px 20px 14px;
  padding: 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.modal-close-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ============================================================
   SET DETAIL MODAL
   ============================================================ */

.set-detail-box {
  max-width: 460px;
  width: 92vw;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
}

.set-detail-inner {
  background: linear-gradient(160deg, #0f0a1e 0%, #1a0f35 60%, #0d1a2e 100%);
  border-radius: 14px;
  border: 1px solid rgba(168,85,247,0.3);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.set-detail-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(168,85,247,0.12);
}

.set-detail-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.set-detail-hdr > div {
  flex: 1;
}

.set-detail-hdr > div h3 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 3px;
}

.set-detail-hdr > div p {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.set-detail-prog {
  padding: 12px 20px 6px;
}

.set-detail-prog-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 5px;
}

.set-detail-prog-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  transition: width 0.4s ease;
}

.set-detail-prog-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-align: right;
}

.set-detail-reward {
  font-size: 11px;
  color: #a855f7;
  padding: 0 20px 10px;
  font-style: italic;
}

.set-detail-no-list {
  padding: 14px 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  text-align: center;
  font-style: italic;
}

.set-players-list {
  max-height: 300px;
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(168,85,247,0.4) transparent;
}

.set-players-list::-webkit-scrollbar {
  width: 4px;
}

.set-players-list::-webkit-scrollbar-thumb {
  background: rgba(168,85,247,0.4);
  border-radius: 2px;
}

.set-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}

.set-player-row.collected {
  cursor: pointer;
}

.set-player-row.collected:hover {
  background: rgba(168,85,247,0.1);
}

.set-player-row.collected:hover .spr-name {
  color: #c084fc;
}

.spr-check {
  color: #a855f7;
  font-size: 14px;
  font-weight: 700;
  width: 16px;
  flex-shrink: 0;
}

.spr-lock {
  color: rgba(255,255,255,0.2);
  font-size: 14px;
  width: 16px;
  flex-shrink: 0;
}

.spr-name {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  transition: color 0.12s;
}

.spr-name.locked {
  color: rgba(255,255,255,0.3);
  font-weight: 400;
}


/* ============================================================
   FEEDBACK FAB & ROADMAP MODAL
   ============================================================ */

/* ── Feedback floating action button ── */
.feedback-fab {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 93;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #ff9f1c;
  border: 1.5px solid rgba(255, 159, 28, 0.45);
  border-radius: 50px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  letter-spacing: 0.3px;
}
.feedback-fab:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 159, 28, 0.8);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 159, 28, 0.22);
}
.feedback-fab:active { transform: translateY(0); }

/* ── What's New lobby button ── */
.whatsnew-btn {
  position: relative;
  border-color: rgba(129, 140, 248, 0.55) !important;
  color: #a5b4fc !important;
}
.whatsnew-btn::after {
  content: "NEW";
  position: absolute;
  top: -7px;
  right: -2px;
  background: #818cf8;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.8px;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── Roadmap modal box ── */
.roadmap-box {
  max-width: 560px;
  width: 92%;
  max-height: min(88dvh, 88vh);
  overflow-y: auto;
  padding: 24px 20px 0;
  text-align: left;
}

.roadmap-content { padding-bottom: 8px; }

.roadmap-section { margin-bottom: 28px; }

.roadmap-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: #ff9f1c;
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 159, 28, 0.22);
}

/* ── Status dots ── */
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.status-dot.done {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.7);
}
.status-dot.wip {
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.7);
  animation: dot-pulse 1.9s ease-in-out infinite;
}
.status-dot.planned {
  background: #818cf8;
  box-shadow: 0 0 6px rgba(129, 140, 248, 0.6);
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Roadmap list items (recently added / in progress) ── */
.roadmap-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 7px;
}
.roadmap-item-text strong {
  display: block;
  font-size: 13px;
  color: #fff;
  margin-bottom: 2px;
}
.roadmap-item-text small {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

/* ── Community voting ── */
.roadmap-vote-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.42);
  margin: 0 0 10px;
  font-style: italic;
}
.vote-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 7px;
}
.vote-emoji { font-size: 19px; line-height: 1; flex-shrink: 0; }
.vote-item-info { flex: 1; min-width: 0; }
.vote-item-info strong {
  display: block;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vote-item-info small { font-size: 11.5px; color: rgba(255, 255, 255, 0.45); }
/* .vote-count removed — no numeric totals shown (votes are device-local only) */
.vote-btn {
  background: rgba(255, 159, 28, 0.11);
  border: 1.5px solid rgba(255, 159, 28, 0.38);
  color: #ff9f1c;
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}
.vote-btn:hover:not(:disabled) {
  background: rgba(255, 159, 28, 0.28);
  transform: scale(1.04);
}
.vote-btn:active:not(:disabled) { transform: scale(0.97); }
.vote-btn.voted {
  background: rgba(74, 222, 128, 0.11);
  border-color: rgba(74, 222, 128, 0.5);
  color: #4ade80;
  cursor: default;
}

/* ── Future roadmap phases ── */
.phase-list { display: flex; flex-direction: column; gap: 7px; }
.roadmap-phase {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 11px 14px;
}
.roadmap-phase > .status-dot { margin-top: 7px; }
.phase-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.36);
  margin-bottom: 1px;
}
.phase-name  { font-size: 13px; font-weight: 700; color: #fff; }
.phase-desc  { font-size: 11.5px; color: rgba(255, 255, 255, 0.45); margin-top: 2px; }

/* ── Mobile tweaks (roadmap modal only — feedback-fab moved to LEFT
   in the dedicated MOBILE CENTERING block further down) ── */
@media (max-width: 600px) {
  .roadmap-box {
    max-height: min(90dvh, 90vh);
    padding: 18px 14px 0;
  }
  .vote-item { flex-wrap: wrap; gap: 8px; }
  .vote-item-info { flex-basis: calc(100% - 110px); }
}


/* ============================================================
   ARCHETYPE RARITY TIERS
   ============================================================ */

/* 🟢 Common */
.archetype-common   { color: #86efac; font-weight: 700; }
/* 🟣 Rare */
.archetype-rare     { color: #c084fc; font-weight: 700; }
/* 🔥 Roast */
.archetype-roast    { color: #fb923c; font-weight: 700; }
/* 🏆 Ultra Rare — shimmering gold */
.archetype-ultraRare {
  color: #fbbf24;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
  animation: archetype-glow 2.5s ease-in-out infinite;
}

@keyframes archetype-glow {
  0%, 100% { text-shadow: 0 0 8px  rgba(251, 191, 36, 0.35); }
  50%       { text-shadow: 0 0 18px rgba(251, 191, 36, 0.85), 0 0 30px rgba(251, 191, 36, 0.22); }
}

/* Archetype tier callout banner shown above the archetype name on reveal */
.archetype-callout {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.archetype-callout.roast {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.4);
}
.archetype-callout.rare {
  background: rgba(192, 132, 252, 0.12);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.35);
}
.archetype-callout.ultraRare {
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.45);
  animation: archetype-glow 2.5s ease-in-out infinite;
}

/* Colored archetype in reveal-details pills */
.reveal-pill.archetype-rare     { border-color: rgba(192, 132, 252, 0.55); color: #c084fc; }
.reveal-pill.archetype-roast    { border-color: rgba(251, 146, 60, 0.55);  color: #fb923c; }
.reveal-pill.archetype-ultraRare { border-color: rgba(251, 191, 36, 0.65); color: #fbbf24; }
.reveal-pill.archetype-common   { border-color: rgba(134, 239, 172, 0.45); color: #86efac; }


/* ============================================================
   LEVEL BADGE SYSTEM
   ============================================================ */

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.level-badge.badge-bronze   { background: rgba(205, 127, 50, 0.18);  color: #cd9a5a; border: 1px solid rgba(205, 127, 50, 0.38);  }
.level-badge.badge-silver   { background: rgba(192, 192, 192, 0.13); color: #c0c0c0; border: 1px solid rgba(192, 192, 192, 0.32); }
.level-badge.badge-gold     { background: rgba(251, 191, 36, 0.15);  color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.42);  }
.level-badge.badge-platinum { background: rgba(167, 139, 250, 0.14); color: #a78bfa; border: 1px solid rgba(167, 139, 250, 0.38); }
.level-badge.badge-diamond  { background: rgba(103, 232, 249, 0.13); color: #67e8f9; border: 1px solid rgba(103, 232, 249, 0.38); }
.level-badge.badge-hof      {
  background: rgba(255, 159, 28, 0.18);
  color: #ff9f1c;
  border: 1px solid rgba(255, 159, 28, 0.5);
  animation: hof-badge-pulse 2.2s ease-in-out infinite;
}
@keyframes hof-badge-pulse {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 8px rgba(255, 159, 28, 0.4); }
}


/* ============================================================
   PROGRESSION CALLOUTS (after-game feedback)
   ============================================================ */

.prog-callouts {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.prog-callout {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 7px;
  padding: 6px 11px;
  border-left: 3px solid rgba(255, 159, 28, 0.5);
  line-height: 1.45;
}
.prog-callout strong          { color: #fff; }
.prog-callout.callout-badge   { border-left-color: #c084fc; }
.prog-callout.callout-set     { border-left-color: #4ade80; }
.prog-callout.callout-level   { border-left-color: #fbbf24; }


/* ============================================================
   LEADERBOARD ROWS — consolidated (replaces the flat flex version above)
   ============================================================ */

/* 3-column grid: rank | name+title | value */
.lb-row {
  display: grid !important;
  grid-template-columns: 32px 1fr auto !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 10px !important;
}

.lb-name-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

/* Icon + username on the same line */
.lb-identity-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.lb-profile-icon {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}
.lb-username {
  font-size: 14px;
  font-weight: 700;
  color: #e8d8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Title + level on the line below username */
.lb-sub-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.lb-user-title {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.lb-level {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.28);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Value column (XP / streak / CP / etc.) */
.lb-value-block { text-align: right; flex-shrink: 0; }
.lb-value-main  {
  font-size: 13px;
  font-weight: 700;
  color: #ff9f1c;
  white-space: nowrap;
}

/* ── Error state ─────────────────────────────────────────────── */
.lb-error {
  text-align: center;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #f87171;
  font-size: 14px;
  font-weight: 600;
}
.lb-error-sub {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.6;
  max-width: 280px;
}
.lb-retry-btn {
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #e8d8ff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.15s;
}
.lb-retry-btn:hover { background: rgba(255, 255, 255, 0.14); }


/* ── Collection lazy-load button ── */
.coll-load-more {
  grid-column: 1 / -1;           /* spans full grid width */
  text-align: center;
  padding: 16px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #ff9f1c;
  cursor: pointer;
  border: 1px dashed rgba(255, 159, 28, 0.3);
  border-radius: 12px;
  background: rgba(255, 159, 28, 0.05);
  transition: background 0.15s;
  user-select: none;
}
.coll-load-more:hover { background: rgba(255, 159, 28, 0.1); }
.coll-load-remaining  { font-weight: 400; color: rgba(255,255,255,0.38); font-size: 12px; }


/* Hidden badge in badge grid */
.badge-card.hidden-badge {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
}
.badge-card.hidden-badge strong { color: rgba(255, 255, 255, 0.22); letter-spacing: 2px; }
.badge-card.hidden-badge span   { color: rgba(255, 255, 255, 0.25); font-style: italic; }


/* ============================================================
   ONBOARDING — Welcome + What's New popups
   ============================================================ */

.onboarding-overlay {
  z-index: 9999;
  align-items: center;
}

/* Welcome box */
.welcome-box {
  max-width: 360px;
  text-align: center;
  padding: 32px 28px 24px;
  border-color: rgba(255, 159, 28, 0.4);
}

.welcome-emoji {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 10px;
}

.welcome-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.welcome-tagline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 20px;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  text-align: left;
}

.welcome-feature {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 159, 28, 0.07);
  border: 1px solid rgba(255, 159, 28, 0.18);
  border-radius: 8px;
  padding: 8px 12px;
}

.welcome-start-btn {
  width: 100%;
  padding: 13px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff9f1c, #e07b00);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.welcome-start-btn:hover { opacity: 0.88; }

/* What's New box */
.whatsnew-popup-box {
  max-width: 380px;
  padding: 28px 24px 22px;
  border-color: rgba(168, 85, 247, 0.4);
}

.whatsnew-version-tag {
  display: inline-block;
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #c084fc;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

.whatsnew-popup-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 16px;
}

.whatsnew-popup-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.whatsnew-popup-section {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 12px;
}

.whatsnew-popup-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.whatsnew-popup-label.new  { color: #4ade80; }
.whatsnew-popup-label.soon { color: rgba(255, 255, 255, 0.35); }

.whatsnew-popup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.whatsnew-popup-list li {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  padding-left: 14px;
  position: relative;
}
.whatsnew-popup-list li::before {
  content: "•";
  position: absolute;
  left: 2px;
  color: #4ade80;
}
.whatsnew-popup-list.soon li {
  color: rgba(255, 255, 255, 0.38);
}
.whatsnew-popup-list.soon li::before {
  color: rgba(255, 255, 255, 0.22);
}

@media (max-width: 480px) {
  .welcome-box,
  .whatsnew-popup-box {
    margin: 12px;
    padding: 22px 18px 18px;
  }
  .whatsnew-popup-cols { grid-template-columns: 1fr; }
}


/* ============================================================
   LEADERBOARD — updated rows (no level-tier badges)
   ============================================================ */

.lb-identity-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-profile-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.lb-level {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.3px;
  white-space: nowrap;
}


/* ============================================================
   EARLY-GAME BANNERS (levels 10–22)
   ============================================================ */

/* Rookie Season — warm orange-brown hardwood feel */
.banner-rookie-season {
  background:
    radial-gradient(circle at 80% 10%, rgba(255, 159, 28, 0.22), transparent 44%),
    linear-gradient(145deg, #2a1200, #150800) !important;
}

/* Hardwood Starter — rich court brown */
.banner-hardwood-starter {
  background:
    radial-gradient(circle at 20% 80%, rgba(196, 100, 20, 0.28), transparent 40%),
    linear-gradient(145deg, #3b1a04, #1a0a00) !important;
}

/* Orange Lights — arena orange glow */
.banner-orange-lights {
  background:
    radial-gradient(circle at 60% 0%, rgba(255, 120, 20, 0.32), transparent 46%),
    radial-gradient(circle at 40% 100%, rgba(200, 60, 0, 0.18), transparent 40%),
    linear-gradient(145deg, #3d1500, #200900) !important;
}

/* Stat Sheet — clean cool-grey data aesthetic */
.banner-stat-sheet-banner {
  background:
    radial-gradient(circle at 100% 0%, rgba(148, 163, 184, 0.18), transparent 42%),
    linear-gradient(145deg, #0f172a, #1e293b) !important;
}

/* Daily Grind — consistent teal hustle energy */
.banner-daily-grind-banner {
  background:
    radial-gradient(circle at 0% 0%, rgba(20, 184, 166, 0.22), transparent 44%),
    linear-gradient(145deg, #042020, #001818) !important;
}

/* Purple Pulse — vibrant mid-purple step above deep-purple */
.banner-purple-pulse {
  background:
    radial-gradient(circle at 50% 0%, rgba(192, 132, 252, 0.28), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.2), transparent 38%),
    linear-gradient(145deg, #2e0d5a, #120026) !important;
}


/* ============================================================
   EARLY-GAME BORDERS (levels 10–22)
   ============================================================ */

/* Bronze Glow */
.border-bronze-glow {
  border-color: rgba(180, 110, 40, 0.72) !important;
  box-shadow: 0 0 0 1px rgba(180, 110, 40, 0.28) inset;
}

/* Rookie Frame */
.border-rookie-frame {
  border-color: rgba(255, 159, 28, 0.6) !important;
}

/* Orange Spark */
.border-orange-spark {
  border-color: rgba(251, 100, 0, 0.72) !important;
  box-shadow: 0 0 6px rgba(251, 100, 0, 0.18);
}

/* Silver Trim */
.border-silver-trim {
  border-color: rgba(192, 200, 220, 0.72) !important;
}

/* Daily Streak Frame */
.border-daily-streak-frame {
  border-color: rgba(20, 184, 166, 0.68) !important;
}

/* Starter Border */
.border-starter-border {
  border-color: rgba(168, 85, 247, 0.55) !important;
}


/* ============================================================
   LEVEL-TIER BADGE CLASSES — kept as dead CSS so old
   localStorage data doesn't cause JS errors if getLevelBadge
   was somehow cached in an old service-worker. No UI uses these.
   ============================================================ */
.level-badge { display: none !important; }


/* ============================================================
   MOBILE CENTERING — strict containment, true symmetric centering
   ROOT CAUSES OF PREVIOUS RIGHT-BIAS:
     1. `max-width: 100vw` includes scrollbar width — caused right shift
     2. `.feedback-fab` and `.mobile-sound-toggle` both pinned to right edge
        with nothing on the left created visual asymmetry
     3. Buttons inside .hero-buttons inherited their max-width without
        explicit `margin: auto` on each, so any extra padding shifted them
   Applies only to phones; desktop is unaffected.
   ============================================================ */

@media (max-width: 600px) {

  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    padding: 6px;
    margin: 0;
  }

  /* The main app container — symmetric padding, true centering, no overflow */
  .game-card {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 14px 12px;
    border-radius: 18px;
    min-height: calc(100dvh - 12px);
    box-sizing: border-box;
    /* Kill any glow shadow that bleeds beyond viewport */
    box-shadow:
      0 0 22px rgba(255, 159, 28, 0.14),
      inset 0 1px 0 rgba(255, 214, 160, 0.08);
  }

  /* All inner screens — symmetric width with explicit auto margins */
  #lobbyScreen,
  #difficultyScreen,
  #gameScreen {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
  }

  .menu-panel {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
  }

  /* Hero button column — explicit symmetric centering */
  .hero-buttons {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    gap: 10px;
    box-sizing: border-box;
  }

  /* Every button in the hero column is the exact same width */
  .hero-buttons > button {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  /* Tighten oversize buttons so they don't dominate small viewports */
  .big-mode-btn  { padding: 16px; font-size: 18px; }
  .secondary-btn { padding: 12px; font-size: 15px; }

  /* Mobile-only: balance left/right floating UI so layout feels centered.
     Move the feedback FAB to the LEFT, keeping music toggle on the right. */
  .feedback-fab {
    left: 8px;
    right: auto;
    bottom: 8px;
    padding: 7px 12px;
    font-size: 12px;
  }
}


/* ============================================================
   CALENDAR — sticky header with back button
   ============================================================ */

.calendar-box {
  /* Allow the sticky header to stick within the scrollable modal */
  position: relative;
  padding-top: 0;
}

.calendar-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 10px;
  margin: 0 -8px 8px;
  background:
    linear-gradient(180deg, rgba(28, 5, 45, 0.98) 70%, rgba(28, 5, 45, 0.85));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 159, 28, 0.18);
}

.calendar-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: rgba(255, 159, 28, 0.12);
  color: #ff9f1c;
  border: 1px solid rgba(255, 159, 28, 0.45);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
.calendar-back-btn:hover  { background: rgba(255, 159, 28, 0.2); }
.calendar-back-btn:active { transform: translateY(1px); }

.calendar-title {
  margin: 0;
  font-size: 18px;
  flex: 1;
  text-align: left;
}


/* ============================================================
   HOW-TO-PLAY tutorial popup
   ============================================================ */

.howto-box {
  max-width: 380px;
  padding: 26px 22px 22px;
  text-align: left;
  border-color: rgba(74, 222, 128, 0.35);
}

.howto-title {
  font-size: 22px;
  color: #fff;
  margin: 0 0 6px;
  text-align: center;
}

.howto-tagline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  margin: 0 0 18px;
}

.howto-rules {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.howto-rule {
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
}

.howto-rule-num {
  font-size: 22px;
  font-weight: 800;
  color: #ff9f1c;
  line-height: 1;
  min-width: 28px;
  text-align: center;
}

.howto-rule-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

.howto-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.howto-hints span {
  background: rgba(255, 159, 28, 0.12);
  border: 1px solid rgba(255, 159, 28, 0.3);
  border-radius: 6px;
  font-size: 12px;
  padding: 3px 8px;
  color: #ffd6a0;
}

.howto-modes {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.howto-mode {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 8px;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.howto-mode strong { color: #fff; font-size: 13px; }
.howto-mode span   { color: rgba(255,255,255,0.55); font-size: 12px; }

.howto-start-btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff9f1c, #e07b00);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.howto-start-btn:hover { opacity: 0.88; }

/* Global "?" help FAB — pairs with the Feedback FAB so it's always
   accessible without overlapping the gameplay Lobby button.
   Desktop: bottom-right, just above Feedback FAB.
   Mobile lobby: bottom-left, above Feedback (which is at left:8px on mobile).
   Mobile gameplay: hidden via CSS rule below so it doesn't crowd the UI. */
.help-fab {
  position: fixed;
  bottom: 18px;
  right: 168px;        /* clear gap to the left of the Feedback FAB on desktop */
  z-index: 92;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #ff9f1c;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid rgba(255, 159, 28, 0.45);
  display: inline-grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.help-fab:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 159, 28, 0.8);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 159, 28, 0.22);
}
.help-fab:active { transform: translateY(0); }

/* Mobile: smaller, near Feedback (left side), hidden during gameplay */
@media (max-width: 600px) {
  .howto-box { padding: 22px 16px 18px; margin: 10px; }

  /* Stack with a clear gap from the Feedback FAB (Feedback is at left:8px bottom:8px,
     ~95px wide on mobile with its ✉️ Feedback text) */
  .help-fab {
    bottom: 8px;
    left: 115px;        /* clear gap to the right of the Feedback FAB */
    right: auto;
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  /* Hide the help button entirely during gameplay so it never overlaps
     the input, stat table, or any in-game UI. */
  body:has(#gameScreen[style*="block"]) .help-fab {
    display: none;
  }
}


/* ============================================================
   FORGOT / RESET PASSWORD forms in auth modal
   ============================================================ */

.auth-form-intro {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  margin: 0 0 10px;
  line-height: 1.5;
}

.auth-forgot-link {
  background: none;
  border: none;
  color: #ff9f1c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px;
  text-align: center;
  margin-top: 4px;
  text-decoration: underline;
  text-decoration-color: rgba(255, 159, 28, 0.4);
  text-underline-offset: 3px;
}
.auth-forgot-link:hover {
  color: #ffb84d;
  text-decoration-color: rgba(255, 184, 77, 0.7);
}
