/* ---------------------------------------
    MONOSPACE + TECHY FONTS
 --------------------------------------- */
 @import url("https://fonts.googleapis.com/css2?family=VT323&family=Orbitron:wght@400;700&family=Roboto:wght@400;700&family=Quicksand&display=swap");

 /* CSS Variables */
 :root {
   /* Colors */
   --primary-color: #63c5da;
   --primary-color-rgb: 99, 197, 218;
   --secondary-color: #98fb98;
   --secondary-color-rgb: 152, 251, 152;
   --positive-feedback-color: #28a745;
   --negative-feedback-color: #dc3545;
   --pause-button-color: gold;
   --ccm-current-tier-accent-rgb: 152, 251, 152;
   --ccm-current-tier-board-image: none;
   --ccm-neon-pink-rgb: 255, 45, 192;
   --ccm-neon-cyan-rgb: 34, 224, 255;
   --ccm-neon-lime-rgb: 132, 255, 56;
   --ccm-tier-rim-gradient: linear-gradient(
     90deg,
     rgba(var(--ccm-neon-pink-rgb), 0.82) 0%,
     rgba(var(--ccm-neon-cyan-rgb), 0.78) 44%,
     rgba(var(--ccm-neon-lime-rgb), 0.58) 74%,
     rgba(var(--ccm-current-tier-accent-rgb), 0.78) 100%
   );
   
   /* Timing */
   --transition-duration: 0.3s;
   --card-flip-duration: 0.5s;
   --feedback-duration: 0.86s;
   --preview-flip-delay: 0.06s;
   --board-transition-duration: 0.6s;
   --board-transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
   --ccm-overlay-duration: 0.42s;
   --ccm-overlay-easing: cubic-bezier(0.4, 0, 0.2, 1);
   --release-control-height: 2.25rem;
   --release-gap: 0.45rem;
   
   /* Sizing */
   --card-size: 6px;
   --board-gap: 0.3em;
   
   /* Effects */
   --neon-glow: 0 0 8px rgba(0, 255, 128, 0.75);
   --gold-glow: 0 0 8px gold;
   --pastel-colors: #ff3f5f, #ffb21f, #7cff5b, #20d7ff, #7a5cff, #ff4bb8;

   /* CCM glass / gradient system */
  /* Backdrop blur: ONE active overlay scrim only. Cards/panels/chips use opaque
     dark-glass gradients instead. Stacking backdrop-filters over animated layers
     causes repaint flicker, so the JS overlay manager assigns the fog owner. */
   --ccm-backdrop-scrim: blur(8px);
   --ccm-overlay-scrim: linear-gradient(165deg, rgba(0, 0, 0, 0.74) 0%, rgba(0, 10, 16, 0.68) 50%, rgba(0, 0, 0, 0.72) 100%);
   --ccm-welcome-radial-scrim: radial-gradient(
     circle at 50% 50%,
     rgba(0, 18, 22, 0.18) 0%,
     rgba(0, 14, 18, 0.3) 18%,
     rgba(0, 8, 12, 0.66) 42%,
     rgba(0, 2, 6, 0.86) 72%,
     rgba(0, 0, 0, 0.95) 100%
   );
   --ccm-glass-bg: linear-gradient(
     145deg,
     rgba(0, 0, 0, 0.78) 0%,
     rgba(0, 34, 40, 0.74) 38%,
     rgba(8, 0, 36, 0.72) 72%,
     rgba(0, 0, 0, 0.76) 100%
   );
   --ccm-glass-bg-play: linear-gradient(
     145deg,
     rgba(0, 0, 0, 0.62) 0%,
     rgba(0, 26, 32, 0.56) 48%,
     rgba(6, 0, 28, 0.54) 100%
   );
   --ccm-glass-bg-subtle: linear-gradient(
     135deg,
     rgba(0, 0, 0, 0.42) 0%,
     rgba(var(--primary-color-rgb), 0.1) 52%,
     rgba(var(--secondary-color-rgb), 0.07) 100%
   );
   --ccm-glass-border: 1px solid rgba(var(--ccm-current-tier-accent-rgb), 0.34);
   --ccm-glass-inset: inset 0 0 0 1px rgba(152, 251, 152, 0.12);
   --ccm-glass-shadow:
     0 10px 36px rgba(0, 0, 0, 0.58),
     0 0 22px rgba(var(--ccm-neon-cyan-rgb), 0.07),
     0 0 24px rgba(var(--ccm-current-tier-accent-rgb), 0.08);
   --ccm-glass-shadow-deep:
     0 0 28px 14px rgba(0, 0, 0, 0.62),
     0 0 18px rgba(var(--ccm-neon-pink-rgb), 0.07),
     var(--ccm-glass-inset);
   --ccm-glass-text: rgba(255, 255, 255, 0.94);
   --ccm-glass-bg-next-board: linear-gradient(
     145deg,
     rgba(0, 0, 0, 0.5) 0%,
     rgba(0, 34, 40, 0.44) 38%,
     rgba(8, 0, 36, 0.42) 72%,
     rgba(0, 0, 0, 0.48) 100%
   );
   --ccm-overlay-scrim-next-board: linear-gradient(
     165deg,
     rgba(0, 0, 0, 0.48) 0%,
     rgba(0, 10, 16, 0.42) 50%,
     rgba(0, 0, 0, 0.46) 100%
   );
   /* Face-down card glass — dark-glass gradient stands in for backdrop blur (no per-card blur) */
   --ccm-card-glass-bg:
     radial-gradient(circle at 50% 38%, rgba(var(--ccm-current-tier-accent-rgb), 0.2), transparent 62%),
     linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.8) 0 2px, rgba(var(--ccm-neon-lime-rgb), 0.62) 2px 4px, transparent 4px calc(100% - 4px), rgba(var(--ccm-neon-cyan-rgb), 0.68) calc(100% - 4px) calc(100% - 2px), rgba(var(--ccm-neon-pink-rgb), 0.58) calc(100% - 2px) 100%),
     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='rgba(100,220,220,0.36)'/%3E%3C/svg%3E"),
     linear-gradient(160deg, #143038 0%, #071d27 48%, #030812 100%);
   --ccm-card-glass-bg-hover:
     radial-gradient(circle at 50% 38%, rgba(var(--ccm-current-tier-accent-rgb), 0.28), transparent 64%),
     linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.92) 0 2px, rgba(var(--ccm-neon-lime-rgb), 0.74) 2px 4px, transparent 4px calc(100% - 4px), rgba(var(--ccm-neon-cyan-rgb), 0.78) calc(100% - 4px) calc(100% - 2px), rgba(var(--ccm-neon-pink-rgb), 0.72) calc(100% - 2px) 100%),
     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='rgba(100,220,220,0.42)'/%3E%3C/svg%3E"),
     linear-gradient(160deg, #173743 0%, #08202b 48%, #030912 100%);
   --ccm-card-glass-border: 1.5px solid rgba(var(--ccm-current-tier-accent-rgb), 0.56);
   --ccm-card-glass-border-hover: 1.5px solid rgba(var(--ccm-current-tier-accent-rgb), 0.78);
   --ccm-card-glass-glow: inset 0 0 0 1px rgba(var(--ccm-current-tier-accent-rgb), 0.08);
   --ccm-card-glass-glow-hover:
     inset 0 0 0 1px rgba(var(--ccm-current-tier-accent-rgb), 0.24),
     inset 0 0 18px rgba(var(--ccm-current-tier-accent-rgb), 0.12),
     0 0 18px rgba(var(--ccm-neon-cyan-rgb), 0.24),
     0 0 14px rgba(var(--ccm-neon-pink-rgb), 0.14);
   /* --pastel-colors: #ffa50a, #ffa50a; */
 }

 /* Touch / narrow: one scrim blur max; panels & cards use opaque glass instead */
 @media (max-width: 768px), (hover: none) and (pointer: coarse) {
   :root {
     --ccm-backdrop-scrim: blur(5px);
     --ccm-glass-bg: linear-gradient(
       145deg,
       rgba(0, 0, 0, 0.88) 0%,
       rgba(0, 34, 40, 0.84) 38%,
       rgba(8, 0, 36, 0.82) 72%,
       rgba(0, 0, 0, 0.86) 100%
     );
     --ccm-glass-bg-play: linear-gradient(
       145deg,
       rgba(0, 0, 0, 0.78) 0%,
       rgba(0, 26, 32, 0.72) 48%,
       rgba(6, 0, 28, 0.7) 100%
     );
     --ccm-glass-bg-subtle: linear-gradient(
       135deg,
       rgba(0, 0, 0, 0.58) 0%,
       rgba(var(--primary-color-rgb), 0.14) 52%,
       rgba(var(--secondary-color-rgb), 0.1) 100%
     );
     --ccm-card-glass-bg:
       radial-gradient(circle at 50% 38%, rgba(var(--ccm-current-tier-accent-rgb), 0.15), transparent 62%),
       linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.58) 0 2px, rgba(var(--ccm-neon-lime-rgb), 0.44) 2px 4px, transparent 4px calc(100% - 4px), rgba(var(--ccm-neon-cyan-rgb), 0.5) calc(100% - 4px) calc(100% - 2px), rgba(var(--ccm-neon-pink-rgb), 0.46) calc(100% - 2px) 100%),
       url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='rgba(100,220,220,0.26)'/%3E%3C/svg%3E"),
       linear-gradient(160deg, #102a34 0%, #071923 48%, #02070f 100%);
     --ccm-card-glass-bg-hover:
       radial-gradient(circle at 50% 38%, rgba(var(--ccm-current-tier-accent-rgb), 0.2), transparent 64%),
       linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.72) 0 2px, rgba(var(--ccm-neon-lime-rgb), 0.52) 2px 4px, transparent 4px calc(100% - 4px), rgba(var(--ccm-neon-cyan-rgb), 0.58) calc(100% - 4px) calc(100% - 2px), rgba(var(--ccm-neon-pink-rgb), 0.56) calc(100% - 2px) 100%),
       url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='rgba(100,220,220,0.36)'/%3E%3C/svg%3E"),
       linear-gradient(160deg, #14303a 0%, #071c26 48%, #02070f 100%);

   }
 }

 @media (prefers-reduced-transparency: reduce) {
   :root {
     --ccm-backdrop-scrim: none;
   }
 }

 /* Base Reset & Font Styles */
 * {
   font-family: "VT323", "Orbitron";
   line-height: 1.1em;
   margin: 0;
   padding: 0;
   -webkit-tap-highlight-color: transparent;
   outline: none;
   user-select: none;
 }
 p {
   padding: 1%;
   margin: -1% 0 1%;
 }
 a {
   color: inherit;
 }
 a:visited,
 a:active {
   color: #ff4682d9;
 }

 /****************************************
  ** Base Styles
  ****************************************/
 html, body {
   color: white;
   height: 100%;
   width: 100vw;
   margin: 0;
   padding: 0;
   overflow: hidden;
 }

 html {
   background: #000102;
 }
body {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: none !important;
}

body.paused #game-container {
  filter: brightness(0.88);
  transition: filter 0.25s ease;
}

body > main {
  position: relative;
  z-index: 1;
  width: 100%;
  transition: opacity 0.55s ease-out;
}

body > aside:not(.fullscreen-overlay) {
  transition: opacity 0.55s ease-out;
}

 /****************************************
  ** Layout Styles
  ****************************************/
#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 98vw;
  max-width: 666px;
  box-sizing: border-box;
  background: var(--ccm-glass-bg-play);
  border: var(--ccm-glass-border);
  border-radius: 0.5rem;
  padding: 2% 2% 3%;
  margin: 0 auto;
  animation: overlayFadeInUp 0.76s forwards;
  box-shadow:
    var(--ccm-glass-shadow),
    inset 0 0 0 1px rgba(var(--ccm-neon-cyan-rgb), 0.08);
  position: relative;
  z-index: 1;
  isolation: isolate;
  transition:
    opacity var(--ccm-overlay-duration) var(--ccm-overlay-easing),
    transform var(--ccm-overlay-duration) var(--ccm-overlay-easing),
    filter 0.35s ease;
}

#game-container::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    var(--ccm-tier-rim-gradient) top / 100% 2px no-repeat,
    var(--ccm-tier-rim-gradient) bottom / 100% 2px no-repeat,
    linear-gradient(180deg, rgba(var(--ccm-neon-pink-rgb), 0.48), transparent 26%, transparent 74%, rgba(var(--ccm-neon-cyan-rgb), 0.4)) left / 2px 100% no-repeat,
    linear-gradient(180deg, rgba(var(--ccm-neon-cyan-rgb), 0.48), transparent 30%, transparent 70%, rgba(var(--ccm-neon-lime-rgb), 0.36)) right / 2px 100% no-repeat;
  opacity: 0.32;
}

body.welcome-active #game-container {
  opacity: 0.42;
  transform: scale(0.982);
  filter: brightness(0.72);
  pointer-events: none;
}

body.ccm-returning-home #game-container {
  opacity: 0;
  transform: translateY(0.35rem) scale(0.966);
  pointer-events: none;
}

body.ccm-returning-home:not(.ccm-fog-active) #game-container {
  transition:
    opacity 220ms var(--ccm-overlay-easing),
    transform 220ms var(--ccm-overlay-easing);
}

/* Don't animate dim/filter on the layer the blur scrim samples */
body.ccm-fog-active #game-container {
  transition: none;
}

 /****************************************
  ** REVEAL ALL & METER
  ****************************************/

 .reveal-all-flex-container {
   display: grid;
   grid-template-columns: minmax(0, 1fr) auto;
   align-items: stretch;
   gap: var(--release-gap);
   width: 100%;
   margin-bottom: 0.6rem;
 }

 .chroma-meter-bar-container {
   min-width: 0;
   display: flex;
   align-items: stretch;
 }

 #chroma-meter-bar {
   position: relative;
   overflow: hidden;
   flex: 1;
   display: flex;
   align-items: center;
   justify-content: center;
   height: var(--release-control-height);
   min-height: var(--release-control-height);
   box-sizing: border-box;
   width: 100%;
   border-radius: 8px;
   background: linear-gradient(
     180deg,
     rgba(0, 0, 0, 0.78) 0%,
     rgba(0, 0, 0, 0.58) 18%,
     rgba(0, 0, 0, 0.44) 52%,
     rgba(0, 0, 0, 0.62) 100%
   );
   border: 1px solid rgba(var(--ccm-current-tier-accent-rgb), 0.26);
   padding: 3px;
   box-shadow:
     inset 0 4px 10px rgba(0, 0, 0, 0.92),
     inset 0 1px 0 rgba(255, 255, 255, 0.1),
     inset 0 -1px 2px rgba(255, 255, 255, 0.04),
     0 1px 0 rgba(0, 0, 0, 0.55),
     0 0 14px rgba(var(--ccm-neon-cyan-rgb), 0.12);
   transition: box-shadow 0.2s ease-out, border-color 0.2s ease-out;
   z-index: 2;
 }

 .meter-label-container {
   position: relative;
   z-index: 3;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 0.35rem;
   height: 100%;
   padding: 0 0.55rem;
   margin: 0;
   border-radius: 5px;
   background: linear-gradient(
     180deg,
     rgba(0, 0, 0, 0.72) 0%,
     rgba(0, 0, 0, 0.58) 100%
   );
   border: 1px solid rgba(var(--ccm-current-tier-accent-rgb), 0.22);
   box-shadow:
     inset 0 2px 6px rgba(0, 0, 0, 0.7),
     inset 0 -1px 0 rgba(255, 255, 255, 0.05),
     0 1px 3px rgba(0, 0, 0, 0.45);
   pointer-events: none;
   white-space: nowrap;
 }

 .meter-crystal-icon {
   font-size: 0.85em;
   line-height: 1;
   color: rgb(var(--ccm-current-tier-accent-rgb));
   text-shadow:
     0 0 6px rgb(var(--ccm-current-tier-accent-rgb)),
     0 0 12px rgba(var(--ccm-neon-cyan-rgb), 0.46);
   animation: crystalPulse 2s infinite;
 }

 #reveal-all-chroma-meter {
   font-family: "Orbitron", sans-serif;
   font-size: 0.62rem;
   font-weight: 700;
   letter-spacing: 0.03em;
   color: var(--secondary-color);
   text-shadow: 0 0 4px rgba(0, 0, 0, 0.85);
   pointer-events: none;
 }

 @keyframes crystalPulse {
   0%, 100% { transform: scale(1); filter: brightness(1); }
   50% { transform: scale(1.12); filter: brightness(1.15); }
 }

 @keyframes meterFlash {
   0% { filter: brightness(1); }
   50% { filter: brightness(1.5); }
   100% { filter: brightness(1); }
 }

 /* Fill/Segment Base Style — liquid in recessed trough */
 .meter-bar-segment-fill {
   position: absolute;
   left: 0;
   top: 0;
   bottom: 0;
   width: 0%;
   border-radius: 4px 4px 5px 5px;
   border: none;
   transition: width 0.5s ease-in-out, filter 0.5s ease-in-out;
   background-color: #ff36c8d9;
   background-image: linear-gradient(
     180deg,
     rgba(255, 255, 255, 0.28) 0%,
     rgba(255, 255, 255, 0.08) 14%,
     transparent 38%,
     rgba(0, 0, 0, 0.18) 100%
   );
   box-shadow:
     inset 0 -6px 14px rgba(0, 0, 0, 0.38),
     inset 0 2px 10px rgba(255, 255, 255, 0.22),
     inset 0 0 8px rgba(255, 255, 255, 0.12);
   filter: saturate(1.18);
   z-index: 1;
 }

 .meter-bar-segment-fill::before {
   content: "";
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   height: 4px;
   border-radius: inherit;
   background: linear-gradient(
     180deg,
     rgba(255, 255, 255, 0.55) 0%,
     rgba(255, 255, 255, 0.18) 45%,
     transparent 100%
   );
   pointer-events: none;
 }

 .meter-bar-segment-fill::after {
   content: "";
   position: absolute;
   inset: 0;
   border-radius: inherit;
   box-shadow:
     inset 0 1px 0 rgba(255, 255, 255, 0.35),
     inset 0 0 14px rgba(var(--ccm-neon-cyan-rgb), 0.18),
     0 0 10px rgba(var(--ccm-neon-pink-rgb), 0.18);
   pointer-events: none;
 }
 .meter-bar-segment-fill.emptying {
   animation: depleteSegments 0.86s ease-in-out forwards;
 }
 @keyframes depleteSegments {
   0% {
     width: var(--current-width);
     background-color: rgba(var(--primary-color-rgb), 1);
     box-shadow: 0 0 20px rgba(var(--primary-color-rgb), 1), 0 0 40px rgba(var(--primary-color-rgb), 0.8);
   }
   46% {
     width: 0%;
     background-color: rgba(var(--primary-color-rgb), 0.3);
     box-shadow: none;
   }
   46.7% {
     width: 100%;
     background-color: rgba(255, 255, 255, 0.86);
     box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 60px rgba(255, 255, 255, 0.6);
   }
   96% {
     width: var(--current-width);
     background-color: rgba(var(--primary-color-rgb), 1);
     box-shadow: 0 0 20px rgba(var(--primary-color-rgb), 1), 0 0 40px rgba(var(--primary-color-rgb), 0.8);
   }
 }
 /* Reveal-all Button */
 .reveal-all-button {
   position: relative;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   height: var(--release-control-height);
   min-height: var(--release-control-height);
   min-width: 5.25rem;
   padding: 0 0.75rem;
   margin: 0;
   box-sizing: border-box;
   color: #fff;
   background:
     linear-gradient(180deg, rgba(255, 55, 198, 0.95) 0%, rgba(216, 31, 90, 0.96) 100%);
   border: 1px solid rgba(var(--ccm-neon-cyan-rgb), 0.48);
   border-radius: 8px;
   transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
   cursor: pointer;
   overflow: hidden;
   box-shadow:
     0 2px 8px rgba(0, 0, 0, 0.28),
     0 0 14px rgba(var(--ccm-neon-pink-rgb), 0.22);
   z-index: 2;
   flex-shrink: 0;
 }

 #reveal-all:hover {
   background: #000;
   color: rgb(var(--ccm-neon-pink-rgb));
   border-color: rgb(var(--ccm-neon-pink-rgb));
   box-shadow:
     0 0 12px rgba(var(--ccm-neon-pink-rgb), 0.35),
     0 0 18px rgba(var(--ccm-neon-cyan-rgb), 0.18);
 }

 .reveal-all-button span {
   font-size: 0.62rem;
   font-family: "Orbitron", sans-serif;
   font-weight: 800;
   letter-spacing: 0.06em;
   text-transform: uppercase;
   line-height: 1;
   text-shadow: 0 0 1px rgb(0, 0, 0);
 }
 .reveal-all-button:disabled,
 .previewing .reveal-all-button {
   color: rgb(var(--ccm-neon-pink-rgb));
   background: #000;
   border: 2px dotted rgb(var(--ccm-neon-pink-rgb));
   filter: none !important;
   opacity: 1 !important;
 }

 .previewing .card.disabled {
   transition: all 0.36s ease;
 }

 .reveal-all-button.pulse {
   animation: buttonPulse 1.6s infinite;
 }

 /****************************************
  ** Icon Button Styles
  ****************************************/

 .icon-button {
   padding: 2px 5px;
   background: none;
   border: none;
   cursor: pointer;
   align-items: center;
   justify-content: center;
   margin: 0 0.3125rem;
 }
 .icon-button svg {
   stroke: var(--secondary-color);
   transition: stroke 0.3s, transform 0.3s;
   filter: drop-shadow(0 0 10px var(--primary-color));
   outline: none;
 }
 .icon-button:hover svg {
   transform: scale(1.1);
 }

 [type=button]:focus, 
 [type=button]:hover, 
 [type=submit]:focus,
 button:focus,
 button:active,
 button:hover {
 color: inherit;
 background-color: inherit;
 outline: none;
 }

 /****************************************
  ** Score & Time Panel Styles
  ****************************************/
 #timer-container-wrapper {
   width: 100%;
   padding: 0 3%;
   box-sizing: border-box;
 }

 #timer-container,
 #score-panel {
   width: 100%;
   margin: 1% 0;
   background: var(--ccm-glass-bg-subtle);
   border: var(--ccm-glass-border);
   border-radius: 0.5rem;
   padding: 0.562em 1rem;
   box-sizing: border-box;
   display: flex;
   justify-content: space-between;
   box-shadow:
     var(--ccm-glass-inset),
     0 4px 16px rgba(0, 0, 0, 0.35),
     0 0 14px rgba(var(--ccm-current-tier-accent-rgb), 0.08);
 }
 #timer-container {
   border-color: rgba(var(--ccm-neon-cyan-rgb), 0.45);
 }
 #score-panel {
   margin: 0 0 2%;
 }
 #tries,
 #score,
 #level {
   font-size: .66em;
   font-weight: 500;
   color: white;
   transition: all 0.3s ease;
 }

 #tries {
   box-shadow: 0 0 16px #63c5daad;
 }

 #score {
   box-shadow: 0 0 16px #98fb987d;
 }

 #level {
   box-shadow: 0 0 16px #ffd70082
 }
 /****************************************
  ** Score Panel Detailed Styles
  ****************************************/
 #score-panel > div {
   position: relative;
 }
 #score-panel > div:nth-child(1),
 #score-panel > div:nth-child(2),
 #score-panel > div:nth-child(3) {
   font-weight: 700;
   font-size: 136%;
 }
 #score-panel > div:nth-child(1) {
   color: var(--primary-color);
 }
 #score-panel > div:nth-child(2) {
   color: var(--secondary-color);
 }
 #score-panel > div:nth-child(3) {
   color: rgb(var(--ccm-current-tier-accent-rgb));
 }

 #score-panel span:not(.score-label) {
   display: inline-block;
   transition: all 0.3s ease;
   padding: 0.2em 0.4em;
   border-radius: 4px;
   min-width: 1.5em;
   text-align: right;
   background:
     linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(var(--ccm-current-tier-accent-rgb), 0.06));
   position: relative;
   border: 1px solid rgba(var(--ccm-current-tier-accent-rgb), 0.18);
   font-family: "Orbitron", sans-serif;
   text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
 }
 #score-panel span.animate-value {
   animation: numberPulse 0.76s ease-in-out;
 }
 #score-panel span.animate-value::after {
   content: "";
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   margin: 0 0 0 1%;
   background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
   opacity: 0;
   animation: flashPulse 0.4s ease-out;
 }

 /****************************************
  ** Overlay Base Styles
  ****************************************/
 .fullscreen-overlay {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   display: none;
   justify-content: center;
   align-items: center;
   pointer-events: none;
   opacity: 0;
   background: transparent;
   backdrop-filter: none;
   -webkit-backdrop-filter: none;
   z-index: 3000;
   transition: opacity var(--ccm-overlay-duration) var(--ccm-overlay-easing);
 }
