body {
  background: #111;
  color: white;
  font-family: Arial, sans-serif;
  text-align: center;
  margin: 0;
  padding: 50px 20px;
}

h1 {
  font-size: 60px;
  margin-bottom: 40px;
}

button {
  margin-top: 40px;
  padding: 18px 55px;
  font-size: 24px;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

#community-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;

  margin-top: 35px;
  margin-bottom: 0;
}

#hole-cards,
#flop,
#turn,
#river {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;

  margin: 0 !important;
  padding: 0;
}

#hole-cards {
  margin-right: 6px;
}

#hole-cards {
  margin-bottom: 35px;
}

#flop {
  margin-bottom: 25px;
}

#turn {
  margin-bottom: 25px;
}

.card {
  width: 80px;
  height: 115px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 28px;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.card.red {
  color: #d00;
}

.card.black {
  color: #111;
}
.card {
  flex-direction: column;
  font-size: 28px;
}

.card.red {
  color: #d00;
}

.card.black {
  color: #111;
}
#developer-tools {
  margin-top: 40px;
  padding: 20px;
  border-top: 1px solid #444;
}

#developer-tools h2 {
  font-size: 40px;
  font-weight: 700;
}

#test-cards {
  width: 320px;
  max-width: 80%;
  padding: 12px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
}

#test-deal-button {
  margin-left: 10px;
}

#developer-tools p {
  opacity: 0.65;
  font-size: 14px;
  margin-top: 10px;
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  background: radial-gradient(
    circle at top,
    #17351f 0%,
    #0d1f13 40%,
    #07110a 100%
  );
  color: white;
}

button,
input {
  font: inherit;
}

.game-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 50px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #9cc7a7;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4rem);
}

h2 {
  font-size: 1rem;
  color: #cfe6d5;
  margin-bottom: 10px;
}

#deal-button,
#test-deal-button {
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
  background: white;
  color: #0c1d12;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

#deal-button:hover,
#test-deal-button:hover {
  transform: translateY(-2px);
}

#deal-button:disabled,
#test-deal-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.table-area {
  background: radial-gradient(
    circle at center,
    #1f6436 0%,
    #174a2a 55%,
    #12381f 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 28px;
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, 0.22),
    0 18px 45px rgba(0, 0, 0, 0.28);
}

.card-section {
  margin-bottom: 24px;
}

