@font-face {
  font-family: 'FFFFORWA';
  src: url('FFFFORWA.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root{
  /* Rarity colors */
  --toZero: calc(-1 * var(--start-deg) - 270deg + var(--nudge));
  --nudge: 0deg;
  --wheel-rot: calc(-1 * var(--start-deg) + var(--nudge));
  --uncommon:#80FF00;
  --rare:#2196F3;
  --epic:#E040FB;
  --legendary:#FBC02D;
  --relic:#ed4242;
  --contraband:#292929;
  --unobtainable:#FF00FF;

  /* Probabilities (%) — sum ~ 100 */
  --p-rare: 48;
  --p-epic: 35;
  --p-legendary: 14;
  --p-relic: 2.49;
  --p-contraband: 0.5;
  --p-unob: 0.01;

  /* Cumulative stops (%) for building the conic gradient */
  --c-rare: calc(var(--p-rare)*1%);
  --c-epic: calc((var(--p-rare)+var(--p-epic))*1%);
  --c-leg:  calc((var(--p-rare)+var(--p-epic)+var(--p-legendary))*1%);
  --c-relic:calc((var(--p-rare)+var(--p-epic)+var(--p-legendary)+var(--p-relic))*1%);
  --c-contr:calc((var(--p-rare)+var(--p-epic)+var(--p-legendary)+var(--p-relic)+var(--p-contraband))*1%);
  --c-unob: calc((var(--p-rare)+var(--p-epic)+var(--p-legendary)+var(--p-relic)+var(--p-contraband)+var(--p-unob))*1%);

  /* Sizing */
  --wheel-size: clamp(320px, 80vmin, 520px);
  --outer-rim-width: 0.34px; /* Reduced by 66% (1px * 0.34) */
  --ring-inset: 16px;
  --inner-rim-size: 280px;
  --hub-size: 200px;

  /* Reflect colors across x then y => +180deg */
  --start-deg-base: -98deg;
  --start-deg: calc(var(--start-deg-base) + 180deg);

  /* Rings / shadows */
  --rim-color:#2f2f2f;
  --rim-color-2:#1e1e1e;
  --shadow-outer: 0 10px 26px rgba(0,0,0,.55);
  --shadow-inset: inset 0 18px 30px rgba(255,255,255,.06),
                  inset 0 -18px 30px rgba(0,0,0,.55);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{
  min-height:100vh; /* Allow content to extend beyond viewport */
  background: radial-gradient(1400px 900px at 30% 20%, #132140, #0f1d38 55%, #0d1830 100%);
  color:#eaeaea;
  font-family:'FFFFORWA','Press Start 2P',system-ui,sans-serif;
  overflow-x:hidden; /* Allow vertical scrolling */
  overflow-y:auto; /* Enable vertical scrolling when needed */
  touch-action: manipulation; /* Prevent zoom on double-tap */
  -webkit-touch-callout: none; /* Prevent callout on iOS */
  -webkit-user-select: none; /* Prevent text selection */
  user-select: none;
}

/* Main Container */
.main-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Wheel Section */
.wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 2rem 1rem;
  gap: 3.5rem;
}

/* Wheel Container */
.wheel-container {
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
}

/* Heroic Section */
.heroic-section {
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

.wheel{
  position:relative;
  width:var(--wheel-size);
  height:var(--wheel-size);
  border-radius:50%;
  filter:drop-shadow(0 10px 34px rgba(0,0,0,.5));
  will-change: transform; /* GPU acceleration hint */
  transform-style: preserve-3d; /* Enable 3D transforms */
  backface-visibility: hidden; /* Prevent flickering */
  -webkit-backface-visibility: hidden;
}

/* Desktop Layout (≥1024px) */
@media (min-width: 1024px) {
  .main-container {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: 
      "wheel heroic"
      "wheel heroic";
    min-height: 100vh;
  }
  
  .wheel-section {
    grid-area: wheel;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 2rem;
    gap: 2rem;
  }
  
  .heroic-section {
    grid-area: heroic;
    position: sticky;
    top: 2rem;
    align-self: start;
    padding: 2rem 2rem 2rem 0;
    width: 360px;
  }
  
  .wheel {
    transform: scale(1.2);
    transform-origin: center;
  }
  
  /* Scale item display proportionally */
  .item-image {
    width: calc(var(--wheel-size) * 0.75 * 1.2);
    height: calc(var(--wheel-size) * 0.75 * 1.2);
  }
  
  /* Use same floating animation for all devices */
  .result-item.show {
    animation: float 2s ease-in-out infinite;
  }
  
  /* Double chat height for desktop users */
  .chat-messages-container.show {
    max-height: 400px !important; /* 2x the mobile height (200px) */
  }
  
  .chat-messages-container .chat-messages {
    max-height: 400px !important; /* 2x the mobile height (200px) */
  }
}

/* OUTER RIM */
.outer-rim{
  position:absolute; 
  inset:0; 
  border-radius:50%;
  background:var(--rim-color);
  box-shadow: inset 0 10px 14px rgba(255,255,255,.06),
              inset 0 -10px 14px rgba(0,0,0,.45),
              var(--shadow-outer);
}
.outer-rim::after{
  content:""; 
  position:absolute; 
  inset:var(--outer-rim-width); 
  border-radius:50%;
  background:transparent;
}

/* COLORED DONUT — hard-coded stops so all browsers render it */
.segments{
  position:absolute;
  inset: calc(var(--outer-rim-width) + var(--ring-inset));
  border-radius:50%;
  background:
    conic-gradient(
      from var(--start-deg),
      var(--rare)        0%   48%,
      var(--epic)        48%  83%,
      var(--legendary)   83%  97%,
      var(--relic)       97%  99.49%,
      var(--contraband)  99.49% 99.99%,
      var(--unobtainable) 99.99% 100%
    );
  box-shadow:
    0 0 0 2px #1c1c1c,
    inset 0 0 0 2px #1b1b1b,
    var(--shadow-inset);
  transform: rotate(var(--toZero));
  transform-origin: 50% 50%;
}

/* Unobtainable: draw a separate conic that ALWAYS starts at 0deg (0 rad) */
.segments::before{
  content:"";
  position:absolute; 
  inset:0; 
  border-radius:50%;
  background:
    conic-gradient(
      from var(--start-deg),
      transparent 0 var(--c-contr),
      red var(--c-contr) var(--c-unob),
      transparent var(--c-unob) 100%
    );
  -webkit-mask: radial-gradient(circle closest-side, #0000 calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(circle closest-side, #0000 calc(100% - 2px), #000 calc(100% - 1.5px));
  pointer-events:none;
}

.segments::after{
  content:""; 
  position:absolute; 
  inset:0; 
  border-radius:50%;
  background:
    radial-gradient(60% 60% at 65% 35%, rgba(255,255,255,.16), transparent 60%),
    radial-gradient(60% 60% at 35% 70%, rgba(0,0,0,.35), transparent 65%);
  mix-blend-mode:soft-light; 
  pointer-events:none;
}

/* INNER RIM (thicker look) */
.inner-rim{
  position:absolute; 
  width:var(--inner-rim-size); 
  height:var(--inner-rim-size);
  left:50%; 
  top:50%; 
  transform:translate(-50%,-50%); 
  border-radius:50%;
  background:var(--rim-color-2);
  box-shadow: inset 0 10px 18px rgba(255,255,255,.05),
              inset 0 -10px 18px rgba(0,0,0,.6),
              0 8px 20px rgba(0,0,0,.35);
  z-index: 10;
}

/* CENTER HUB */
.hub{
  position:absolute;
  width:var(--hub-size);
  height:var(--hub-size);
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  border:none;
  border-radius:50%;
  background: radial-gradient(circle at 40% 30%, #ff3a2e, #e11d1d 58%, #bf1111 85%);
  color:#fff;
  cursor:pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,.55), inset 0 8px 12px rgba(0,0,0,.35);
  z-index:35;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  row-gap:3px;
  letter-spacing:1px;
  text-shadow:0 2px 0 rgba(0,0,0,.35);
  transition: transform 0.3s ease;
  font-family:'FFFFORWA','Press Start 2P',system-ui,sans-serif;
}

.hub:hover{ 
  transform:translate(-50%,-50%) scale(1.15); 
  transition: transform 0.3s ease;
}
.hub:active{ 
  transform:translate(-50%,-50%) scale(0.95); 
}

/* Invisible clickable area over inner circle */
.invisible-spin-button {
  position: absolute;
  width: var(--inner-rim-size);
  height: var(--inner-rim-size);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 20;
  opacity: 0;
  pointer-events: none; /* Prevent blocking clicks when hidden */
}

/* Trigger hub hover effect when hovering over invisible button */
.invisible-spin-button:hover ~ .hub {
  transform: translate(-50%, -50%) scale(1.15);
}

.hub-top{
  font-size:36px;
  line-height:1;
  margin:0;
  transform: translateY(-5px);
}

.hub-sub{
  font-size:16px;
  line-height:1;
  margin:0;
  color: #CCCCCC;
  transform: translateY(5px);
}

/* Pointer container that rotates around the inner rim - GPU optimized */
.pointer-container {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0); /* Use 3D transform for GPU acceleration */
  width: var(--inner-rim-size);
  height: var(--inner-rim-size);
  z-index: 5;
  will-change: transform; /* Hint to browser for optimization */
  backface-visibility: hidden; /* Prevent flickering */
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d; /* Enable 3D transforms */
}

/* POINTER that stays at the top of the container - GPU optimized */
.pointer{
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate3d(-50%, -20px, 0); /* Use 3D transform for GPU acceleration */
  width:0; 
  height:0;
  border-left:16px solid transparent;
  border-right:16px solid transparent;
  border-bottom:22px solid var(--relic);
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.45));
  z-index: 5;
  will-change: transform; /* Hint to browser for optimization */
  backface-visibility: hidden; /* Prevent flickering */
  -webkit-backface-visibility: hidden;
}

/* Pointer container rotates around the inner rim with smooth physics - GPU optimized */
.pointer-container.spinning{ 
  transition: transform 2s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform; /* Ensure GPU acceleration during animation */
  transform-style: preserve-3d; /* Enable 3D transforms */
}

/* Optimized pointer pool items */
.pointer-pool-item {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* Hide text during spin */
.pointer-container.spinning ~ .hub .hub-text {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Hide spin button text and pointer after spin */
.hub.hidden {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.pointer-container.hidden {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.invisible-spin-button.hidden {
  opacity: 0;
  pointer-events: none !important;
  transition: opacity 0.5s ease;
}

.invisible-spin-button:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

/* Next Item Container */
.next-item-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 35px 0;
}

/* Next Item UI */
.next-item-ui {
  display: flex;
  align-items: center;
  gap: 20px;
  background: transparent;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Heroic Container - Removed (now using .heroic-section) */

/* Mobile adjustments */
@media (max-width: 768px) {
  .wheel-section {
    height: 100vh;
    padding: 1rem;
    gap: 2.5rem;
  }
  
  .wheel {
    transform: scale(1.0);
    transform-origin: center;
  }
  
  .next-item-container {
    padding: 25px 0;
  }
  
  /* Adjust button sizes for mobile */
  .kr-section, .next-item-text {
    min-width: 120px;
    height: 44px;
    font-size: 14px;
  }
  
  .kr-text {
    font-size: 14px;
  }
  
  .reload-icon {
    font-size: 14px;
    transform: scale(2.5) translateY(-1px);
  }
  
  .kr-text {
    transform: translateY(1px);
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1023px) {
  .wheel-section {
    height: 100vh;
    padding: 1.5rem;
    gap: 1.5rem;
  }
}

.next-item-ui.show {
  opacity: 1;
  pointer-events: auto;
}

/* KR Section (Left side) */
.kr-section {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 3px solid #ff00ff;
  border-radius: 6px;
  padding: 12px 16px;
  gap: 0px;
  white-space: nowrap;
  transition: all 0.3s ease;
  cursor: pointer;
  min-width: 140px;
  height: 48px;
}

.kr-section:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

.reload-icon {
  color: white;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  transform: scale(2.5) translateY(-3px);
  margin-right: 12px;
  display: flex;
  align-items: center;
}

.kr-text {
  color: white;
  font-size: 18px;
  font-weight: bold;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  letter-spacing: 1px;
  white-space: nowrap;
  transform: translateY(2px);
}

/* Next Item Text (Right side) */
.next-item-text {
  background: transparent;
  border: 3px solid white;
  border-radius: 6px;
  padding: 12px 16px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  letter-spacing: 1px;
  white-space: nowrap;
  transition: all 0.3s ease;
  cursor: pointer;
  min-width: 140px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.next-item-text:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Show result item */
.result-item {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: var(--wheel-size);
  height: var(--wheel-size);
  border-radius: 50%;
  background: var(--current-color);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  z-index: 15;
  opacity: 0;
  transition: all 0.5s cubic-bezier(.25,.46,.45,.94);
}

.result-item.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(-50%, -50%) scale(1) translateY(0px); }
  50% { transform: translate(-50%, -50%) scale(1) translateY(-10px); }
}

/* ITEM CIRCLE */
.item-circle{
  width:60px; 
  height:60px; 
  border-radius:50%;
  box-shadow:0 4px 12px rgba(0,0,0,.3);
  border:2px solid rgba(255,255,255,.2);
}

/* Spin button */
.spin-button {
  position: absolute;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: linear-gradient(45deg, #ff6b35, #f7931e);
  color: white;
  border: none;
  border-radius: 25px;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.spin-button.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spin-button:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
}

/* Result display */
.result-display {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.result-display.show {
  opacity: 1;
}

/* Season Filter Dropdown */
.season-filter {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30,40,50,.8);
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.season-filter label {
  color: #eaeaea;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.season-dropdown {
  background: rgba(20,25,35,.9);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  color: #eaeaea;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 10px;
  padding: 8px 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  min-width: 120px;
}

.season-dropdown:hover {
  border-color: rgba(255,255,255,.4);
  background: rgba(25,30,40,.9);
}

.season-dropdown:focus {
  border-color: #2196F3;
  box-shadow: 0 0 0 2px rgba(33,150,243,.2);
}

.season-dropdown option {
  background: rgba(20,25,35,.95);
  color: #eaeaea;
  padding: 8px;
}

/* Show/hide dropdowns based on screen size */
.desktop-tablet-only {
  display: block;
}

.mobile-only {
  display: none;
}

/* Tablet positioning - now handled in main tablet section above */

/* Mobile positioning - above the wheel */
@media (max-width: 768px) {
  .desktop-tablet-only {
    display: none;
  }
  
  .mobile-only {
    display: block;
  }
  
  .mobile-only .season-filter {
    position: static;
    margin: 20px auto;
    width: fit-content;
    z-index: 50;
  }
  
  .mobile-only .season-filter label {
    font-size: 10px;
  }
  
  .mobile-only .season-dropdown {
    font-size: 8px;
    padding: 6px 10px;
    min-width: 100px;
  }
}

/* Info panel */
.info-panel{
  width: min(100%, 360px);
  background: #000000; 
  border-radius:8px; 
  padding:20px;
  border:1px solid rgba(255,255,255,.05); 
  backdrop-filter: blur(10px);
}
.info-panel h2{ 
  font-size:24px; 
  text-align:center; 
  margin-bottom:12px; 
}
.rarity-item{ 
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
  margin:8px 0; 
}
.rarity-color{ 
  width:20px; 
  height:20px; 
  border-radius:3px; 
  margin-right:10px; 
}
.rainbow{ 
  background: conic-gradient(red,orange,yellow,green,cyan,blue,violet,red); 
}

/* Rainbow animation for Unobtainable results */
@keyframes rainbow-shimmer {
  0% {
    background: conic-gradient(
      from 0deg,
      hsl(0, 100%, 50%) 0%,
      hsl(60, 100%, 50%) 16.66%,
      hsl(120, 100%, 50%) 33.33%,
      hsl(180, 100%, 50%) 50%,
      hsl(240, 100%, 50%) 66.66%,
      hsl(300, 100%, 50%) 83.33%,
      hsl(360, 100%, 50%) 100%
    );
    filter: brightness(1.2) saturate(1.5);
  }
  16.66% {
    background: conic-gradient(
      from 60deg,
      hsl(60, 100%, 50%) 0%,
      hsl(120, 100%, 50%) 16.66%,
      hsl(180, 100%, 50%) 33.33%,
      hsl(240, 100%, 50%) 50%,
      hsl(300, 100%, 50%) 66.66%,
      hsl(360, 100%, 50%) 83.33%,
      hsl(60, 100%, 50%) 100%
    );
    filter: brightness(1.4) saturate(1.8);
  }
  33.33% {
    background: conic-gradient(
      from 120deg,
      hsl(120, 100%, 50%) 0%,
      hsl(180, 100%, 50%) 16.66%,
      hsl(240, 100%, 50%) 33.33%,
      hsl(300, 100%, 50%) 50%,
      hsl(360, 100%, 50%) 66.66%,
      hsl(60, 100%, 50%) 83.33%,
      hsl(120, 100%, 50%) 100%
    );
    filter: brightness(1.2) saturate(1.5);
  }
  50% {
    background: conic-gradient(
      from 180deg,
      hsl(180, 100%, 50%) 0%,
      hsl(240, 100%, 50%) 16.66%,
      hsl(300, 100%, 50%) 33.33%,
      hsl(360, 100%, 50%) 50%,
      hsl(60, 100%, 50%) 66.66%,
      hsl(120, 100%, 50%) 83.33%,
      hsl(180, 100%, 50%) 100%
    );
    filter: brightness(1.4) saturate(1.8);
  }
  66.66% {
    background: conic-gradient(
      from 240deg,
      hsl(240, 100%, 50%) 0%,
      hsl(300, 100%, 50%) 16.66%,
      hsl(360, 100%, 50%) 33.33%,
      hsl(60, 100%, 50%) 50%,
      hsl(120, 100%, 50%) 66.66%,
      hsl(180, 100%, 50%) 83.33%,
      hsl(240, 100%, 50%) 100%
    );
    filter: brightness(1.2) saturate(1.5);
  }
  83.33% {
    background: conic-gradient(
      from 300deg,
      hsl(300, 100%, 50%) 0%,
      hsl(360, 100%, 50%) 16.66%,
      hsl(60, 100%, 50%) 33.33%,
      hsl(120, 100%, 50%) 50%,
      hsl(180, 100%, 50%) 66.66%,
      hsl(240, 100%, 50%) 83.33%,
      hsl(300, 100%, 50%) 100%
    );
    filter: brightness(1.4) saturate(1.8);
  }
  100% {
    background: conic-gradient(
      from 360deg,
      hsl(360, 100%, 50%) 0%,
      hsl(60, 100%, 50%) 16.66%,
      hsl(120, 100%, 50%) 33.33%,
      hsl(180, 100%, 50%) 50%,
      hsl(240, 100%, 50%) 66.66%,
      hsl(300, 100%, 50%) 83.33%,
      hsl(360, 100%, 50%) 100%
    );
    filter: brightness(1.2) saturate(1.5);
  }
}

.rainbow-unobtainable {
  animation: rainbow-shimmer 2s ease-in-out infinite;
  background: conic-gradient(
    from 0deg,
    hsl(0, 100%, 50%) 0%,
    hsl(60, 100%, 50%) 16.66%,
    hsl(120, 100%, 50%) 33.33%,
    hsl(180, 100%, 50%) 50%,
    hsl(240, 100%, 50%) 66.66%,
    hsl(300, 100%, 50%) 83.33%,
    hsl(360, 100%, 50%) 100%
  ) !important;
}

/* Item Display System */
.item-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 15;
  opacity: 0;
  transition: all 0.5s cubic-bezier(.25,.46,.45,.94);
  pointer-events: none;
}

.item-display.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.item-image {
  width: calc(var(--wheel-size) * 0.75);
  height: calc(var(--wheel-size) * 0.75);
  object-fit: contain;
  /* Animation handled by JavaScript for smooth trig functions */
}

.item-text-overlay {
  position: fixed;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 24px 48px;
  border-radius: 8px;
  text-align: center;
  width: 600px;
  max-width: 90vw;
  min-height: 80px;
  z-index: 25;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.item-text-overlay.show {
  opacity: 1;
}

.item-name {
  color: white;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 2px;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
}

.item-creator {
  color: #ccc;
  font-size: 10px;
  opacity: 0.9;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
}

/* Animation now handled by JavaScript for true trigonometric motion */

/* Mobile Responsive Design */
@media (max-width: 768px) {
  /* Mobile wheel system scaling - scale down entire wheel */
  .wheel {
    transform: scale(0.7);
    transform-origin: center;
  }
  
  /* Mobile hub scaling - scale down with wheel */
  .hub {
    width: calc(var(--hub-size) * 0.6);
    height: calc(var(--hub-size) * 0.6);
  }
  
  .hub-top {
    font-size: 22px;
  }
  
  .hub-sub {
    font-size: 10px;
  }
  
  /* Mobile inner rim and pointer scaling */
  .inner-rim {
    width: calc(var(--inner-rim-size) * 0.7);
    height: calc(var(--inner-rim-size) * 0.7);
  }
  
  .pointer-container {
    width: calc(var(--inner-rim-size) * 0.7);
    height: calc(var(--inner-rim-size) * 0.7);
  }
  
  .invisible-spin-button {
    width: calc(var(--inner-rim-size) * 0.7);
    height: calc(var(--inner-rim-size) * 0.7);
  }
  
  /* Mobile item display - scale with wheel */
  .item-image {
    width: calc(var(--wheel-size) * 0.75);
    height: calc(var(--wheel-size) * 0.75);
  }
  
  /* Mobile text overlay */
  .item-text-overlay {
    width: 90vw;
    max-width: 90vw;
    padding: 16px 24px;
    min-height: 60px;
    bottom: 10%;
  }
  
  .item-name {
    font-size: 12px;
  }
  
  .item-creator {
    font-size: 8px;
  }
  
  .info-panel h2 {
    font-size: 18px;
    margin-bottom: 8px;
  }
  
  .rarity-item {
    margin: 6px 0;
    font-size: 10px;
  }
  
  .rarity-color {
    width: 16px;
    height: 16px;
  }
}

/* Tablet Responsive Design */
@media (min-width: 769px) and (max-width: 1023px) {
  .wheel {
    transform: scale(1.1);
    transform-origin: center;
  }
  
  .item-image {
    width: calc(var(--wheel-size) * 0.75);
    height: calc(var(--wheel-size) * 0.75);
  }
  
  .item-text-overlay {
    width: 500px;
    padding: 20px 40px;
    bottom: 12%;
  }
  
  .info-panel h2 {
    font-size: 20px;
  }
}

/* Spin History Button */
.spin-history-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  z-index: 100;
}

.spin-history-btn {
  position: relative;
  width: 100%;
  height: 40px;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  font-size: 14px !important;
  background-color: #00B800 !important;
  box-shadow: inset 0px -4px 0px 0px #008400 !important;
  border-radius: 4px;
  border: 2px solid white;
  text-align: center;
  color: white;
  display: block;
  transition: all 0.08s;
  cursor: pointer;
  line-height: 24px;
  margin-top: 20px;
}

.spin-history-btn:hover {
  background: #00cc00;
  transform: scale(0.85);
  transition: transform 0.15s ease-in-out;
}

/* Popup Overlay */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-overlay.show {
  display: flex;
}

/* Popup Content */
.popup-content {
  background: rgba(30, 40, 50, 0.95);
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  max-height: 90vh;
  overflow: hidden;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #000000;
  border-bottom: 3px solid #666666;
}

.popup-header h2 {
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 24px;
  font-weight: bold;
  margin: 0;
  flex: 1;
  text-align: center;
}

.stats-btn-popup, .load-more-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  background: #2196F3;
  color: white;
  transition: all 0.3s ease;
}

.stats-btn-popup:hover, .load-more-btn:hover {
  background: #1976D2;
  transform: scale(1.05);
}

.date-range {
  color: #fbc02d;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
  text-align: center;
  padding: 15px 20px;
}

.popup-footer {
  color: #fbc02d;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  padding: 15px 20px;
}

.stats-date-range {
  color: #fbc02d;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
  text-align: center;
  padding: 8px 20px 12px 20px;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}


/* Settings Popup */
.settings-popup {
  width: 500px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.settings-content {
  padding: 20px;
}

.setting-group {
  margin-bottom: 25px;
}

.setting-group label {
  display: block;
  color: white;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 8px;
}

.slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1976D2;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  background: #1565C0;
  transform: scale(1.1);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1976D2;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider-value {
  color: white;
  font-weight: bold;
  min-width: 50px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
}

.setting-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  line-height: 1.4;
}

.gray-description {
  color: rgba(255, 255, 255, 0.5);
}

.settings-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  justify-content: center;
}

.reset-btn, .apply-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.reset-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.apply-btn {
  background: #1976D2;
  color: white;
}

.apply-btn:hover {
  background: #1565C0;
  transform: translateY(-2px);
}

/* Spin History Popup */
.spin-history-popup {
  width: 95vw;
  max-width: 1000px;
  height: 70vh;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 15px;
  padding: 20px;
  max-height: calc(80vh - 160px);
  overflow-y: auto;
}

.items-grid::-webkit-scrollbar {
  width: 8px;
}

.items-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.items-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.items-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.item-slot {
  aspect-ratio: 1;
  border: 3px solid;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.item-slot img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.item-slot.rare { border-color: var(--rare); }
.item-slot.epic { border-color: var(--epic); }
.item-slot.legendary { border-color: var(--legendary); }
.item-slot.relic { border-color: var(--relic); }
.item-slot.contraband { border-color: var(--contraband); }
.item-slot.unobtainable { border-color: var(--unobtainable); }

.item-slot:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.1);
}

/* Stats Popup */
.stats-popup {
  width: 400px;
  max-height: 600px;
}

.stats-content {
  padding: 10px 20px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 16px;
  font-weight: bold;
}

.rarity-stats {
  margin-top: 8px;
}

.rarity-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 14px;
  font-weight: bold;
}

.rarity-stat-item .rarity-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-right: 10px;
}

/* Leaderboard Popup */
.leaderboard-popup {
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

/* Leaderboard tooltip hover behavior */
.icon-container:hover .tooltip {
  opacity: 1 !important;
}

.icon-container .tooltip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Notification Area */
.notification-area {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  pointer-events: none;
  max-width: 90vw;
}

.notification-item {
  background: rgba(60, 60, 60, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px 20px;
  margin-bottom: 8px;
  font-family: 'FFFFORWA', monospace;
  font-size: 14px;
  color: white;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideInDown 0.3s ease-out, fadeOut 0.3s ease-in 4.7s forwards;
  transform-origin: top;
}

.notification-item.unobtainable .item-name {
  background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow 2s linear infinite;
}

.notification-item.contraband .item-name {
  color: #292929;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.6);
  animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.6);
  }
  to {
    text-shadow: 0 0 15px rgba(255, 255, 255, 1), 0 0 25px rgba(255, 255, 255, 0.8), 0 0 35px rgba(255, 255, 255, 0.6);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

@keyframes rainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Chatbox Bar */
.chatbox-bar {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  background: rgba(40, 40, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0 0 12px 12px; /* Rounded bottom corners only */
  padding: 8px 12px;
  gap: 8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-width: 400px;
  min-width: 300px;
}

.chatbox-btn {
  background: rgba(60, 60, 60, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
}

.chatbox-btn:hover {
  background: rgba(80, 80, 80, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.chatbox-btn svg {
  transition: all 0.2s ease;
}

.chatbox-btn:hover svg {
  transform: scale(1.1);
}

/* Chat Messages Container */
.chat-messages-container {
  position: fixed;
  bottom: 60px; /* Directly above the input bar, touching */
  left: 20px;
  right: 20px;
  max-height: 200px; /* Show 6-7 messages */
  background: rgba(40, 40, 40, 0.95); /* Match input bar background */
  border-radius: 8px 8px 0 0; /* Rounded top corners only */
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2); /* Match input bar border */
  border-bottom: none; /* No bottom border to connect with input bar */
  z-index: 1000;
  overflow: hidden;
  display: none; /* Hidden by default, shown when user is logged in */
  max-width: 400px; /* Same width as input bar */
  min-width: 300px; /* Same width as input bar */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Match input bar shadow */
}

.chat-messages {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 12px; /* Match input bar padding exactly */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-message {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'FFFFORWA', monospace;
  font-size: 12px;
  color: white;
  word-wrap: break-word;
  animation: slideInMessage 0.3s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-message .message-content {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}

.chat-message .username {
  color: #4CAF50;
  font-weight: bold;
  margin-right: 4px;
}

.chat-message .badges {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0; /* Prevent badges from shrinking */
}

.chat-message .message-text {
  color: rgba(255, 255, 255, 0.9);
}

/* Rainbow animation for Unobtainable item names in chat */
@keyframes rainbow {
  0%, 100% { color: Crimson; border-color: Crimson; }
  20% { color: orange; border-color: orange; }
  40% { color: yellow; border-color: yellow; }
  60% { color: lime; border-color: lime; }
  80% { color: MediumBlue; border-color: MediumBlue; }
}

.rainbow-text {
  animation: rainbow 0.5s linear infinite;
  font-weight: bold;
}

/* Kbot Discord Link */
.kbot-discord-link {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: rgba(40, 40, 40, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kbot-discord-link:hover {
  transform: scale(1.1);
  background: rgba(60, 60, 60, 0.95);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.kbot-discord-link img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: brightness(0.9);
  transition: filter 0.3s ease;
}

.kbot-discord-link:hover img {
  filter: brightness(1.1);
}

/* Tooltip styling */
.kbot-discord-link::before {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1001;
  margin-bottom: 8px;
}

.kbot-discord-link:hover::before {
  opacity: 1;
  visibility: visible;
}


/* Mobile-specific Kbot Discord placement */
.kbot-discord-link-mobile {
  display: none;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(40, 40, 40, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.kbot-discord-link-mobile img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.kbot-discord-link-mobile .kbot-discord-text {
  color: #fff;
  font-size: 14px;
  opacity: 0.9;
}

/* Show mobile Kbot icon and hide floating one on small screens */
@media (max-width: 768px) {
  .kbot-discord-link {
    display: none;
  }
  .kbot-discord-link-mobile {
    display: flex;
  }
}





/* Scrollbar styling for chat messages */
.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Animation for new messages */
@keyframes slideInMessage {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Show chat when user is logged in */
.chat-messages-container.show {
  display: block;
}

.message-input-container {
  flex: 1;
  min-width: 150px;
  position: relative;
}


.message-input {
  width: 100%;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  color: white;
  font-family: 'FFFFORWA', monospace;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.message-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(30, 30, 30, 0.9);
}

.message-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.message-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.leaderboard-content {
  padding: 10px 20px;
}

.leaderboard-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 14px;
  flex-wrap: wrap;
}

.main-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mobile: Stack vertically */
@media (max-width: 768px) {
  .leaderboard-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  
  .ratio-filter-container {
    margin-left: 0;
    justify-content: space-between;
  }
}

/* Desktop: Side by side */
@media (min-width: 769px) {
  .leaderboard-filters {
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
  }
  
  .main-filter {
    order: 1;
  }
  
  .ratio-filter-container {
    order: 2;
    margin-left: 0;
  }
}

.leaderboard-filters select {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border: 2px solid #fbc02d;
  border-radius: 5px;
  padding: 8px 12px;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
  cursor: pointer;
}

.leaderboard-filters select:focus {
  outline: none;
  border-color: #ff9800;
  box-shadow: 0 0 10px rgba(255, 152, 0, 0.3);
}

.ratio-filter-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 15px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(251, 192, 45, 0.3);
}

.ratio-filter-container label {
  font-size: 12px;
  color: #ccc;
  white-space: nowrap;
}

.ratio-filter-container select {
  font-size: 11px;
  padding: 6px 8px;
  min-width: 120px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #fbc02d;
}

.leaderboard-table-container {
  max-height: 400px;
  overflow-y: auto;
  border: 2px solid #fbc02d;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
}

.leaderboard-table th {
  background: #000000;
  color: #fbc02d;
  padding: 12px 8px;
  text-align: left;
  font-weight: bold;
  border-bottom: 2px solid #fbc02d;
  position: sticky;
  top: 0;
  z-index: 10;
}

.leaderboard-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table tbody tr:hover {
  background: rgba(251, 192, 45, 0.1);
}

.leaderboard-table .rank {
  font-weight: bold;
  color: #fbc02d;
  text-align: center;
  width: 60px;
}

.leaderboard-table .username {
  font-weight: bold;
  color: white;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-table .value {
  font-weight: bold;
  color: #ff9800;
  text-align: right;
  width: 100px;
}

.leaderboard-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
}

.leaderboard-pagination button {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border: 2px solid #fbc02d;
  border-radius: 5px;
  padding: 8px 16px;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.leaderboard-pagination button:hover:not(:disabled) {
  background: rgba(251, 192, 45, 0.2);
  border-color: #ff9800;
  transform: scale(1.05);
}

.leaderboard-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #666;
}

.leaderboard-pagination button:disabled:hover {
  transform: none;
  background: rgba(0, 0, 0, 0.8);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .spin-history-btn {
    font-size: 10px;
    padding: 10px 16px;
  }
  
  .spin-history-popup {
    width: 95vw;
    height: 85vh;
  }
  
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 15px;
  }
  
  .stats-popup {
    width: 90vw;
    max-width: 400px;
  }
}

/* Authentication Styles */
.auth-popup {
  width: 400px;
  max-width: 90vw;
}

/* OAuth Buttons Container */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}

/* Google Button Styles */
.google-btn {
  width: 100%;
  padding: 12px 16px;
  background: white;
  color: #333;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  border-color: #c1c7cd;
  transform: translateY(-1px);
}

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

/* Discord Button Styles */
.discord-btn {
  width: 100%;
  padding: 12px 16px;
  background: #5865F2;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.discord-btn:hover {
  background: #4752C4;
  transform: translateY(-1px);
}

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

/* Auth Tabs */
.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #333;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
}

.tab-btn.active {
  color: #fff;
  border-bottom-color: #4285f4;
}

.tab-btn:hover {
  color: #fff;
}

.auth-tab {
  display: none !important;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-tab.active {
  display: block !important;
  opacity: 1;
}

/* Ensure auth content is visible */
.auth-content {
  min-height: 200px;
  padding: 20px;
}

/* Force register modal content to be visible */
#registerOverlay .auth-tab {
  display: none !important;
}

#registerOverlay .auth-tab.active {
  display: block !important;
  opacity: 1 !important;
}

#registerOverlay .oauth-buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100% !important;
  margin-bottom: 16px !important;
}

#registerOverlay .form-group {
  margin-bottom: 16px !important;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #eaeaea;
  font-size: 14px;
  font-weight: 500;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  color: #eaeaea;
  font-size: 14px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
}

.form-group input:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.form-group input:invalid {
  border-color: #f44336;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px 20px;
  background: #4285f4;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
}

.auth-submit-btn:hover:not(:disabled) {
  background: #3367d6;
  transform: translateY(-1px);
}

.auth-submit-btn:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
}

/* Username Selection Modal */
.username-popup {
  max-width: 400px;
}

.username-content p {
  color: #bbb;
  margin-bottom: 20px;
  text-align: center;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
}

.username-status {
  margin-top: 8px;
  font-size: 12px;
  min-height: 16px;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
}

.username-status.available {
  color: #4caf50;
}

.username-status.taken {
  color: #f44336;
}

.username-status.checking {
  color: #ff9800;
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  color: #888;
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #333;
}

.auth-divider span {
  padding: 0 16px;
  background: radial-gradient(1400px 900px at 30% 20%, #132140, #0f1d38 55%, #0d1830 100%);
}

/* Discord Info in User Menu */
.discord-info {
  color: #5865F2;
  font-size: 12px;
  margin-top: 4px;
}

/* Discord Link/Unlink Buttons */
.discord-link-btn {
  background: #5865F2 !important;
  color: white !important;
}

.discord-link-btn:hover {
  background: #4752C4 !important;
}

.discord-unlink-btn {
  background: #ed4242 !important;
  color: white !important;
}

.discord-unlink-btn:hover {
  background: #c73e1d !important;
}


.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 14px;
  font-weight: bold;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #333;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #555;
  background: rgba(0, 0, 0, 0.8);
}

.auth-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #ff3a2e, #e11d1d);
  border: none;
  border-radius: 8px;
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-btn:hover {
  background: linear-gradient(135deg, #e11d1d, #bf1111);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 58, 46, 0.3);
}

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

.auth-switch {
  margin-top: 20px;
  text-align: center;
}

.auth-switch p {
  color: #888;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
}

.auth-switch a {
  color: #ff3a2e;
  text-decoration: none;
  font-weight: bold;
}

.auth-switch a:hover {
  color: #e11d1d;
  text-decoration: underline;
}

/* User Menu Styles */
.user-menu-popup {
  width: 350px;
  max-width: 90vw;
}

.user-menu-content {
  padding: 20px;
}

.user-info {
  text-align: center;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  border: 1px solid #333;
}

.user-info h3 {
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 16px;
  margin: 0 0 5px 0;
}

.user-info p {
  color: #888;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
  margin: 0;
}

/* Discord User Display */
.discord-user-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.discord-username {
  color: #5865F2;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 16px;
  font-weight: bold;
  margin: 0;
}

.discord-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #5865F2;
  object-fit: cover;
}

/* Regular User Display */
.regular-user-display h3 {
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 16px;
  margin: 0 0 5px 0;
}

.regular-user-display p {
  color: #888;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
  margin: 0;
}

.user-stats {
  margin-bottom: 20px;
}

.user-stats h4 {
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 14px;
  margin: 0 0 10px 0;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  color: #ccc;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-action-btn {
  padding: 10px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  border-radius: 6px;
  color: white;
  font-family: 'FFFFORWA', 'Press Start 2P', system-ui, sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-action-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: #555;
}

.logout-btn {
  background: rgba(255, 58, 46, 0.2);
  border-color: #ff3a2e;
}

.logout-btn:hover {
  background: rgba(255, 58, 46, 0.3);
  border-color: #e11d1d;
}