.fullscreen-overlay.show,
.fullscreen-overlay.hiding {
  display: flex;
}
.fullscreen-overlay.show {
  opacity: 1;
  pointer-events: all;
}
/* Blur scrim on a fixed pseudo-layer — never opacity-faded (that re-rasterizes blur) */
.fullscreen-overlay.overlay-fog-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--ccm-overlay-scrim);
  backdrop-filter: var(--ccm-backdrop-scrim);
  -webkit-backdrop-filter: var(--ccm-backdrop-scrim);
}
#welcome-screen.overlay-fog-active::before {
  background: var(--ccm-welcome-radial-scrim);
}
.fullscreen-overlay.overlay-fog-active {
  transition: none;
}
.fullscreen-overlay.overlay-fog-active.show {
  opacity: 1;
  background: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.fullscreen-overlay.hiding {
  opacity: 0;
  pointer-events: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.fullscreen-overlay.overlay-fog-active.hiding::before {
  display: none;
}

 .fullscreen-overlay .overlay-content,
 .fullscreen-overlay .how-to-overlay-content {
   border-radius: 0.46rem;
   width: 86%;
   max-width: 396px;
   box-sizing: border-box;
   padding: 2em 1em;
   border: var(--ccm-glass-border);
   background: var(--ccm-glass-bg);
   box-shadow: var(--ccm-glass-shadow-deep);
   color: var(--ccm-glass-text);
   opacity: 0;
   transform: translateY(6%);
   position: relative;
 }
 
 /* Modal Close Button (X) */
 .modal-close-button {
   position: absolute;
   top: 0.5em;
   right: 0.5em;
   background: transparent;
   border: none;
   color: var(--secondary-color);
   font-size: 2em;
   line-height: 1;
   width: 1.5em;
   height: 1.5em;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 0;
   z-index: 10;
   transition: all 0.3s ease;
   border-radius: 4px;
   text-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.8);
 }
 .modal-close-button:hover {
   color: var(--primary-color);
   transform: scale(1.2);
   text-shadow: 0 0 12px rgba(var(--primary-color-rgb), 1);
   background: rgba(0, 0, 0, 0.2);
 }
 .modal-close-button:active {
   transform: scale(0.9);
 }

 .fullscreen-overlay.show .overlay-content,
 .fullscreen-overlay.show .how-to-overlay-content {
   opacity: 1;
   transform: translateY(0);
   animation: overlayFadeInUp var(--ccm-overlay-duration) var(--ccm-overlay-easing) forwards;
 }
 
 .fullscreen-overlay.hiding .overlay-content,
 .fullscreen-overlay.hiding .how-to-overlay-content {
   animation: overlayFadeOutDown var(--ccm-overlay-duration) var(--ccm-overlay-easing) forwards;
 }

 /* --- Save & Exit: "progress banked" confirm pulse (Save & Exit only) --- */
 .fullscreen-overlay.show .overlay-content.ccm-save-confirm {
   animation: ccmSaveConfirm 300ms var(--ccm-overlay-easing) both;
   pointer-events: none;
 }

 /* --- Return-to-home exit: panel lifts away & recedes instead of dropping.
    Shared by every goHome() path (Save & Exit, Game Over, pause → Go Home)
    so "leaving for the welcome screen" reads consistently across the game. --- */
 .fullscreen-overlay.ccm-exit-home.hiding .overlay-content,
 .fullscreen-overlay.ccm-exit-home.hiding .how-to-overlay-content {
   animation: ccmExitHomeLift var(--ccm-overlay-duration) var(--ccm-overlay-easing) forwards;
 }

 /****************************************
  ** Welcome Screen Styles
  ****************************************/
  #welcome-content {
   position: relative;
 }

  #welcome-content .icon-button {
   position: absolute;
   top: 0.5rem;
   right: 0.5rem;
   z-index: 6;
   border: var(--ccm-glass-border);
   border-radius: 6px;
   padding: 0.28rem 0.36rem 0;
   background: rgba(0, 0, 0, 0.48);
   box-shadow: var(--ccm-glass-inset);
   margin: 0;
 }

 #welcome-content #welcome-achievement-button {
   left: 0.5rem;
   right: auto;
 }

 body.welcome-ready-pulse #welcome-screen.show #welcome-title {
   animation: ccmWelcomeReadyTitle 950ms ease-out both;
 }

 body.welcome-home-pulse #welcome-screen.show #welcome-title {
   animation: ccmWelcomeHomeTitle 900ms ease-out both;
 }

 body.welcome-ready-pulse #welcome-screen.show .welcome-tier-panel.is-tier-active .tier-carousel-slide.is-welcome-start .tier-carousel-card {
   animation: ccmWelcomeReadyCard 940ms 60ms ease-out both;
 }

 body.welcome-intro-lock #welcome-screen {
   cursor: wait;
 }

 body.welcome-intro-lock #welcome-screen .overlay-content {
   pointer-events: none;
 }

 body.welcome-board-travel #welcome-screen.show .welcome-tier-panel.is-tier-active .tier-board-carousel-viewport {
   scroll-snap-type: none;
 }

 body.welcome-board-travel #welcome-screen.show .welcome-tier-panel.is-tier-active .tier-carousel-slide.is-welcome-target .tier-carousel-card {
   animation: ccmWelcomeArrivedCard 980ms ease-out both;
 }

 body.welcome-home-pulse #welcome-screen.show .welcome-tier-panel.is-tier-active .tier-carousel-slide.is-active .tier-carousel-card {
   animation: ccmWelcomeHomeCard 920ms 50ms ease-out both;
 }

 body.welcome-ready-pulse #welcome-screen.show .welcome-tier-panel.is-tier-active .tier-carousel-slide.is-welcome-start .tier-carousel-card::after,
 body.welcome-board-travel #welcome-screen.show .welcome-tier-panel.is-tier-active .tier-carousel-slide.is-welcome-target .tier-carousel-card::after {
   content: "";
   position: absolute;
   inset: 0;
   border-radius: inherit;
   pointer-events: none;
   opacity: 0;
   z-index: 3;
   will-change: opacity, transform;
   background:
     radial-gradient(ellipse 76% 58% at 50% 42%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.2), transparent 60%),
     linear-gradient(118deg, transparent 0%, rgba(255, 255, 255, 0.11) 46%, transparent 70%);
   transform: translate3d(-8%, 0, 0) scale(0.985);
   animation: ccmWelcomeCardBackGlow 980ms cubic-bezier(0.2, 0.82, 0.24, 1) both;
 }

 body.welcome-home-pulse #welcome-screen.show .welcome-tier-panel.is-tier-active .tier-carousel-slide.is-active .tier-carousel-card::after {
   content: "";
   position: absolute;
   inset: 0;
   border-radius: inherit;
   pointer-events: none;
   opacity: 0;
   z-index: 3;
   will-change: opacity, transform;
   background:
     radial-gradient(ellipse 78% 62% at 50% 44%, rgba(255, 215, 0, 0.16), transparent 62%),
     linear-gradient(118deg, transparent 0%, rgba(255, 255, 255, 0.12) 44%, transparent 68%);
   transform: translate3d(-6%, 0, 0) scale(0.988);
   animation: ccmWelcomeHomeGlow 920ms cubic-bezier(0.2, 0.82, 0.24, 1) both;
 }

 @keyframes ccmWelcomeReadyTitle {
   0%, 100% {
     text-shadow: none;
   }
   42% {
     text-shadow:
       0 0 14px rgba(var(--secondary-color-rgb), 0.45),
       0 0 24px rgba(var(--primary-color-rgb), 0.28);
   }
 }

 @keyframes ccmWelcomeHomeTitle {
   0%, 100% {
     text-shadow: none;
   }
   46% {
     text-shadow:
       0 0 12px rgba(255, 215, 0, 0.42),
       0 0 22px rgba(var(--secondary-color-rgb), 0.3);
   }
 }

 @keyframes ccmWelcomeReadyCard {
   0% {
     border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.34);
   }
   38% {
     border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.66);
   }
   100% {
     border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.34);
   }
 }

 @keyframes ccmWelcomeHomeCard {
   0% {
     transform: translateZ(0) scale(0.99);
     border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.34);
   }
   42% {
     transform: translateZ(0) scale(1.015);
     border-color: rgba(255, 215, 0, 0.68);
   }
   100% {
     transform: translateZ(0) scale(1);
     border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.34);
   }
 }

 @keyframes ccmWelcomeArrivedCard {
   0% {
     border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.34);
   }
   34% {
     border-color: rgba(255, 215, 0, 0.72);
   }
   100% {
     border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.34);
   }
 }

 @keyframes ccmWelcomeCardBackGlow {
   0% {
     opacity: 0;
     transform: translate3d(-8%, 0, 0) scale(0.985);
   }
   34% {
     opacity: 0.72;
     transform: translate3d(0, 0, 0) scale(1);
   }
   100% {
     opacity: 0;
     transform: translate3d(8%, 0, 0) scale(1.012);
   }
 }

 @keyframes ccmWelcomeHomeGlow {
   0% {
     opacity: 0;
     transform: translate3d(-6%, 0, 0) scale(0.988);
   }
   38% {
     opacity: 0.64;
     transform: translate3d(0, 0, 0) scale(1);
   }
   100% {
     opacity: 0;
     transform: translate3d(6%, 0, 0) scale(1.008);
   }
 }

#welcome-screen .overlay-content,
#pause-confirmation-overlay .overlay-content {
  border-color: var(--primary-color);
  padding: 0.55em 1em 0.36em;
  max-height: 90vh;
  overflow-y: auto;
  margin: 5vh auto;
}

/* Custom scrollbar for welcome container - Desktop & Mobile */
#welcome-screen .overlay-content::-webkit-scrollbar {
  width: 12px;
}

#welcome-screen .overlay-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--primary-color);
  border-radius: 10px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}

#welcome-screen .overlay-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(99, 197, 218, 0.6), inset 0 0 4px rgba(152, 251, 152, 0.4);
}

#welcome-screen .overlay-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  box-shadow: 0 0 12px rgba(152, 251, 152, 0.8), inset 0 0 6px rgba(99, 197, 218, 0.6);
}

/* Firefox scrollbar styling */
#welcome-screen .overlay-content {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) rgba(0, 0, 0, 0.4);
}
 #welcome-screen #welcome-title {
   font-size: calc(44px - 2%);
   padding: .66rem 0.25%;
   font-weight: 600;
   line-height: 0.75em;
   pointer-events: none;
   margin: 0 auto 1%;
   font-family: "Orbitron", sans-serif;
 }
 #welcome-screen #welcome-title span {
   font-size: 47%;
   font-family: "Orbitron", sans-serif;
 }
 #welcome-screen .tier-option {
   padding: 1% 0 0;
   text-shadow: var(--neon-glow);
 }
 #welcome-screen .overlay-button {
   letter-spacing: 0.0625rem;
   background-color: rgba(0, 0, 0, 0.46);
   border-color: var(--secondary-color);
   width: auto;
   padding: 2%;
   margin: 0;
 }
   
 /* Consolidated Reset Overlay Button */
 #welcome-screen .reset-overlay-button {
   font-family: "Orbitron", sans-serif;
   font-size: 0.61em;
   background: rgb(12 11 26 / 54%);
   border: 1px dotted var(--primary-color);
   border-radius: 6px;
   color: var(--primary-color);
   padding: 3%;
   cursor: pointer;
   transition: all 0.3s ease-in-out;
   width: 100%;
   margin: 1% auto;
 }

 #welcome-screen .reset-danger-button {
   display: flex;
   align-items: center;
   gap: 0.65rem;
   margin-top: 0.85rem;
   padding: 0.75rem 0.85rem;
   text-align: left;
   background:
     linear-gradient(135deg, rgba(48, 8, 12, 0.82), rgba(18, 4, 8, 0.92));
   border: 1px solid rgba(220, 53, 69, 0.72);
   border-radius: 8px;
   color: #ffb4b4;
   box-shadow:
     inset 0 0 0 1px rgba(255, 80, 80, 0.08),
     0 0 0 1px rgba(0, 0, 0, 0.45),
     0 0 18px rgba(220, 53, 69, 0.16);
   transition:
     background 0.25s ease,
     border-color 0.25s ease,
     box-shadow 0.25s ease,
     transform 0.2s ease;
 }

 #welcome-screen .reset-danger-button:hover {
   background:
     linear-gradient(135deg, rgba(72, 10, 16, 0.92), rgba(28, 6, 10, 0.96));
   border-color: rgba(255, 90, 90, 0.95);
   box-shadow:
     inset 0 0 0 1px rgba(255, 120, 120, 0.14),
     0 0 0 1px rgba(0, 0, 0, 0.45),
     0 0 22px rgba(220, 53, 69, 0.38);
   transform: translateY(-1px);
 }

 #welcome-screen .reset-danger-button:active {
   transform: translateY(0);
   box-shadow:
     inset 0 0 12px rgba(0, 0, 0, 0.45),
     0 0 10px rgba(220, 53, 69, 0.22);
 }

 .reset-danger-button__icon {
   flex: 0 0 auto;
   display: grid;
   place-items: center;
   width: 1.65rem;
   height: 1.65rem;
   border-radius: 50%;
   background: rgba(220, 53, 69, 0.18);
   border: 1px solid rgba(255, 120, 120, 0.45);
   color: #ffd0d0;
   font-size: 0.95rem;
   line-height: 1;
   text-shadow: 0 0 8px rgba(255, 80, 80, 0.65);
 }

 .reset-danger-button__copy {
   display: flex;
   flex-direction: column;
   gap: 0.18rem;
   min-width: 0;
 }

 .reset-danger-button__title {
   display: block;
   font-size: 0.92rem;
   letter-spacing: 0.04em;
   color: #ffc9c9;
   text-shadow: 0 0 10px rgba(220, 53, 69, 0.35);
 }

 .reset-danger-button__hint {
   display: block;
   font-family: system-ui, sans-serif;
   font-size: 0.72rem;
   line-height: 1.25;
   color: rgba(255, 180, 180, 0.78);
 }

 /****************************************
  ** Welcome Screen Tier Options Styles
  ****************************************/
 .welcome-tier-picker {
   --welcome-chrome-accent-rgb: 152, 251, 152;
   --welcome-handoff-ms: 360ms;
   --welcome-handoff-ease: cubic-bezier(0.4, 0, 0.2, 1);
   margin: 3% 0;
 }

 .welcome-tier-panels {
   display: grid;
   grid-template-columns: minmax(0, 1fr);
   position: relative;
   isolation: isolate;
 }

 .welcome-tier-panel {
   grid-area: 1 / 1;
   opacity: 0;
   visibility: hidden;
   pointer-events: none;
   transform: translateX(6px) scale(0.994);
   z-index: 0;
   transition:
     opacity var(--welcome-handoff-ms) var(--welcome-handoff-ease),
     transform var(--welcome-handoff-ms) var(--welcome-handoff-ease),
     border-color var(--welcome-handoff-ms) ease,
     box-shadow var(--welcome-handoff-ms) ease,
     background var(--welcome-handoff-ms) ease;
 }

 .welcome-tier-panel.is-tier-active {
   opacity: 1;
   visibility: visible;
   pointer-events: auto;
   transform: translateX(0) scale(1);
   z-index: 2;
 }

 .welcome-tier-panel.is-tier-exiting {
   opacity: 0;
   visibility: visible;
   pointer-events: none;
   transform: translateX(-6px) scale(0.994);
   z-index: 1;
 }

 .welcome-tier-panel.is-tier-hidden {
   opacity: 0;
   visibility: hidden;
   pointer-events: none;
   transform: translateX(6px) scale(0.994);
   z-index: 0;
 }

 .welcome-tier-panel.is-tier-instant {
   transition: none !important;
 }

 #welcome-screen.welcome-tier-handoff .overlay-content,
 .welcome-tier-handoff {
   backface-visibility: hidden;
   transform: translateZ(0);
 }

 #welcome-screen.welcome-tier-handoff .overlay-content {
   transition: none;
 }

 .welcome-tier-handoff .welcome-tier-tabs,
 .welcome-tier-handoff .welcome-tier-nav,
 .welcome-tier-handoff .welcome-tier-panel.is-tier-active {
   transition-duration: var(--welcome-handoff-ms);
   transition-timing-function: var(--welcome-handoff-ease);
 }

 .welcome-zenith-section {
   margin-top: 0.85rem;
   padding-top: 0.65rem;
   border-top: 1px solid rgba(var(--primary-color-rgb), 0.18);
   max-height: 0;
   opacity: 0;
   overflow: hidden;
   transform: translateY(6px);
   transition:
     opacity var(--welcome-handoff-ms, 360ms) var(--welcome-handoff-ease, cubic-bezier(0.4, 0, 0.2, 1)),
     transform var(--welcome-handoff-ms, 360ms) var(--welcome-handoff-ease, cubic-bezier(0.4, 0, 0.2, 1)),
     max-height var(--welcome-handoff-ms, 360ms) var(--welcome-handoff-ease, cubic-bezier(0.4, 0, 0.2, 1)),
     margin-top var(--welcome-handoff-ms, 360ms) ease,
     padding-top var(--welcome-handoff-ms, 360ms) ease;
 }

 .welcome-zenith-section.is-unlocked {
   max-height: 20rem;
   opacity: 1;
   overflow: visible;
   transform: translateY(0);
 }

 .welcome-zenith-section.is-zenith-revealed {
   box-shadow: 0 -8px 24px rgba(133, 0, 215, 0.12);
 }

 .welcome-zenith-section:not(.is-unlocked),
 .welcome-zenith-section[hidden] {
   display: none !important;
 }

 .welcome-zenith-section__eyebrow {
   margin: 0 0 0.45rem;
   text-align: center;
   font-family: "Orbitron", sans-serif;
   font-size: 0.58rem;
   letter-spacing: 0.14em;
   text-transform: uppercase;
   color: rgba(200, 160, 255, 0.72);
 }

 .welcome-zenith-card {
   margin: 0 0.35rem;
   padding: 0.7rem 0.75rem 0.75rem;
   border-radius: 10px;
   border: 1px solid rgba(133, 0, 215, 0.38);
   background: linear-gradient(165deg, rgba(16, 4, 28, 0.82), rgba(133, 0, 215, 0.1));
   box-shadow:
     inset 0 0 0 1px rgba(255, 255, 255, 0.04),
     0 0 16px rgba(133, 0, 215, 0.14);
   transition: border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
 }

 .welcome-zenith-section.is-highlighted .welcome-zenith-card {
   border-color: rgba(200, 120, 255, 0.62);
   box-shadow:
     inset 0 0 0 1px rgba(255, 255, 255, 0.05),
     0 0 20px rgba(133, 0, 215, 0.28);
 }

 .welcome-zenith-section.is-locked .welcome-zenith-card {
   border-color: rgba(133, 0, 215, 0.22);
   opacity: 0.88;
 }

 #welcome-screen .welcome-zenith-card.tier-option-container.locked {
   border: 1px solid rgba(133, 0, 215, 0.22) !important;
   opacity: 0.88;
   background: linear-gradient(165deg, rgba(16, 4, 28, 0.72), rgba(0, 0, 0, 0.55)) !important;
   color: inherit;
 }

 .welcome-zenith-card__head {
   display: flex;
   align-items: center;
   gap: 0.55rem;
   margin-bottom: 0.55rem;
 }

 .welcome-zenith-card__preview {
   position: relative;
   width: min(8.8rem, 52vw);
   aspect-ratio: 3 / 4;
   margin: 0 auto 0.6rem;
   overflow: hidden;
   border-radius: 8px;
   border: 1px solid rgba(200, 120, 255, 0.52);
   background: linear-gradient(165deg, rgba(16, 4, 28, 0.76), rgba(0, 0, 0, 0.62));
   box-shadow:
     0 0 0 2px rgba(0, 0, 0, 0.46),
     0 0 18px rgba(133, 0, 215, 0.22),
     inset 0 0 0 1px rgba(255, 255, 255, 0.05);
 }

 .welcome-zenith-card__preview::after {
   content: "";
   position: absolute;
   inset: 0;
   background:
     linear-gradient(0deg, rgba(0, 0, 0, 0.84) 0%, rgba(0, 0, 0, 0.22) 48%, transparent 78%),
     radial-gradient(ellipse 78% 42% at 50% 38%, transparent 40%, rgba(0, 0, 0, 0.42) 100%);
   pointer-events: none;
 }

 .welcome-zenith-card__preview img {
   display: block;
   width: 100%;
   height: 100%;
   object-fit: cover;
   object-position: center;
   filter: saturate(1.04) brightness(0.92);
 }

 .welcome-zenith-card__preview figcaption {
   position: absolute;
   left: 0;
   right: 0;
   bottom: 0.44rem;
   z-index: 1;
   margin: 0;
   text-align: center;
   font-family: "Orbitron", sans-serif;
   font-size: 0.58rem;
   letter-spacing: 0.08em;
   text-transform: uppercase;
   color: rgba(240, 224, 255, 0.92);
   text-shadow: 0 1px 4px rgba(0, 0, 0, 0.94), 0 0 10px rgba(133, 0, 215, 0.5);
 }

 .welcome-zenith-section.is-locked .welcome-zenith-card__preview {
   opacity: 0.7;
   filter: saturate(0.75);
 }

 .welcome-zenith-card__badge {
   flex: 0 0 auto;
   width: 2rem;
   height: 2rem;
   display: grid;
   place-items: center;
   border-radius: 6px;
   border: 1px solid rgba(133, 0, 215, 0.5);
   background: rgba(133, 0, 215, 0.15);
   font-family: "Orbitron", sans-serif;
   font-size: 0.85rem;
   color: rgba(220, 180, 255, 0.95);
 }

 .welcome-zenith-card__titles {
   flex: 1;
   min-width: 0;
 }

 .welcome-zenith-card__title {
   display: block;
   font-family: "Orbitron", sans-serif;
   font-size: 0.78rem;
   letter-spacing: 0.04em;
   color: rgba(220, 180, 255, 0.95);
 }

 .welcome-zenith-card__tagline {
   display: block;
   margin-top: 0.12rem;
   font-size: 0.58rem;
   color: rgba(200, 160, 255, 0.72);
 }

 .welcome-zenith-card__lock {
   display: none;
   flex: 0 0 auto;
   width: 1rem;
   height: 1rem;
   background: url("../assets/images/gridTierLocks_gold.webp") no-repeat center / contain;
   filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.85));
   opacity: 0.92;
 }

 .welcome-zenith-section.is-locked .welcome-zenith-card__lock {
   display: block;
 }

 .welcome-zenith-card__body {
   display: flex;
   flex-direction: column;
   align-items: stretch;
   gap: 0.4rem;
 }

 .welcome-zenith-card__runs {
   margin: 0;
   text-align: center;
   font-family: "Orbitron", sans-serif;
   line-height: 1.2;
 }

 .welcome-zenith-card__runs-value {
   font-size: 1.65rem;
   font-weight: 700;
   color: rgba(200, 140, 255, 0.95);
   text-shadow: 0 0 14px rgba(133, 0, 215, 0.45);
   margin-right: 0.2rem;
 }

 .welcome-zenith-section.is-locked .welcome-zenith-card__runs-value {
   color: rgba(255, 255, 255, 0.35);
   text-shadow: none;
 }

 .welcome-zenith-card__runs-label {
   font-size: 0.58rem;
   letter-spacing: 0.06em;
   text-transform: uppercase;
   color: rgba(255, 255, 255, 0.62);
 }

 .welcome-zenith-card__meta {
   margin: 0;
   text-align: center;
   font-size: 0.62rem;
   letter-spacing: 0.03em;
   color: rgba(var(--primary-color-rgb), 0.9);
 }

 .welcome-zenith-card__note {
   margin: 0;
   text-align: center;
   font-size: 0.58rem;
   line-height: 1.3;
   color: rgba(200, 160, 255, 0.78);
 }

 .welcome-zenith-card__btn {
   display: block !important;
   width: auto !important;
   min-width: 8.5rem;
   max-width: 12rem;
   align-self: center;
   margin: 0.25rem auto 0 !important;
   text-align: center;
 }

 .welcome-zenith-card .difficulty-option.locked::before {
   content: none;
 }

 #welcome-screen .welcome-tier-panel.tier-option-container.locked {
   border: 1px solid rgba(255, 255, 255, 0.12) !important;
   opacity: 0.78;
   background:
     radial-gradient(ellipse 90% 42% at 50% 0%, rgba(255, 255, 255, 0.035), transparent 62%),
     linear-gradient(180deg, rgba(0, 0, 0, 0.88), rgba(16, 0, 8, 0.78) 48%, rgba(0, 0, 0, 0.9)) !important;
   color: inherit;
   box-shadow:
     var(--ccm-glass-inset),
     0 0 14px rgba(0, 0, 0, 0.34);
 }

 #welcome-screen .welcome-tier-panel.tier-option-container.locked .tier-option::before {
   display: none;
 }

 .welcome-tier-rail {
   display: grid;
   grid-template-columns: auto minmax(0, 1fr) auto;
   align-items: center;
   gap: 0.35rem;
   padding: 0.12rem 0.1rem 0.4rem;
 }

 .welcome-tier-tabs {
   --welcome-tier-tab-size: 3rem;
   --welcome-tier-end-pad: 0.35rem;

   display: flex;
   gap: 0.35rem;
   justify-content: flex-start;
   flex-wrap: nowrap;
   container-type: inline-size;
   overflow-x: auto;
   scroll-snap-type: x proximity;
   scroll-padding-inline: 0.2rem var(--welcome-tier-end-pad);
   scroll-behavior: smooth;
   touch-action: pan-x;
   overscroll-behavior-x: contain;
   padding: 0.18rem 0.2rem;
   border: 1px solid rgba(var(--welcome-chrome-accent-rgb, var(--primary-color-rgb)), 0.42);
   border-radius: 999px;
   background:
     var(--ccm-tier-rim-gradient) top / 100% 1px no-repeat,
     radial-gradient(ellipse 48% 120% at 50% 50%, rgba(var(--welcome-chrome-accent-rgb, var(--primary-color-rgb)), 0.18), transparent 72%),
     linear-gradient(90deg, rgba(0, 0, 0, 0.64), rgba(var(--welcome-chrome-accent-rgb, var(--primary-color-rgb)), 0.12), rgba(0, 0, 0, 0.64));
   box-shadow:
     inset 0 0 0 1px rgba(255, 255, 255, 0.025),
     inset 0 0 14px rgba(0, 0, 0, 0.46),
     0 0 14px rgba(var(--welcome-chrome-accent-rgb, var(--primary-color-rgb)), 0.14),
     0 0 18px rgba(var(--ccm-neon-pink-rgb), 0.06);
   mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 1.1rem), transparent);
   scrollbar-width: none;
   -ms-overflow-style: none;
   transition:
     border-color 0.42s ease,
     box-shadow 0.42s ease,
     background 0.42s ease;
 }

 .welcome-tier-tabs__spacer--end {
   flex: 0 0 var(--welcome-tier-end-pad);
   width: var(--welcome-tier-end-pad);
   height: 1px;
   pointer-events: none;
 }

 .welcome-tier-tabs__spacer {
   display: none;
 }

 .welcome-tier-tabs::-webkit-scrollbar {
   display: none;
 }

 .welcome-tier-nav {
   width: 1.72rem;
   aspect-ratio: 1;
   display: grid;
   place-items: center;
   border: 1px dotted rgba(var(--welcome-chrome-accent-rgb, var(--secondary-color-rgb)), 0.48);
   border-radius: 50%;
   background:
     radial-gradient(circle at 50% 35%, rgba(var(--welcome-chrome-accent-rgb, var(--secondary-color-rgb)), 0.16), rgba(0, 0, 0, 0.64));
   color: rgb(var(--welcome-chrome-accent-rgb, var(--secondary-color-rgb)));
   font-family: "Orbitron", sans-serif;
   font-size: 1.05rem;
   line-height: 1;
   cursor: pointer;
   box-shadow:
     inset 0 0 9px rgba(0, 0, 0, 0.46),
     0 0 10px rgba(var(--welcome-chrome-accent-rgb, var(--secondary-color-rgb)), 0.14);
   transition: opacity 0.2s ease, border-color 0.42s ease, box-shadow 0.42s ease, transform 0.2s ease, color 0.42s ease, background 0.42s ease;
 }

 .welcome-tier-nav:not(:disabled):hover {
   border-color: rgba(var(--welcome-chrome-accent-rgb, var(--secondary-color-rgb)), 0.82);
   box-shadow:
     inset 0 0 9px rgba(0, 0, 0, 0.46),
     0 0 14px rgba(var(--welcome-chrome-accent-rgb, var(--secondary-color-rgb)), 0.28);
   transform: translateY(-1px);
 }

 .welcome-tier-nav:disabled {
   opacity: 0.32;
   cursor: default;
 }

 .welcome-tier-tab {
   position: relative;
   isolation: isolate;
   flex: 0 0 auto;
   min-width: var(--welcome-tier-tab-size);
   padding: 0.34rem 0.58rem;
   scroll-snap-align: start;
   scroll-snap-stop: always;
   border: 1px dotted rgba(var(--tier-accent-rgb, var(--primary-color-rgb)), 0.42);
   border-radius: 8px;
   background:
     radial-gradient(circle at 54% 24%, rgba(var(--tier-accent-rgb, var(--primary-color-rgb)), 0.12), transparent 58%),
     linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(var(--tier-accent-rgb, var(--primary-color-rgb)), 0.08)),
     var(--tier-art-image, none) center / cover no-repeat;
   color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.82);
   font-family: "Orbitron", sans-serif;
   font-size: 0.72rem;
   cursor: pointer;
   box-shadow:
     inset 0 0 8px rgba(0, 0, 0, 0.58),
     inset 0 0 0 1px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.06);
   transition:
     background 0.42s ease,
     border-color 0.42s ease,
     box-shadow 0.42s ease,
     color 0.42s ease,
     transform 0.42s ease;
 }

 .welcome-tier-tab::before,
 .welcome-tier-tab::after {
   content: "";
   position: absolute;
   pointer-events: none;
   opacity: 0;
   transition: opacity 0.28s ease, transform 0.28s ease;
 }

 .welcome-tier-tab::before {
   inset: -0.28rem;
   z-index: -1;
   border-radius: 12px;
   background:
     radial-gradient(ellipse 92% 86% at 50% 50%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.42), transparent 68%),
     radial-gradient(ellipse 120% 70% at 50% 50%, rgba(var(--ccm-neon-cyan-rgb), 0.14), transparent 76%);
   filter: blur(2px);
   transform: scale(0.9);
 }

 .welcome-tier-tab::after {
   left: 50%;
   bottom: -0.18rem;
   z-index: 2;
   width: 1.55rem;
   height: 0.16rem;
   border-radius: 999px;
   background: rgb(var(--tier-accent-rgb, var(--secondary-color-rgb)));
   box-shadow:
     0 0 9px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.78),
     0 0 14px rgba(var(--ccm-neon-cyan-rgb), 0.24);
   transform: translateX(-50%) scaleX(0.55);
 }

 .welcome-tier-tab.active,
 .welcome-tier-tab[aria-selected="true"] {
   background:
     linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.24), rgba(var(--tier-accent-rgb, var(--primary-color-rgb)), 0.34), rgba(var(--ccm-neon-cyan-rgb), 0.2)) top / 100% 2px no-repeat,
     radial-gradient(circle at 58% 18%, rgba(255, 255, 255, 0.12), transparent 34%),
     linear-gradient(135deg, rgba(0, 0, 0, 0.62), rgba(var(--tier-accent-rgb, var(--primary-color-rgb)), 0.26)),
     var(--tier-art-image, none) center / cover no-repeat;
   border-color: rgb(var(--tier-accent-rgb, var(--secondary-color-rgb)));
   color: rgb(var(--tier-accent-rgb, var(--secondary-color-rgb)));
   box-shadow:
     0 0 0 1px rgba(0, 0, 0, 0.48),
     0 0 15px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.58),
     0 0 22px rgba(var(--ccm-neon-pink-rgb), 0.16),
     inset 0 0 0 1px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.2),
     inset 0 0 14px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.12);
   transform: translateY(-1px) scale(1.035);
 }

 .welcome-tier-tab.active::before,
 .welcome-tier-tab[aria-selected="true"]::before,
 .welcome-tier-tab.is-bridge-target:not(.active)::before {
   opacity: 1;
   transform: scale(1);
 }

 .welcome-tier-tab.active::after,
 .welcome-tier-tab[aria-selected="true"]::after,
 .welcome-tier-tab.is-bridge-target:not(.active)::after {
   opacity: 1;
   transform: translateX(-50%) scaleX(1);
 }

 .welcome-tier-tab.is-bridge-target:not(.active) {
   border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.72);
   color: rgb(var(--tier-accent-rgb, var(--secondary-color-rgb)));
   box-shadow:
     0 0 0 1px rgba(0, 0, 0, 0.5),
     0 0 14px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.46),
     0 0 18px rgba(var(--ccm-neon-cyan-rgb), 0.16),
     inset 0 0 0 1px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.16);
   transform: translateY(-1px) scale(1.045);
 }

 .welcome-tier-tab.current:not(.locked):not(.active) {
   border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.58);
 }

 .welcome-tier-tab.cleared:not(.active) {
   border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.42);
   color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.88);
 }

 .welcome-tier-tab.locked {
   opacity: 0.68;
   border-color: rgba(255, 255, 255, 0.14) !important;
   background:
     radial-gradient(circle at 54% 24%, rgba(255, 255, 255, 0.045), transparent 58%),
     linear-gradient(135deg, rgba(20, 0, 7, 0.86), rgba(0, 0, 0, 0.9));
   color: rgba(255, 190, 190, 0.66);
   box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.72) !important;
 }

 .welcome-tier-tab.locked .welcome-tier-tab__num::after {
   content: "";
   display: inline-block;
   width: 0.72rem;
   height: 0.72rem;
   margin-left: 0.18rem;
   vertical-align: -0.08rem;
   background: url("../assets/images/gridTierLocks_gold.webp") no-repeat center / contain;
   filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.85));
   opacity: 0.92;
 }

 .welcome-tier-tab__num {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   min-width: 1.7rem;
   padding: 0.1rem 0.28rem;
   border: 1px solid rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.26);
   border-radius: 999px;
   background:
     radial-gradient(ellipse 80% 130% at 50% 18%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.12), transparent 68%),
     linear-gradient(180deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.56));
   box-shadow:
     inset 0 0 8px rgba(0, 0, 0, 0.62),
     0 0 8px rgba(0, 0, 0, 0.3);
   line-height: 1.1;
   text-shadow:
     0 0 7px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.45),
     0 1px 4px rgba(0, 0, 0, 0.92);
 }

 .welcome-tier-tab.active .welcome-tier-tab__num,
 .welcome-tier-tab[aria-selected="true"] .welcome-tier-tab__num {
   border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.48);
   background:
     radial-gradient(ellipse 80% 130% at 50% 18%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.2), transparent 68%),
     linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.48));
   color: #fff;
 }

 .welcome-tier-tab.is-bridge-target:not(.active) .welcome-tier-tab__num {
   border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.42);
   background:
     radial-gradient(ellipse 80% 130% at 50% 18%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.18), transparent 68%),
     linear-gradient(180deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.54));
   color: #fff;
 }

 .welcome-tier-tab.locked .welcome-tier-tab__num {
   border-color: rgba(255, 255, 255, 0.12);
   background: linear-gradient(180deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.64));
   color: rgba(255, 190, 190, 0.68);
   text-shadow: 0 1px 4px rgba(0, 0, 0, 0.92);
 }

 #welcome-screen .welcome-tier-panel.tier-option-container {
   border: 1px solid rgba(var(--tier-accent-rgb, var(--welcome-chrome-accent-rgb, var(--primary-color-rgb))), 0.46);
   border-radius: 6px;
   margin: 0;
   background:
     linear-gradient(180deg, rgba(0, 0, 0, 0.86), rgba(0, 8, 12, 0.78) 46%, rgba(0, 0, 0, 0.88)),
     radial-gradient(ellipse 90% 42% at 50% 0%, rgba(var(--tier-accent-rgb, var(--welcome-chrome-accent-rgb, var(--primary-color-rgb))), 0.1), transparent 62%),
     var(--tier-art-image, none) center / cover no-repeat;
   box-shadow:
     var(--ccm-glass-inset),
     0 0 16px rgba(var(--tier-accent-rgb, var(--welcome-chrome-accent-rgb, var(--primary-color-rgb))), 0.16),
     0 0 18px rgba(var(--ccm-neon-cyan-rgb), 0.05);
   padding: 3px 1px 0.65rem;
 }

 #welcome-screen .welcome-tier-panel.tier-option-container:hover {
   background:
     linear-gradient(180deg, rgba(0, 0, 0, 0.82), rgba(0, 8, 12, 0.72) 46%, rgba(0, 0, 0, 0.84)),
     radial-gradient(ellipse 90% 42% at 50% 0%, rgba(var(--tier-accent-rgb, var(--welcome-chrome-accent-rgb, var(--primary-color-rgb))), 0.14), transparent 62%),
     var(--tier-art-image, none) center / cover no-repeat;
 }

 #welcome-screen nav .tier-option-container {
   border: var(--ccm-glass-border);
   border-radius: 6px;
   margin: 3% 0;
   background: var(--ccm-glass-bg-subtle);
   box-shadow: var(--ccm-glass-inset);
   transition: all 0.3s ease-in-out;
   padding: 3px 1px 1px;
 }
 #welcome-screen nav .tier-option-container:hover {
   background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(var(--primary-color-rgb), 0.14));
 }
 #welcome-screen .tier-option {
   font-size: 86%;
   font-family: "Orbitron", sans-serif;
   user-select: none;
   background:
     linear-gradient(90deg, rgba(0, 0, 0, 0.74), rgba(var(--tier-accent-rgb, var(--welcome-chrome-accent-rgb, var(--primary-color-rgb))), 0.14), rgba(0, 0, 0, 0.72));
   padding: 0.3em 0;
   margin: 0 2% 1%;
   border-radius: 3px;
   border: 1px dotted rgba(var(--tier-accent-rgb, var(--welcome-chrome-accent-rgb, var(--primary-color-rgb))), 0.36);
   line-height: 1.1em;
   box-shadow: inset 0 0 12px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.05);
   transition: border-color 0.42s ease, background 0.42s ease, box-shadow 0.42s ease;
 }
 /* ---------------------------------------------------------------
    Per-tier accent colours. Each tier carries a signature colour so the
    carousel cards, the active tab and the tier label visibly shift as you
    scroll within a tier and especially as you cross into the next one.
    The variable is set on every [data-tier] element (tab, panel, carousel)
    and consumed downstream via rgb(var(--tier-accent-rgb, <fallback>)). */
 #welcome-screen [data-tier="1"] {
   --tier-accent-rgb: 152, 251, 152;
   --tier-art-image: url("../assets/images/First Steps.webp");
 } /* First Steps */
 #welcome-screen [data-tier="2"] {
   --tier-accent-rgb: 99, 197, 218;
   --tier-art-image: url("../assets/images/Rising Stream.webp");
 } /* Rising Stream */
 #welcome-screen [data-tier="3"] {
   --tier-accent-rgb: 255, 209, 102;
   --tier-art-image: url("../assets/images/Sunlit Grove.webp");
 } /* Sunlit Grove */
 #welcome-screen [data-tier="4"] {
   --tier-accent-rgb: 96, 165, 255;
   --tier-art-image: url("../assets/images/Windy Valley.webp");
 } /* Windy Valley */
 #welcome-screen [data-tier="5"] {
   --tier-accent-rgb: 255, 138, 61;
   --tier-art-image: url("../assets/images/Ember Garden.webp");
 } /* Ember Garden */
 #welcome-screen [data-tier="6"] {
   --tier-accent-rgb: 176, 122, 255;
   --tier-art-image: url("../assets/images/Sacred Peak.webp");
 } /* Sacred Peak */
 #welcome-screen [data-tier="7"] {
   --tier-accent-rgb: 128, 216, 255;
   --tier-art-image: url("../assets/images/Moonlit Crossing.webp");
 } /* Moonlit Crossing */
 #welcome-screen [data-tier="8"] {
   --tier-accent-rgb: 255, 105, 180;
   --tier-art-image: url("../assets/images/Mystic Depths.webp");
 } /* Mystic Depths */
 #welcome-screen [data-tier="9"] {
   --tier-accent-rgb: 46, 242, 194;
   --tier-art-image: url("../assets/images/Crystal Hollow.webp");
 } /* Crystal Hollow */
 #welcome-screen [data-tier="10"] {
   --tier-accent-rgb: 255, 92, 142;
   --tier-art-image: url("../assets/images/Starfall Ridge.webp");
 } /* Starfall Ridge */
 #welcome-screen [data-tier="11"] {
   --tier-accent-rgb: 255, 199, 64;
   --tier-art-image: url("../assets/images/Divine Mastery.webp");
 } /* Divine Mastery */
 #welcome-screen [data-tier="12"] {
   --tier-accent-rgb: 190, 120, 255;
   --tier-art-image: url("../assets/images/Celestial Gate.webp");
 } /* Celestial Gate */
 #welcome-screen [data-tier="13"] {
   --tier-accent-rgb: 128, 216, 255;
   --tier-art-image: url("../assets/images/Stillwater Veil.webp");
 } /* Stillwater Veil */
 #welcome-screen [data-tier="14"] {
   --tier-accent-rgb: 255, 184, 224;
   --tier-art-image: url("../assets/images/Lotus Meridian.webp");
 } /* Lotus Meridian */
 #welcome-screen [data-tier="zenith"] {
   --tier-accent-rgb: 190, 120, 255;
   --tier-art-image: url("../assets/images/Zenith.webp");
 } /* Zenith */

 #welcome-screen .tier-option-container[data-tier] .tier-option span {
   color: rgb(var(--tier-accent-rgb, var(--secondary-color-rgb)));
   text-shadow:
     0 0 8px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.5),
     0 0 2px rgba(0, 0, 0, 0.85);
 }
 #welcome-screen .tier-option span {
   background: #00000016;
   padding: 2% 3%;
   border-radius: 3px;
   font-size: 106%;
 }

 /* Per-tier board carousel on welcome screen */
 .tier-board-carousel {
   display: grid;
   grid-template-columns: auto 1fr auto;
   grid-template-rows: auto auto;
   align-items: center;
   gap: 0.25rem 0.35rem;
   padding: 0.35rem 0.15rem 0;
 }