.card-row {
  min-height: 118px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.street-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.card {
  width: 78px;
  height: 108px;
  border-radius: 12px;
  background: #f7f4ec;
  border: 2px solid rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  color: #111;
  font-size: 1.45rem;
  font-weight: 800;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.card.red {
  color: #c62026;
}

.card.black {
  color: #151515;
}

.dealdle-card-reveal {
  animation: cardReveal 0.28s ease both;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(-18px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.results-section {
  margin-top: 24px;
  background: rgba(10, 20, 13, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 22px;
}

.results-header {
  margin-bottom: 10px;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.placeholder-text {
  color: #91a998;
  margin: 0;
}

.badge-reveal {
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: badgeReveal 0.24s ease both;
}

@keyframes badgeReveal {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.total-xp-reveal,
.overall-roll-rarity {
  margin-top: 8px;
  border-radius: 14px;
  padding: 14px;
  font-weight: 800;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
}

.rarity-common {
  border-left: 4px solid #b9b9b9;
}

.rarity-uncommon {
  border-left: 4px solid #5cc978;
}

.rarity-rare {
  border-left: 4px solid #5691ff;
}

.rarity-epic {
  border-left: 4px solid #b16cff;
}

.rarity-legendary {
  border-left: 4px solid #ffb545;
}

.rarity-all-in {
  border-left: 4px solid #ff3b19;
  box-shadow:
    0 0 18px rgba(255, 80, 30, 0.42),
    inset 0 0 18px rgba(255, 80, 30, 0.1);
}

.developer-panel {
  margin-top: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
}

.developer-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.developer-panel p {
  color: #a9b9ad;
  margin: 14px 0 8px;
}

.test-example {
  font-size: 0.9rem;
}

#test-deal-input {
  width: 100%;
  margin: 8px 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0b160e;
  color: white;
  outline: none;
}

@media (max-width: 700px) {
  .game-header {
    align-items: flex-end;
  }

  .table-area {
    padding: 20px;
  }

  .street-row {
    grid-template-columns: 1fr;
  }

  .card {
    width: 68px;
    height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.card-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.card-label {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  opacity: 0.55;
  line-height: 1;
}
.badge-viewport {
  width: min(520px, 92vw);
  margin: 20px auto 0;
  overflow: visible;
  position: relative;
  height: auto;
}

.badge-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deal-badge-layout {
  display: flex;
  align-items: center;
}

.deal-badge-emoji {
  font-size: 20px;
  width: 42px;
  flex-shrink: 0;
  text-align: center;
  margin-left: 8px;
  margin-right: 4px;
}

.deal-badge-content {
  flex: 1;
  min-width: 0;
}

.badge-review-mode .badge-slide-away {
  transform: none;
  opacity: 1;
  filter: none;
}
.live-xp-box {
  min-width: 95px;
  margin: 26px auto 0;
  padding: 9px 18px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);

  font-weight: bold;
  font-size: 1rem;
}

#live-xp {
  font-size: 1.15rem;
}

.live-xp-label {
  opacity: 0.7;
  font-size: 0.9rem;
}

#badge-roll-area {
  width: min(560px, 92vw);
  margin: 18px auto 0;

  display: flex;
  flex-direction: column;
  gap: 10px;

  min-height: 220px;
}
.final-roll-result {
  margin: 24px auto 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.final-roll-rarity {
  padding: 5px 12px;
  border-radius: 5px;

  font-size: 1.25rem;
  font-weight: bold;
  letter-spacing: 0.5px;

  background: rgba(0, 255, 180, 0.06);
  border: 1px solid rgba(0, 255, 180, 0.35);
}

.final-roll-xp {
  padding: 8px 16px;
  border-radius: 999px;

  font-size: 1.15rem;
  font-weight: bold;
  letter-spacing: 0.5px;

  background: rgba(0, 255, 180, 0.07);
  border: 1px solid rgba(0, 255, 180, 0.35);
}
/* COMMON — Grey */
.final-rarity-fold {
  color: #b8b8b8;
  border-color: #777777;
  background: rgba(150, 150, 150, 0.1);
}

/* UNCOMMON — Green */
.final-rarity-uncommon {
  color: #4dff88;
  border-color: #35c96a;
  background: rgba(53, 201, 106, 0.1);
}

/* RARE — Blue */
.final-rarity-rare {
  color: #4da6ff;
  border-color: #348ee8;
  background: rgba(52, 142, 232, 0.1);
}

/* EPIC — Purple */
.final-rarity-epic {
  color: #c56cff;
  border-color: #a64de8;
  background: rgba(166, 77, 232, 0.1);
}

/* LEGENDARY — Gold */
.final-rarity-legendary {
  color: #ffd84d;
  border-color: #e6b936;
  background: rgba(230, 185, 54, 0.11);
}

/* ALL IN — Multi-chrome */
.final-rarity-all-in {
  color: transparent;

  background:
    linear-gradient(#111, #111) padding-box,
    linear-gradient(
        90deg,
        #ff3b3b,
        #ffb13b,
        #fff23b,
        #4dff88,
        #4da6ff,
        #b84dff,
        #ff4dc4,
        #ff3b3b
      )
      border-box;

  border: 1px solid transparent;

  background-size:
    100% 100%,
    300% 100%;

  -webkit-background-clip: padding-box, border-box;
}

/* Multichrome text for ALL IN */
.final-rarity-all-in,
.badge-rarity-all-in {
  color: white;
  border: 1px solid #ff2b2b;

  background: #111;

  text-shadow:
    0 0 6px #ff2b2b,
    0 0 12px #ff2b2b;

  animation: allInRedBlack 0.65s infinite;
}

@keyframes allInRedBlack {
  0%,
  100% {
    background: #090909;
    border-color: #ff2b2b;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.35);
  }

  50% {
    background: #c40000;
    border-color: #111;
    box-shadow: 0 0 18px rgba(255, 0, 0, 0.8);
  }
}

.final-roll-rarity.rarity-up,
.final-roll-xp.rarity-up {
  animation: rarityUpgrade 0.45s ease-out;
}

@keyframes rarityUpgrade {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}
.badge-rarity-common {
  color: #b8b8b8;
  border-color: #777777;
  background: rgba(150, 150, 150, 0.1);
}

.badge-rarity-uncommon {
  color: #4dff88;
  border-color: #35c96a;
  background: rgba(53, 201, 106, 0.1);
}

.badge-rarity-rare {
  color: #4da6ff;
  border-color: #348ee8;
  background: rgba(52, 142, 232, 0.1);
}

.badge-rarity-epic {
  color: #c56cff;
  border-color: #a64de8;
  background: rgba(166, 77, 232, 0.1);
}

.badge-rarity-legendary {
  color: #ffd84d;
  border-color: #e6b936;
  background: rgba(230, 185, 54, 0.11);
}

.badge-rarity-all-in {
  color: white;
  border: 1px solid transparent;

  background:
    linear-gradient(#111, #111) padding-box,
    linear-gradient(
        90deg,
        #ff3b3b,
        #ffb13b,
        #fff23b,
        #4dff88,
        #4da6ff,
        #b84dff,
        #ff4dc4,
        #ff3b3b
      )
      border-box;

  background-size:
    100% 100%,
    300% 100%;

  text-shadow:
    0 0 6px #ff4dc4,
    0 0 12px #4da6ff,
    0 0 18px #4dff88;

  animation:
    dealdleBadgeReveal 0.35s ease-out both,
    allInRedBlack 0.65s infinite;
}
/* FORCE ALL IN TO RED + BLACK */
.badge-rarity-all-in,
.final-rarity-all-in {
  color: white !important;
  border: 1px solid #ff2020 !important;
  background: #080808 !important;
  background-image: none !important;

  text-shadow:
    0 0 6px #ff2020,
    0 0 12px #ff2020 !important;

  animation:
    dealdleBadgeReveal 0.35s ease-out both,
    allInRedBlack 0.8s ease-in-out infinite !important;
}

@keyframes allInRedBlack {
  0%,
  100% {
    background: #080808;
    border-color: #ff2020;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.4);
  }

  50% {
    background: #d00000;
    border-color: #080808;
    box-shadow: 0 0 18px rgba(255, 0, 0, 0.9);
  }
}
.profile-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.profile-panel.hidden {
  display: none;
}

.profile-card {
  width: min(900px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  background: #111;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 24px;
  position: relative;
}

.profile-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.profile-stats {
  margin-bottom: 24px;
}

#profile-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
#top-controls {
  display: flex;
  flex-direction: column;
  align-items: center; /* <-- this is the important line */
  justify-content: center;
}

#top-controls #deal-button {
  position: relative;
  top: -180px;
}

#profile-button {
  position: absolute;
  right: 20px;
}
/* DEAL BUTTON - FINAL RESULT POSITION */
#deal-button,
#test-deal-button {
  background: #062e16;
  color: #1f7a4d;

  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;

  padding: 13px 32px;
  min-width: 120px;
  min-height: 52px;

  border: 2px solid #1f7a4d;
  border-radius: 12px;

  box-shadow:
    0 0 10px hwb(#1f7a4d / 0.35),
    inset 0 0 10px rgba(#1f7a4d, 0.08);

  cursor: pointer;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

#deal-button:hover,
#test-deal-button:hover {
  background: #140000;

  transform: scale(1.06);

  box-shadow:
    0 0 18px rgba(#1f7a4d, 0.65),
    inset 0 0 12px rgba(#1f7a4d, 0.12);
}

.final-roll-result #deal-button {
  margin-top: 30px;
  margin-bottom: 30px;
}
.final-roll-result #deal-button:hover {
  background: #111;
  transform: scale(1.05);
}
#results > #deal-button {
  display: block;
  margin: 25px auto 20px;
}
.final-roll-result {
  margin: 25px auto 20px;
}
.final-roll-rarity,
.final-roll-xp {
  min-width: 220px;
  min-height: 55px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.5rem;
  font-weight: 900;

  padding: 12px 24px;
  box-sizing: border-box;
}
.final-roll-result.placeholder .final-roll-rarity,
.final-roll-result.placeholder .final-roll-xp {
  color: #d0d0d0;
  background: rgba(180, 180, 180, 0.08);
  border-color: rgba(200, 200, 200, 0.35);
  box-shadow: 0 0 10px rgba(200, 200, 200, 0.12);
}
:root {
  --flop-center-offset: -18px;
}

h1,
.final-roll-result,
#top-controls,
#badge-roll-area {
  position: relative;
  left: var(--flop-center-offset);
}
#deal-button {
  position: static;
  margin: 24px auto 20px;
  display: block;
}
.final-roll-rarity.final-rarity-fold,
.final-roll-xp.final-rarity-fold .final-roll-percentile.final-rarity-fold {
  color: #d0d0d0 !important;
  border-color: rgba(200, 200, 200, 0.35) !important;
  background: rgba(180, 180, 180, 0.08) !important;
}

.final-roll-rarity.final-rarity-uncommon,
.final-roll-xp.final-rarity-uncommon
  .final-roll-percentile.final-rarity-uncommon {
  color: #63d471 !important;
  border-color: rgba(99, 212, 113, 0.45) !important;
  background: rgba(99, 212, 113, 0.08) !important;
  box-shadow: 0 0 12px rgba(99, 212, 113, 0.2) !important;
}

.final-roll-rarity.final-rarity-rare,
.final-roll-xp.final-rarity-rare .final-roll-percentile.final-rarity-rare {
  color: #4da3ff !important;
  border-color: rgba(77, 163, 255, 0.45) !important;
  background: rgba(77, 163, 255, 0.08) !important;
  box-shadow: 0 0 12px rgba(77, 163, 255, 0.2) !important;
}

.final-roll-rarity.final-rarity-epic,
.final-roll-xp.final-rarity-epic .final-roll-percentile.final-rarity-epic {
  color: #c46cff !important;
  border-color: rgba(196, 108, 255, 0.45) !important;
  background: rgba(196, 108, 255, 0.08) !important;
  box-shadow: 0 0 12px rgba(196, 108, 255, 0.2) !important;
}

.final-roll-rarity.final-rarity-legendary,
.final-roll-xp.final-rarity-legendary
  .final-roll-percentile.final-rarity-legendary {
  color: #ffd34d !important;
  border-color: rgba(255, 211, 77, 0.5) !important;
  background: rgba(255, 211, 77, 0.08) !important;
  box-shadow: 0 0 12px rgba(255, 211, 77, 0.2) !important;
}
#deal-button {
  transform: translateX(0px);
}
#results #deal-button {
  transform: translateX(-18px);
}
.final-roll-info-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.final-roll-percentile {
  min-width: 140px;
  min-height: 55px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 12px 20px;
  box-sizing: border-box;

  border-radius: 999px;

  font-size: 1.1rem;
  font-weight: 900;

  color: #d0d0d0;
  background: rgba(180, 180, 180, 0.08);
  border: 1px solid rgba(200, 200, 200, 0.35);

  letter-spacing: 0.5px;
}
.final-roll-percentile.final-rarity-fold {
  color: var(--common);
  border-color: var(--common);
}

.final-roll-percentile.final-rarity-uncommon {
  color: var(--uncommon);
  border-color: var(--uncommon);
}

.final-roll-percentile.final-rarity-rare {
  color: var(--rare);
  border-color: var(--rare);
}

.final-roll-percentile.final-rarity-epic {
  color: var(--epic);
  border-color: var(--epic);
}

.final-roll-percentile.final-rarity-legendary {
  color: var(--legendary);
  border-color: var(--legendary);
}

.final-roll-percentile.final-rarity-all-in {
  color: var(--all-in);
  border-color: var(--all-in);
}
.final-roll-rarity.final-rarity-all-in,
.final-roll-xp.final-rarity-all-in,
.final-roll-percentile.final-rarity-all-in {
  color: #ff1744;
  border-color: #ff1744;
  box-shadow: 0 0 18px rgba(255, 23, 68, 0.45);
}
.final-roll-percentile {
  display: none !important;
}
/* LIVE XP RARITY COLOURS */

.final-roll-xp.final-rarity-fold {
  color: #b8b8b8 !important;
  border-color: #b8b8b8 !important;
}

.final-roll-xp.final-rarity-uncommon {
  color: #4caf50 !important;
  border-color: #4caf50 !important;
}

.final-roll-xp.final-rarity-rare {
  color: #2196f3 !important;
  border-color: #2196f3 !important;
}

.final-roll-xp.final-rarity-epic {
  color: #a855f7 !important;
  border-color: #a855f7 !important;
}

.final-roll-xp.final-rarity-legendary {
  color: #ff9800 !important;
  border-color: #ff9800 !important;
}

.final-roll-xp.final-rarity-all-in {
  color: white !important;
  border-color: #ff1744 !important;
  background: #0a0a0a !important;

  text-shadow:
    0 0 6px #ff1744,
    0 0 12px #ff1744,
    0 0 20px rgba(255, 23, 68, 0.9);

  box-shadow:
    0 0 10px rgba(255, 23, 68, 0.9),
    0 0 22px rgba(255, 23, 68, 0.55);
}
#custom-deal-label {
  display: none;
  text-align: center;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 1.5px;
  color: #888;
  margin-top: 6px;
  margin-bottom: 6px;
}
#custom-deal-label {
  display: none;
  color: #fff;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  margin-top: 10px;
}
@media (max-width: 700px) {
  body {
    padding: 10px 6px;
    overflow-x: hidden;
  }

  h1 {
    font-size: 30px;
    margin-bottom: 14px;
  }

  .game-shell {
    width: 100%;
    padding: 8px 0 20px;
  }

  .final-roll-result {
    margin: 10px auto 8px;
    gap: 5px;
    left: 0 !important;
  }

  .final-roll-rarity,
  .final-roll-xp {
    min-width: 135px;
    min-height: 38px;
    font-size: 0.9rem;
    padding: 6px 12px;
  }

  #custom-deal-label {
    font-size: 0.7rem;
    margin-top: 4px;
    margin-bottom: 2px;
  }

  #community-cards {
    width: 100%;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 0;
    flex-wrap: nowrap;
    justify-content: center;
  }

  #hole-cards,
  #flop,
  #turn,
  #river {
    gap: 2px;
    margin: 0 !important;
    padding: 0;
    flex-wrap: nowrap;
  }

  .poker-card-flip {
    width: 40px;
    height: 58px;
    flex: 0 0 auto;
  }

  .poker-card-face {
    border-radius: 5px;
  }

  .card {
    font-size: 0.65rem;
  }

  .card-label {
    font-size: 8px;
  }

  #deal-button,
  #test-deal-button {
    font-size: 13px;
    padding: 7px 14px;
    min-width: 84px;
    min-height: 36px;
    margin-top: 10px;
  }

  #results #deal-button {
    transform: none !important;
    margin: 12px auto 10px;
  }

  #badge-roll-area {
    width: calc(100vw - 18px);
    margin-top: 10px;
    gap: 5px;
    min-height: 0;
    left: 0 !important;

    display: flex;
    flex-direction: column;
  }

  #developer-tools {
    padding: 10px;
    margin-top: 14px;
  }

  #developer-tools h2 {
    font-size: 18px;
    margin-bottom: 6px;
  }

  #test-cards {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    font-size: 12px;
    margin-bottom: 6px;
  }

  #developer-tools p {
    font-size: 10px;
    margin-top: 6px;
    margin-bottom: 0;
  }

  :root {
    --flop-center-offset: 0px;
  }
}
@media (max-width: 700px) {
  #community-cards {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 10px !important;
  }

  #hole-cards,
  #flop,
  #turn,
  #river {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 2px !important;
    margin: 0 !important;
  }

  .poker-card-flip {
    width: 65px !important;
    height: 92px !important;
  }

  .card-label {
    font-size: 8px !important;
  }

  #badge-roll-area {
    width: 90vw !important;
    min-height: 0 !important;
    gap: 4px !important;
    margin-top: 8px !important;
  }

  .dealdle-badge-reveal {
    font-size: 10px !important;
    padding: 6px 8px !important;
    margin: 1px 0 !important;
  }

  #top-controls {
    position: static !important;
    left: 0 !important;
    transform: none !important;
  }

  #deal-button {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 10px auto !important;
  }

  .final-roll-result {
    left: 0 !important;
    margin: 8px auto !important;
  }

  :root {
    --flop-center-offset: 0px;
  }
}
#menu-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 18px;
}

#profile-menu-button,
#badge-menu-button {
  background: #050505;
  color: #1f7a4d;
  border: 2px solid #1f7a4d;
  border-radius: 10px;
  padding: 9px 18px;
  font-weight: 800;
  cursor: pointer;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;
  background: rgba(0, 0, 0, 0.78);
}

.menu-overlay.hidden {
  display: none;
}

.menu-panel {
  width: min(520px, 92vw);
  max-height: 85vh;
  overflow-y: auto;

  position: relative;

  background: #101010;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 24px;
}

.badge-menu-panel {
  width: min(1400px, 94vw);
}

.menu-panel h2 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.menu-close {
  position: absolute;
  top: 10px;
  right: 12px;

  background: transparent;
  color: white;
  border: none;

  font-size: 28px;
  cursor: pointer;
}

.profile-stat {
  display: flex;
  justify-content: space-between;
  gap: 20px;

  padding: 12px 0;
  border-bottom: 1px solid #2a2a2a;
}

.profile-stat span {
  color: #999;
}

#badge-collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.collection-badge {
  padding: 14px;
  border-radius: 12px;

  background: #181818;
  border: 1px solid #333;
}

.collection-badge.locked {
  opacity: 0.3;
  filter: grayscale(1);
}

.collection-badge-name {
  font-weight: 800;
  margin-bottom: 5px;
}

.collection-badge-rarity {
  font-size: 0.8rem;
  opacity: 0.7;
}

@media (max-width: 700px) {
  #menu-buttons {
    margin: 6px 0 10px;
  }

  #profile-menu-button,
  #badge-menu-button {
    font-size: 12px;
    padding: 7px 12px;
  }

  .menu-panel {
    padding: 18px;
  }

  #badge-collection-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .collection-badge {
    padding: 9px;
    font-size: 12px;
  }
}
/* PROFILE + BADGE MENU BUTTON FIX */

#profile-menu-button,
#badge-menu-button {
  margin: 0 !important;

  padding: 9px 18px !important;

  min-width: auto !important;
  min-height: auto !important;

  position: static !important;
  top: auto !important;
  left: auto !important;

  transform: none !important;

  font-size: 14px !important;

  background: #050505 !important;
  color: #1f7a4d !important;

  border: 2px solid #1f7a4d !important;
  border-radius: 10px !important;
}

#profile-menu-button:hover,
#badge-menu-button:hover {
  transform: scale(1.04) !important;
  background: #111 !important;
}
.menu-close {
  margin: 0 !important;
  padding: 4px 8px !important;

  min-width: 0 !important;
  min-height: 0 !important;

  background: transparent !important;
  border: none !important;

  color: white !important;

  font-size: 28px !important;
  line-height: 1 !important;

  position: absolute !important;
  top: 12px !important;
  right: 12px !important;

  transform: none !important;
}
#badge-collection-progress {
  margin-bottom: 20px;
  color: #ddd;
  font-size: 1.1rem;
  font-weight: 800;
}
.collection-badge {
  border: 1px solid #333;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.collection-badge.locked {
  opacity: 0.45;
}

.collection-badge.locked .collection-badge-name {
  color: #777;
}

.collection-badge.badge-rarity-common {
  border-color: #777;
}

.collection-badge.badge-rarity-uncommon {
  border-color: #35c96a;
  box-shadow: 0 0 8px rgba(53, 201, 106, 0.15);
}

.collection-badge.badge-rarity-rare {
  border-color: #348ee8;
  box-shadow: 0 0 8px rgba(52, 142, 232, 0.18);
}

.collection-badge.badge-rarity-epic {
  border-color: #a64de8;
  box-shadow: 0 0 8px rgba(166, 77, 232, 0.2);
}

.collection-badge.badge-rarity-legendary {
  border-color: #e6b936;
  box-shadow: 0 0 10px rgba(230, 185, 54, 0.22);
}

.collection-badge.badge-rarity-all-in {
  border-color: #ff2020;
  box-shadow: 0 0 12px rgba(255, 32, 32, 0.28);
}
.collection-badge-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.collection-badge.locked .collection-badge-icon {
  opacity: 0;
}
.collection-badge-emoji {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 8px;
  text-align: center;
}
.deal-badge-emoji {
  width: 42px;
  min-width: 42px;
  font-size: 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-left: -10px;
  margin-right: 4px;
}
.dealdle-badge-reveal {
  width: min(560px, 92vw);
  max-width: 560px;

  margin-left: auto;
  margin-right: auto;

  padding: 14px 16px;
  border-radius: 14px;
}

.collection-badge-description {
  margin-top: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.7;
  text-align: center;
}
/* Bigger + perfectly equal collection badges */
.collection-badge {
  display: flex;
  flex-direction: column;
  align-items: center;

  height: 190px;
  padding: 14px 12px;

  box-sizing: border-box;
}

/* Emoji always occupies same area */
.collection-badge-emoji {
  height: 32px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* Reserve TWO lines for every badge name */
.collection-badge-name {
  height: 46px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  line-height: 1.2;
}

/* Description gets equal space on every badge */
.collection-badge-description {
  height: 48px;
  flex-shrink: 0;

  display: flex;
  align-items: flex-start;
  justify-content: center;

  margin-top: 3px;

  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

/* Rarity always sits at same height */
.collection-badge-rarity {
  margin-top: auto;

  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}
#badge-menu .menu-close {
  position: fixed;
  top: 18px;
  right: 22px;

  z-index: 9999;

  margin: 0;
}
.menu-overlay:not(.hidden) .menu-close {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;

  margin: 0 !important;
  z-index: 99999 !important;
  font-size: 70px !important;
}
#badge-sort-button {
  display: block;
  width: 190px;
  margin: 10px 0 18px 0;
  padding: 9px 16px;

  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;

  background: rgba(255, 255, 255, 0.08);
  color: white;

  font-size: 13px;
  font-weight: 700;
  text-align: center;

  cursor: pointer;

  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;

  background: rgba(255, 255, 255, 0.08);
  color: white;

  font-size: 13px;
  font-weight: 700;

  cursor: pointer;
}

#badge-sort-button:hover {
  background: rgba(255, 255, 255, 0.13);
}
.collection-badge.badge-rarity-all-in {
  animation: none !important;

  background: #080808 !important;
  border-color: #ff2020 !important;

  box-shadow: 0 0 12px rgba(255, 32, 32, 0.28) !important;
}
/* Badge Collection title */
#badge-menu h2 {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 16px;
  text-align: center;
}

#badge-menu h2 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  margin-top: 0;
  margin-bottom: 10px;
  text-align: center;
}

#badge-collection-progress {
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  text-align: center;
}
#badge-collection-progress {
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  margin: 0 !important;
}

/* Pull the sort button + badges closer to the header */
#badge-sort-button {
  margin-top: -2px !important;
  margin-bottom: 8px !important;
}

#badge-collection-grid {
  margin-top: 0 !important;
}
#profile-auth-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

#profile-auth-controls button {
  margin: 0;
  padding: 10px 18px;

  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;

  background: rgba(255, 255, 255, 0.08);
  color: white;

  font-size: 13px;
  font-weight: 800;

  cursor: pointer;
}

#profile-auth-controls button:hover {
  background: rgba(255, 255, 255, 0.13);
}
.profile-auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.profile-auth-form.hidden {
  display: none;
}

.profile-auth-form input {
  width: 100%;
  padding: 10px 12px;

  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;

  background: rgba(255, 255, 255, 0.06);
  color: white;

  font-size: 14px;
  outline: none;
}

.profile-auth-form button {
  margin: 0;
  padding: 10px 16px;

  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;

  background: rgba(255, 255, 255, 0.08);
  color: white;

  font-size: 13px;
  font-weight: 800;

  cursor: pointer;
}
.profile-auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-auth-form.hidden {
  display: none;
}
#profile-menu-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
}

#profile-menu-button:hover,
#profile-menu-button:active,
#profile-menu-button:focus {
  background: none;
  border: none;
  box-shadow: none;
  transform: none;
}

#profile-menu-button svg {
  width: 58px;
  height: 58px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#profile-menu-button,
#profile-menu-button:hover,
#profile-menu-button:focus,
#profile-menu-button:active {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;

  padding: 0 !important;
  width: 70px;
  height: 70px;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#profile-menu-button svg {
  width: 58px;
  height: 58px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
#profile-menu-button {
  position: fixed !important;
  top: 20px;
  right: 20px;
  z-index: 1000;
}
/* ========================================
   BADGES — BLACK POKER CHIP BUTTON
   ======================================== */

#badge-menu-button {
  position: fixed !important;
  top: 95px;
  right: 20px;
  z-index: 1000;

  width: 70px;
  height: 70px;
  padding: 0 !important;

  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#badge-menu-button:hover,
#badge-menu-button:focus,
#badge-menu-button:active {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  transform: none !important;
}

#badge-menu-button {
  position: fixed !important;
  top: 20px;
  right: 100px;
  z-index: 1000;

  width: 70px;
  height: 70px;
  padding: 0 !important;

  background: transparent !important;
  border: none !important;
  box-shadow: none !important;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#badge-menu-button:hover,
#badge-menu-button:active,
#badge-menu-button:focus {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
}

#badge-menu-button img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}
#badge-menu-button {
  position: fixed !important;
  top: 110px;
  right: 20px;
  z-index: 1000;

  width: 70px;
  height: 70px;
  padding: 0 !important;

  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
/* PROFILE + BADGES ICON STACK */

#profile-menu-button,
#badge-menu-button {
  position: fixed !important;
  right: 20px !important;

  width: 70px !important;
  height: 70px !important;

  padding: 0 !important;
  margin: 0 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Profile on top */
#profile-menu-button {
  top: 20px !important;
}

/* Badges directly below */
#badge-menu-button {
  top: 150px !important;
}

#profile-menu-button svg {
  width: 100px !important;
  height: 100px !important;
}

#badge-menu-button img {
  width: 100px !important;
  height: 100px !important;
  object-fit: contain;
}
#badge-menu-button img {
  filter: drop-shadow(2px 0 0 Black) drop-shadow(-2px 0 0 Black)
    drop-shadow(0 2px 0 Black) drop-shadow(0 -2px 0 Black);
}
#profile-menu-button svg {
  stroke: white !important;
}
#profile-menu-button,
#badge-menu-button {
  position: absolute !important;
}
#badge-menu .menu-panel {
  position: relative;
}

#badge-collection-progress {
  position: absolute !important;
  top: 75px !important;
  left: 0;
  right: 0;

  text-align: center;
  margin: 0 !important;
}
#badge-collection-progress {
  pointer-events: none !important;
}

#badge-sort-button {
  position: relative !important;
  z-index: 5 !important;
  pointer-events: auto !important;
}
.badge-times-earned {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.75;
  font-weight: 600;
}
/* Give badge cards more room for obtained count */
.collection-badge {
  min-height: 180px !important;
  height: auto !important;
  padding-bottom: 14px !important;
}

/* Obtained counter */
/* Obtained counter */
.collection-badge-count {
  margin-top: 4px;

  font-size: 14px;
  font-weight: 600;
  font-family: inherit;

  line-height: 1;
  text-align: center;
}
#profile-logout-button {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
}
#profile-logout-button {
  width: 100%;
  margin-top: 18px;
  padding: 12px;

  background: #dc2626 !important;
  color: white !important;

  border: none;
  border-radius: 8px;

  font-weight: 700;
  cursor: pointer;
}