.tier-board-carousel-viewport {
  --tier-carousel-card-size: clamp(6.8rem, 46vw, 8.2rem);
  --tier-carousel-gap: 0.55rem;
  --tier-carousel-end-pad: max(0.62rem, calc((100cqw - var(--tier-carousel-card-size)) / 2));

  grid-column: 2;
  position: relative;
  container-type: inline-size;
  isolation: isolate;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--tier-carousel-gap) var(--tier-carousel-end-pad);
  scroll-behavior: smooth;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.24);
  background:
    linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.2), rgba(var(--ccm-neon-cyan-rgb), 0.15), rgba(var(--ccm-neon-lime-rgb), 0.11)) top / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
    radial-gradient(ellipse at 50% 0%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.07), transparent 58%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 15, 20, 0.66) 48%, rgba(0, 0, 0, 0.78) 100%);
  box-shadow:
    inset 0 4px 14px rgba(0, 0, 0, 0.88),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 3px rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 14px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.12),
    0 0 18px rgba(var(--ccm-neon-pink-rgb), 0.06);
  mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - 1rem),
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - 1rem),
    transparent
  );
}

.tier-board-carousel-viewport.is-drag-scrolling {
  scroll-snap-type: none;
  scroll-behavior: auto;
  cursor: grabbing;
}

.welcome-tier-tabs.is-drag-scrolling {
  scroll-snap-type: none;
  scroll-behavior: auto;
  cursor: grabbing;
}

.welcome-tier-tabs {
  cursor: grab;
}

 .tier-board-carousel-viewport::-webkit-scrollbar {
   display: none;
 }

.tier-board-carousel-track {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: var(--tier-carousel-gap);
  padding-block: 0.48rem;
  padding-inline-start: var(--tier-carousel-gap);
  padding-inline-end: 0;
}

.tier-board-carousel-track::after {
  content: "";
  flex: 0 0 var(--tier-carousel-end-pad);
}

.tier-carousel-slide {
   flex: 0 0 var(--tier-carousel-card-size);
   display: flex;
   scroll-snap-align: center;
   scroll-snap-stop: always;
   margin: 0;
   padding: 0;
 }

.tier-carousel-slide:first-child {
  scroll-snap-align: start;
}

.tier-carousel-slide:last-child {
  scroll-snap-align: end;
}

.tier-board-carousel.has-bridge .tier-board-carousel-track::after {
  flex-basis: var(--tier-carousel-gap);
}

.tier-carousel-slide--bridge .tier-carousel-card {
  border-style: dashed;
  background: transparent;
}

.tier-carousel-slide--bridge.is-bridge-active .tier-carousel-card,
.tier-carousel-slide--bridge.is-active .tier-carousel-card {
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 20px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.3);
}

.tier-carousel-slide--zenith-bridge .tier-carousel-card,
.tier-carousel-card--zenith-bridge {
  border-color: rgba(190, 120, 255, 0.42);
  background: transparent;
}

.tier-carousel-slide--zenith-bridge.is-bridge-active .tier-carousel-card,
.tier-carousel-slide--zenith-bridge.is-active .tier-carousel-card {
  border-color: rgba(200, 140, 255, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 22px rgba(133, 0, 215, 0.34);
}

.tier-carousel-card__bridge-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.tier-carousel-card__bridge-art::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.38) 28%, rgba(0, 0, 0, 0.54) 62%, rgba(0, 0, 0, 0.8) 100%),
    radial-gradient(ellipse 78% 48% at 50% 42%, rgba(0, 0, 0, 0.36), transparent 64%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.24) 42%, rgba(0, 0, 0, 0.08) 78%);
  pointer-events: none;
}

.tier-carousel-card__bridge-art img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center 35%;
  opacity: 0.5;
  filter: saturate(0.98) brightness(0.88);
  user-select: none;
}

.tier-carousel-slide:has(.difficulty-option.locked) .tier-carousel-card__bridge-art img,
.tier-option-container.locked .tier-carousel-card__bridge-art img {
  opacity: 0.14;
  filter: grayscale(1) saturate(0.3) brightness(0.42) blur(1px);
}

.tier-carousel-card__tier-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.tier-carousel-card__tier-art::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.38) 28%, rgba(0, 0, 0, 0.54) 62%, rgba(0, 0, 0, 0.8) 100%),
    radial-gradient(ellipse 78% 48% at 50% 42%, rgba(0, 0, 0, 0.36), transparent 64%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.24) 42%, rgba(0, 0, 0, 0.08) 78%);
  pointer-events: none;
}

.tier-carousel-card__tier-art img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.48;
  filter: saturate(0.98) brightness(0.88);
  user-select: none;
}

.tier-carousel-card--bridge,
.tier-carousel-card--zenith-bridge {
  width: 100%;
}

.tier-carousel-card--bridge .tier-carousel-card__btn,
.tier-carousel-card--zenith-bridge .tier-carousel-card__btn {
  margin-top: auto;
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.78) !important;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.64), rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.22)) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 12px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.2);
  color: rgba(255, 255, 255, 0.94) !important;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.9);
}

.tier-carousel-card__bridge-entry {
  grid-row: 1 / 5;
  position: relative;
  z-index: 1;
  align-self: stretch;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.11rem;
  margin: 0.02rem 0.02rem 0;
  padding: 0.32rem 0.3rem 0.28rem;
  border-radius: 7px;
  border: 1px solid rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.22);
  background:
    radial-gradient(ellipse 80% 58% at 50% 28%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.1), transparent 66%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.84));
  box-shadow:
    inset 0 0 14px rgba(0, 0, 0, 0.48),
    0 0 10px rgba(0, 0, 0, 0.22);
  text-align: center;
}

.tier-carousel-card__bridge-entry.is-bridge-locked,
.tier-option-container.locked .tier-carousel-card__bridge-entry {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(ellipse 80% 58% at 50% 28%, rgba(255, 255, 255, 0.04), transparent 66%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.9));
}

.tier-carousel-card__bridge-kicker,
.tier-carousel-card__bridge-title,
.tier-carousel-card__bridge-copy,
.tier-carousel-card__bridge-meta {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.92);
}

.tier-carousel-card__bridge-kicker {
  font-size: 0.4rem;
  line-height: 1.05;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--tier-accent-rgb, var(--secondary-color-rgb)));
}

.tier-carousel-card__bridge-title {
  font-size: clamp(0.55rem, 7.8cqw, 0.74rem);
  line-height: 1.04;
  color: rgba(255, 255, 255, 0.96);
}

.tier-carousel-card__bridge-copy {
  font-size: 0.4rem;
  line-height: 1.22;
  color: rgba(255, 255, 255, 0.76);
}

.tier-carousel-card__bridge-meta {
  width: fit-content;
  max-width: 100%;
  align-self: center;
  margin-top: 0.03rem;
  padding: 0.09rem 0.28rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.24);
  background: rgba(0, 0, 0, 0.42);
  font-size: 0.36rem;
  line-height: 1.14;
  letter-spacing: 0.04em;
  color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.88);
}

.tier-carousel-card__bridge-stars {
  grid-row: auto;
  margin-top: 0.05rem;
  min-width: 2.94rem;
  min-height: 0.86rem;
  padding: 0.05rem 0.12rem 0.06rem;
}

.tier-carousel-card__bridge-stars .tier-carousel-card__star {
  width: 0.74rem;
  height: 0.74rem;
  font-size: 0.54rem;
}

.tier-carousel-card--bridge .tier-carousel-card__stat,
.tier-carousel-card--zenith-bridge .tier-carousel-card__stat {
  margin-top: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95);
}

.tier-carousel-card--bridge .tier-carousel-card__grid,
.tier-carousel-card--zenith-bridge .tier-carousel-card__grid {
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.tier-carousel-card--zenith-bridge .tier-carousel-card__note {
  margin: 0;
  font-size: 0.44rem;
  line-height: 1.12;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.92);
}

.tier-board-carousel.has-bridge .tier-carousel-slide:nth-last-child(2) {
  scroll-snap-align: start;
}