#profile-logout-button:hover {
  background: #b91c1c !important;
}
/* More vertical room inside Profile */
#profile-menu {
  padding-bottom: 32px;
}

/* Smaller centered logout button */
#profile-logout-button {
  display: block;
  width: fit-content;
  padding: 8px 14px;
  margin-top: 28px;
  margin-right: auto;
  margin-left: 0;

  background: #e5252a;
  color: white;

  border: none;
  border-radius: 7px;

  font-size: 12px;
  font-weight: bold;

  cursor: pointer;
}
.logout-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.logout-confirm-overlay.hidden {
  display: none;
}

.logout-confirm-box {
  width: min(360px, calc(100% - 40px));
  padding: 28px;
  background: #111;
  border: 1px solid #444;
  border-radius: 16px;
  text-align: center;
}

.logout-confirm-box h2 {
  margin: 0 0 10px;
  color: white;
}

.logout-confirm-box p {
  margin: 0 0 24px;
  color: #aaa;
}

.logout-confirm-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.logout-confirm-buttons button {
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

#logout-cancel-button {
  background: #333;
  color: white;
}

#logout-confirm-button {
  background: #e5252a;
  color: white;
}

#logout-confirm-button:hover {
  background: #ff3035;
}
.profile-rarest-label {
  color: #999;
  font-size: 16px;
  font-weight: 400;
  font-family: Arial, sans-serif;
}

/* ========================================
   MOBILE BADGE COLLECTION FIX
   ======================================== */
@media (max-width: 700px) {
  #badge-menu .menu-panel {
    padding: 14px 12px 16px !important;
    overflow-x: hidden !important;
  }

  #badge-menu h2 {
    font-size: 24px !important;
    line-height: 1.1 !important;
    margin: 0 52px 10px 52px !important;
    text-align: center !important;
  }

  #badge-collection-progress {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;

    display: block !important;
    width: 100% !important;

    margin: 0 0 10px 0 !important;

    font-size: 16px !important;
    line-height: 1.2 !important;
    text-align: center !important;

    pointer-events: none !important;
  }

  #badge-sort-button {
    position: static !important;
    width: fit-content !important;
    max-width: 100% !important;

    margin: 0 0 10px 0 !important;
    padding: 7px 10px !important;

    font-size: 11px !important;
    line-height: 1.1 !important;
  }

  #badge-collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-top: 0 !important;
  }

  .collection-badge {
    min-width: 0 !important;
    min-height: 135px !important;
    height: 135px !important;

    padding: 8px 6px !important;
    border-radius: 10px !important;

    font-size: 11px !important;
  }

  .collection-badge-emoji {
    height: 24px !important;
    font-size: 22px !important;
    margin-bottom: 4px !important;
  }

  .collection-badge-name {
    height: 32px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    margin-bottom: 2px !important;
  }

  .collection-badge-description {
    height: 34px !important;
    margin-top: 2px !important;
    margin-bottom: 2px !important;

    font-size: 9px !important;
    line-height: 1.2 !important;
  }

  .collection-badge-rarity,
  .collection-badge-count,
  .badge-times-earned {
    font-size: 10px !important;
    line-height: 1 !important;
  }

  .collection-badge-count,
  .badge-times-earned {
    margin-top: 3px !important;
  }

  .menu-overlay:not(.hidden) .menu-close {
    top: 10px !important;
    right: 10px !important;
    font-size: 46px !important;
  }
}

@media (max-width: 420px) {
  #badge-menu h2 {
    font-size: 22px !important;
  }

  #badge-collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .collection-badge {
    min-height: 128px !important;
    height: 128px !important;
  }
}

/* ========================================
   SMALLER MOBILE PROFILE + BADGE ICONS
   ======================================== */
@media (max-width: 700px) {
  #profile-menu-button,
  #badge-menu-button {
    width: 44px !important;
    height: 44px !important;
    right: 10px !important;
  }

  #profile-menu-button {
    top: 10px !important;
  }

  #badge-menu-button {
    top: 62px !important;
  }

  #profile-menu-button svg,
  #badge-menu-button img {
    width: 44px !important;
    height: 44px !important;
  }
}

@media (max-width: 430px) {
  #profile-menu-button,
  #badge-menu-button {
    width: 40px !important;
    height: 40px !important;
  }

  #badge-menu-button {
    top: 58px !important;
  }

  #profile-menu-button svg,
  #badge-menu-button img {
    width: 40px !important;
    height: 40px !important;
  }
}
/* MOBILE: 3 BADGES ACROSS + FIX OBTAINED TEXT */
@media (max-width: 700px) {
  #badge-collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  .collection-badge {
    width: 100% !important;
    min-width: 0 !important;
    height: 145px !important;
    min-height: 145px !important;
    padding: 7px 4px !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  .collection-badge-emoji {
    height: 22px !important;
    font-size: 20px !important;
    margin-bottom: 3px !important;
  }

  .collection-badge-name {
    width: 100% !important;
    height: 29px !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    margin-bottom: 2px !important;
    overflow-wrap: anywhere !important;
  }

  .collection-badge-description {
    width: 100% !important;
    height: 35px !important;
    min-height: 35px !important;
    font-size: 8px !important;
    line-height: 1.15 !important;
    margin: 2px 0 !important;
    overflow: hidden !important;
  }

  .collection-badge-rarity {
    margin-top: auto !important;
    font-size: 9px !important;
    line-height: 1 !important;
  }

  .collection-badge-count,
  .badge-times-earned {
    position: static !important;
    width: 100% !important;
    height: auto !important;

    margin: 3px 0 0 !important;
    padding: 0 !important;

    font-size: 8px !important;
    line-height: 1.1 !important;
    text-align: center !important;
    white-space: nowrap !important;

    transform: none !important;
    flex-shrink: 0 !important;
  }
}

/* DON'T switch back to 1 column on tiny phones */
@media (max-width: 430px) {
  #badge-collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* ========================================
   DAILY DEALDLE + LEADERBOARDS
   ======================================== */

#leaderboard-menu-button {
  position: fixed;
  top: 260px;
  right: 20px;
  z-index: 10001;

  width: 64px;
  height: 64px;
  margin: 0;
  padding: 0;

  display: grid;
  place-items: center;

  border: none;
  border-radius: 50%;
  background: transparent;
  color: white;

  font-size: 34px;
  line-height: 1;
  cursor: pointer;

  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}

#leaderboard-menu-button:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

#top-controls {
  gap: 10px;
}

#daily-deal-button {
  position: static !important;
  margin: 0 auto 20px !important;
  padding: 11px 22px;

  min-width: 170px;
  min-height: 46px;

  border: 2px solid #d4af37;
  border-radius: 12px;

  background: #211a05;
  color: #f2cf59;

  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.8px;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

#daily-deal-button:hover {
  transform: scale(1.04);
  box-shadow: 0 0 16px rgba(242, 207, 89, 0.28);
}

#daily-deal-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#game-mode-label {
  width: fit-content;
  margin: 0 auto 12px;
  padding: 6px 12px;

  border: 1px solid rgba(242, 207, 89, 0.55);
  border-radius: 999px;

  color: #f2cf59;
  background: rgba(242, 207, 89, 0.08);

  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.2px;
}

#game-mode-label.hidden {
  display: none;
}

.leaderboard-menu-panel {
  width: min(760px, 94vw) !important;
  max-height: 86vh;
  overflow-y: auto;
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;

  margin: 14px 0 18px;
}

.leaderboard-tab {
  margin: 0 !important;
  padding: 10px 8px !important;

  min-width: 0;

  border: 1px solid #333 !important;
  border-radius: 9px !important;

  background: #171717 !important;
  color: #aaa !important;

  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1.15;
}

.leaderboard-tab.active {
  color: white !important;
  border-color: #1f7a4d !important;
  background: rgba(31, 122, 77, 0.16) !important;
}

#leaderboard-current-title {
  margin: 8px 0 2px;
  color: white;
  font-size: 18px;
}

#leaderboard-date {
  min-height: 18px;
  margin-bottom: 10px;

  color: #888;
  font-size: 12px;
  font-weight: 700;
}

#leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;

  min-height: 48px;
  padding: 9px 12px;

  border: 1px solid #2d2d2d;
  border-radius: 10px;

  background: #151515;
}

.leaderboard-row.is-me {
  border-color: #1f7a4d;
  background: rgba(31, 122, 77, 0.12);
}

.leaderboard-rank {
  font-weight: 900;
  color: #ddd;
}

.leaderboard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  text-align: left;
  font-weight: 800;
}

.leaderboard-value {
  white-space: nowrap;
  text-align: right;

  color: #62d58a;
  font-weight: 900;
}

.leaderboard-loading,
.leaderboard-empty {
  padding: 26px 10px;
  color: #888;
  font-weight: 700;
}

@media (max-width: 700px) {
  #leaderboard-menu-button {
    width: 44px !important;
    height: 44px !important;
    top: 175px !important;
    right: 10px !important;
    font-size: 25px !important;
  }

  #daily-deal-button {
    min-width: 145px;
    min-height: 42px;
    padding: 9px 14px;
    font-size: 12px;
  }

  .leaderboard-menu-panel {
    width: calc(100vw - 18px) !important;
    padding: 14px 10px 16px !important;
  }

  .leaderboard-tabs {
    gap: 5px;
  }

  .leaderboard-tab {
    padding: 9px 4px !important;
    font-size: 9px !important;
  }

  .leaderboard-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 8px 7px;
  }

  .leaderboard-rank,
  .leaderboard-name,
  .leaderboard-value {
    font-size: 11px;
  }
}

@media (max-width: 430px) {
  #leaderboard-menu-button {
    width: 40px !important;
    height: 40px !important;
    top: 165px !important;
    right: 10px !important;
    font-size: 23px !important;
  }

  .leaderboard-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .leaderboard-value {
    font-size: 10px;
  }
}

/* ========================================
   DEALDLE MODE SECTIONS
   ======================================== */

#game-mode-switch {
  width: min(430px, calc(100% - 24px));
  margin: 12px auto 22px;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.game-mode-tab {
  margin: 0 !important;
  padding: 11px 16px !important;

  min-width: 0 !important;
  min-height: 44px !important;

  border: 1px solid #2f2f2f !important;
  border-radius: 10px !important;

  background: #111 !important;
  color: #8f8f8f !important;

  font-size: 13px !important;
  font-weight: 900 !important;
  letter-spacing: 0.8px;

  cursor: pointer;
}

.game-mode-tab.active {
  color: #72d694 !important;
  border-color: #1f7a4d !important;
  background: rgba(31, 122, 77, 0.14) !important;
  box-shadow: 0 0 12px rgba(31, 122, 77, 0.12);
}

.game-mode-section {
  width: min(620px, calc(100% - 24px));
  margin: 0 auto 18px;
}

.game-mode-section.hidden {
  display: none !important;
}

.mode-card {
  padding: 18px;

  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;

  background: rgba(10, 15, 11, 0.68);
}

.mode-card h2 {
  margin: 0 0 5px;
  color: white;
  font-size: 22px;
}

.mode-card p {
  margin: 0 0 14px;
  color: #929292;
  font-size: 13px;
}

#unlimited-controls,
#daily-controls {
  display: flex;
  align-items: center;
  justify-content: center;
}

#unlimited-controls #deal-button,
#daily-controls #daily-deal-button {
  margin: 4px auto !important;
}

#daily-section .mode-card {
  border-color: rgba(212, 175, 55, 0.3);
  background:
    radial-gradient(circle at top, rgba(212, 175, 55, 0.08), transparent 60%),
    rgba(10, 15, 11, 0.7);
}

#daily-section-status {
  margin: 2px 0 14px;

  color: #d6c47b;
  font-size: 12px;
  font-weight: 800;
}

.daily-section-board {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.daily-section-board h3 {
  margin: 0 0 10px;
  color: white;
  font-size: 14px;
}

#daily-section-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.daily-section-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;

  padding: 7px 9px;

  border: 1px solid #2a2a2a;
  border-radius: 8px;

  background: #151515;

  font-size: 11px;
}

.daily-section-row.is-me {
  border-color: #1f7a4d;
  background: rgba(31, 122, 77, 0.1);
}

.daily-section-rank {
  font-weight: 900;
}

.daily-section-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  text-align: left;
  font-weight: 800;
}

.daily-section-xp {
  white-space: nowrap;
  color: #d6c47b;
}

.daily-section-empty {
  padding: 12px;
  color: #777;
  font-size: 11px;
  font-weight: 700;
}

/* Daily now owns its own leaderboard, so trophy menu only needs 2 tabs */
#leaderboard-menu .leaderboard-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 700px) {
  #game-mode-switch {
    width: min(330px, calc(100% - 18px));
    margin-top: 8px;
    margin-bottom: 12px;
  }

  .game-mode-tab {
    min-height: 38px !important;
    padding: 8px 9px !important;
    font-size: 10px !important;
  }

  .game-mode-section {
    width: calc(100% - 12px);
    margin-bottom: 12px;
  }

  .mode-card {
    padding: 12px;
  }

  .mode-card h2 {
    font-size: 17px;
  }

  .mode-card p {
    margin-bottom: 10px;
    font-size: 10px;
  }

  #daily-section-status {
    margin-bottom: 10px;
    font-size: 10px;
  }

  .daily-section-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    padding: 6px;
    font-size: 9px;
  }

  .daily-section-xp {
    font-size: 9px;
  }
}

/* ========================================
   CUSTOM LEADERBOARD ICON
   ======================================== */

#leaderboard-menu-button .leaderboard-icon {
  width: 100px;
  height: 100px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;

  color: white;

  transition:
    transform 0.18s ease,
    filter 0.18s ease,
    color 0.18s ease;
}

#leaderboard-menu-button:hover .leaderboard-icon {
  color: #72d694;
  transform: scale(1.06);
  filter: drop-shadow(0 0 7px rgba(114, 214, 148, 0.55));
}

@media (max-width: 700px) {
  #leaderboard-menu-button .leaderboard-icon {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 430px) {
  #leaderboard-menu-button .leaderboard-icon {
    width: 38px;
    height: 38px;
  }
}

/* ========================================
   MATCHING MENU ICON HOVER / GLOW
   ======================================== */

#profile-menu-button,
#badge-menu-button {
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}

#profile-menu-button:hover,
#badge-menu-button:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 10px rgba(114, 214, 148, 0.6));
}

#profile-menu-button svg {
  transition:
    transform 0.18s ease,
    filter 0.18s ease,
    stroke 0.18s ease;
}

#profile-menu-button:hover svg {
  stroke: #72d694;
}

#badge-menu-button img {
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}

#badge-menu-button:hover img {
  transform: scale(1.06);
  filter: drop-shadow(0 0 7px rgba(114, 214, 148, 0.55));
}

/* ========================================
   VERTICAL ALIGNMENT: MODE BOX + ROLL AREA
   ======================================== */

/* Keep the original stretched width. Only fix horizontal centering/alignment
   down the page so the mode box, cards and roll result share the same center. */
.game-mode-section,
.mode-card,
#community-cards,
#results,
#badge-roll-area,
.final-roll-result {
  margin-left: auto !important;
  margin-right: auto !important;
}

.game-mode-section {
  box-sizing: border-box;
}

.mode-card {
  box-sizing: border-box;
}

/* Prevent the Daily/Unlimited section from being shifted sideways by any
   inherited positioning rules. */
#daily-section,
#unlimited-section {
  left: auto !important;
  right: auto !important;
  transform: none !important;
}

/* ========================================
   MATCH MODE BOX TO ROLL RESULT CENTERLINE
   ======================================== */

/* The roll rarity / XP area is intentionally shifted by
   --flop-center-offset on desktop. Apply that SAME offset to the
   Daily/Unlimited tabs + whole section so they line up perfectly. */
#game-mode-switch,
#daily-section,
#unlimited-section {
  position: relative !important;
  left: var(--flop-center-offset) !important;
  right: auto !important;
  transform: none !important;
}

/* Mobile already resets the roll area to the true centre. */
@media (max-width: 700px) {
  #game-mode-switch,
  #daily-section,
  #unlimited-section {
    left: 0 !important;
  }
}

/* ========================================
   DEAL BUTTON POSITION + DAILY ALIGNMENT
   ======================================== */

/* Unlimited's normal DEAL button belongs below the cards like the original UI. */
#unlimited-controls {
  display: none !important;
}

/* Keep the normal DEAL button in its original green style/position below cards. */
#deal-button {
  position: static !important;
  margin: 20px auto !important;
}

/* Daily keeps the special gold/yellow action button. */
#daily-deal-button {
  display: block;
  position: static !important;
  margin: 4px auto !important;

  min-width: 170px;
  min-height: 46px;
  padding: 11px 22px;

  border: 2px solid #d4af37 !important;
  border-radius: 12px !important;

  background: #211a05 !important;
  color: #f2cf59 !important;

  font-weight: 900 !important;
  letter-spacing: 0.8px;

  box-shadow: 0 0 14px rgba(212, 175, 55, 0.12);
}

#daily-deal-button:hover {
  transform: scale(1.04);
  box-shadow: 0 0 18px rgba(242, 207, 89, 0.32);
}

/* Daily and Unlimited use the exact same centreline adjustment as the roll area. */
#daily-section,
#unlimited-section,
#game-mode-switch {
  position: relative !important;
  left: var(--flop-center-offset) !important;
  right: auto !important;
  transform: none !important;
}

@media (max-width: 700px) {
  #daily-section,
  #unlimited-section,
  #game-mode-switch {
    left: 0 !important;
  }

  #daily-deal-button {
    min-width: 145px;
    min-height: 42px;
    padding: 9px 14px;
    font-size: 12px;
  }
}

/* ========================================
   DAILY / UNLIMITED LABEL ALIGNMENT
   ======================================== */

#game-mode-label,
#unlimited-game-label {
  position: relative !important;
  left: var(--flop-center-offset) !important;

  width: fit-content;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;

  padding: 6px 12px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.2px;
}

/* Daily = gold */
#game-mode-label {
  border: 1px solid rgba(242, 207, 89, 0.55) !important;
  background: rgba(242, 207, 89, 0.08) !important;
  color: #f2cf59 !important;
}

/* Unlimited = DealDle green */
#unlimited-game-label {
  margin-bottom: 12px;
  border: 1px solid rgba(31, 122, 77, 0.75);
  background: rgba(31, 122, 77, 0.12);
  color: #2fa56a;
}

/* Only show the Unlimited label while Unlimited is the selected section. */
body:has(#daily-section:not(.hidden)) #unlimited-game-label {
  display: none;
}

body:has(#unlimited-section:not(.hidden)) #unlimited-game-label {
  display: block;
}

@media (max-width: 700px) {
  #game-mode-label,
  #unlimited-game-label {
    left: 0 !important;
  }
}

/* ========================================
   UNLIMITED DEAL BUTTON — PERMANENT AREA
   ======================================== */

#unlimited-deal-area {
  display: block;
  width: 100%;
  margin: 10px auto 18px;
  text-align: center;

  position: relative;
  left: var(--flop-center-offset);
}

#unlimited-deal-area #deal-button {
  display: block;
  margin: 12px auto !important;
}

@media (max-width: 700px) {
  #unlimited-deal-area {
    left: 0 !important;
    margin-top: 8px;
  }
}

/* Normal DEAL button directly below the cards */
#unlimited-deal-area {
  margin: 14px auto 10px !important;
  padding: 0 !important;
  min-height: 0 !important;
}

#unlimited-deal-area #deal-button {
  margin: 0 auto !important;
}

/* ========================================
   LEADERBOARD ICON — DON'T FOLLOW SCROLL
   ======================================== */

#leaderboard-menu-button {
  position: absolute !important;
}

@media (max-width: 700px) {
  #leaderboard-debug-panel {
    width: calc(100% - 12px);
    padding: 10px;
  }

  .leaderboard-debug-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* Leaderboard tab colours */
.leaderboard-tab[data-leaderboard="lifetime-xp"] {
  color: #72d694 !important;
  border-color: #1f7a4d !important;
  background: rgba(31, 122, 77, 0.14) !important;
}
.leaderboard-tab[data-leaderboard="lifetime-xp"]:hover,
.leaderboard-tab[data-leaderboard="lifetime-xp"].active {
  color: #72d694 !important;
  border-color: #2fa56a !important;
  background: rgba(31, 122, 77, 0.22) !important;
  box-shadow: 0 0 12px rgba(47, 165, 106, 0.22);
}
.leaderboard-tab[data-leaderboard="highest-deal"] {
  color: #f2cf59 !important;
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.1) !important;
}
.leaderboard-tab[data-leaderboard="highest-deal"]:hover,
.leaderboard-tab[data-leaderboard="highest-deal"].active {
  color: #f2cf59 !important;
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.18) !important;
  box-shadow: 0 0 12px rgba(242, 207, 89, 0.22);
}
/* Slightly larger leaderboard icon */
#leaderboard-menu-button svg {
  width: 31px;
  height: 31px;
}