.tier-board-carousel.has-bridge .tier-carousel-slide--bridge {
  scroll-snap-align: start;
}

 .tier-carousel-card {
   display: grid;
   grid-template-rows: 0.62rem 2.02rem 0.64rem 2.08rem minmax(0.52rem, auto);
   align-items: center;
   width: 100%;
   height: 8.2rem;
   row-gap: 0.1rem;
   padding: 0.5rem 0.48rem 0.46rem;
   border-radius: 8px;
   border: 1px solid rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.34);
   background:
     linear-gradient(160deg, rgba(0, 0, 0, 0.58), rgba(var(--tier-accent-rgb, var(--primary-color-rgb)), 0.14));
   box-shadow:
     inset 0 0 0 1px rgba(var(--tier-accent-rgb, 255, 255, 255), 0.06),
     0 0 12px rgba(0, 0, 0, 0.28);
   transition:
     border-color 0.25s ease,
     box-shadow 0.25s ease,
     background 0.25s ease,
     opacity 0.25s ease,
     transform 0.25s ease;
   position: relative;
   overflow: hidden;
   backface-visibility: hidden;
   transform: translateZ(0);
 }

 .tier-carousel-card > * {
   position: relative;
   z-index: 1;
 }

 .tier-carousel-card > .tier-carousel-card__bridge-art {
   position: absolute;
   z-index: 0;
 }

 .tier-carousel-card > .tier-carousel-card__tier-art {
   position: absolute;
   z-index: 0;
 }

 .tier-carousel-card::before {
   content: "";
   position: absolute;
   inset: 0;
   z-index: 0;
   border-radius: inherit;
   pointer-events: none;
   background:
     var(--ccm-tier-rim-gradient) top / 100% 2px no-repeat,
     var(--ccm-tier-rim-gradient) bottom / 100% 2px no-repeat,
     radial-gradient(circle at 13% 84%, rgba(var(--ccm-neon-pink-rgb), 0.18), transparent 20%),
     radial-gradient(circle at 88% 18%, rgba(var(--ccm-neon-cyan-rgb), 0.16), transparent 18%),
     radial-gradient(ellipse 80% 55% at 50% 105%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.12), transparent 62%);
   opacity: 0.72;
 }

 .tier-carousel-card::after {
   content: "";
   position: absolute;
   inset: 0.28rem;
   z-index: 0;
   border-radius: 6px;
   pointer-events: none;
   border: 1px solid rgba(var(--ccm-neon-cyan-rgb), 0.16);
   box-shadow:
     inset 0 0 16px rgba(var(--ccm-neon-pink-rgb), 0.06),
     inset 0 0 12px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.08);
   opacity: 0.54;
 }

 .tier-carousel-slide:not(.is-active) .tier-carousel-card {
   opacity: 0.72;
   transform: translateZ(0) scale(0.965);
 }

 .tier-carousel-slide.is-active .tier-carousel-card {
   border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.74);
   box-shadow:
     inset 0 0 0 1px rgba(255, 255, 255, 0.06),
     0 0 0 1px rgba(0, 0, 0, 0.52),
     0 0 22px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.42),
     0 0 18px rgba(var(--ccm-neon-cyan-rgb), 0.12);
   transform: translateZ(0) scale(1);
 }

 .tier-carousel-slide.is-active .tier-carousel-card::before {
   opacity: 0.95;
 }

 .tier-carousel-slide.is-active .tier-carousel-card::after {
   border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.34);
   box-shadow:
     inset 0 0 18px rgba(var(--ccm-neon-pink-rgb), 0.08),
     inset 0 0 16px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.14),
     0 0 16px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.16);
   opacity: 0.88;
 }

 .tier-board-carousel--gliding .tier-carousel-card {
   transition-duration: 0.38s;
 }

 .tier-board-carousel--gliding .tier-board-carousel-viewport {
   scroll-behavior: auto;
 }

 .tier-carousel-card__lock {
   display: none;
   position: absolute;
   top: 0.35rem;
   right: 0.35rem;
   width: 1.15rem;
   height: 1.15rem;
   background: url("../assets/images/gridTierLocks_gold.webp") no-repeat center / contain;
   filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.85)) brightness(1.08);
   opacity: 0.94;
   pointer-events: none;
   z-index: 2;
 }

 .tier-carousel-slide.is-locked .tier-carousel-card__lock,
 .tier-option-container.locked .tier-carousel-card__lock {
   display: block;
 }

 .tier-carousel-slide .difficulty-option.locked::before {
   content: none;
 }

 .tier-carousel-slide:has(.difficulty-option:not(.locked):not(:disabled)) .tier-carousel-card {
   cursor: pointer;
 }

 .tier-carousel-slide:has(.difficulty-option:not(.locked):not(:disabled)) .tier-carousel-card:hover {
   border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.68);
   box-shadow:
     inset 0 0 0 1px rgba(255, 255, 255, 0.06),
     0 0 16px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.24);
 }

 .tier-carousel-slide:has(.difficulty-option:not(.locked):not(:disabled)) .tier-carousel-card:active {
   transform: scale(0.985);
 }

 /* Locked card / tier / button: show the "not-allowed" cursor */
 .tier-carousel-slide.is-locked .tier-carousel-card,
 .tier-carousel-slide:has(.difficulty-option.locked) .tier-carousel-card,
 .tier-carousel-slide:has(.difficulty-option:disabled) .tier-carousel-card,
 .tier-option-container.locked,
 .tier-option-container.locked .tier-carousel-card,
 .difficulty-option.locked,
 .difficulty-option:disabled,
 .welcome-zenith-section.is-locked .welcome-zenith-card {
   cursor: not-allowed;
 }

 .tier-board-carousel--solo .tier-carousel-nav,
 .tier-board-carousel--solo .tier-carousel-dots {
   display: none;
 }

 .tier-board-carousel--solo .tier-board-carousel-viewport {
   overflow: visible;
   mask-image: none;
 }

 .tier-board-carousel--solo .tier-board-carousel-track {
   justify-content: center;
   width: 100%;
   padding: 0.35rem 0;
 }

 .tier-board-carousel--solo .tier-carousel-slide {
   flex: 0 0 min(100%, 11.5rem);
 }

 .tier-carousel-card__note {
   grid-row: 4;
   align-self: center;
   justify-self: center;
   margin: 0;
   text-align: center;
   font-size: 0.58rem;
   line-height: 1.25;
   letter-spacing: 0.03em;
   color: rgba(200, 160, 255, 0.82);
 }

 .tier-carousel-slide--zenith .tier-carousel-card {
   border-color: rgba(133, 0, 215, 0.38);
   background: linear-gradient(160deg, rgba(16, 4, 28, 0.78), rgba(133, 0, 215, 0.12));
 }

 .tier-carousel-slide:has(.difficulty-option.locked) .tier-carousel-card,
 .tier-carousel-slide.is-locked .tier-carousel-card {
   border-color: rgba(220, 53, 69, 0.35);
   background: linear-gradient(160deg, rgba(24, 4, 8, 0.72), rgba(0, 0, 0, 0.58));
   opacity: 0.82;
 }

 .tier-carousel-card__stat {
   grid-row: 2;
   align-self: center;
   margin: 0;
   line-height: 1;
   text-align: center;
 }

 .tier-carousel-card__count {
   display: block;
   font-family: "Orbitron", sans-serif;
   font-size: 1.26rem;
   font-weight: 700;
   color: rgb(var(--tier-accent-rgb, var(--secondary-color-rgb)));
   text-shadow:
     0 0 10px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.5),
     0 1px 6px rgba(0, 0, 0, 0.92);
 }

 .tier-carousel-card__unit {
   display: block;
   margin-top: 0.09rem;
   font-family: "Orbitron", sans-serif;
   font-size: 0.56rem;
   letter-spacing: 0.08em;
   text-transform: uppercase;
   color: rgba(255, 255, 255, 0.88);
   text-shadow: 0 1px 5px rgba(0, 0, 0, 0.9);
 }

 .tier-carousel-card__grid {
   grid-row: 3;
   align-self: center;
   margin: 0;
   text-align: center;
   font-size: 0.56rem;
   letter-spacing: 0.035em;
   color: rgba(var(--primary-color-rgb), 0.95);
   opacity: 0.95;
   text-shadow: 0 1px 5px rgba(0, 0, 0, 0.88);
 }

 /* Per-board star rating: earned, unearned, and warm-up-exempt slots */
 .tier-carousel-card__stars {
   grid-row: 4;
   align-self: center;
   justify-self: center;
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 0.1rem;
   width: fit-content;
   min-width: 3.18rem;
   margin: 0.02rem auto 0;
   padding: 0.08rem 0.14rem 0.09rem;
   min-height: 0.98rem;
   line-height: 1;
   border-radius: 6px;
   background: linear-gradient(
     180deg,
     rgba(0, 0, 0, 0.74) 0%,
     rgba(0, 0, 0, 0.56) 48%,
     rgba(0, 0, 0, 0.66) 100%
   );
   border: 1px solid rgba(0, 0, 0, 0.62);
   box-shadow:
     inset 0 3px 7px rgba(0, 0, 0, 0.78),
     inset 0 1px 0 rgba(255, 255, 255, 0.08),
     inset 0 -1px 0 rgba(255, 255, 255, 0.035),
     0 1px 0 rgba(255, 255, 255, 0.04);
 }

 .tier-carousel-card__star {
   position: relative;
   display: inline-grid;
   place-items: center;
   width: 0.84rem;
   height: 0.84rem;
   border-radius: 4px;
   font-size: 0.62rem;
   line-height: 1;
   color: rgba(255, 255, 255, 0.18);
   background: linear-gradient(
     180deg,
     rgba(255, 255, 255, 0.035) 0%,
     rgba(0, 0, 0, 0.24) 40%,
     rgba(0, 0, 0, 0.44) 100%
   );
   border: 1px solid rgba(0, 0, 0, 0.52);
   box-shadow:
     inset 0 2px 4px rgba(0, 0, 0, 0.78),
     inset 0 -1px 0 rgba(255, 255, 255, 0.04);
   text-shadow: 0 1px 1px rgba(0, 0, 0, 0.9);
   transition: color 0.25s ease, opacity 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
 }

 .tier-carousel-card__star.is-earned {
   color: #ffd75a;
   background: linear-gradient(
     180deg,
     rgba(255, 215, 0, 0.18) 0%,
     rgba(120, 78, 0, 0.22) 48%,
     rgba(0, 0, 0, 0.36) 100%
   );
   box-shadow:
     inset 0 2px 5px rgba(0, 0, 0, 0.62),
     inset 0 -1px 0 rgba(255, 240, 150, 0.16),
     inset 0 0 7px rgba(255, 215, 0, 0.16);
   text-shadow:
     0 0 5px rgba(255, 215, 0, 0.5),
     0 1px 1px rgba(0, 0, 0, 0.9);
 }

 .tier-carousel-card__stars[data-has-rating="false"] .tier-carousel-card__star:not(.is-unavailable):not(.is-missed) {
   color: rgba(255, 255, 255, 0.36);
 }

 /* Missed star = achievable but the player didn't earn it — mirrors the in-game
    disabled X card: diagonal hatch backing + crossed red bars. */
 .tier-carousel-card__star.is-missed {
   color: transparent;
   opacity: 0.92;
   background:
     repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.16) 3px, rgba(0, 0, 0, 0.32) 3px, rgba(0, 0, 0, 0.32) 6px),
     linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.46));
   text-shadow: none;
 }

 .tier-carousel-card__star.is-missed::before,
 .tier-carousel-card__star.is-missed::after {
   content: "";
   position: absolute;
   top: 50%;
   left: 50%;
   width: 78%;
   height: 22%;
   border-radius: 10px;
   background: #ff4080d9;
   transform: translate(-50%, -50%) rotate(45deg);
 }

 .tier-carousel-card__star.is-missed::after {
   transform: translate(-50%, -50%) rotate(-45deg);
 }

 /* Unavailable star = "metric not counted on this board" (e.g. warm-up cap).
    Neutral muted dash — distinct from earned (gold â˜…) and missed (red X). */
 .tier-carousel-card__star.is-unavailable {
   color: transparent;
   opacity: 0.54;
   background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.4));
   text-shadow: none;
 }

 .tier-carousel-card__star.is-unavailable::after {
   content: "";
   position: absolute;
   left: 0.22rem;
   right: 0.22rem;
   top: 50%;
   height: 2px;
   border-radius: 999px;
   background: rgba(255, 255, 255, 0.32);
   transform: translateY(-50%);
 }

 .tier-carousel-slide.is-locked .tier-carousel-card__stars,
 .tier-carousel-slide:has(.difficulty-option.locked) .tier-carousel-card__stars {
   opacity: 0.72;
 }

 .tier-carousel-slide.is-locked .tier-carousel-card__star,
 .tier-carousel-slide:has(.difficulty-option.locked) .tier-carousel-card__star {
   color: rgba(255, 255, 255, 0.11);
   opacity: 0.65;
   text-shadow: none;
 }

 .tier-carousel-slide.is-locked .tier-carousel-card__star.is-missed::before,
 .tier-carousel-slide.is-locked .tier-carousel-card__star.is-missed::after,
 .tier-carousel-slide:has(.difficulty-option.locked) .tier-carousel-card__star.is-missed::before,
 .tier-carousel-slide:has(.difficulty-option.locked) .tier-carousel-card__star.is-missed::after {
   background: rgba(255, 64, 128, 0.5);
   box-shadow: none;
 }

 .tier-carousel-card__btn {
   grid-row: 5;
   align-self: end;
   width: 100% !important;
   margin: 0 !important;
   padding: 0.34rem 0.32rem !important;
   font-size: 0.6rem !important;
   line-height: 1.12;
   border-radius: 5px;
 }

 .tier-carousel-card__btn.locked {
   color: rgba(255, 180, 180, 0.82) !important;
   border-color: rgba(220, 53, 69, 0.55) !important;
   background: rgba(36, 6, 10, 0.72) !important;
   cursor: not-allowed;
 }

 .tier-carousel-card__btn:disabled:not(.locked) {
   opacity: 0.48;
   cursor: not-allowed;
   border-color: rgba(255, 255, 255, 0.14) !important;
   background: rgba(0, 0, 0, 0.55) !important;
   color: rgba(255, 200, 200, 0.72) !important;
 }

 .tier-carousel-nav {
   grid-row: 1;
   width: 1.85rem;
   height: 1.85rem;
   border-radius: 50%;
   border: 1px dotted rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.6);
   background: rgba(0, 0, 0, 0.5);
   color: rgb(var(--tier-accent-rgb, var(--secondary-color-rgb)));
   font-size: 1.15rem;
   line-height: 1;
   cursor: pointer;
   transition: background 0.2s ease, opacity 0.2s ease;
 }

 .tier-carousel-nav:disabled {
   opacity: 0.28;
   cursor: default;
 }

 .tier-carousel-nav:not(:disabled):hover {
   background: rgba(var(--primary-color-rgb), 0.22);
 }

 .tier-carousel-prev { grid-column: 1; }
 .tier-carousel-next { grid-column: 3; }

 .tier-carousel-dots {
   grid-column: 1 / -1;
   display: flex;
   justify-content: center;
   gap: 0.28rem;
   padding-top: 0.15rem;
 }

 .tier-carousel-dot {
   width: 0.42rem;
   height: 0.42rem;
   padding: 0;
   border: none;
   border-radius: 50%;
   background: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.28);
   cursor: pointer;
   transition: transform 0.2s ease, background 0.2s ease;
 }

 .tier-carousel-dot.active {
   background: rgb(var(--tier-accent-rgb, var(--secondary-color-rgb)));
   transform: scale(1.25);
   box-shadow: 0 0 6px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.65);
 }

 .tier-carousel-dot.locked {
   background: rgba(220, 53, 69, 0.35);
   box-shadow: inset 0 0 0 1px rgba(255, 120, 120, 0.25);
   position: relative;
 }

 .tier-carousel-dot.locked::after {
   content: "";
   position: absolute;
   inset: -2px;
   background: url("../assets/images/gridTierLocks_gold.webp") no-repeat center / 0.55rem;
   opacity: 0.85;
   pointer-events: none;
 }

 .tier-carousel-dot.locked.active {
   background: rgba(220, 53, 69, 0.55);
   box-shadow: 0 0 6px rgba(220, 53, 69, 0.45);
 }

 /* How To Play Button - Styled to stand out */
 #how-to-play-button {
   border: var(--ccm-glass-border);
   border-radius: 6px;
   background: var(--ccm-glass-bg-subtle);
   box-shadow: var(--ccm-glass-inset), 0 0 18px rgba(var(--primary-color-rgb), 0.12);
   color: white;
   padding: 0.3em 0;
   margin: 3% 0;
   width: 100%;
   cursor: pointer;
   transition: all 0.3s ease-in-out;
   font-size: 86%;
   font-family: "Orbitron", sans-serif;
   user-select: none;
   line-height: 1.1em;
 }
 #how-to-play-button:hover {
   background: linear-gradient(135deg, rgba(0, 0, 0, 0.52), rgba(var(--primary-color-rgb), 0.16));
   box-shadow: var(--ccm-glass-inset), 0 0 24px rgba(var(--primary-color-rgb), 0.2);
 }
 #how-to-play-button span {
   color: var(--primary-color);
   text-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.8), 0 0 15px rgba(var(--primary-color-rgb), 0.5);
   animation: howToGlow 2s ease-in-out infinite;
   background: #00000016;
   /* padding: 2% 3%; */
   border-radius: 3px;
   font-size: 106%;
   display: block;
 }
 @keyframes howToGlow {
   0%, 100% { 
     text-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.8), 0 0 15px rgba(var(--primary-color-rgb), 0.5);
   }
   50% { 
     text-shadow: 0 0 12px rgba(var(--primary-color-rgb), 1), 0 0 20px rgba(var(--primary-color-rgb), 0.8);
   }
 }
 
 /* How To Play Modal Overlay */
 #how-to-play-overlay .how-to-overlay-content {
   border-color: var(--primary-color);
   max-width: 420px;
   width: 92%;
   max-height: min(86vh, 520px);
   display: flex;
   flex-direction: column;
   overflow: hidden;
   padding: 2.5% 3% 2%;
 }

 #how-to-play-overlay .how-to-title {
   font-size: 1.35em;
   margin: 0 0 0.35em;
   flex-shrink: 0;
 }

 #how-to-play-overlay .how-to-basics {
   color: rgba(255, 255, 255, 0.88);
   background: rgba(0, 0, 0, 0.48);
   box-shadow: var(--ccm-glass-inset);
   border-radius: 4px;
   border: 1px dotted rgba(var(--primary-color-rgb), 0.28);
   padding: 0.45em 0.65em;
   margin-bottom: 0.55em;
   font-size: 0.78em;
   line-height: 1.35;
   text-align: left;
   flex-shrink: 0;
 }

 #how-to-play-overlay .how-to-basics p {
   margin: 0.2em 0;
 }

 #how-to-play-overlay .how-to-stats {
   display: flex;
   gap: 1em;
   flex-wrap: wrap;
 }

 #how-to-play-overlay .how-to-tier-nav {
   display: flex;
   flex-wrap: wrap;
   gap: 0.28em;
   margin-bottom: 0.45em;
   flex-shrink: 0;
 }

 #how-to-play-overlay .how-to-tier-tab {
   flex: 1 1 auto;
   min-width: 2.1em;
   padding: 0.28em 0.35em;
   font-size: 0.72em;
   font-family: inherit;
   border: 1px dotted rgba(var(--primary-color-rgb), 0.45);
   border-radius: 4px;
   background: rgba(0, 0, 0, 0.35);
   color: rgba(255, 255, 255, 0.78);
   cursor: pointer;
   transition: background 0.2s, color 0.2s, border-color 0.2s;
 }

 #how-to-play-overlay .how-to-tier-tab:hover {
   border-color: var(--primary-color);
   color: #fff;
 }

 #how-to-play-overlay .how-to-tier-tab.active {
   background: rgba(var(--primary-color-rgb), 0.22);
   border-color: var(--secondary-color);
   color: var(--secondary-color);
 }

 #how-to-play-overlay .how-to-tier-panels {
   flex: 1 1 auto;
   min-height: 0;
   position: relative;
 }

 #how-to-play-overlay .how-to-tier-panel {
   display: none;
   max-height: min(34vh, 210px);
   overflow-y: auto;
   overscroll-behavior: contain;
   text-align: left;
   color: rgba(255, 255, 255, 0.9);
   background: rgba(0, 0, 0, 0.46);
   border: 1px dotted rgba(var(--primary-color-rgb), 0.22);
   box-shadow: var(--ccm-glass-inset);
   border-radius: 4px;
   padding: 0.5em 0.65em;
   font-size: 0.76em;
   line-height: 1.4;
   scrollbar-width: thin;
   scrollbar-color: rgba(var(--primary-color-rgb), 0.5) transparent;
 }

 #how-to-play-overlay .how-to-tier-panel.active {
   display: block;
 }

 #how-to-play-overlay .how-to-tier-panel h3 {
   font-size: 1.05em;
   margin: 0 0 0.35em;
   color: var(--secondary-color);
 }

 #how-to-play-overlay .how-to-tier-tip {
   margin: 0 0 0.45em;
   opacity: 0.88;
   font-size: 0.95em;
 }

 #how-to-play-overlay .how-to-board-list {
   list-style: none;
   margin: 0;
   padding: 0;
 }

 #how-to-play-overlay .how-to-board-legend {
   margin: 0 0 0.35em;
   opacity: 0.72;
   font-size: 0.88em;
   line-height: 1.35;
 }

 #how-to-play-overlay .how-to-board-row {
   display: grid;
   grid-template-columns: 1.1em 3.4em 3.6em 2.8em 3em 2.6em 3em;
   gap: 0.45em;
   align-items: baseline;
   margin: 0.12em 0;
   padding: 0.08em 0;
 }

 #how-to-play-overlay .how-to-board-header {
   opacity: 0.72;
   font-size: 0.9em;
   border-bottom: 1px dotted rgba(var(--primary-color-rgb), 0.25);
   padding-bottom: 0.2em;
   margin-bottom: 0.15em;
 }

 #how-to-play-overlay .how-to-board-cell {
   white-space: nowrap;
 }

 #how-to-play-overlay .how-to-board-num {
   color: var(--secondary-color);
   font-weight: 600;
 }

 #how-to-play-overlay .how-to-board-hot {
   color: var(--secondary-color);
 }

 #how-to-play-overlay .how-to-board-chroma {
   color: #c8b6ff;
 }

 #how-to-play-overlay .how-to-board-meta {
   opacity: 0.82;
   font-size: 0.92em;
 }

 #how-to-play-overlay .how-to-board-list strong {
   color: var(--secondary-color);
   font-weight: 600;
 }

 #how-to-play-overlay .how-to-close-wrap {
   margin-top: 0.55em;
   flex-shrink: 0;
 }

 #how-to-play-overlay #how-to-close-button {
   margin-top: 0;
   width: 100%;
 }



 /* ---------------------------------------
    Utility overlay polish: How To
 --------------------------------------- */
 #how-to-play-overlay .how-to-overlay-content {
   --utility-overlay-accent-rgb: var(--ccm-current-tier-accent-rgb);
   isolation: isolate;
   border: 1px solid rgba(var(--utility-overlay-accent-rgb), 0.52);
   background:
     linear-gradient(180deg, rgba(0, 8, 11, 0.86), rgba(0, 0, 0, 0.93)),
     radial-gradient(ellipse 86% 56% at 50% 18%, rgba(var(--utility-overlay-accent-rgb), 0.14), transparent 70%),
     var(--ccm-current-tier-board-image) top center / cover no-repeat,
     var(--ccm-glass-bg);
   box-shadow:
     0 0 0 1px rgba(255, 255, 255, 0.045),
     0 0 28px rgba(var(--utility-overlay-accent-rgb), 0.16),
     0 22px 58px rgba(0, 0, 0, 0.72),
     inset 0 0 0 1px rgba(var(--utility-overlay-accent-rgb), 0.1),
     inset 0 0 42px rgba(0, 0, 0, 0.42);
 }

 #how-to-play-overlay .how-to-overlay-content::before,
 #how-to-play-overlay .how-to-overlay-content::after {
   content: "";
   position: absolute;
   inset: 0;
   border-radius: inherit;
   pointer-events: none;
 }

 #how-to-play-overlay .how-to-overlay-content::before {
   z-index: 0;
   background: url("../assets/images/gameBG_roundColorFade-1.png") center 36% / 142% no-repeat;
   opacity: 0.32;
   filter: saturate(1.15) brightness(0.95);
   mix-blend-mode: screen;
 }

 #how-to-play-overlay .how-to-overlay-content::after {
   z-index: 0;
   inset: 1px;
   background:
     linear-gradient(90deg, rgba(0, 0, 0, 0.52), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.52)),
     linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 16%, rgba(0, 0, 0, 0.5));
   box-shadow:
     inset 0 0 0 1px rgba(var(--utility-overlay-accent-rgb), 0.1),
     inset 0 -18px 42px rgba(0, 0, 0, 0.44);
 }

 #how-to-play-overlay .how-to-overlay-content > * {
   position: relative;
   z-index: 1;
 }

 #how-to-play-overlay .how-to-title {
   color: rgba(255, 255, 255, 0.96);
   text-shadow:
     0 0 12px rgba(var(--utility-overlay-accent-rgb), 0.42),
     0 2px 7px rgba(0, 0, 0, 0.9);
 }

 #how-to-play-overlay .how-to-basics {
   position: relative;
   overflow: hidden;
   border-color: rgba(var(--utility-overlay-accent-rgb), 0.34);
   background:
     linear-gradient(180deg, rgba(0, 0, 0, 0.64), rgba(0, 8, 12, 0.76)),
     url("../assets/images/gameBG_roundColorFade-1.png") center / 150% no-repeat;
   box-shadow:
     inset 0 0 0 1px rgba(255, 255, 255, 0.045),
     inset 0 0 24px rgba(var(--utility-overlay-accent-rgb), 0.08),
     0 0 16px rgba(var(--utility-overlay-accent-rgb), 0.08);
 }

 #how-to-play-overlay .how-to-basics strong,
 #how-to-play-overlay .how-to-stats strong {
   color: rgb(var(--utility-overlay-accent-rgb));
   text-shadow: 0 0 7px rgba(var(--utility-overlay-accent-rgb), 0.52);
 }

 #how-to-play-overlay .how-to-stats span {
   display: inline-flex;
   align-items: center;
   gap: 0.35em;
   padding: 0.18em 0.48em;
   border: 1px solid rgba(var(--utility-overlay-accent-rgb), 0.2);
   border-radius: 5px;
   background: rgba(0, 0, 0, 0.34);
 }

 #how-to-play-overlay [data-tier="1"] {
   --tier-accent-rgb: 152, 251, 152;
   --tier-art-image: url("../assets/images/First Steps.webp");
 }
 #how-to-play-overlay [data-tier="2"] {
   --tier-accent-rgb: 99, 197, 218;
   --tier-art-image: url("../assets/images/Rising Stream.webp");
 }
 #how-to-play-overlay [data-tier="3"] {
   --tier-accent-rgb: 255, 209, 102;
   --tier-art-image: url("../assets/images/Sunlit Grove.webp");
 }
 #how-to-play-overlay [data-tier="4"] {
   --tier-accent-rgb: 96, 165, 255;
   --tier-art-image: url("../assets/images/Windy Valley.webp");
 }
 #how-to-play-overlay [data-tier="5"] {
   --tier-accent-rgb: 255, 138, 61;
   --tier-art-image: url("../assets/images/Ember Garden.webp");
 }
 #how-to-play-overlay [data-tier="6"] {
   --tier-accent-rgb: 176, 122, 255;
   --tier-art-image: url("../assets/images/Sacred Peak.webp");
 }
 #how-to-play-overlay [data-tier="7"] {
   --tier-accent-rgb: 128, 216, 255;
   --tier-art-image: url("../assets/images/Moonlit Crossing.webp");
 }
 #how-to-play-overlay [data-tier="8"] {
   --tier-accent-rgb: 255, 105, 180;
   --tier-art-image: url("../assets/images/Mystic Depths.webp");
 }
 #how-to-play-overlay [data-tier="9"] {
   --tier-accent-rgb: 46, 242, 194;
   --tier-art-image: url("../assets/images/Crystal Hollow.webp");
 }
 #how-to-play-overlay [data-tier="10"] {
   --tier-accent-rgb: 255, 92, 142;
   --tier-art-image: url("../assets/images/Starfall Ridge.webp");
 }
 #how-to-play-overlay [data-tier="11"] {
   --tier-accent-rgb: 255, 199, 64;
   --tier-art-image: url("../assets/images/Divine Mastery.webp");
 }
 #how-to-play-overlay [data-tier="12"] {
   --tier-accent-rgb: 190, 120, 255;
   --tier-art-image: url("../assets/images/Celestial Gate.webp");
 }
 #how-to-play-overlay [data-tier="13"] {
   --tier-accent-rgb: 128, 216, 255;
   --tier-art-image: url("../assets/images/Stillwater Veil.webp");
 }
 #how-to-play-overlay [data-tier="14"] {
   --tier-accent-rgb: 255, 184, 224;
   --tier-art-image: url("../assets/images/Lotus Meridian.webp");
 }
 #how-to-play-overlay [data-tier="zenith"] {
   --tier-accent-rgb: 190, 120, 255;
   --tier-art-image: url("../assets/images/Zenith.webp");
 }

 #how-to-play-overlay .how-to-tier-nav {
   gap: 0.3em;
   padding: 0.28em;
   border: 1px solid rgba(var(--utility-overlay-accent-rgb), 0.28);
   border-radius: 6px;
   background:
     linear-gradient(180deg, rgba(0, 0, 0, 0.52), rgba(0, 8, 12, 0.68)),
     url("../assets/images/gameBG_roundColorFade-1.png") center / 118% no-repeat;
   box-shadow:
     inset 0 0 0 1px rgba(255, 255, 255, 0.045),
     inset 0 0 16px rgba(var(--utility-overlay-accent-rgb), 0.08);
 }

 #how-to-play-overlay .how-to-tier-tab {
   flex: 1 1 2.65rem;
   min-height: 2.05rem;
   border-color: rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.34);
   background:
     linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.1)),
     var(--tier-art-image, none) center / cover no-repeat;
   color: rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.78);
   box-shadow:
     inset 0 0 0 1px rgba(255, 255, 255, 0.035),
     inset 0 0 14px rgba(0, 0, 0, 0.5);
 }

 #how-to-play-overlay .how-to-tier-tab:hover {
   border-color: rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.66);
   color: #fff;
   box-shadow:
     0 0 12px rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.22),
     inset 0 0 0 1px rgba(255, 255, 255, 0.06);
 }

 #how-to-play-overlay .how-to-tier-tab.active {
   border-color: rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.84);
   background:
     linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.2), rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.34), rgba(var(--ccm-neon-cyan-rgb), 0.18)),
     linear-gradient(180deg, rgba(0, 0, 0, 0.48), rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.22)),
     var(--tier-art-image, none) center / cover no-repeat;
   color: rgb(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)));
   text-shadow: 0 0 8px rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.62);
   box-shadow:
     0 0 14px rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.38),
     inset 0 0 0 1px rgba(255, 255, 255, 0.08),
     inset 0 0 16px rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.14);
 }

 #how-to-play-overlay .how-to-tier-panel {
   border-color: rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.34);
   background:
     linear-gradient(180deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.91)),
     radial-gradient(ellipse 82% 64% at 50% 16%, rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.13), transparent 72%),
     var(--tier-art-image, none) top center / cover no-repeat;
   box-shadow:
     inset 0 0 0 1px rgba(255, 255, 255, 0.04),
     inset 0 0 24px rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.08),
     0 0 16px rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.08);
 }

 #how-to-play-overlay .how-to-tier-panel h3,
 #how-to-play-overlay .how-to-board-num,
 #how-to-play-overlay .how-to-board-hot,
 #how-to-play-overlay .how-to-board-list strong {
   color: rgb(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)));
   text-shadow: 0 0 7px rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.52);
 }

 #how-to-play-overlay .how-to-tier-tip {
   color: rgba(255, 255, 255, 0.88);
 }

 #how-to-play-overlay .how-to-board-legend {
   padding: 0.34em 0.42em;
   border: 1px solid rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.16);
   border-radius: 4px;
   background: rgba(0, 0, 0, 0.28);
 }

 #how-to-play-overlay .how-to-board-row {
   grid-template-columns: 1.1em minmax(3.35em, 1fr) 3.3em 3em 3.1em 2.9em 3.1em;
   gap: 0.34em;
   padding: 0.14em 0.24em;
   border-radius: 4px;
 }

 #how-to-play-overlay .how-to-board-row:not(.how-to-board-header):nth-child(odd) {
   background: rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.055);
 }

 #how-to-play-overlay .how-to-board-row:not(.how-to-board-header):hover {
   background: rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.1);
 }

 #how-to-play-overlay .how-to-board-header {
   position: sticky;
   top: 0;
   z-index: 2;
   border-bottom-color: rgba(var(--tier-accent-rgb, var(--utility-overlay-accent-rgb)), 0.28);
   background: rgba(0, 0, 0, 0.72);
 }

 #how-to-play-overlay .overlay-button {
   min-height: 2.5rem;
   border-color: rgba(var(--utility-overlay-accent-rgb), 0.48);
   background:
     linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(var(--utility-overlay-accent-rgb), 0.12)),
     url("../assets/images/gameBG_roundColorFade-1.png") center / 130% no-repeat;
   box-shadow:
     inset 0 0 0 1px rgba(255, 255, 255, 0.04),
     0 0 14px rgba(var(--utility-overlay-accent-rgb), 0.12);
 }

 @media (max-width: 666px) {
   #how-to-play-overlay .how-to-overlay-content {
     width: min(94vw, 380px);
     max-height: min(90vh, 740px);
     padding: 0.9rem 0.72rem 0.72rem;
   }

   #how-to-play-overlay .how-to-title {
     font-size: 1.15em;
   }

   #how-to-play-overlay .how-to-basics {
     font-size: 0.68em;
     padding: 0.45em 0.55em;
   }

   #how-to-play-overlay .how-to-tier-tab {
     flex-basis: 2.35rem;
     min-height: 1.82rem;
     font-size: 0.62em;
     padding: 0.24em 0.28em;
   }

   #how-to-play-overlay .how-to-tier-panel {
     max-height: min(40vh, 300px);
     padding: 0.48rem;
     font-size: 0.66em;
   }

   #how-to-play-overlay .how-to-board-row {
     grid-template-columns: 0.9em minmax(2.6em, 1fr) 2.55em 2.6em 2.7em 2.55em 2.7em;
     gap: 0.22em;
     padding-inline: 0.1em;
   }

   #how-to-play-overlay .how-to-board-legend {
     font-size: 0.78em;
   }
 }
 /* Utility overlay close button polish */
 #how-to-play-overlay .modal-close-button,
 #achievement-overlay .modal-close-button {
   top: 0.42rem;
   right: 0.42rem;
   width: 2rem;
   height: 2rem;
   border: 1px solid rgba(var(--ccm-current-tier-accent-rgb), 0.22);
   background: rgba(0, 0, 0, 0.26);
   box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
 }

 @media (max-width: 666px) {
   #how-to-play-overlay .modal-close-button,
   #achievement-overlay .modal-close-button {
     top: 0.34rem;
     right: 0.34rem;
     width: 1.72rem;
     height: 1.72rem;
     font-size: 1.42em;
   }
 }/* ---------------------------------------
      Animations
   --------------------------------------- */
   @keyframes buttonPulse {
     0%, 100% {
       transform: scale(1);
       text-shadow: 0 1px 15px rgba(var(--primary-color-rgb), 0.64), var(--inner-glow);
     }
     50% {
       transform: scale(1.03);
       text-shadow: 0 0 10px rgba(255, 217, 0, 0.76);
     }
   }
   
   @keyframes flashPulse {
     0% { opacity: 0; }
     50% { opacity: 1; }
     100% { opacity: 0; }
   }
   
   @keyframes numberPulse {
     0% {
       transform: scale(1);
       text-shadow: 0 0 0.3125rem var(--primary-color);
       font-weight: 400;
     }
     50% {
       transform: scale(1.2);
       text-shadow: 0 0 0.4rem 0.6375rem var(--primary-color),
                    0 0 1.66rem var(--primary-color);
       color: #fff;
     }
     100% {
       transform: scale(1);
       text-shadow: 0 0 0.3125rem var(--primary-color);
       font-weight: 300;
     }
   }
   
   /* ---------------------------------------
      Locked Item Styles
   --------------------------------------- */
   .locked {
     opacity: 0.46;
     position: relative;
     z-index: 2;
     overflow: visible;
   }

   /* Board buttons only — not whole-tier containers */
   .difficulty-option.locked::before {
     pointer-events: none;
     content: "";
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     width: 1.5em;
     height: 1.5em;
     background: url("../assets/images/gridTierLocks_gold.webp")
       no-repeat center / contain;
     opacity: 0.92;
     z-index: 3;
     filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.85)) brightness(1.12);
   }

   .tier-option-container.locked {
     position: relative;
     border: 1px dotted red !important;
     opacity: 0.54;
     background: #ff000006 !important;
     color: pink;
   }

   /* One lock on the tier header when the whole tier is locked */
   .tier-option-container.locked .tier-option {
     position: relative;
   }

   .tier-option-container.locked .tier-option::before {
     pointer-events: none;
     content: "";
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     width: 1.25em;
     height: 1.25em;
     background: url("../assets/images/gridTierLocks_gold.webp")
       no-repeat center / contain;
     opacity: 0.95;
     z-index: 3;
     filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.85)) brightness(1.12);
   }

   /* Whole-tier lock uses header icon only — not per collapsed/hidden board btn */
   .tier-option-container.locked .difficulty-option::before {
     content: none;
   }

   .difficulty-option.locked {
     position: relative;
     border: 1px dotted red !important;
     opacity: 0.54;
     background: #140000e2 !important;
     color: pink;
     overflow: visible;
     cursor: not-allowed;
   }

   /* Let the locked card's not-allowed cursor show over the disabled button too */
   .difficulty-option.locked,
   .difficulty-option:disabled {
     pointer-events: none;
   }
   
   /* ---------------------------------------
      Overlay Content & Button Styles
   --------------------------------------- */
   .overlay-content h2 {
     font-size: 1.76em;
     margin: 0.36em 0;
     text-shadow:
       0 0 10px rgba(var(--primary-color-rgb), 0.45),
       0 2px 5px rgba(0, 0, 0, 0.85);
   }

 #main-progression-title {
     font-size: 1.6em;
 }

   .overlay-button-container {
     display: flex;
     flex-wrap: wrap;
     justify-content: center;
     gap: 10px;
     margin: 10px 0;
   }
   .overlay-button {
     background:
       linear-gradient(155deg, rgba(0, 0, 0, 0.58), rgba(var(--ccm-current-tier-accent-rgb), 0.08));
     border: 1px solid rgba(var(--ccm-current-tier-accent-rgb), 0.32);
     border-radius: 6px;
     color: #fff;
     padding: 2%;
     cursor: pointer;
     transition: all 0.3s ease-in-out;
     width: 100%;
     max-width: 186px;
     font-family: "Orbitron";
     font-size: 0.6em;
     line-height: 1.2em;
     box-shadow:
       var(--ccm-glass-inset),
       0 0 10px rgba(var(--ccm-current-tier-accent-rgb), 0.08);
   }
   .overlay-button:hover {
     background:
       linear-gradient(135deg, rgba(0, 0, 0, 0.56), rgba(var(--ccm-current-tier-accent-rgb), 0.16));
     border-color: rgba(var(--ccm-neon-cyan-rgb), 0.45);
     box-shadow:
       var(--ccm-glass-inset),
       0 0 14px rgba(var(--ccm-neon-cyan-rgb), 0.16),
       0 0 18px rgba(var(--ccm-neon-pink-rgb), 0.08);
   }

   
   #board-change-overlay .overlay-button-container,
   #winning-feedback .overlay-button-container {
     display: grid;
     grid-template-columns: repeat(2, minmax(10.5rem, 1fr));
     width: min(100%, 25rem);
     margin-inline: auto;
     align-items: stretch;
   }

   #board-change-overlay .overlay-button,
   #winning-feedback .overlay-button {
     width: 100%;
     max-width: none;
     min-height: 2.42rem;
     padding: 0.58rem 0.82rem;
     display: inline-flex;
     align-items: center;
     justify-content: center;
     text-align: center;
   }
   /* ---------------------------------------
      Board Change & Info Styles
   --------------------------------------- */
   #board-change-content img {
     position: relative;
     display: block;
     margin: -0.65em auto 0.2em;
     padding: 0;
     border-radius: 14px;
     opacity: 0.92;
     z-index: 1;
     animation: overlayFadeInUp 1.66s forwards;
   }

   #board-change-content .tier-progress-image {
     width: clamp(4.7rem, 27vw, 6.2rem);
     max-width: 34%;
     aspect-ratio: 3 / 4;
     object-fit: contain;
     opacity: 0.78;
     filter: saturate(0.86) brightness(0.78);
     border: 1px solid rgba(var(--board-change-tier-accent-rgb, var(--ccm-current-tier-accent-rgb)), 0.54);
     box-shadow:
       0 0 0 2px rgba(0, 0, 0, 0.48),
       0 0 18px rgba(var(--ccm-neon-pink-rgb), 0.2),
       0 0 22px rgba(var(--board-change-tier-accent-rgb, var(--ccm-current-tier-accent-rgb)), 0.24);
     margin: auto;
   }
   
   /* ---------------------------------------
      Level & Game-Over Info Styles
   --------------------------------------- */

   #winning-message {
     font-size: 1.2em;
     margin: 0;
   }
   #board-change-content .board-change-message-sub,
   .winning-message-sub,
   .game-over-message-sub {
     color: gold;
     font-family: "Orbitron";
     font-size: 0.66em;
     margin-bottom: 2em;
     line-height: 1.46em;
   }
   .level-stat-value,
   #current-board-size {
     font-size: 0.76em;
     font-family: "Orbitron";
     color: var(--secondary-color);
     padding: 5%;
   }
   
   /* ---------------------------------------
      Button Context Styles
   --------------------------------------- */
   .overlay-content #continue-next-level,
   #board-win-save-go-home {
     border-color: var(--secondary-color);
   }
   .overlay-content #continue-board-change,
   #tier-button-return-home {
     border-color: purple;
     margin: 1%;
   }
   #restart-game-over {
     border: 1px dotted red;
   }
   
   /* ---------------------------------------
      Winning Feedback & Perfect Popups
   --------------------------------------- */
   #winning-feedback.overlay-fog-active::before,
   #board-change-overlay.overlay-fog-active::before {
     background: var(--ccm-overlay-scrim-next-board);
   }

   #winning-feedback .overlay-content {
     border-color: rgba(var(--secondary-color-rgb), 0.65);
     border-radius: 6px;
     width: 80%;
     margin: 7% auto;
     background: var(--ccm-glass-bg-next-board);
   box-shadow:
       0 0 22px 10px rgba(0, 0, 0, 0.42),
       inset 0 0 0 1px rgba(152, 251, 152, 0.14);
   }

   #board-change-overlay .overlay-content {
     --board-change-tier-accent-rgb: var(--ccm-current-tier-accent-rgb);
     border-color: rgba(var(--board-change-tier-accent-rgb), 0.62) !important;
     border-radius: 6px;
     width: 80%;
     margin: 7% auto;
     background: radial-gradient(ellipse 70% 34% at 50% 0%, rgb(255 45 192 / 21%), #00000024 70%), radial-gradient(circle at 18% 84%, rgba(var(--ccm-neon-cyan-rgb), 0.1), #94207d1c 32%), linear-gradient(145deg, rgba(0, 0, 0, 0.56) 0%, rgba(var(--board-change-tier-accent-rgb), 0.1) 42%, rgba(8, 0, 36, 0.42) 100%) !important;
     box-shadow:
       0 0 22px 10px rgba(0, 0, 0, 0.44),
       0 0 24px rgba(var(--board-change-tier-accent-rgb), 0.2),
       0 0 22px rgba(var(--ccm-neon-pink-rgb), 0.08),
       inset 0 0 0 1px rgba(var(--ccm-neon-cyan-rgb), 0.12);
   }

   #winning-feedback .overlay-content h2,
   #board-change-overlay .overlay-content h2 {
     text-shadow:
       0 0 12px rgba(var(--primary-color-rgb), 0.55),
       0 2px 6px rgba(0, 0, 0, 0.9);
   }

   #winning-feedback #winning-message,
   #board-change-overlay #main-progression-message {
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 0.12rem;
     margin: 0.26rem auto 0.7rem;
     line-height: 1.15;
     color: rgb(var(--board-change-next-tier-accent-rgb, var(--board-change-tier-accent-rgb, var(--ccm-current-tier-accent-rgb))));
     text-shadow: 0 1px 4px rgba(0, 0, 0, 0.88);
   }

   .board-change-tier-kicker {
     font-family: "Orbitron", sans-serif;
     font-size: 0.58em;
     letter-spacing: 0.12em;
     text-transform: uppercase;
     color: rgba(var(--board-change-next-tier-accent-rgb, var(--board-change-tier-accent-rgb, var(--ccm-current-tier-accent-rgb))), 0.84);
   }

   .board-change-tier-name {
     font-family: "Orbitron", sans-serif;
     font-size: 1.02em;
     color: rgb(var(--board-change-next-tier-accent-rgb, var(--board-change-tier-accent-rgb, var(--ccm-current-tier-accent-rgb))));
     text-shadow:
       0 0 12px rgba(var(--board-change-next-tier-accent-rgb, var(--board-change-tier-accent-rgb, var(--ccm-current-tier-accent-rgb))), 0.42),
       0 2px 6px rgba(0, 0, 0, 0.92);
   }

   .board-change-tier-copy {
     max-width: 18rem;
     font-family: "Orbitron", sans-serif;
     font-size: 0.58em;
     line-height: 1.38;
     color: rgba(255, 255, 255, 0.78);
   }

   #board-change-content .board-change-message-sub,
   #winning-feedback .winning-message-sub {
     text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
   }


    .perfect-level-message {
     animation: buttonPulse 1.8s infinite;
     margin: 1% 0 2%;
   }

 /* ---------------------------------------
    Star Explosion Particles
 --------------------------------------- */
 .star-particle {
   position: absolute;       /* now absolute _inside_ the message */
   font-size: 1.2em;
   color: white;
   pointer-events: none;
   filter: drop-shadow(0 0 6px white);
   will-change: transform, opacity;
   opacity: 0;
   z-index: 999;             /* above the text */
 }


   /* ---------------------------------------
      Time Display Styles
   --------------------------------------- */
   span:has(#time-display) {
     font-size: 1.26em;
     text-shadow: 0 0 16px var(--primary-color);
     line-height: 0.9em;
   }
   #time-display {
     font-size: 0.8em;
     display: block;
     font-weight: 600;
     font-family: "Orbitron", sans-serif;
     animation: timerPulse 1s infinite;
     transition: color 0.5s ease;
   }
   
   .pulse {
     animation: timerPulse 0.5s;
   }

    /************************************************
    Value Change Popups
 ************************************************/
 .value-change-popup {
   width: fit-content;
   position: absolute;
   pointer-events: none;
   font-size: 1.5em;
   z-index: 99;
   text-align: center;
   letter-spacing: 0.5px;
   filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.66));
   transition: all 0.6s ease;
   padding: 3% 10%;
   border-radius: 8px;
   transform: translate(190%, 0);
   margin-right: calc(100% + 5px);
   margin-top: -5px;
 }
 .value-change-popup.increase {
   animation: floatUp 1.56s ease-out forwards;
   font-family: "Orbitron";
 }
 .value-change-popup.decrease,
 .value-change-popup.score-change.decrease {
   animation: floatDown 1.06s ease-out forwards;
   color: red;
 }
 .value-change-popup.score-change,
 .value-change-popup.score-change.increase {
   font-size: 1.1em;
   border: 2px dotted #000;
   color: #000;
   background-color: gold;
   font-weight: 900;
 }
 /************************************************
    Additional Reveal-All States & Meter Animation
 ************************************************/
 .filled-animation {
   animation: meterPulse 0.66s ease-out alternate 2;
 }
 #meter-revealAll-gameBoard-container {
   padding: 0.65rem 0.65rem 0.85rem;
   width: 100%;
   box-sizing: border-box;
   border: 1px dotted rgba(var(--secondary-color-rgb), 0.45);
   border-radius: 10px;
   background: linear-gradient(145deg, rgba(var(--primary-color-rgb), 0.12), rgba(var(--secondary-color-rgb), 0.08));
   margin-top: 0.35rem;
   position: relative;
 }

 .game-board-frame {
   position: relative;
   width: 100%;
 }

 #game-toast-layer {
   position: absolute;
   inset: 0;
   pointer-events: none;
   z-index: 25;
   overflow: visible;
 }

 #game-toast-layer #feedback,
 #game-toast-layer .streak-feedback-popup {
   pointer-events: none;
 }

 /************************************************
    Popup & Float Animations
 ************************************************/
 @keyframes floatUp {
   0% { opacity: 0; transform: translate(-86%, 0); }
   10% { opacity: 1; }
   90% { opacity: 1; transform: translate(-86%, -60px); }
   100% { opacity: 0; transform: translate(166%, -80px); }
 }
 @keyframes floatDown {
   0% { opacity: 0; transform: translate(-66%, 0); }
   15% { opacity: 1; }
   85% { opacity: 1; transform: translate(-66%, 80px); }
   100% { opacity: 0; transform: translate(-166%, 100px); }
 }

 /************************************************
    Glow & Pulse Animations
 ************************************************/
 @keyframes meterPulse {
   0% { transform: scale(1) translateX(0); box-shadow: 0 0 6px rgba(255,255,0,0.952); }
   20% { transform: scale(1.02) translateX(5px); }
   40% { transform: scale(1.03) translateX(-5px); box-shadow: 0 0 12px rgba(255,255,0,1); }
   60% { transform: scale(1.03) translateX(3px); box-shadow: 0 0 18px rgba(255,255,0,1); }
   80% { transform: scale(1.02) translateX(-3px); }
   100% { transform: scale(1) translateX(0); box-shadow: 0 0 6px rgba(255,255,0,0.952); }
 }

 /************************************************
    Game Board Layout
 ************************************************/
 #game-board {
     position: relative;
   display: grid;
   grid-template-columns: repeat(var(--card-columns), 1fr);
   z-index: 1;
   gap: var(--board-gap);
   border: 1px solid rgba(var(--ccm-current-tier-accent-rgb), 0.48);
   padding: 0.3em;
   border-radius: 0.6rem;
   width: 100%;
   height: calc(17em + 17vw);
   box-sizing: border-box;
   perspective: 966px;
   background:
     radial-gradient(ellipse 76% 24% at 50% 0%, rgba(var(--ccm-neon-cyan-rgb), 0.035), transparent 74%),
     radial-gradient(circle at 10% 88%, rgba(var(--ccm-neon-pink-rgb), 0.032), transparent 28%),
     radial-gradient(circle at 88% 18%, rgba(var(--ccm-neon-lime-rgb), 0.025), transparent 24%),
     radial-gradient(ellipse 72% 56% at 50% 48%, rgba(0, 12, 16, 0.54) 0%, rgba(0, 0, 0, 0.9) 84%),
     linear-gradient(180deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 8, 12, 0.88) 52%, rgba(0, 0, 0, 0.92) 100%),
     var(--ccm-current-tier-board-image) top center / cover no-repeat,
     #000000;
   opacity: 1 !important;
   box-shadow:
     inset 0 0 0 1px rgba(var(--ccm-neon-cyan-rgb), 0.08),
     0 0 10px rgba(0,255,213,0.16),
     0 0 18px rgba(var(--ccm-current-tier-accent-rgb), 0.14);
   transition: height var(--board-transition-duration) var(--board-transition-timing),
               width var(--board-transition-duration) var(--board-transition-timing),
               opacity var(--board-transition-duration) var(--board-transition-timing),
               transform var(--board-transition-duration) var(--board-transition-timing);
 }

 #game-board::before {
     content: "";
     position: absolute;
     inset: 0;
     pointer-events: none;
     z-index: 0;
     background-image:
       linear-gradient(to right, rgba(var(--ccm-current-tier-accent-rgb), 0.075) 1px, transparent 1px),
       linear-gradient(to bottom, rgba(var(--ccm-current-tier-accent-rgb), 0.075) 1px, transparent 1px);
     background-size: calc(100% / var(--card-columns)) calc(100% / var(--card-rows));
     opacity: 1;
     transition: opacity 0.66s ease;
   }

 #game-board::after {
   content: "";
   position: absolute;
   inset: 0.22rem;
   z-index: 0;
   pointer-events: none;
   border-radius: 0.42rem;
   background:
     var(--ccm-tier-rim-gradient) top / 100% 1px no-repeat,
     var(--ccm-tier-rim-gradient) bottom / 100% 1px no-repeat,
     linear-gradient(180deg, rgba(var(--ccm-neon-pink-rgb), 0.2), transparent 30%, transparent 70%, rgba(var(--ccm-neon-cyan-rgb), 0.16)) left / 1px 100% no-repeat,
     linear-gradient(180deg, rgba(var(--ccm-neon-cyan-rgb), 0.18), transparent 28%, transparent 72%, rgba(var(--ccm-neon-lime-rgb), 0.14)) right / 1px 100% no-repeat;
   opacity: 0.54;
 }

   /* Class to fade out the grid lines */
   #game-board.fade-lines::before {
     opacity: 0;
   }
   

@keyframes boardPulseGlow {
     0% {
       box-shadow: 0 0 10px rgba(152, 251, 134, 0.5);
     }
     50% {
       box-shadow: 0 0 20px rgb(165, 247, 150);
     }
     100% {
       box-shadow: 0 0 10px rgba(152, 251, 134, 0.5);
     }
   }
   
   #game-board.reveal-all {
     /* Remove the static box-shadow and apply the pulsing animation */
     animation: boardPulseGlow 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
     transition: none;
   }

 /* Tier-change transition: shake -> shed -> empty beat -> deal-in */
 .game-board-frame.ccm-home-clearing {
   animation: ccmHomeFrameSettle 240ms var(--ccm-overlay-easing) both;
   transform-origin: center center;
 }

 #game-board.ccm-home-clearing {
   pointer-events: none;
 }

 #game-board.ccm-home-clearing .card {
   animation: ccmHomeCardBank 220ms cubic-bezier(0.32, 0.72, 0.22, 1) forwards;
   animation-delay: calc(var(--home-card-i, 0) * 9ms);
   transition: none;
   will-change: transform, opacity;
 }

 #meter-revealAll-gameBoard-container.tier-transition-active {
   transition: filter 280ms ease;
 }

 #meter-revealAll-gameBoard-container.tier-transition-active .game-board-frame {
   filter: drop-shadow(0 0 10px rgba(var(--secondary-color-rgb), 0.35));
 }

 .game-board-frame.tier-transition-shake {
   animation: tierBoardShake var(--tier-shake-ms, 540ms) cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
   transform-origin: center center;
 }

 .game-board-frame.tier-transition-shake #game-board {
   animation: tierBoardInnerShake var(--tier-shake-ms, 540ms) cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
   transform-origin: center center;
 }

 #game-board.tier-transition-exit {
   pointer-events: none;
 }

 #game-board.tier-transition-exit .card {
   animation: tierCardShed var(--tier-shed-duration, 720ms) cubic-bezier(0.45, 0, 0.85, 0.35) forwards;
   animation-delay: calc(
     var(--tier-shed-start-ms, 360ms) + var(--tier-shed-i, 0) * var(--tier-shed-stagger-ms, 34ms)
   );
   transition: none;
   will-change: transform, opacity;
 }

 #game-board.tier-transition-enter .card.active {
   animation: tierCardDeal var(--tier-deal-duration, 580ms) cubic-bezier(0.33, 1, 0.45, 1) forwards;
   animation-delay: calc(var(--tier-deal-i, 0) * var(--tier-deal-stagger-ms, 46ms));
   transition: none;
 }

 .tier-transition-board-art {
   position: absolute;
   inset: 0.3em;
   z-index: 1;
   overflow: hidden;
   border-radius: 0.42rem;
   pointer-events: none;
   background: rgba(0, 0, 0, 0.48);
 }

 .tier-transition-board-art::after {
   content: "";
   position: absolute;
   inset: 0;
   background:
     radial-gradient(ellipse 68% 48% at 50% 44%, rgba(0, 0, 0, 0.14), transparent 58%),
     linear-gradient(180deg, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.68));
   pointer-events: none;
 }

 .tier-transition-board-art__layer {
   position: absolute;
   inset: 0;
   background:
     radial-gradient(ellipse 72% 54% at 50% 44%, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.62) 78%),
     var(--tier-old-image) top center / cover no-repeat;
   transform-origin: center center;
   will-change: opacity, transform, filter;
 }

 .tier-transition-board-art__layer--old {
   opacity: 0.5;
   animation: tierBoardArtOldRelease 1.22s cubic-bezier(0.45, 0, 0.35, 1) forwards;
 }

 .tier-transition-board-art__layer--new {
   opacity: 0;
   transform: scale(0.86);
   background:
     radial-gradient(ellipse 72% 54% at 50% 44%, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.62) 78%),
     var(--tier-new-image) top center / cover no-repeat;
   animation: tierBoardArtNewArrive 1.36s 0.42s cubic-bezier(0.25, 0.84, 0.28, 1) forwards;
 }

 @keyframes tierBoardShake {
   0%, 100% { transform: translate(0, 0) rotate(0deg); }
   8% { transform: translate(-7px, 5px) rotate(-1.4deg); }
   16% { transform: translate(8px, -6px) rotate(1.5deg); }
   24% { transform: translate(-9px, 4px) rotate(-1.6deg); }
   32% { transform: translate(10px, -4px) rotate(1.7deg); }
   40% { transform: translate(-8px, 6px) rotate(-1.3deg); }
   48% { transform: translate(7px, -5px) rotate(1.2deg); }
   56% { transform: translate(-6px, 4px) rotate(-0.9deg); }
   64% { transform: translate(5px, -3px) rotate(0.8deg); }
   72% { transform: translate(-4px, 2px) rotate(-0.5deg); }
   84% { transform: translate(2px, -1px) rotate(0.25deg); }
 }

 @keyframes tierBoardInnerShake {
   0%, 100% { transform: translate(0, 0); }
   12% { transform: translate(2px, -1px); }
   24% { transform: translate(-2px, 2px); }
   36% { transform: translate(3px, 1px); }
   48% { transform: translate(-3px, -2px); }
   60% { transform: translate(2px, 1px); }
   72% { transform: translate(-1px, -1px); }
 }

 @keyframes tierCardShed {
   0% {
     opacity: 1;
     transform: translate3d(0, 0, 0) scale(1) rotateY(0deg) rotateZ(0deg);
   }
   28% {
     opacity: 1;
     transform: translate3d(calc(var(--tier-shed-x, 0) * 0.35), calc(var(--tier-shed-y, 0) * 0.25), 0)
       scale(0.94) rotateY(35deg) rotateZ(calc(var(--tier-shed-r, 0deg) * 0.35));
   }
   100% {
     opacity: 0;
     transform: translate3d(var(--tier-shed-x, 0), var(--tier-shed-y, 0), 0)
       scale(0.18) rotateY(165deg) rotateZ(var(--tier-shed-r, 0deg));
   }
 }

 @keyframes tierCardDeal {
   0% {
     opacity: 0;
     transform: scale(0.28) rotateY(-92deg) translateY(-14px);
   }
   65% {
     opacity: 1;
     transform: scale(1.05) rotateY(6deg) translateY(0);
   }
   100% {
     opacity: 1;
     transform: scale(1) rotateY(0deg) translateY(0);
   }
 }

 @keyframes tierBoardArtOldRelease {
   0% {
     opacity: 0.5;
     transform: scale(1);
     filter: saturate(0.82) brightness(0.72);
   }
   48% {
     opacity: 0.38;
     transform: scale(0.94);
     filter: saturate(0.74) brightness(0.58);
   }
   100% {
     opacity: 0;
     transform: scale(0.78);
     filter: saturate(0.55) brightness(0.36) blur(1px);
   }
 }

 @keyframes tierBoardArtNewArrive {
   0% {
     opacity: 0;
     transform: scale(0.86);
     filter: saturate(0.7) brightness(0.48) blur(1px);
   }
   62% {
     opacity: 0.38;
     transform: scale(1.035);
     filter: saturate(0.86) brightness(0.62);
   }
   100% {
     opacity: 0.32;
     transform: scale(1);
     filter: saturate(0.82) brightness(0.56);
   }
 }

 @keyframes ccmHomeFrameSettle {
   0% {
     transform: translateY(0) scale(1);
   }
   42% {
     transform: translateY(-0.08rem) scale(1.006);
   }
   100% {
     transform: translateY(0.16rem) scale(0.988);
   }
 }

 @keyframes ccmHomeCardBank {
   0% {
     opacity: 1;
     transform: translate3d(0, 0, 0) scale(1) rotateY(0deg) rotateZ(0deg);
   }
   46% {
     opacity: 0.92;
     transform: translate3d(var(--home-card-x, 0px), -0.22rem, 0) scale(0.965) rotateY(18deg) rotateZ(0deg);
   }
   100% {
     opacity: 0;
     transform: translate3d(var(--home-card-x, 0px), 0.85rem, 0) scale(0.72) rotateY(76deg) rotateZ(var(--home-card-r, 0deg));
   }
 }

 @media (prefers-reduced-motion: reduce) {
   .game-board-frame.tier-transition-shake,
   .game-board-frame.tier-transition-shake #game-board,
   #game-board.tier-transition-exit .card,
   #game-board.tier-transition-enter .card.active,
   .tier-transition-board-art__layer,
   .game-board-frame.ccm-home-clearing,
   #game-board.ccm-home-clearing .card {
     animation: none !important;
   }
 }

 /************************************************
    Card Base, State & Animation Styles
 ************************************************/
  .card {
    height: auto;
    border-radius: 6px;
    cursor: pointer;
   box-shadow: none;
   transform-style: preserve-3d;
   position: relative;
   opacity: 0;
   border: 1px solid transparent;
   transition:
     transform 0.28s cubic-bezier(0.34, 1.1, 0.64, 1),
     box-shadow 0.28s ease,
     opacity 0.5s ease-in-out;
    z-index: 10;
  }

  .card:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 3px;
    box-shadow: 0 0 16px rgba(var(--secondary-color-rgb), 0.66);
  }
 
 .card .card-face {
   position: absolute;
   width: 100%;
   height: 100%;
   backface-visibility: hidden;
   border-radius: 6px;
 }

 /* Face-down: patterned domino/turtle back, matching the tier/loading card backs. */
 .card .card-back:not(.disabled-back) {
   overflow: hidden;
   background: var(--ccm-card-glass-bg);
   background-size: auto, auto, 8px 8px, auto;
   border: var(--ccm-card-glass-border);
   box-shadow:
     var(--ccm-card-glass-glow),
     inset 0 1px 0 rgba(255, 255, 255, 0.1),
     inset 0 -3px 10px rgba(0, 0, 0, 0.72),
     inset 0 0 0 3px rgba(4, 12, 18, 0.92),
     0 2px 8px rgba(0, 0, 0, 0.34);
   transition:
     background 0.24s ease,
     border-color 0.24s ease,
     box-shadow 0.24s ease;
 }

 .card .card-back:not(.disabled-back)::before {
   content: "";
   position: absolute;
   inset: 10%;
   z-index: 1;
   border-radius: 4px;
   pointer-events: none;
   opacity: 1;
   background:
     radial-gradient(circle at 50% 42%, rgba(var(--ccm-neon-cyan-rgb), 0.16), transparent 46%),
     radial-gradient(circle at 30% 72%, rgba(var(--ccm-neon-pink-rgb), 0.12), transparent 38%),
     linear-gradient(155deg, rgba(255, 255, 255, 0.06), transparent 36%),
     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='rgba(100,220,220,0.26)'/%3E%3C/svg%3E"),
     linear-gradient(165deg, rgba(12, 34, 44, 0.9), rgba(2, 8, 14, 0.96));
   background-size: auto, auto, auto, 8px 8px, auto;
   border: 1px solid rgba(var(--ccm-current-tier-accent-rgb), 0.34);
   box-shadow:
     inset 0 0 14px rgba(0, 0, 0, 0.58),
     0 0 8px rgba(var(--ccm-current-tier-accent-rgb), 0.12);
 }

 .card .card-back:not(.disabled-back)::after {
   content: "";
   position: absolute;
   inset: 0;
   z-index: 2;
   border-radius: inherit;
   pointer-events: none;
   background:
     radial-gradient(circle at 50% 42%, rgba(var(--ccm-current-tier-accent-rgb), 0.11), transparent 54%),
     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='rgba(100,220,220,0.42)'/%3E%3C/svg%3E");
   background-size: auto, 8px 8px;
   opacity: 0.46;
   mix-blend-mode: screen;
 }

 .card.active:not(.flipped):not(.matched):not(.disabled):hover {
   transform: translateY(-3px) scale(1.025);
   z-index: 12;
 }

 .card.active:not(.flipped):not(.matched):not(.disabled):hover .card-back {
   background: var(--ccm-card-glass-bg-hover);
   background-size: auto, auto, 8px 8px, auto;
   border: var(--ccm-card-glass-border-hover);
   box-shadow:
     var(--ccm-card-glass-glow-hover),
     inset 0 1px 0 rgba(255, 255, 255, 0.14),
     inset 0 -3px 10px rgba(0, 0, 0, 0.72),
     inset 0 0 0 3px rgba(4, 12, 18, 0.92),
     0 4px 14px rgba(0, 0, 0, 0.34);
 }

 .card.active:not(.flipped):not(.matched):not(.disabled):hover .card-back::before {
   border-color: rgba(var(--ccm-current-tier-accent-rgb), 0.46);
   box-shadow:
     inset 0 0 16px rgba(0, 0, 0, 0.56),
     0 0 10px rgba(var(--ccm-current-tier-accent-rgb), 0.16);
 }

 .card.active:not(.flipped):not(.matched):not(.disabled):hover .card-back::after {
   opacity: 0.62;
 }

  .card .card-front {
    transform: rotateY(180deg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .card .card-front::after {
    content: "";
    position: absolute;
    inset: 0;
   background: linear-gradient(126deg, #aebcbf 0%, #6e7774 56%, #250f36 56%, #0a080985 86%);
   background-size: 100% 100%;
   background-blend-mode: multiply;
    z-index: 2;
    opacity: 0.167;
    pointer-events: none;
  }

  .card-mark {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.55em;
    min-height: 2.55em;
    border: 1px dotted rgba(255, 255, 255, 0.38);
    border-radius: 50%;
    background:
      radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.26), transparent 58%),
      radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.05) 74%);
    color: rgba(255, 255, 255, 0.96);
    font-family: "VT323", "Orbitron", monospace;
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    text-shadow:
      0 1px 4px rgba(0, 0, 0, 0.82),
      0 0 8px rgba(255, 255, 255, 0.34),
      0 0 16px rgba(255, 255, 255, 0.26);
    box-shadow:
      inset 0 0 12px rgba(255, 255, 255, 0.12),
      0 0 16px rgba(0, 0, 0, 0.24);
    pointer-events: none;
  }

  .card-mark::before,
  .card-mark::after {
    content: "";
    position: absolute;
    inset: 0.18em;
    border-radius: inherit;
    pointer-events: none;
  }

  .card-mark::before {
    border-top: 1px solid rgba(255, 255, 255, 0.28);
    border-bottom: 1px solid rgba(0, 0, 0, 0.22);
    transform: rotate(38deg);
  }

  .card-mark::after {
    inset: -0.12em;
    border: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0.72;
  }
 .card.flipped {
   transform: rotateY(180deg);
   box-shadow: 0 0 0.625rem 0.125rem #000;
 }
 .card.mismatch-settling {
   pointer-events: none;
 }
 .card.matched {
   box-shadow: 0 0 0.9375rem var(--positive-feedback-color);
   animation: matchedPulse 0.5s infinite alternate;
 }
 @keyframes matchedPulse {
   from { box-shadow: 0 0 0.375rem 0.1875rem currentColor; }
   to { box-shadow: 0 0 1.25rem 0.3125rem currentColor; }
 }
 /* Match flavor: a quick springy pop on the pair, pulse glow continues alongside */
 .card.matched.is-match-pop {
   animation:
     matchPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1,
     matchedPulse 0.5s infinite alternate;
 }
 @keyframes matchPop {
   0%   { transform: rotateY(180deg) scale(1); }
   35%  { transform: rotateY(180deg) scale(1.09); }
   100% { transform: rotateY(180deg) scale(1); }
 }

 .ccm-match-flare {
   position: fixed;
   inset: 0;
   z-index: 1490;
   pointer-events: none;
   --ccm-match-color: #98fb98;
   --ccm-match-rgb: 152, 251, 152;
   --ccm-match-intensity: 1;
 }

 .ccm-match-breath {
   position: absolute;
   inset: 0;
   width: 100%;
   height: 100%;
   overflow: visible;
 }

 .ccm-match-breath-path {
   fill: none;
   stroke: rgba(var(--ccm-match-rgb), 0.36);
   stroke-width: 1.6;
   stroke-linecap: round;
   stroke-dasharray: var(--ccm-breath-length, 260);
   stroke-dashoffset: var(--ccm-breath-length, 260);
   filter:
     drop-shadow(0 0 calc(4px * var(--ccm-match-intensity)) rgba(var(--ccm-match-rgb), 0.34))
     drop-shadow(0 0 calc(10px * var(--ccm-match-intensity)) rgba(255, 255, 255, 0.12));
   opacity: 0;
   animation: ccmMatchBreathDraw 940ms cubic-bezier(0.24, 0.86, 0.36, 1) forwards;
 }

 .ccm-match-ring {
   position: absolute;
   border-radius: 999px;
   border: 1px solid rgba(var(--ccm-match-rgb), 0.28);
   background: transparent;
   box-shadow:
     0 0 calc(7px * var(--ccm-match-intensity)) rgba(var(--ccm-match-rgb), 0.22),
     inset 0 0 calc(8px * var(--ccm-match-intensity)) rgba(var(--ccm-match-rgb), 0.12);
   transform: translate(-50%, -50%) scale(0.9);
   opacity: 0;
   animation: ccmMatchRingBloom 860ms cubic-bezier(0.24, 0.82, 0.36, 1) forwards;
 }

 .ccm-match-mote {
   position: absolute;
   width: var(--size, 4px);
   height: var(--size, 4px);
   border-radius: 50%;
   background: rgba(255, 255, 255, 0.82);
   box-shadow:
     0 0 6px rgba(255, 255, 255, 0.48),
     0 0 12px rgba(var(--ccm-match-rgb), 0.44);
   opacity: 0;
   transform: translate(-50%, -50%) scale(0.56);
   animation: ccmMatchMoteFloat 840ms ease-out forwards;
   animation-delay: var(--delay, 0ms);
 }

 .ccm-match-splash {
   position: absolute;
   width: var(--splash-width, 7px);
   height: var(--splash-height, 5px);
   border-radius: 62% 38% 56% 44% / 52% 46% 58% 48%;
   background:
     radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.48), transparent 36%),
     radial-gradient(ellipse at 56% 62%, rgba(var(--ccm-match-rgb), 0.46), rgba(var(--ccm-match-rgb), 0.16) 58%, transparent 76%);
   box-shadow:
     0 0 8px rgba(var(--ccm-match-rgb), 0.24),
     inset 0 0 4px rgba(255, 255, 255, 0.14);
   opacity: 0;
   transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(0.28);
   filter: blur(0.2px);
   mix-blend-mode: screen;
   animation: ccmMatchSplashDrift 760ms cubic-bezier(0.22, 0.82, 0.32, 1) forwards;
   animation-delay: var(--delay, 0ms);
 }

 @keyframes ccmMatchBreathDraw {
   0% {
     opacity: 0;
     stroke-dashoffset: var(--ccm-breath-length, 260);
     stroke-width: 1.2;
   }
   36% {
     opacity: 0.78;
     stroke-dashoffset: 0;
     stroke-width: 2.4;
   }
   76% {
     opacity: 0.42;
     stroke-dashoffset: calc(var(--ccm-breath-length, 260) * -0.12);
   }
   100% {
     opacity: 0;
     stroke-dashoffset: calc(var(--ccm-breath-length, 260) * -0.28);
     stroke-width: 1.4;
   }
 }

 @keyframes ccmMatchRingBloom {
   0% {
     opacity: 0;
     transform: translate(-50%, -50%) scale(0.7);
   }
   30% {
     opacity: 0.42;
     transform: translate(-50%, -50%) scale(1.02);
   }
   100% {
     opacity: 0;
     transform: translate(-50%, -50%) scale(1.2);
   }
 }

 @keyframes ccmMatchMoteFloat {
   0% {
     opacity: 0;
     transform: translate(-50%, -50%) scale(0.44);
   }
   30% {
     opacity: 0.82;
     transform: translate(calc(-50% + var(--mx) * 0.3), calc(-50% + var(--my) * 0.28)) scale(1);
   }
   100% {
     opacity: 0;
     transform: translate(calc(-50% + var(--mx)), calc(-50% + var(--my))) scale(0.68);
   }
 }

 @keyframes ccmMatchSplashDrift {
   0% {
     opacity: 0;
     transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(0.24);
     filter: blur(0.4px);
   }
   24% {
     opacity: var(--splash-opacity, 0.48);
     transform: translate(calc(-50% + var(--splash-x-mid, 0px)), calc(-50% + var(--splash-y-mid, 0px))) rotate(var(--rot, 0deg)) scale(1);
     filter: blur(0);
   }
   68% {
     opacity: 0.24;
   }
   100% {
     opacity: 0;
     transform: translate(calc(-50% + var(--splash-x, 0px)), calc(-50% + var(--splash-y, 0px))) rotate(var(--end-rot, 0deg)) scale(0.58);
     filter: blur(1.2px);
   }
 }

 @media (prefers-reduced-motion: reduce) {
   .card.matched.is-match-pop { animation: matchedPulse 0.5s infinite alternate; }
   .ccm-match-flare { display: none; }
 }
 @keyframes cardPulseWave {
   0% {
     transform: scale(1);
     opacity: 0.8;
     background: transparent;
     box-shadow: 0 0 20px transparent;
     border: var(--secondary-color) dotted 1px;
     border-radius: 20px;
   }
   50% {
     opacity: 0.54;
     background: rgba(0,255,255,0.2);
     box-shadow: 0 0 40px rgba(0,255,255,0.3);
   }
   96% { border: gold dotted 0px; }
   100% {
     transform: scale(1.36);
     opacity: 0;
     background: rgba(0,255,255,0);
     box-shadow: 0 0 60px rgba(0,255,255,0);
     border-radius: 30px;
   }
 }

 /************************************************
    Disabled Card Styles
 ************************************************/
 .card.disabled {
     cursor: default;
     pointer-events: none;
   }
   .card.disabled .card-back,
   .card.disabled .card-front {
     opacity: 0.5;
     pointer-events: none;
   }
   .card.disabled .card-face {
     background: #f0f0f0;
     opacity: 0.5;
     transition: all 0.3s ease;
     border: 1px dashed rgba(120, 120, 120, 0.45);
   }
   .card.disabled:hover .card-face {
     opacity: 0.6;
   }
 .disabled-indicator {
   position: absolute;
   width: 100%;
   height: 100%;
   display: flex;
   align-items: center;
   justify-content: center;
 }
 .disabled-x {
   position: absolute;
   width: 60%;
   height: 60%;
   opacity: 0.76;
 }
 .disabled-x::before,
 .disabled-x::after {
   content: "";
   position: absolute;
   top: 50%;
   left: 50%;
   width: 86%;
   height: 26%;
   background: #ff4080d9;
   border-radius: 10px;
   transform: translate(-50%, -50%) rotate(45deg);
 }
 .disabled-x::after {
   transform: translate(-50%, -50%) rotate(-45deg);
 }
 .disabled-pattern {
   position: absolute;
   width: 100%;
   height: 100%;
   background: repeating-linear-gradient(45deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1) 10px, rgba(0,0,0,0.2) 10px, rgba(0,0,0,0.2) 20px);
 }

 /************************************************
    First Flipped Card Highlight & Animation
 ************************************************/
 .card.first-flipped {
   position: relative;
   z-index: 100;
   transition: all 0.3s ease-in-out;
 }
 .card.first-flipped::before,
 .card.first-flipped::after,
 .card.first-flipped .card-face::before {
   content: "";
   position: absolute;
   inset: -6px;
   border-radius: 8px;
   animation: cardPulseWave 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
   pointer-events: none;
   transition: opacity 0.3s ease-out;
   opacity: 1;
 }