/* ========================================
   PUBLIC PROFILES
   ======================================== */

.public-profile-link {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.public-profile-link:hover {
  color: #63d471;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.public-profile-panel {
  width: min(520px, calc(100vw - 32px));
}

#public-profile-badges-button {
  display: block;
  margin: 28px 0 0;
  padding: 12px 18px;
  border: 1px solid #1f7a4d;
  border-radius: 9px;
  background: rgba(31, 122, 77, 0.14);
  color: #72d694;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
}

#public-profile-badges-button:hover {
  background: rgba(31, 122, 77, 0.24);
  box-shadow: 0 0 12px rgba(47, 165, 106, 0.22);
}

#public-profile-badges-button:disabled {
  opacity: 0.45;
  cursor: default;
}

#public-badge-back-button {
  display: block;
  margin: 0 0 14px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

#public-badge-collection-progress {
  margin: 8px 0 16px;
  font-weight: 800;
}

#public-badge-collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 700px) {
  #public-badge-collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .public-profile-panel {
    width: min(520px, calc(100vw - 24px));
  }
}

/* ========================================
   VIEW PROFILE BUTTONS
   ======================================== */

.view-profile-button {
  flex: 0 0 auto;
  margin-left: 10px;
  padding: 5px 9px;
  border: 1px solid rgba(99, 212, 113, 0.5);
  border-radius: 7px;
  background: rgba(99, 212, 113, 0.08);
  color: #72d694;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.35px;
  white-space: nowrap;
  cursor: pointer;
}

.view-profile-button:hover {
  background: rgba(99, 212, 113, 0.17);
  border-color: #72d694;
  box-shadow: 0 0 10px rgba(99, 212, 113, 0.18);
}

/* Public profile/badge collection sits ABOVE the leaderboard overlay. */
#public-profile-menu,
#public-badge-menu {
  z-index: 10050;
}

/* Keep the leaderboard visibly behind while a profile is open. */
#leaderboard-menu.profile-behind {
  z-index: 10000;
}

/* Old clickable-name styling is no longer needed. */
.leaderboard-name,
.daily-section-name {
  min-width: 0;
}

@media (max-width: 700px) {
  .view-profile-button {
    margin-left: 6px;
    padding: 4px 6px;
    font-size: 0.56rem;
  }
}
/* Keep original leaderboard layout + View Profile on the right */
.leaderboard-row {
  position: relative;
  padding-right: 120px;
}

.leaderboard-rank {
  flex: 0 0 50px;
}

.leaderboard-name {
  flex: 1;
}

.leaderboard-value {
  flex: 0 0 auto;
  margin-left: auto;
}

/* View Profile doesn't affect the original layout */
.leaderboard-row .view-profile-button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}
/* DEFAULT — inactive tabs are grey */
.leaderboard-tab {
  color: #999 !important;
  border-color: #444 !important;
  background: #181818 !important;
  box-shadow: none !important;
}

/* LIFETIME XP — green ONLY when selected */
.leaderboard-tab[data-leaderboard="lifetime-xp"].active {
  color: #72d694 !important;
  border-color: #2fa56a !important;
  background: rgba(31, 122, 77, 0.22) !important;
  box-shadow: 0 0 12px rgba(47, 165, 106, 0.22) !important;
}

/* HIGHEST DEAL — yellow ONLY when selected */
.leaderboard-tab[data-leaderboard="highest-deal"].active {
  color: #f2cf59 !important;
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.18) !important;
  box-shadow: 0 0 12px rgba(242, 207, 89, 0.22) !important;
}
/* ========================================
   BIGGER DAILY DEALDLE UI
   ======================================== */

#daily-section .mode-card h2 {
  font-size: 1.7rem;
}

#daily-section .mode-card > p {
  font-size: 1rem;
}

#daily-section-status {
  font-size: 1rem;
  font-weight: 800;
}

#daily-deal-button {
  font-size: 1rem;
  padding: 14px 24px;
}

/* Today's Top 20 */
.daily-section-board h3 {
  font-size: 1.2rem;
  margin-bottom: 14px;
}

/* Leaderboard rows */
#daily-section-leaderboard .leaderboard-row,
#daily-section-leaderboard .daily-leaderboard-row {
  font-size: 1rem;
  min-height: 44px;
}

/* Rank / medal */
#daily-section-leaderboard .leaderboard-rank,
#daily-section-leaderboard .daily-section-rank {
  font-size: 1.05rem;
}

/* Username */
#daily-section-leaderboard .leaderboard-name,
#daily-section-leaderboard .daily-section-name {
  font-size: 1rem;
  font-weight: 800;
}

/* XP */
#daily-section-leaderboard .leaderboard-value,
#daily-section-leaderboard .daily-section-value {
  font-size: 1rem;
  font-weight: 900;
}
/* ========================================
   PUBLIC BADGE COLLECTION
   Match own badge collection
   ======================================== */

#public-badge-menu .badge-menu-panel {
  width: min(1100px, 92vw);
  max-width: 1100px;
}

/* 6 badges across */
#public-badge-collection-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

/* Match normal collection card sizing */
#public-badge-collection-grid .collection-badge {
  width: auto;
  min-width: 0;
}

/* Tablet */
@media (max-width: 900px) {
  #public-badge-collection-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Mobile — same 3-across setup as your collection */
@media (max-width: 600px) {
  #public-badge-menu .badge-menu-panel {
    width: calc(100vw - 24px);
  }

  #public-badge-collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
}
/* ========================================
   HIGHEST DEAL — YELLOW THEME
   ======================================== */

/* XP values */
#leaderboard-menu.highest-deal-active .leaderboard-value {
  color: #f2cf59 !important;
}

/* VIEW PROFILE buttons */
#leaderboard-menu.highest-deal-active .view-profile-button {
  color: #f2cf59 !important;
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.1) !important;
}

#leaderboard-menu.highest-deal-active .view-profile-button:hover {
  background: rgba(212, 175, 55, 0.2) !important;
  border-color: #f2cf59 !important;
  box-shadow: 0 0 10px rgba(242, 207, 89, 0.22) !important;
}

/* Your own leaderboard row */
#leaderboard-menu.highest-deal-active .leaderboard-row.is-current-user {
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.08) !important;
  box-shadow: 0 0 10px rgba(242, 207, 89, 0.12) !important;
}

/* ========================================
   LEADERBOARD — VIEW PROFILE BESIDE NAME
   XP stays pinned to the far right
   ======================================== */

#leaderboard-list .leaderboard-row {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  position: relative !important;
  padding-right: 14px !important;
}

#leaderboard-list .leaderboard-rank {
  flex: 0 0 50px !important;
}

#leaderboard-list .leaderboard-name {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
}

#leaderboard-list .view-profile-button {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  transform: none !important;

  flex: 0 0 auto !important;
  margin: 0 12px 0 10px !important;
}

#leaderboard-list .leaderboard-value {
  flex: 0 0 auto !important;
  margin-left: auto !important;
  white-space: nowrap !important;
}
/* Highest Deal — make your own row highlight yellow */
#leaderboard-menu.highest-deal-active .leaderboard-row.current-user,
#leaderboard-menu.highest-deal-active .leaderboard-row.is-current-user {
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.08) !important;
  box-shadow: 0 0 10px rgba(242, 207, 89, 0.12) !important;
}
/* Wider public badge collection */
#public-badge-menu .badge-menu-panel {
  width: 94vw !important;
  max-width: 1500px !important;
}

/* Keep 6 badges across and let them use the extra space */
#public-badge-collection-grid {
  width: 100% !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
/* Username + View Profile stacked together */
#leaderboard-list .leaderboard-name {
  flex: 0 0 170px !important;
  width: 170px !important;
}

/* Put View Profile underneath the username */
#leaderboard-list .view-profile-button {
  position: absolute !important;
  left: 78px !important;
  top: 30px !important;

  margin: 0 !important;
  transform: none !important;
}

/* Give each row enough height for the button */
#leaderboard-list .leaderboard-row {
  position: relative !important;
  min-height: 68px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

/* XP remains on the far right */
#leaderboard-list .leaderboard-value {
  margin-left: auto !important;
}
/* DAILY TAB — yellow when selected */
#daily-mode-tab.active {
  color: #ffd84d !important;
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.1) !important;
  box-shadow: 0 0 12px rgba(255, 216, 77, 0.15) !important;
}

/* Daily tab hover */
#daily-mode-tab.active:hover {
  background: rgba(212, 175, 55, 0.16) !important;
  box-shadow: 0 0 16px rgba(255, 216, 77, 0.22) !important;
}
/* DAILY TOP 20 — current user yellow highlight */
#daily-section-leaderboard .leaderboard-row.current-user,
#daily-section-leaderboard .leaderboard-row.is-current-user,
#daily-section-leaderboard .daily-leaderboard-row.current-user,
#daily-section-leaderboard .daily-leaderboard-row.is-current-user {
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.08) !important;
  box-shadow: 0 0 10px rgba(242, 207, 89, 0.12) !important;
}
/* ========================================
   LEADERBOARD TABS — INACTIVE = GREY
   ======================================== */

/* Both tabs grey by default */
.leaderboard-tab {
  color: #888 !important;
  border-color: #3d3d3d !important;
  background: #181818 !important;
  box-shadow: none !important;
}

/* Lifetime XP selected = GREEN */
.leaderboard-tab[data-leaderboard="lifetime-xp"].active {
  color: #72d694 !important;
  border-color: #2fa56a !important;
  background: rgba(31, 122, 77, 0.18) !important;
  box-shadow: 0 0 12px rgba(47, 165, 106, 0.2) !important;
}

/* Highest Deal selected = YELLOW */
.leaderboard-tab[data-leaderboard="highest-deal"].active {
  color: #f2cf59 !important;
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.15) !important;
  box-shadow: 0 0 12px rgba(242, 207, 89, 0.2) !important;
}

/* ========================================
   LEADERBOARD — FINAL PROFILE BUTTON LAYOUT
   Username above button, XP stays far right
   ======================================== */

#leaderboard-list .leaderboard-row {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;

  min-height: 88px !important;
  padding: 12px 14px !important;
  padding-left: 22px !important;
}

#leaderboard-list .leaderboard-rank {
  flex: 0 0 50px !important;
  align-self: center !important;
}

#leaderboard-list .leaderboard-name {
  position: absolute !important;
  left: 76px !important;
  top: 18px !important;

  width: auto !important;
  min-width: 150px !important;

  margin: 0 !important;
  text-align: left !important;
}

#leaderboard-list .view-profile-button {
  position: absolute !important;
  left: 76px !important;
  top: 46px !important;

  margin: 0 !important;
  transform: none !important;
  white-space: nowrap !important;
}