.card.first-flipped::before { animation-delay: 0s; }
.card.first-flipped::after { animation-delay: 0.2s; }
.card.first-flipped .card-face::before { animation-delay: 0.4s; }

 /************************************************
    Mismatch "X" Feedback & Overlays
 ************************************************/
 .mismatch-x {
   font-family: Quicksand, sans-serif;
   position: fixed;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   font-size: calc(36vw + 56vh);
   color: rgba(255,0,0,0.76);
   pointer-events: none;
   font-weight: 900;
   opacity: 0;
   z-index: 1500;
   text-shadow: 0 0 26px rgba(255,0,0,0.36);
   line-height: 0;
   text-align: center;
   width: 100vw;
   height: 100vh;
   display: flex;
   justify-content: center;
   align-items: center;
 }
 .mismatch-x.show {
   opacity: 1;
   animation: shakeX var(--ccm-mismatch-x-duration, 640ms) cubic-bezier(0.36, 0, 0.66, 1) forwards;
 }
 .red-screen-flash {
   position: fixed;
   top: 0; 
   left: 0;
   width: 100vw;
   height: 100vh;
   background-color: rgba(255,0,0,0.15);
   z-index: 1000;
   pointer-events: none;
   opacity: 0;
   transition: opacity 100ms ease-in-out;
 }

 .red-screen-flash.show {
   opacity: 1;
 }
 .card-flash-red {
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background-color: rgba(255,0,0,0.5);
   pointer-events: none;
   border-radius: inherit;
   z-index: 10;
 }
    
    /********************************************************
      ** Reveal All Chroma & Particle Styles
   ********************************************************/
   
  /* Random âœ¦ "fairy dust" puff on card turns — mirrors the loader sparkle */
  .ccm-card-sparkle {
    position: fixed;
    z-index: 1500;
    width: 0;
    height: 0;
    pointer-events: none;
  }

  .ccm-card-spark {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%) scale(0.2);
    color: var(--ccm-spark-color, #98fb98);
    text-shadow:
      0 0 6px var(--ccm-spark-color, #98fb98),
      0 0 11px rgba(255, 255, 255, 0.62);
    opacity: 0;
    line-height: 1;
    will-change: transform, opacity;
    animation: ccmCardSparkPop 0.92s ease-out forwards;
    animation-delay: var(--delay, 0ms);
  }

  @keyframes ccmCardSparkPop {
    0% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
    }
    28% {
      opacity: 1;
      transform:
        translate(calc(-50% + var(--dx) * 0.5), calc(-50% + var(--dy) * 0.5))
        scale(1.12) rotate(calc(var(--rot) * 0.5));
    }
    100% {
      opacity: 0;
      transform:
        translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
        scale(0.5) rotate(var(--rot));
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .ccm-card-sparkle { display: none; }
  }

   .particle {
     position: absolute;
     background-color: gold;
     border-radius: 50%;
     will-change: transform, opacity, filter, border-radius;
     pointer-events: none;
     box-shadow: 0 0 5px rgba(255, 255, 255, 0.45);
     opacity: 1;
     /* Enhanced for better performance */
     transform: translateZ(0);
     backface-visibility: hidden;
     -webkit-font-smoothing: antialiased;
   }

   /* Enhanced trail effect for particles in motion */
   .particle::before {
     content: '';
     position: absolute;
     top: 50%;
     left: 50%;
     width: 34px;
     height: 2px;
     transform: translate(-50%, -50%) rotate(0deg);
     background: linear-gradient(to right, 
       rgba(255, 255, 255, 0.55) 0%,
       var(--particle-color, currentColor) 30%,
       transparent 100%);
     filter: blur(4px);
     opacity: 0.45;
     transition: opacity 0.35s ease;
   }
   
   /* Enhanced glow for the particle head */
   .particle::after {
     content: '';
     position: absolute;
     inset: -4px;
     border-radius: inherit;
     background: radial-gradient(circle, 
       rgba(255, 255, 255, 0.45) 0%,
       var(--particle-color, currentColor) 40%,
       transparent 82%);
     filter: blur(3px);
     opacity: 0.55;
     transition: opacity 0.35s ease, filter 0.35s ease;
   }
   
   /* Particle container with better performance */
   .particles-container {
     pointer-events: none;
     overflow: visible;
     /* GPU acceleration */
     transform: translateZ(0);
     will-change: contents;
   }

   .click-particles-container .particle::before,
   .click-particles-container .particle::after {
     display: none;
   }

   .particle-click {
     box-shadow:
       0 0 4px var(--particle-color, currentColor),
       0 0 8px rgba(255, 255, 255, 0.22);
     border: 1px solid rgba(255, 255, 255, 0.14);
   }
   
#chroma-meter-bar.meter-receiving {
   box-shadow:
     inset 0 4px 10px rgba(0, 0, 0, 0.92),
     inset 0 1px 0 rgba(255, 255, 255, 0.14),
     inset 0 -1px 2px rgba(255, 255, 255, 0.05),
     0 0 calc(8px + var(--meter-charge, 0) * 18px) rgba(var(--primary-color-rgb), calc(0.35 + var(--meter-charge, 0) * 0.55)),
     0 0 calc(14px + var(--meter-charge, 0) * 26px) rgba(var(--secondary-color-rgb), calc(0.2 + var(--meter-charge, 0) * 0.45));
   filter: brightness(calc(1 + var(--meter-charge, 0) * 0.18));
   transition: box-shadow 0.12s ease-out, filter 0.12s ease-out;
 }

 #chroma-meter-bar.meter-homing {
   border-color: rgba(var(--secondary-color-rgb), 0.85);
 }

 .meter-bar-segment-fill.meter-fill-receiving {
   transition: width 0.1s ease-out, box-shadow 0.12s ease-out, filter 0.12s ease-out !important;
 }

 .particle-chip {
   border-radius: 6px;
   border: 1px solid rgba(100, 200, 180, 0.38);
   box-shadow: 0 0 10px rgba(0, 0, 0, 0.28);
   transform-origin: center center;
   transition:
     border-radius 0.52s cubic-bezier(0.32, 0.92, 0.42, 1),
     border-color 0.48s ease,
     box-shadow 0.48s ease,
     filter 0.48s ease;
 }

 /* Full card-face peel before shrink + homing */
 .particle-chip-peel,
 .particle-chip-shrunk {
   border-radius: 6px;
 }

 .particle-chip-peel {
   border: 1px solid rgba(100, 200, 180, 0.42);
   background: linear-gradient(145deg, rgba(0, 20, 26, 0.46) 0%, rgba(0, 8, 16, 0.4) 100%);
   box-shadow:
     0 0 14px rgba(0, 0, 0, 0.32),
     inset 0 0 10px rgba(255, 255, 255, 0.16);
 }

 .particle-chip-morphing {
   border: 1px solid rgba(152, 251, 152, 0.24);
   border-radius: 18%;
   box-shadow:
     0 0 12px var(--particle-color, currentColor),
     inset 0 0 6px rgba(255, 255, 255, 0.08);
   filter: saturate(1.04);
 }

 .particle-chip-morphing::after {
   opacity: 0.1;
   transition: opacity 0.45s ease;
 }

 .particle-chip-floaty {
   border: 1px solid rgba(255, 255, 255, 0.12);
   border-radius: 42%;
   box-shadow: 0 0 12px var(--particle-color, currentColor);
   filter: saturate(1.02) blur(0.55px);
 }

 .particle-chip-floaty::after {
   opacity: 0.03;
 }

 .particle-chip-peel::before,
 .particle-chip-morphing::before,
 .particle-chip-floaty::before {
   opacity: 0 !important;
 }

 .particle-chip-peel::after {
   inset: 0;
   border-radius: inherit;
   opacity: 0.22;
   background: linear-gradient(126deg, rgba(255, 255, 255, 0.24) 0%, transparent 48%, rgba(0, 0, 0, 0.16) 100%);
   transition: opacity 0.48s ease;
 }

 .particle-chip-shrunk {
   border-radius: 50%;
   border: 1px solid rgba(255, 255, 255, 0.1);
   box-shadow: 0 0 10px var(--particle-color, currentColor);
 }

 .particle-chip::before {
   opacity: 0;
   transition: opacity 0.28s ease-out;
 }

 .particle-chip::after {
   content: "";
   position: absolute;
   inset: 0;
   border-radius: inherit;
   background: linear-gradient(126deg, #aebcbf 0%, #6e7774 56%, #250f36 56%, #0a080985 86%);
   opacity: 0.16;
   pointer-events: none;
   transition: opacity 0.48s ease, border-radius 0.52s ease;
 }

 .particle-chip-homing::before {
   opacity: 0.55;
   width: 24px;
   filter: blur(4px);
 }

   #chroma-meter-bar.meter-beacon {
     animation: meterBeacon 0.46s ease-out;
   }

   @keyframes meterBeacon {
     0%, 100% {
       box-shadow:
         inset 0 4px 10px rgba(0, 0, 0, 0.92),
         inset 0 1px 0 rgba(255, 255, 255, 0.1),
         inset 0 -1px 2px rgba(255, 255, 255, 0.04);
     }
     45% {
       box-shadow:
         inset 0 4px 10px rgba(0, 0, 0, 0.88),
         inset 0 1px 0 rgba(255, 255, 255, 0.22),
         0 0 16px rgba(var(--primary-color-rgb), 0.85),
         0 0 28px rgba(var(--secondary-color-rgb), 0.55);
     }
   }
   
   /********************************************************
      ** Feedback Elements
   ********************************************************/
   #feedback {
     letter-spacing: 0.1px;
     position: absolute;
     left: 50%;
     top: 42%;
     transform: translate(-50%, -50%) scale(0.9);
     padding: 0.45em 0.65em;
     color: #fff;
     font-weight: 300 !important;
     font-size: clamp(1rem, 3.6vw, 1.36rem);
     opacity: 0;
     transition: opacity var(--feedback-duration), transform var(--feedback-duration);
     pointer-events: none;
     text-align: center;
     z-index: 2;
     width: min(88%, 16rem);
     max-width: calc(100% - 1rem);
     line-height: 0.9em;
     border-radius: 6px;
     background: rgba(0, 0, 0, 0.68);
     border: 1px dotted rgba(var(--primary-color-rgb), 0.35);
     box-shadow: var(--ccm-glass-shadow-deep);
     text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
   }
   
   /********************************************************
      ** Streak Feedback Styles
   ********************************************************/
   .streak-feedback-popup {
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     padding: 8px 14px;
     background-color: rgba(255, 215, 0, 0.88);
     border-radius: 15px;
     box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.45);
     color: #222;
     font-weight: bold;
     text-align: center;
     position: absolute;
     left: 50%;
     top: calc(56% - var(--streak-stack, 0) * 2.4rem);
     transform: translate(-50%, -50%);
     z-index: 3;
     transform-origin: center;
     pointer-events: none;
     border: 2px dotted black;
     width: min(78%, 13rem);
     animation: streakToastFloat 1.35s ease-out forwards;
   }
   .streak-count {
     font-size: 1.3rem;
     margin-bottom: 5px;
   }
   .streak-bonus {
     font-size: 1.1rem;
     color: #fff;
     text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
   }
   .streak-bonus-label {
     color: #FFD700;
     font-size: 0.9rem;
     text-transform: uppercase;
   }
   .streak-meter-bonus-popup {
     padding: 10px 15px;
     background-color: rgba(100, 100, 255, 0.78);
     border-radius: 10px;
     box-shadow: 0 0 15px rgba(100, 100, 255, 0.4);
     color: white;
     font-weight: bold;
     text-align: center;
     z-index: 1500;
     max-width: 200px;
     pointer-events: none;
     border: 2px dotted black;
     animation: floatDownPopup 1.2s forwards;
   }
   
   @keyframes streakToastFloat {
     0% {
       opacity: 0;
       transform: translate(-50%, -50%) scale(0.82);
     }
     14% {
       opacity: 1;
       transform: translate(-50%, calc(-50% - 4px)) scale(1);
     }
     72% {
       opacity: 1;
       transform: translate(-50%, calc(-50% - 10px)) scale(1);
     }
     100% {
       opacity: 0;
       transform: translate(-50%, calc(-50% - 24px)) scale(0.96);
     }
   }

   @keyframes floatDownPopup {
     0% {
       transform: translate(-5%, 5px) scale(0.7);
       opacity: 0;
     }
     10% {
       transform: translate(-6%, 10px) scale(0.8);
       opacity: 1;
     }
     60% {
       opacity: 1;
     }
     80% {
       transform: translate(-6%, 40px) scale(1);
       opacity: 1;
     }
     100% {
       transform: translate(-20%, 40px) scale(1);
       opacity: 0;
     }
   }
   
   /********************************************************
      ** Animations for Popups & Effects
   ********************************************************/
   @keyframes shakeX {
     0% { opacity: 0; transform: translate(-50%, -50%) scale(0.78) rotate(0deg); }
     12% { opacity: 0.86; transform: translate(-50%, -50%) scale(1.16) rotate(-3deg); }
     24% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.08) rotate(3deg); }
     36% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.03) rotate(-2deg); }
     52% { opacity: 0.82; transform: translate(-50%, -50%) scale(1) rotate(2deg); }
     68% { opacity: 0.72; transform: translate(-50%, -50%) scale(0.98) rotate(-1deg); }
     82% { opacity: 0.42; transform: translate(-50%, -50%) scale(0.93) rotate(1deg); }
     100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8) rotate(0deg); }
   }
   
   @keyframes flashPulseDanger {
     0% { color: #ff0000; opacity: 1; }
     50% { color: #ffffff; opacity: 0.6; }
     100% { color: #ff0000; opacity: 1; }
   }
   
   /********************************************************
      ** Board Change & Level Complete
   ********************************************************/
   #current-board-value,
   #next-board-value,
   #game-over-board {
     display: block;
     margin: .6em 0 0.6em;
     animation: overlayFadeInUp 2.6s forwards;
   }
   
   /********************************************************
      ** Pause Overlay
   ********************************************************/
 #pause-overlay .overlay-content,
 #sound-overlay .overlay-content {
   padding: 1em;
   border-color: rgba(var(--secondary-color-rgb), 0.55);
   max-width: 500px;
   max-height: 75vh;
   overflow-y: auto;
   margin: 5vh auto;
   box-sizing: border-box;
 }

/* Custom scrollbar for music player modal - Desktop & Mobile */
#sound-overlay .overlay-content::-webkit-scrollbar {
  width: 12px;
}