#leaderboard-list .leaderboard-value {
  position: static !important;
  margin-left: auto !important;
  flex: 0 0 auto !important;
  align-self: center !important;
  white-space: nowrap !important;
}
/* ========================================
   LEADERBOARD TABS — FINAL ACTIVE COLOURS
   ======================================== */

/* INACTIVE — force grey */
#leaderboard-menu .leaderboard-tab:not(.active) {
  color: #888 !important;
  border-color: #3d3d3d !important;
  background: #181818 !important;
  box-shadow: none !important;
}

/* ACTIVE Lifetime XP — green */
#leaderboard-menu .leaderboard-tab[data-leaderboard="lifetime-xp"].active {
  color: #72d694 !important;
  border-color: #1f9d62 !important;
  background: rgba(31, 157, 98, 0.12) !important;
  box-shadow: 0 0 12px rgba(31, 157, 98, 0.2) !important;
}

/* ACTIVE Highest Deal — yellow */
#leaderboard-menu .leaderboard-tab[data-leaderboard="highest-deal"].active {
  color: #ffd84d !important;
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.12) !important;
  box-shadow: 0 0 12px rgba(255, 216, 77, 0.2) !important;
}
/* ========================================
   DAILY TOP 20 — YELLOW USER HIGHLIGHT
   ======================================== */

/* Current user's row = yellow */
#daily-section #daily-section-leaderboard .leaderboard-row.current-user,
#daily-section #daily-section-leaderboard .leaderboard-row.is-current-user,
#daily-section #daily-section-leaderboard .daily-leaderboard-row.current-user,
#daily-section
  #daily-section-leaderboard
  .daily-leaderboard-row.is-current-user {
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.08) !important;
  box-shadow: 0 0 10px rgba(242, 207, 89, 0.15) !important;
}

/* Daily leaderboard XP — MUCH bigger + green */
#daily-section-leaderboard .leaderboard-value,
#daily-section-leaderboard .daily-section-value,
#daily-section-leaderboard .daily-leaderboard-value {
  color: #49e681 !important;
  font-size: 1.35rem !important;
  font-weight: 900 !important;
}
/* ========================================
   BIG TOP 3 MEDALS
   ======================================== */

/* Main leaderboards + Daily DealDle */
.leaderboard-rank,
.daily-section-rank {
  font-size: 1.15rem;
}

/* Top 3 medal emojis */
.leaderboard-row:nth-child(-n + 3) .leaderboard-rank,
.daily-section-row:nth-child(-n + 3) .daily-section-rank {
  font-size: 2rem !important;
  line-height: 1;
}
/* Fade ALL menu icons when a menu is open */
body:has(.menu-overlay:not(.hidden)) #menu-buttons button {
  opacity: 0.3;
  filter: brightness(0.45);
  pointer-events: none;
}

/* Keep the button for the currently open menu visible */
body:has(#profile-menu:not(.hidden)) #profile-menu-button,
body:has(#badge-menu:not(.hidden)) #badge-menu-button,
body:has(#leaderboard-menu:not(.hidden)) #leaderboard-menu-button {
  opacity: 1;
  filter: none;
}

/* Smooth fade */
#menu-buttons button {
  transition:
    opacity 0.2s ease,
    filter 0.2s ease,
    transform 0.18s ease;
}
/* Center leaderboard icon with the other menu icons */
#leaderboard-menu-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#leaderboard-menu-button .leaderboard-icon {
  display: block;
  margin: 0 auto !important;
  transform: translateX(0) !important;
}

/* Leaderboard button — allow icon to actually grow */
#menu-buttons #leaderboard-menu-button {
  width: 90px !important;
  height: 90px !important;
  min-width: 90px !important;
  min-height: 90px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 0 !important;
  overflow: visible !important;
}

/* Actual leaderboard SVG */
#menu-buttons #leaderboard-menu-button .leaderboard-icon {
  width: 95px !important;
  height: 95px !important;
  max-width: none !important;
  max-height: none !important;
  transform: translateX(10px) !important;

  margin: 0 !important;
  flex-shrink: 0 !important;
}
/* DAILY — your own row = yellow */
#daily-section-leaderboard .daily-section-row.is-me {
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.09) !important;
  box-shadow: 0 0 10px rgba(242, 207, 89, 0.15) !important;
}

/* DAILY — XP = green */
#daily-section-leaderboard .daily-section-xp {
  color: #49e681 !important;
  font-size: 1.2rem !important;
  font-weight: 900 !important;
}

/* ========================================
   DEALDLE — MOBILE UI FIX (FINAL OVERRIDE)
   Keeps desktop unchanged
   ======================================== */
@media (max-width: 700px) {
  body {
    padding: 14px 8px 28px !important;
    overflow-x: hidden !important;
  }

  /* Leave clean room for the compact icon row */
  body > h1 {
    font-size: 36px !important;
    line-height: 1.05 !important;
    margin: 18px 0 18px !important;
    padding-right: 0 !important;
    position: relative !important;
    left: 0 !important;
  }

  /* Put Profile / Badges / Leaderboard in one small row */
  #menu-buttons {
    position: fixed !important;
    top: 8px !important;
    right: 8px !important;
    z-index: 1000 !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;

    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #menu-buttons #profile-menu-button,
  #menu-buttons #badge-menu-button,
  #menu-buttons #leaderboard-menu-button {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;

    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;

    margin: 0 !important;
    padding: 2px !important;
    transform: none !important;
    overflow: visible !important;
  }

  #menu-buttons #profile-menu-button svg {
    width: 38px !important;
    height: 38px !important;
  }

  #menu-buttons #badge-menu-button img {
    width: 42px !important;
    height: 42px !important;
  }

  #menu-buttons #leaderboard-menu-button .leaderboard-icon {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    margin: 0 !important;
    transform: none !important;
  }

  /* Mode switch fits the phone cleanly */
  #game-mode-switch {
    width: calc(100vw - 28px) !important;
    max-width: 440px !important;
    margin: 10px auto 14px !important;
    gap: 8px !important;
  }

  #game-mode-switch .game-mode-tab {
    min-width: 0 !important;
    width: 50% !important;
    padding: 10px 6px !important;
    margin: 0 !important;
    font-size: 12px !important;
    letter-spacing: 0.7px !important;
  }

  /* Mode cards use almost all available width */
  .game-mode-section,
  .mode-card {
    width: 100% !important;
    max-width: none !important;
  }

  .mode-card {
    padding: 16px 12px !important;
    margin: 0 auto 12px !important;
    border-radius: 16px !important;
  }

  .mode-card h2 {
    font-size: 19px !important;
    margin-bottom: 8px !important;
  }

  .mode-card p {
    font-size: 12px !important;
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
  }

  #unlimited-game-label,
  #game-mode-label {
    margin-top: 10px !important;
    margin-bottom: 8px !important;
    font-size: 12px !important;
  }

  /* Result boxes */
  .final-roll-result {
    margin: 6px auto 8px !important;
    gap: 6px !important;
  }

  .final-roll-rarity,
  .final-roll-xp {
    min-width: 168px !important;
    min-height: 42px !important;
    padding: 7px 12px !important;
    font-size: 1rem !important;
  }

  /* Cards: still readable, but much less vertically huge */
  #community-cards {
    width: 100% !important;
    margin: 8px auto 0 !important;
    gap: 6px !important;
  }

  .card-group {
    gap: 4px !important;
  }

  #hole-cards,
  #flop,
  #turn,
  #river {
    gap: 3px !important;
  }

  .poker-card-flip {
    width: 52px !important;
    height: 74px !important;
  }

  .poker-card-face {
    border-radius: 6px !important;
  }

  .card-label {
    font-size: 8px !important;
    letter-spacing: 1px !important;
  }

  /* Prevent desktop offsets leaking into mobile */
  h1,
  .final-roll-result,
  #top-controls,
  #badge-roll-area {
    left: 0 !important;
    transform: none !important;
  }

  #deal-button,
  #results #deal-button {
    transform: none !important;
    margin: 10px auto !important;
  }

  /* Menus fit properly on a phone */
  .menu-overlay {
    padding: 10px !important;
  }

  .menu-panel,
  .badge-menu-panel,
  .leaderboard-menu-panel,
  .public-profile-panel {
    width: calc(100vw - 20px) !important;
    max-width: none !important;
    max-height: 90vh !important;
    padding: 18px 12px !important;
    border-radius: 14px !important;
  }

  .menu-overlay:not(.hidden) .menu-close {
    top: 10px !important;
    right: 12px !important;
    font-size: 38px !important;
  }

  /* Badge collection: two compact columns */
  #badge-collection-grid,
  #public-badge-collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .collection-badge {
    height: 170px !important;
    padding: 10px 7px !important;
  }

  .collection-badge-emoji {
    font-size: 25px !important;
  }

  .collection-badge-name {
    font-size: 12px !important;
  }

  .collection-badge-description {
    font-size: 10px !important;
  }

  /* Leaderboard rows don't spill off-screen */
  #leaderboard-list .leaderboard-row {
    min-height: 78px !important;
    padding: 10px 8px !important;
  }

  #leaderboard-list .leaderboard-rank {
    flex: 0 0 38px !important;
  }

  #leaderboard-list .leaderboard-name {
    left: 52px !important;
    top: 14px !important;
    min-width: 0 !important;
    max-width: 48vw !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  #leaderboard-list .view-profile-button {
    left: 52px !important;
    top: 41px !important;
    font-size: 10px !important;
    padding: 5px 8px !important;
  }

  #leaderboard-list .leaderboard-value {
    font-size: 0.95rem !important;
  }
}

/* Extra-small phones */
@media (max-width: 380px) {
  #menu-buttons #profile-menu-button,
  #menu-buttons #badge-menu-button,
  #menu-buttons #leaderboard-menu-button {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
  }

  #menu-buttons #profile-menu-button svg {
    width: 33px !important;
    height: 33px !important;
  }

  #menu-buttons #badge-menu-button img,
  #menu-buttons #leaderboard-menu-button .leaderboard-icon {
    width: 36px !important;
    height: 36px !important;
  }

  .poker-card-flip {
    width: 48px !important;
    height: 69px !important;
  }
}

/* ========================================
   MOBILE PROFILE BADGE COLLECTION — 3 PER ROW
   Same compact collection style on own/public profiles
   ======================================== */
@media (max-width: 700px) {
  #profile-badge-grid,
  #public-badge-collection-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #profile-badge-grid .collection-badge,
  #public-badge-collection-grid .collection-badge {
    width: 100% !important;
    min-width: 0 !important;
    height: 150px !important;
    padding: 8px 4px !important;
    overflow: hidden !important;
  }

  #profile-badge-grid .collection-badge-emoji,
  #public-badge-collection-grid .collection-badge-emoji {
    height: 27px !important;
    font-size: 23px !important;
    margin-bottom: 4px !important;
  }

  #profile-badge-grid .collection-badge-name,
  #public-badge-collection-grid .collection-badge-name {
    width: 100% !important;
    height: 34px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    overflow-wrap: anywhere !important;
  }

  #profile-badge-grid .collection-badge-description,
  #public-badge-collection-grid .collection-badge-description {
    width: 100% !important;
    height: 43px !important;
    margin: 2px 0 !important;
    font-size: 8px !important;
    line-height: 1.15 !important;
    overflow: hidden !important;
  }

  #profile-badge-grid .collection-badge-rarity,
  #public-badge-collection-grid .collection-badge-rarity {
    font-size: 9px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}

/* ========================================
   MOBILE HEADER — RESTORE SIDE ICONS
   Daily + Unlimited stay side-by-side.
   Menu icons stay small at the right and never create scrolling.
   ======================================== */
@media (max-width: 700px) {
  html,
  body {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Restore the original side-style menu instead of a top horizontal row */
  #menu-buttons {
    position: fixed !important;
    top: 112px !important;
    right: 7px !important;
    left: auto !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;

    width: 42px !important;
    max-width: 42px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    overflow: visible !important;
    z-index: 1000 !important;
  }

  #menu-buttons #profile-menu-button,
  #menu-buttons #badge-menu-button,
  #menu-buttons #leaderboard-menu-button {
    position: static !important;
    inset: auto !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    margin: 0 !important;
    padding: 1px !important;
    transform: none !important;
  }

  #menu-buttons #profile-menu-button svg {
    width: 34px !important;
    height: 34px !important;
  }

  #menu-buttons #badge-menu-button img {
    width: 38px !important;
    height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
  }

  #menu-buttons #leaderboard-menu-button .leaderboard-icon {
    width: 37px !important;
    height: 37px !important;
    max-width: 37px !important;
    max-height: 37px !important;
    margin: 0 !important;
    transform: none !important;
  }

  /* Keep title centered and clear of the side controls */
  body > h1 {
    width: 100% !important;
    padding: 0 52px !important;
    box-sizing: border-box !important;
    margin: 22px auto 20px !important;
    text-align: center !important;
  }

  /* Daily / Unlimited always beside each other */
  #game-mode-switch {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: calc(100% - 72px) !important;
    max-width: 430px !important;
    margin: 10px auto 16px !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  #game-mode-switch .game-mode-tab,
  #daily-mode-tab,
  #unlimited-mode-tab {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 10px 4px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }

  /* Never let fixed controls increase the page width */
  #menu-buttons,
  #menu-buttons * {
    box-sizing: border-box !important;
  }
}

@media (max-width: 380px) {
  #menu-buttons {
    right: 4px !important;
    width: 36px !important;
    max-width: 36px !important;
  }

  #menu-buttons #profile-menu-button,
  #menu-buttons #badge-menu-button,
  #menu-buttons #leaderboard-menu-button {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    min-height: 35px !important;
    max-width: 35px !important;
    max-height: 35px !important;
  }

  #menu-buttons #profile-menu-button svg {
    width: 30px !important;
    height: 30px !important;
  }

  #menu-buttons #badge-menu-button img,
  #menu-buttons #leaderboard-menu-button .leaderboard-icon {
    width: 33px !important;
    height: 33px !important;
    max-width: 33px !important;
    max-height: 33px !important;
  }

  #game-mode-switch {
    width: calc(100% - 62px) !important;
  }

  #game-mode-switch .game-mode-tab,
  #daily-mode-tab,
  #unlimited-mode-tab {
    font-size: 10px !important;
    letter-spacing: 0.3px !important;
  }
}

/* ========================================
   MOBILE MENU ICONS — STATIC SIDE RAIL
   Do NOT follow viewport while scrolling.
   Keep outside the Daily/Unlimited mode card.
   ======================================== */
@media (max-width: 700px) {
  #menu-buttons {
    /* Static page position: scrolls away normally instead of following screen */
    position: absolute !important;
    top: 112px !important;
    right: 7px !important;
    left: auto !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 5px !important;

    width: 42px !important;
    max-width: 42px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;

    /* No box/background around the icon rail */
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;

    transform: none !important;
    overflow: visible !important;
    z-index: 50 !important;
  }

  #menu-buttons #profile-menu-button,
  #menu-buttons #badge-menu-button,
  #menu-buttons #leaderboard-menu-button {
    position: static !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    margin: 0 !important;
    padding: 1px !important;

    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Reserve right-side space so the mode card never sits behind the icon rail */
  #daily-section,
  #unlimited-section {
    width: calc(100% - 54px) !important;
    margin-left: 0 !important;
    margin-right: 54px !important;
  }

  #daily-section .mode-card,
  #unlimited-section .mode-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 380px) {
  #menu-buttons {
    right: 4px !important;
    width: 36px !important;
    max-width: 36px !important;
  }

  #daily-section,
  #unlimited-section {
    width: calc(100% - 46px) !important;
    margin-right: 46px !important;
  }
}

/* ========================================
   BADGE COLLECTION — XP DISPLAY + XP ORDER UI
   ======================================== */
.collection-badge-xp {
  margin-top: 5px;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.35px;
  color: #ffffff;
  opacity: 0.9;
}

/* Mobile: force every badge collection to exactly 3 per row */
@media (max-width: 700px) {
  #badge-collection-grid,
  #profile-badge-grid,
  #public-badge-collection-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #badge-collection-grid .collection-badge,
  #profile-badge-grid .collection-badge,
  #public-badge-collection-grid .collection-badge {
    width: 100% !important;
    min-width: 0 !important;
    height: 164px !important;
    padding: 7px 4px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  #badge-collection-grid .collection-badge-emoji,
  #profile-badge-grid .collection-badge-emoji,
  #public-badge-collection-grid .collection-badge-emoji {
    height: 25px !important;
    font-size: 22px !important;
    margin-bottom: 3px !important;
  }

  #badge-collection-grid .collection-badge-name,
  #profile-badge-grid .collection-badge-name,
  #public-badge-collection-grid .collection-badge-name {
    width: 100% !important;
    height: 31px !important;
    font-size: 9px !important;
    line-height: 1.08 !important;
    overflow-wrap: anywhere !important;
  }

  #badge-collection-grid .collection-badge-description,
  #profile-badge-grid .collection-badge-description,
  #public-badge-collection-grid .collection-badge-description {
    width: 100% !important;
    height: 38px !important;
    margin: 2px 0 !important;
    font-size: 7.5px !important;
    line-height: 1.12 !important;
    overflow: hidden !important;
  }

  #badge-collection-grid .collection-badge-xp,
  #profile-badge-grid .collection-badge-xp,
  #public-badge-collection-grid .collection-badge-xp {
    margin: 3px 0 2px !important;
    font-size: 8px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #badge-collection-grid .collection-badge-rarity,
  #profile-badge-grid .collection-badge-rarity,
  #public-badge-collection-grid .collection-badge-rarity {
    font-size: 8px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}

/* =========================================================
   FINAL ROLL HIGHLIGHT COLOURS — rarity, XP + highlights
   Keeps every result box matched to its corresponding rarity.
   ========================================================= */

.final-roll-rarity.final-rarity-fold,
.final-roll-xp.final-rarity-fold,
.final-roll-percentile.final-rarity-fold {
  color: #d0d0d0 !important;
  border-color: rgba(200, 200, 200, 0.55) !important;
  background: rgba(180, 180, 180, 0.08) !important;
  box-shadow: 0 0 12px rgba(200, 200, 200, 0.12) !important;
}

.final-roll-rarity.final-rarity-uncommon,
.final-roll-xp.final-rarity-uncommon,
.final-roll-percentile.final-rarity-uncommon {
  color: #63d471 !important;
  border-color: #63d471 !important;
  background: rgba(99, 212, 113, 0.08) !important;
  box-shadow: 0 0 14px rgba(99, 212, 113, 0.22) !important;
}

.final-roll-rarity.final-rarity-rare,
.final-roll-xp.final-rarity-rare,
.final-roll-percentile.final-rarity-rare {
  color: #4da3ff !important;
  border-color: #4da3ff !important;
  background: rgba(77, 163, 255, 0.08) !important;
  box-shadow: 0 0 14px rgba(77, 163, 255, 0.24) !important;
}

.final-roll-rarity.final-rarity-epic,
.final-roll-xp.final-rarity-epic,
.final-roll-percentile.final-rarity-epic {
  color: #c46cff !important;
  border-color: #c46cff !important;
  background: rgba(196, 108, 255, 0.08) !important;
  box-shadow: 0 0 14px rgba(196, 108, 255, 0.25) !important;
}

.final-roll-rarity.final-rarity-legendary,
.final-roll-xp.final-rarity-legendary,
.final-roll-percentile.final-rarity-legendary {
  color: #ffd34d !important;
  border-color: #ffd34d !important;
  background: rgba(255, 211, 77, 0.08) !important;
  box-shadow: 0 0 15px rgba(255, 211, 77, 0.28) !important;
}

/* MYTHIC — red */
.final-roll-rarity.final-rarity-mythic,
.final-roll-xp.final-rarity-mythic,
.final-roll-percentile.final-rarity-mythic {
  color: #ff3030 !important;
  border-color: #ff3030 !important;
  background: rgba(255, 48, 48, 0.09) !important;
  text-shadow: 0 0 8px rgba(255, 48, 48, 0.45) !important;
  box-shadow:
    0 0 12px rgba(255, 48, 48, 0.38),
    inset 0 0 12px rgba(255, 48, 48, 0.06) !important;
}

/* ALL IN keeps its special red/black animated top-rarity look */
.final-roll-rarity.final-rarity-all-in,
.final-roll-xp.final-rarity-all-in,
.final-roll-percentile.final-rarity-all-in {
  color: white !important;
  border-color: #ff1744 !important;
  background: #080808 !important;
  text-shadow:
    0 0 6px #ff1744,
    0 0 12px #ff1744 !important;
  box-shadow:
    0 0 12px rgba(255, 23, 68, 0.7),
    0 0 22px rgba(255, 23, 68, 0.35) !important;
}

/* Mythic badge styling too, so collections/reveals use the same red. */
.badge-rarity-mythic,
.collection-badge.badge-rarity-mythic {
  color: #ff3030 !important;
  border-color: #ff3030 !important;
  background: rgba(255, 48, 48, 0.09) !important;
  box-shadow: 0 0 12px rgba(255, 48, 48, 0.28) !important;
}