#sound-overlay .overlay-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--secondary-color);
  border-radius: 10px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}

#sound-overlay .overlay-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(99, 197, 218, 0.6), inset 0 0 4px rgba(152, 251, 152, 0.4);
}

#sound-overlay .overlay-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  box-shadow: 0 0 12px rgba(152, 251, 152, 0.8), inset 0 0 6px rgba(99, 197, 218, 0.6);
}

/* Firefox scrollbar styling */
#sound-overlay .overlay-content {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) rgba(0, 0, 0, 0.4);
}

#sound-overlay #sound-close-button {
  margin: 0.8em auto 0;
  display: block;
  width: auto;
  min-width: 120px;
  padding: 0.5em 1em;
  box-sizing: border-box;
}

/* Sound Effects Volume Controls */
.sound-effects-controls {
  margin: 1em 0;
  padding: 0.8em;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border: 1px dotted rgba(var(--secondary-color-rgb), 0.3);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  box-sizing: border-box;
}

.sound-volume-control {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  box-sizing: border-box;
  min-width: 0;
}

.sound-volume-control label {
  font-size: 0.75em;
  color: var(--secondary-color);
  font-family: "Orbitron", sans-serif;
  text-align: left;
  margin: 0 0 0.2em 0;
  line-height: 1.2;
}

.volume-slider-container {
  display: flex;
  align-items: center;
  gap: 0.3em;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.volume-slider {
  flex: 1;
  min-width: 0;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin: 0;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--secondary-color);
  border: 1px dotted black;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(var(--secondary-color-rgb), 0.8);
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--secondary-color);
  border: 1px dotted black;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(var(--secondary-color-rgb), 0.8);
}

.volume-value {
  min-width: 40px;
  max-width: 40px;
  text-align: center;
  font-size: 0.7em;
  color: var(--primary-color);
  font-family: "Orbitron", sans-serif;
  flex-shrink: 0;
  line-height: 1;
}

.volume-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dotted var(--secondary-color);
  border-radius: 4px;
  color: var(--secondary-color);
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  transition: all 0.3s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.volume-btn:hover {
  background: rgba(var(--secondary-color-rgb), 0.2);
  transform: scale(1.1);
}

.volume-btn:active {
  transform: scale(0.95);
}
   #pause-overlay nav { margin: 1%; }
   #pause-overlay nav h2 {
     margin: 0.10em;
     width: 100%;
   }
   #pause-overlay h2 { margin: 0.6em 0 0; }
   #pause-overlay img { width: 26%; }
   #pause-overlay #pause-buttons {
     display: flex;
     justify-content: center;
     gap: 0.6rem;
   }
   #pause-overlay .overlay-button, #sound-overlay .overlay-button { border: 1px dotted var(--secondary-color); }
   
   /* Music Controls Compact Styling */
   #sound-overlay h2 {
     margin: 0.4em 0 0.5em;
     font-size: 1.1em;
     text-align: center;
   }
   #sound-overlay .overlay-button-container {
     margin: 0.5em 0;
     gap: 0.4rem;
     display: grid;
     grid-template-columns: repeat(3, 1fr);
     justify-content: center;
   }
   #sound-overlay .overlay-button {
     padding: 0.5em 0.4em;
     font-size: 0.75em;
     box-sizing: border-box;
     width: 100%;
   }
   /* Box look comes from the shared #current-track-wrapper, #sound-track-wrapper rule */
   #sound-track-wrapper {
     padding: 0.4em;
     box-sizing: border-box;
   }
   #sound-track-wrapper .current-track-name {
     font-size: 0.75em;
     padding: 0;
     margin: 0;
     text-align: center;
     overflow: hidden;
     text-overflow: ellipsis;
     white-space: nowrap;
   }
   
   /********************************************************
      ** Confirmation & Reset Overlays
   ********************************************************/
   #reset-confirmation-overlay .overlay-content,
   #replay-confirmation-overlay .overlay-content {
     border-color: var(--primary-color);
     padding: 1em 1em 0.36em;
   }
   #reset-confirmation-overlay #reset-all-confirm-yes,
   #replay-confirmation-overlay #replay-completed-board-confirm-yes {
     border: 1px dotted red;
     color: red;
     background: #ff000006;
   }
   #reset-confirmation-overlay #reset-all-confirm-no,
   #replay-confirmation-overlay #replay-completed-board-confirm-no {
     border: 1px dotted var(--secondary-color);
     color: var(--secondary-color);
     background: #98fb9806;
   }
   
   /********************************************************
      ** Game Over Styles
   ********************************************************/
   #game-over .overlay-content {
     border-color: rgba(220, 53, 69, 0.55);
     background: linear-gradient(
       145deg,
       rgba(0, 0, 0, 0.82) 0%,
       rgba(48, 0, 0, 0.72) 45%,
       rgba(0, 0, 0, 0.78) 100%
     );
   }
   #game-over .overlay-content .overlay-button {
     border-color: red;
     width: 47%;
   }
   
   /********************************************************
      ** Overlay Button Styles in Overlays
   ********************************************************/
   #resume-button, #go-home-button, #mute-button, #skip-button, #vol-down, #vol-up, #sound-mute-button, #sound-skip-button, #sound-vol-down, #sound-vol-up, #replay-completed-board-confirm-yes, #replay-completed-board-confirm-no, #pause-confirmation-overlay #go-to-welcome-confirm-y, #pause-confirmation-overlay #go-to-welcome-confirm-n, #continue-next-level, #continue-board-change, #tier-button-return-home, #board-win-save-go-home, #reset-all-confirm-yes, #reset-all-confirm-no, #sound-prev-button, #sound-loop-random-button, #prev-button, #loop-random-button {
     width: 30%;
   }
   #welcome-screen #reset-all-progress-button {
     width: 100%;
   }
   #go-to-welcome-confirm-y,
   #go-to-welcome-confirm-n,
   #reset-all-confirm-yes,
   #reset-all-confirm-no {
     border-color: white;
   }
   
  /****************************************
     Media Queries - Phone (666px and below)
  ****************************************/
  @media (max-width: 520px) {
    #board-change-overlay .overlay-button-container,
    #winning-feedback .overlay-button-container {
      grid-template-columns: 1fr;
      width: min(100%, 15rem);
    }
  }

  @media (max-width: 666px) {
    #score-panel {
      font-size: 0.86rem;
      padding: 1% 3% 3%;
    }
    #score-panel span:not(.score-label) {
      display: block;
      text-align: center;
    }

    .reveal-all-flex-container {
      gap: 0.35rem;
    }

    .reveal-all-button {
      min-width: 4.6rem;
      padding: 0 0.5rem;
    }

    #reveal-all-chroma-meter {
      font-size: 0.55rem;
    }
    
    /* Welcome Screen Mobile Optimization */
    #welcome-screen .overlay-content {
      max-height: 65vh;
      overflow-y: auto;
      margin: 2vh auto;
    }
    
    /* Music Player Modal Mobile Optimization */
    #sound-overlay .overlay-content {
      max-height: 55vh;
      overflow-y: auto;
      margin: 2vh auto;
      padding: 0.8em 0.6em;
      box-sizing: border-box;
    }
    
    /* Sound Effects Controls Mobile - Single Column */
    #sound-overlay .sound-effects-controls {
      grid-template-columns: 1fr;
      gap: 0.5rem;
      padding: 0.6em;
      margin: 0.8em 0;
    }
    
    #sound-overlay .sound-volume-control {
      margin: 0;
    }
    
    #sound-overlay .sound-volume-control label {
      font-size: 0.7em;
    }
    
    #sound-overlay .overlay-button-container {
      gap: 0.3rem;
      grid-template-columns: repeat(3, 1fr);
    }
    
    #sound-overlay .overlay-button {
      font-size: 0.7em;
      padding: 0.4em 0.3em;
      width: 100%;
    }
    
    #sound-overlay h2 {
      font-size: 1em;
      margin: 0.3em 0 0.4em;
    }
    
    #sound-overlay .volume-value {
      min-width: 36px;
      max-width: 36px;
      font-size: 0.65em;
    }
    
    #sound-overlay .volume-btn {
      width: 24px;
      height: 24px;
      min-width: 24px;
      min-height: 24px;
      font-size: 0.9em;
    }
    
    /* Force Portrait Orientation on Phone */
    html {
      min-height: 100vh;
      min-width: 100vw;
    }
    body {
      transform: none !important;
    }
  }
  
  /* Landscape orientation on phone - DISABLED for iframe compatibility */
  /* @media screen and (orientation: landscape) and (max-width: 666px) {
    body {
      transform: rotate(-90deg) !important;
      transform-origin: left top;
      width: 100vh;
      height: 100vw;
      position: absolute;
      top: 100%;
      left: 0;
    }
  } */
   
   /****************************************
      Animation Keyframes
   ****************************************/
   @keyframes overlayFadeInUp {
     0% {
       opacity: 0;
       transform: translateY(6%);
     }
     100% {
       opacity: 1;
       transform: translateY(0);
     }
   }
   
   @keyframes overlayFadeOutDown {
     0% {
       opacity: 1;
       transform: translateY(0) scale(1);
     }
     100% {
       opacity: 0;
       transform: translateY(8%) scale(0.96);
     }
   }

   /* Save & Exit confirm: a quick lift + neon glow that settles back, reading
      as "saved" before the panel banks away. Uses drop-shadow (not box-shadow)
      to avoid clobbering each overlay's own inset border glow. */
   @keyframes ccmSaveConfirm {
     0% {
       transform: translateY(0) scale(1);
       filter: drop-shadow(0 0 0 rgba(var(--secondary-color-rgb), 0));
     }
     45% {
       transform: translateY(-2%) scale(1.02);
       filter: drop-shadow(0 0 18px rgba(var(--secondary-color-rgb), 0.7));
     }
     100% {
       transform: translateY(0) scale(1);
       filter: drop-shadow(0 0 0 rgba(var(--secondary-color-rgb), 0));
     }
   }

   /* Return-to-home exit: panel rises up, shrinks slightly and softens, the
      opposite of the in-place drop-down used for "back"/cancel dismissals. */
   @keyframes ccmExitHomeLift {
     0% {
       opacity: 1;
       transform: translateY(0) scale(1);
       filter: blur(0);
     }
     100% {
       opacity: 0;
       transform: translateY(-9%) scale(0.94);
       filter: blur(2px);
     }
   }
   
   /****************************************
      Current Track & Animation
   ****************************************/
   #current-track-wrapper,
   #sound-track-wrapper {
     width: 90%;
     background: rgba(0,30,15,0.3);
     border-radius: 4px;
     border: 1px dotted var(--secondary-color);
     margin: auto;
     box-shadow: 0 0 5px rgba(142,255,186,0.3);
   }
   
   #current-track-display,
   #sound-track-display {
     width: 100%;
     text-align: center;
     margin: 0.36em 0;
     font-size: 0.9em;
     color: var(--secondary-color);
     text-shadow: var(--neon-glow);
     overflow: hidden;
     white-space: nowrap;
     padding: 0.3em 0;
     position: relative;
   }
   
   @keyframes fadeInOut {
     0% { opacity: 0; transform: translateY(8px); }
     16% { opacity: 1; transform: translateY(0); }
     90% { opacity: 1; transform: translateY(0); }
     100% { opacity: 0; transform: translateY(-20px); }
   }

   .current-track-name {
     display: inline-block;
     animation: fadeInOut 6.96s infinite;
   }




 /* Streak Timer Styles */
 #time-display.streak-active {
   animation: timerPulse 1s infinite alternate;
   font-family: "Orbitron", sans-serif;
 }

.streak-time-bonus-container {
  background: linear-gradient(135deg, rgb(135 255 0 / 12%), rgb(106 0 255 / 14%));
  border: 1px dotted gold;
  border-radius: 10px;
   padding: .36em 1.76em;
   color: var(--secondary-color);
   text-align: center;
   box-shadow: 0 0 30px 20px rgba(0, 0, 0, 0.36);
   animation: streakBonusAppear 2.86s ease-out forwards, buttonPulse 2s infinite;
   width: fit-content;
   margin: 2% auto 4%;
 }


 .streak-bonus-title {
   font-size: .76em;
   margin-bottom: 0.5rem;
   font-family: "Orbitron", sans-serif;
   text-shadow: 0 0 10px var(--secondary-color);
 }

 .streak-bonus-points {
   margin: -1% 0 0 0;
   font-size: .7em;
   font-weight: 700;
   color: gold;
   text-shadow: 0 0 15px gold;
   font-family: "Orbitron", sans-serif;
   animation: streakBonusAppear 1.86s ease-out forwards, buttonPulse .6s infinite;

 }

 @keyframes streakBonusAppear {
   0% {
     opacity: 0;
   }
   66% {
     opacity: 1;
   }
   100% {
     opacity: 1;
   }
 }


 @keyframes timerPulse {
   from {
     text-shadow: 0 0 5px currentColor;
   }
   to {
     text-shadow: 0 0 15px currentColor;
   }
 }

 /* Low-tries warning (classes toggled in updateAllUI) */
 #tries.tries-low {
   color: #ff5a5a;
   text-shadow: 0 0 8px rgba(255, 0, 0, 0.55);
 }
 #tries.tries-low-flash {
   animation: flashPulseDanger 0.5s ease-in-out 3;
 }


 /* For styling the srollbar */

 /* Width of srollbar */
 ::-webkit-scrollbar {
   width: 8px;
 }

 /* Track Color*/
 ::-webkit-scrollbar-track 
 {
   background: #333;
   border: 1px solid var(--secondary-color);
 }

 /* Handle Color and Width via border*/
 ::-webkit-scrollbar-thumb 
 { 
   background: var(--secondary-color);
   border: 1px solid transparent;
   border-radius: 10px;
   background-clip: content-box;
 }


/* ============================================================
   TIER CARD REVEAL — pop + twirl (loading-screen style) before
   the board transition into a new tier. Tap the card to advance.
   ============================================================ */
.tier-card-reveal {
  --tier-reveal-accent-rgb: 152, 251, 152;
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.42s ease;
}
.tier-card-reveal.show {
  opacity: 1;
  pointer-events: all;
}
.tier-card-reveal__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--tier-reveal-accent-rgb), 0.14), transparent 60%),
    rgba(2, 6, 10, 0.82);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.tier-card-reveal__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  perspective: 1100px;
}
.tier-card-reveal__card {
  position: relative;
  width: min(64vw, 270px);
  aspect-ratio: 3 / 4;
  cursor: pointer;
  transform-style: preserve-3d;
  border: none;
  background: transparent;
  outline: none;
  transform: scale(0.4);
  opacity: 0;
}
.tier-card-reveal.show .tier-card-reveal__card {
  animation: tierRevealPop 0.62s cubic-bezier(0.18, 0.9, 0.24, 1.2) forwards;
}
.tier-card-reveal__card:focus-visible {
  box-shadow: 0 0 0 3px rgba(var(--tier-reveal-accent-rgb), 0.6);
  border-radius: 1rem;
}
.tier-card-reveal__inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
}
.tier-card-reveal.is-twirling .tier-card-reveal__inner {
  animation: tierRevealTwirl 2.6s cubic-bezier(0.45, 0.05, 0.2, 1) infinite;
}
.tier-card-reveal__face {
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1.5px solid rgba(var(--tier-reveal-accent-rgb), 0.55);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.6),
    0 0 26px rgba(var(--tier-reveal-accent-rgb), 0.28),
    inset 0 0 18px rgba(0, 0, 0, 0.45);
}
.tier-card-reveal__back::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--tier-reveal-accent-rgb), 0.12), transparent 54%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='rgba(100,220,220,0.42)'/%3E%3C/svg%3E");
  background-size: auto, 8px 8px;
  opacity: 0.62;
  mix-blend-mode: screen;
}
.tier-card-reveal__front {
  transform: rotateY(180deg);
  background: #061119;
}
.tier-card-reveal__back {
  background-color: #061018;
  background-image:
    radial-gradient(circle at 50% 38%, rgba(var(--tier-reveal-accent-rgb), 0.24), transparent 62%),
    linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.92) 0 2px, rgba(var(--ccm-neon-lime-rgb), 0.8) 2px 4px, transparent 4px calc(100% - 4px), rgba(var(--ccm-neon-cyan-rgb), 0.84) calc(100% - 4px) calc(100% - 2px), rgba(var(--ccm-neon-pink-rgb), 0.78) calc(100% - 2px) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='rgba(100,220,220,0.36)'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #143038 0%, #071d27 48%, #030812 100%);
  background-size: auto, auto, 8px 8px, auto;
  border-color: rgba(var(--tier-reveal-accent-rgb), 0.72);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.6),
    0 0 26px rgba(var(--tier-reveal-accent-rgb), 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -4px 14px rgba(0, 0, 0, 0.72),
    inset 0 0 0 4px rgba(3, 9, 14, 0.94);
}
.tier-card-reveal__back::before {
  content: "";
  position: absolute;
  inset: 9%;
  z-index: 1;
  border-radius: 0.72rem;
  border: 1.5px solid rgba(var(--tier-reveal-accent-rgb), 0.44);
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--ccm-neon-cyan-rgb), 0.2), transparent 46%),
    radial-gradient(circle at 30% 72%, rgba(var(--ccm-neon-pink-rgb), 0.16), transparent 38%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.07), transparent 36%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='rgba(100,220,220,0.24)'/%3E%3C/svg%3E"),
    linear-gradient(165deg, rgba(12, 34, 44, 0.92), rgba(2, 8, 14, 0.96));
  background-size: auto, auto, auto, 8px 8px, auto;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.58),
    0 0 12px rgba(var(--tier-reveal-accent-rgb), 0.16);
  pointer-events: none;
}
.tier-card-reveal__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.02) brightness(0.94);
}
.tier-card-reveal__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.4rem 0.9rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 8%, rgba(0, 0, 0, 0.64) 62%, rgba(0, 0, 0, 0.12) 100%);
}
.tier-card-reveal__tier {
  font-family: "Orbitron", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(var(--tier-reveal-accent-rgb));
  text-shadow: 0 0 8px rgba(var(--tier-reveal-accent-rgb), 0.55);
}
.tier-card-reveal__name {
  font-family: "Orbitron", sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.tier-card-reveal__prompt {
  width: fit-content;
  max-width: 100%;
  align-self: center;
  margin-top: 0.08rem;
  padding: 0.16rem 0.42rem;
  border: 1px solid rgba(var(--tier-reveal-accent-rgb), 0.34);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.46);
  font-family: "Orbitron", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(var(--tier-reveal-accent-rgb), 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.88);
}
.tier-card-reveal__hint {
  appearance: none;
  border: 1px solid rgba(var(--tier-reveal-accent-rgb), 0.32);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.38);
  padding: 0.36rem 0.92rem;
  margin: 0;
  cursor: pointer;
  font-family: "Orbitron", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  animation: tierRevealHintPulse 1.8s ease-in-out infinite;
}
.tier-card-reveal__hint:hover,
.tier-card-reveal__hint:focus-visible {
  color: rgb(var(--tier-reveal-accent-rgb));
  border-color: rgba(var(--tier-reveal-accent-rgb), 0.68);
  box-shadow: 0 0 14px rgba(var(--tier-reveal-accent-rgb), 0.2);
  outline: none;
}
.tier-card-reveal.is-dismissing .tier-card-reveal__card {
  animation: tierRevealFly 0.52s cubic-bezier(0.5, 0, 0.75, 0.2) forwards;
}
.tier-card-reveal.is-dismissing .tier-card-reveal__hint {
  opacity: 0;
  transition: opacity 0.2s ease;
}

@keyframes tierRevealPop {
  0% { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.06) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes tierRevealTwirl {
  0%, 12% { transform: rotateY(0deg); }
  44%, 56% { transform: rotateY(180deg); }
  88%, 100% { transform: rotateY(360deg); }
}
@keyframes tierRevealFly {
  0% { transform: scale(1) rotateY(0deg); opacity: 1; }
  100% { transform: scale(1.5) rotateY(220deg) translateY(-12%); opacity: 0; }
}
@keyframes tierRevealHintPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

@media (prefers-reduced-motion: reduce) {
  .tier-card-reveal.show .tier-card-reveal__card { animation: none; transform: scale(1); opacity: 1; }
  .tier-card-reveal.is-twirling .tier-card-reveal__inner { animation: none; transform: rotateY(180deg); }
  .tier-card-reveal.is-dismissing .tier-card-reveal__card { animation: none; opacity: 0; transition: opacity 0.2s ease; }
  .tier-card-reveal__hint { animation: none; }
}

/* === CCM soft carousel and dormant slots overrides === */
#welcome-screen .welcome-tier-tabs {
  border-color: rgba(var(--welcome-chrome-accent-rgb, var(--primary-color-rgb)), 0.3);
  background:
    radial-gradient(ellipse 42% 110% at 50% 50%, rgba(var(--welcome-chrome-accent-rgb, var(--primary-color-rgb)), 0.12), transparent 72%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 16, 20, 0.62), rgba(0, 0, 0, 0.72));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    inset 0 0 16px rgba(0, 0, 0, 0.58),
    0 0 14px rgba(var(--welcome-chrome-accent-rgb, var(--primary-color-rgb)), 0.1);
}

#welcome-screen .welcome-tier-tab {
  border-style: solid;
  border-color: rgba(var(--tier-accent-rgb, var(--primary-color-rgb)), 0.28);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.78), rgba(0, 12, 16, 0.72) 52%, rgba(0, 0, 0, 0.84)),
    radial-gradient(ellipse 78% 90% at 50% 18%, rgba(var(--tier-accent-rgb, var(--primary-color-rgb)), 0.1), transparent 68%),
    var(--tier-art-image, none) center / cover no-repeat;
  color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    inset 0 0 12px rgba(0, 0, 0, 0.66),
    0 1px 8px rgba(0, 0, 0, 0.35);
}

#welcome-screen .welcome-tier-tab::before {
  inset: -0.18rem;
  border-radius: 10px;
  background:
    radial-gradient(ellipse 90% 78% at 50% 50%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.26), transparent 70%),
    radial-gradient(ellipse 120% 70% at 50% 50%, rgba(var(--ccm-neon-cyan-rgb), 0.08), transparent 76%);
  filter: blur(1.5px);
}

#welcome-screen .welcome-tier-tab::after {
  bottom: -0.12rem;
  height: 0.12rem;
  background: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.92);
  box-shadow:
    0 0 8px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.58),
    0 0 12px rgba(var(--ccm-neon-cyan-rgb), 0.16);
}

#welcome-screen .welcome-tier-tab.active,
#welcome-screen .welcome-tier-tab[aria-selected="true"] {
  background:
    linear-gradient(90deg, rgba(var(--tier-accent-rgb, var(--primary-color-rgb)), 0.22), rgba(255, 255, 255, 0.08), rgba(var(--tier-accent-rgb, var(--primary-color-rgb)), 0.18)) top / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(0, 0, 0, 0.58), rgba(0, 18, 22, 0.58) 54%, rgba(0, 0, 0, 0.74)),
    radial-gradient(ellipse 72% 86% at 50% 18%, rgba(var(--tier-accent-rgb, var(--primary-color-rgb)), 0.2), transparent 70%),
    var(--tier-art-image, none) center / cover no-repeat;
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.72);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.48),
    0 0 14px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.34),
    inset 0 0 0 1px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.16),
    inset 0 0 14px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.1);
}

#welcome-screen .welcome-tier-tab.locked {
  opacity: 0.54;
  border-color: rgba(255, 255, 255, 0.12) !important;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.86), rgba(8, 0, 10, 0.88) 52%, rgba(0, 0, 0, 0.92)),
    radial-gradient(ellipse 60% 80% at 50% 20%, rgba(255, 255, 255, 0.04), transparent 70%);
  color: rgba(255, 210, 220, 0.62);
}

#welcome-screen .tier-carousel-card {
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 22%),
    radial-gradient(ellipse 76% 52% at 50% 24%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.1), transparent 70%),
    linear-gradient(160deg, rgba(0, 0, 0, 0.78), rgba(0, 18, 22, 0.66) 52%, rgba(0, 0, 0, 0.84));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 0 18px rgba(0, 0, 0, 0.52),
    0 2px 12px rgba(0, 0, 0, 0.34);
}

#welcome-screen .tier-carousel-card::before {
  background:
    linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.24) 0 1px, rgba(var(--ccm-neon-lime-rgb), 0.18) 1px 2px, transparent 2px calc(100% - 2px), rgba(var(--ccm-neon-cyan-rgb), 0.22) calc(100% - 2px) calc(100% - 1px), rgba(var(--ccm-neon-pink-rgb), 0.18) calc(100% - 1px) 100%),
    radial-gradient(circle at 13% 84%, rgba(var(--ccm-neon-pink-rgb), 0.1), transparent 20%),
    radial-gradient(circle at 88% 18%, rgba(var(--ccm-neon-cyan-rgb), 0.1), transparent 18%),
    radial-gradient(ellipse 80% 55% at 50% 105%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.08), transparent 62%);
  opacity: 0.56;
}

#welcome-screen .tier-carousel-card::after {
  inset: 0.24rem;
  border-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.045), transparent 30%),
    radial-gradient(ellipse 70% 90% at 50% 12%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.06), transparent 70%);
  box-shadow:
    inset 0 0 0 1px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.08),
    inset 0 0 18px rgba(0, 0, 0, 0.38);
  opacity: 0.72;
}

#welcome-screen .tier-carousel-card__tier-art::after,
#welcome-screen .tier-carousel-card__bridge-art::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.36) 30%, rgba(0, 0, 0, 0.54) 64%, rgba(0, 0, 0, 0.78) 100%),
    radial-gradient(ellipse 78% 48% at 50% 42%, rgba(0, 0, 0, 0.34), transparent 64%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.24) 42%, rgba(0, 0, 0, 0.08) 78%);
}

#welcome-screen .tier-carousel-card__tier-art img,
#welcome-screen .tier-carousel-card__bridge-art img {
  opacity: 0.5;
  filter: saturate(1) brightness(0.9);
}

#welcome-screen .tier-carousel-slide.is-active .tier-carousel-card {
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.045),
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.28),
    0 0 16px rgba(var(--ccm-neon-cyan-rgb), 0.08);
}

#welcome-screen .tier-carousel-slide:has(.difficulty-option.locked) .tier-carousel-card,
#welcome-screen .tier-carousel-slide.is-locked .tier-carousel-card {
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.2);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.82), rgba(12, 2, 12, 0.78) 54%, rgba(0, 0, 0, 0.9)),
    radial-gradient(ellipse 70% 80% at 50% 20%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.055), transparent 70%);
  opacity: 0.78;
}

#welcome-screen .tier-carousel-card__btn.locked {
  color: rgba(255, 215, 225, 0.72) !important;
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.22) !important;
  background: rgba(20, 4, 12, 0.78) !important;
}

#welcome-screen .welcome-tier-tab.locked {
  opacity: 0.76;
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.24) !important;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.86), rgba(2, 10, 12, 0.82) 52%, rgba(0, 0, 0, 0.92)),
    radial-gradient(ellipse 70% 80% at 50% 18%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.1), transparent 72%);
  color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.08),
    inset 0 0 12px rgba(0, 0, 0, 0.72),
    0 0 10px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.1) !important;
}

#welcome-screen .welcome-tier-tab.locked .welcome-tier-tab__num {
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.24);
  background:
    radial-gradient(ellipse 80% 130% at 50% 18%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.12), transparent 68%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.62));
  color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.84);
  text-shadow:
    0 0 7px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.32),
    0 1px 4px rgba(0, 0, 0, 0.94);
}

#welcome-screen .welcome-tier-tab.locked .welcome-tier-tab__num::after,
#welcome-screen .tier-carousel-card__lock,
#welcome-screen .tier-carousel-dot.locked::after {
  filter:
    drop-shadow(0 0 4px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.72))
    drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
}

#welcome-screen .tier-carousel-slide:has(.difficulty-option.locked) .tier-carousel-card,
#welcome-screen .tier-carousel-slide.is-locked .tier-carousel-card {
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.3);
  box-shadow:
    inset 0 0 0 1px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.06),
    inset 0 0 18px rgba(0, 0, 0, 0.58),
    0 0 14px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.1);
}

#welcome-screen .tier-carousel-card__btn.locked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.78) !important;
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.34) !important;
  background:
    radial-gradient(ellipse 80% 110% at 50% 8%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.09), transparent 66%),
    rgba(10, 8, 13, 0.82) !important;
}

#welcome-screen .tier-carousel-card__btn.locked::before {
  content: "";
  display: inline-block;
  width: 0.78rem;
  height: 0.78rem;
  flex: 0 0 auto;
  background: url("../assets/images/gridTierLocks_gold.webp") no-repeat center / contain;
  filter:
    drop-shadow(0 0 4px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.72))
    drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
  opacity: 0.94;
}

#welcome-screen .tier-carousel-dot.locked {
  background: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.28),
    0 0 8px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.18);
}

#welcome-screen .tier-carousel-dot.locked.active {
  background: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.28);
  box-shadow:
    0 0 8px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.46),
    inset 0 0 0 1px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.3);
}

@supports (-webkit-mask-image: url("../assets/images/gridTierLocks_gold.webp")) {
  #welcome-screen .welcome-tier-tab.locked .welcome-tier-tab__num::after,
  #welcome-screen .tier-carousel-card__lock,
  #welcome-screen .tier-carousel-card__btn.locked::before,
  #welcome-screen .tier-carousel-dot.locked::after {
    background: rgb(var(--tier-accent-rgb, var(--secondary-color-rgb)));
    -webkit-mask-image: url("../assets/images/gridTierLocks_gold.webp");
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
  }

  #welcome-screen .tier-carousel-dot.locked::after {
    background-image: none;
    -webkit-mask-size: 0.62rem 0.62rem;
  }
}

#welcome-screen .tier-carousel-card__star.is-missed {
  opacity: 0.84;
  background:
    radial-gradient(circle at 50% 46%, rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.12), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.5));
  border-color: rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.18);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.72),
    inset 0 0 8px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.08);
}

#welcome-screen .tier-carousel-card__star.is-missed::before,
#welcome-screen .tier-carousel-card__star.is-missed::after {
  width: 68%;
  height: 16%;
  background: linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.68), rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.7));
  box-shadow:
    0 0 5px rgba(var(--tier-accent-rgb, var(--secondary-color-rgb)), 0.22),
    inset 0 0 2px rgba(255, 255, 255, 0.16);
}

.card.disabled {
  cursor: default;
  pointer-events: none;
  opacity: 1;
  filter: saturate(0.88) brightness(0.92);
}

.card.disabled .card-back,
.card.disabled .card-front,
.card.disabled .card-face {
  overflow: hidden;
  opacity: 0.86;
  background:
    radial-gradient(circle at 50% 38%, rgba(var(--ccm-current-tier-accent-rgb), 0.12), transparent 62%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.42)),
    var(--ccm-card-glass-bg);
  background-size: auto, auto, auto, auto, 8px 8px, auto;
  border: 1px solid rgba(var(--ccm-current-tier-accent-rgb), 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -4px 14px rgba(0, 0, 0, 0.76),
    inset 0 0 0 3px rgba(3, 9, 14, 0.86),
    0 1px 8px rgba(0, 0, 0, 0.28);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.card.disabled .card-face::before {
  content: "";
  position: absolute;
  inset: 10%;
  z-index: 1;
  border-radius: 5px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--ccm-current-tier-accent-rgb), 0.12), transparent 50%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 36%),
    linear-gradient(165deg, rgba(8, 26, 34, 0.72), rgba(2, 8, 14, 0.86));
  border: 1px solid rgba(var(--ccm-current-tier-accent-rgb), 0.22);
  box-shadow:
    inset 0 0 14px rgba(0, 0, 0, 0.58),
    0 0 8px rgba(var(--ccm-current-tier-accent-rgb), 0.08);
}

.card.disabled .card-face::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 44%, rgba(var(--ccm-current-tier-accent-rgb), 0.08), transparent 52%),
    linear-gradient(120deg, transparent 0 38%, rgba(255, 255, 255, 0.035) 45%, transparent 54% 100%);
  opacity: 0.64;
  mix-blend-mode: screen;
}

.disabled-indicator {
  inset: 0;
  z-index: 4;
  overflow: hidden;
}

.disabled-indicator::before {
  content: "";
  position: absolute;
  width: 54%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(var(--ccm-current-tier-accent-rgb), 0.2);
  background:
    radial-gradient(circle at 50% 50%, rgba(var(--ccm-current-tier-accent-rgb), 0.12), transparent 58%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.28), transparent 72%);
  box-shadow:
    0 0 12px rgba(var(--ccm-current-tier-accent-rgb), 0.08),
    inset 0 0 10px rgba(0, 0, 0, 0.52);
  opacity: 0.72;
  animation: ccmDormantSealBreath 4.8s ease-in-out infinite;
}

.disabled-pattern {
  inset: 0;
  width: auto;
  height: auto;
  z-index: 1;
  opacity: 0.44;
  background:
    radial-gradient(circle at 24% 24%, rgba(var(--ccm-current-tier-accent-rgb), 0.16) 0 2px, transparent 2.5px),
    repeating-linear-gradient(135deg, rgba(var(--ccm-current-tier-accent-rgb), 0.05) 0 1px, transparent 1px 10px),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.34));
  background-size: 12px 12px, auto, auto;
  mix-blend-mode: screen;
}

.disabled-x {
  z-index: 2;
  width: 46%;
  height: 46%;
  opacity: 0.86;
  filter:
    drop-shadow(0 0 5px rgba(var(--ccm-current-tier-accent-rgb), 0.22))
    drop-shadow(0 1px 4px rgba(0, 0, 0, 0.72));
}

.disabled-x::before,
.disabled-x::after {
  width: 78%;
  height: 15%;
  background:
    linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.58), rgba(var(--ccm-current-tier-accent-rgb), 0.72), rgba(var(--ccm-neon-cyan-rgb), 0.52));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 7px rgba(var(--ccm-current-tier-accent-rgb), 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.38);
}

@keyframes ccmDormantSealBreath {
  0%, 100% {
    opacity: 0.46;
    transform: scale(0.94);
  }
  50% {
    opacity: 0.78;
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .disabled-indicator::before {
    animation: none;
  }
}
/* === end CCM soft carousel and dormant slots overrides === */


/* === CCM richer tier transition overlays === */
.tier-transition-board-art {
  isolation: isolate;
  background:
    radial-gradient(ellipse 74% 58% at 50% 44%, rgba(var(--ccm-current-tier-accent-rgb), 0.12), transparent 68%),
    radial-gradient(circle at 16% 82%, rgba(var(--ccm-neon-pink-rgb), 0.08), transparent 26%),
    radial-gradient(circle at 86% 18%, rgba(var(--ccm-neon-cyan-rgb), 0.08), transparent 24%),
    rgba(0, 0, 0, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(var(--ccm-current-tier-accent-rgb), 0.12),
    inset 0 0 28px rgba(0, 0, 0, 0.72);
}

.tier-transition-board-art::before {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: 4;
  pointer-events: none;
  opacity: 0.32;
  background:
    radial-gradient(ellipse 48% 34% at 50% 46%, rgba(var(--ccm-current-tier-accent-rgb), 0.28), transparent 70%),
    radial-gradient(circle at 30% 70%, rgba(var(--ccm-neon-pink-rgb), 0.13), transparent 30%),
    radial-gradient(circle at 72% 24%, rgba(var(--ccm-neon-cyan-rgb), 0.14), transparent 28%);
  filter: blur(10px);
  mix-blend-mode: screen;
  animation: tierBoardArtVeilPulse 1.65s ease-out forwards;
}

.tier-transition-board-art::after {
  z-index: 5;
  background:
    linear-gradient(115deg, transparent 0 36%, rgba(255, 255, 255, 0.08) 45%, transparent 56% 100%),
    radial-gradient(ellipse 68% 48% at 50% 44%, rgba(0, 0, 0, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.72));
  animation: tierBoardArtSheen 1.52s ease-out forwards;
}

.tier-transition-board-art__layer {
  overflow: hidden;
}

.tier-transition-board-art__layer::before,
.tier-transition-board-art__layer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tier-transition-board-art__layer::before {
  inset: -9%;
  opacity: 0.24;
  filter: blur(5px) saturate(1.08);
  mix-blend-mode: screen;
}

.tier-transition-board-art__layer::after {
  opacity: 0.34;
  background:
    radial-gradient(ellipse 72% 40% at 50% 96%, rgba(var(--ccm-current-tier-accent-rgb), 0.18), transparent 68%),
    linear-gradient(90deg, rgba(var(--ccm-neon-pink-rgb), 0.12), transparent 16% 84%, rgba(var(--ccm-neon-cyan-rgb), 0.12));
  mix-blend-mode: screen;
}

.tier-transition-board-art__layer--old::before {
  background:
    radial-gradient(ellipse 76% 56% at 50% 44%, transparent, rgba(0, 0, 0, 0.52) 74%),
    var(--tier-old-image) top center / cover no-repeat;
  animation: tierBoardArtOldEcho 1.22s cubic-bezier(0.45, 0, 0.35, 1) forwards;
}

.tier-transition-board-art__layer--new::before {
  background:
    radial-gradient(ellipse 76% 56% at 50% 44%, transparent, rgba(0, 0, 0, 0.44) 74%),
    var(--tier-new-image) top center / cover no-repeat;
  animation: tierBoardArtNewEcho 1.36s 0.42s cubic-bezier(0.25, 0.84, 0.28, 1) forwards;
}


@keyframes tierBoardArtVeilPulse {
  0% { opacity: 0; transform: scale(0.92); }
  40% { opacity: 0.34; transform: scale(1.02); }
  100% { opacity: 0.18; transform: scale(1.08); }
}

@keyframes tierBoardArtSheen {
  0% { opacity: 0; transform: translateX(-18%); }
  45% { opacity: 0.42; }
  100% { opacity: 0.18; transform: translateX(18%); }
}

@keyframes tierBoardArtOldEcho {
  0% { opacity: 0.24; transform: scale(1.08); }
  100% { opacity: 0; transform: scale(0.88); }
}

@keyframes tierBoardArtNewEcho {
  0% { opacity: 0; transform: scale(0.94); }
  58% { opacity: 0.28; transform: scale(1.08); }
  100% { opacity: 0.13; transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .tier-transition-board-art::before,
  .tier-transition-board-art::after,
  .tier-transition-board-art__layer::before,
  .tier-transition-board-art__layer::after {
    animation: none !important;
  }
}
/* === end CCM richer tier transition overlays === */

/* === CCM 3D card depth pass === */
.card {
  --ccm-card-tilt-x: 0deg;
  --ccm-card-tilt-y: 0deg;
  --ccm-card-lift: 0px;
  --ccm-card-scale: 1;
  --ccm-card-glare-x: 50%;
  --ccm-card-glare-y: 38%;
  transform-origin: center center;
  transform:
    translateY(var(--ccm-card-lift))
    rotateX(var(--ccm-card-tilt-x))
    rotateY(var(--ccm-card-tilt-y))
    scale(var(--ccm-card-scale));
}

.card.active {
  will-change: transform;
}

.card.flipped {
  transform:
    translateY(var(--ccm-card-lift))
    rotateX(var(--ccm-card-tilt-x))
    rotateY(calc(180deg + var(--ccm-card-tilt-y)))
    scale(var(--ccm-card-scale));
}

.card.active:not(.flipped):not(.matched):not(.disabled):hover {
  --ccm-card-lift: -3px;
  --ccm-card-scale: 1.025;
  transform:
    translateY(var(--ccm-card-lift))
    rotateX(var(--ccm-card-tilt-x))
    rotateY(var(--ccm-card-tilt-y))
    scale(var(--ccm-card-scale));
}

.card.active.card-3d-pressed:not(.flipped):not(.matched):not(.disabled):hover {
  --ccm-card-lift: -1px;
  --ccm-card-scale: 0.992;
}

.card:not(.first-flipped)::before {
  content: "";
  position: absolute;
  inset: 2px -2px -2px 2px;
  z-index: 0;
  border-radius: 8px;
  transform: translateZ(-3px);
  pointer-events: none;
  opacity: 0.46;
  background:
    linear-gradient(126deg, rgba(255, 255, 255, 0.1), rgba(var(--ccm-current-tier-accent-rgb), 0.12) 28%, rgba(1, 5, 9, 0.58) 70%),
    rgba(0, 0, 0, 0.38);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.28),
    0 0 8px rgba(var(--ccm-current-tier-accent-rgb), 0.08);
}

.card .card-face {
  z-index: 1;
  transform-style: preserve-3d;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 2px 0 0 rgba(255, 255, 255, 0.06),
    inset -2px 0 0 rgba(0, 0, 0, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.26);
}

.card .card-back:not(.disabled-back) {
  transform: translateZ(2.4px);
  box-shadow:
    var(--ccm-card-glass-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    inset 2px 0 0 rgba(255, 255, 255, 0.06),
    inset -2px 0 0 rgba(0, 0, 0, 0.22),
    inset 0 -3px 9px rgba(0, 0, 0, 0.56),
    inset 0 0 0 3px rgba(4, 12, 18, 0.82),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.card .card-back:not(.disabled-back)::after {
  background:
    radial-gradient(circle at var(--ccm-card-glare-x) var(--ccm-card-glare-y), rgba(255, 255, 255, 0.12), transparent 22%),
    radial-gradient(circle at 50% 42%, rgba(var(--ccm-current-tier-accent-rgb), 0.11), transparent 54%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='rgba(100,220,220,0.42)'/%3E%3C/svg%3E");
  background-size: auto, auto, 8px 8px;
}

.card.card-3d-active .card-back:not(.disabled-back)::after {
  opacity: 0.54;
}

.card .card-front {
  transform: rotateY(180deg) translateZ(2.4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 2px 0 0 rgba(255, 255, 255, 0.1),
    inset -2px 0 0 rgba(0, 0, 0, 0.14),
    inset 0 -7px 15px rgba(0, 0, 0, 0.1),
    0 7px 18px rgba(0, 0, 0, 0.22);
}

.card .card-front::after {
  background:
    radial-gradient(circle at var(--ccm-card-glare-x) var(--ccm-card-glare-y), rgba(255, 255, 255, 0.28), transparent 23%),
    linear-gradient(126deg, #aebcbf 0%, #6e7774 56%, #250f36 56%, #0a080985 86%);
}

.card.card-3d-active .card-front::after {
  opacity: 0.22;
}

.tier-card-reveal__card {
  --ccm-card-glare-x: 50%;
  --ccm-card-glare-y: 38%;
}

.tier-card-reveal__inner::before,
.tier-card-reveal__inner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  pointer-events: none;
}

.tier-card-reveal__inner::before {
  inset: 2px -4px -4px 2px;
  transform: translateZ(-8px) scale(0.985);
  background: linear-gradient(130deg, rgba(var(--tier-reveal-accent-rgb), 0.16), rgba(0, 0, 0, 0.56) 52%, rgba(0, 0, 0, 0.78));
  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(var(--tier-reveal-accent-rgb), 0.18);
}

.tier-card-reveal__inner::after {
  z-index: 4;
  transform: translateZ(8px);
  background:
    radial-gradient(circle at var(--ccm-card-glare-x) var(--ccm-card-glare-y), rgba(255, 255, 255, 0.12), transparent 21%),
    linear-gradient(130deg, rgba(255, 255, 255, 0.08), transparent 36%, rgba(255, 255, 255, 0.03) 62%, transparent 74%);
  mix-blend-mode: screen;
  opacity: 0.13;
}

.tier-card-reveal__face {
  transform-style: preserve-3d;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.52),
    0 0 24px rgba(var(--tier-reveal-accent-rgb), 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 2px 0 0 rgba(255, 255, 255, 0.1),
    inset -3px 0 0 rgba(0, 0, 0, 0.18),
    inset 0 -8px 18px rgba(0, 0, 0, 0.28);
}

.tier-card-reveal__back {
  transform: translateZ(5px);
}

.tier-card-reveal__front {
  transform: rotateY(180deg) translateZ(5px);
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card.flipped,
  .card.active:not(.flipped):not(.matched):not(.disabled):hover {
    --ccm-card-tilt-x: 0deg;
    --ccm-card-tilt-y: 0deg;
  }
}
/* === end CCM 3D card depth pass === */
