body {
  margin: 0;
  background: #0b1114;
  color: white;
  font-family: sans-serif;
}


.leaderboard {
  position: absolute;
  top: 20px;
  left: 20px; /* of right: 20px */
  width: 220px;

  background: rgba(10, 20, 25, 0.85);
  backdrop-filter: blur(10px);

  border-radius: 12px;
  padding: 12px;

  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  color: white;
  font-size: 14px;
}

.leaderboard-title {
  font-weight: bold;
  margin-bottom: 8px;
  opacity: 0.8;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

/* 🏆 TOP 3 */
.leaderboard-item:nth-child(2) {
  color: gold;
  font-weight: bold;
}

.leaderboard-item:nth-child(3) {
  color: silver;
}

.leaderboard-item:nth-child(4) {
  color: #cd7f32; /* bronze */
}

#leaderboard {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  
  width: 280px;
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  background: rgba(10, 20, 25, 0.85);
  backdrop-filter: blur(10px);

  border-radius: 12px;
  padding: 12px;

  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 100;
}

.leaderboard-title {
  text-align: center;
  font-weight: bold;
  margin-bottom: 10px;
  opacity: 0.8;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 14px;
}

.leaderboard-item:hover {
  background: rgba(255,255,255,0.05);
}

#leaderboard {
  position: fixed;
  top: 80px;
  right: 20px;
}

#resetGame {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);

  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);

  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 12px;
  border-radius: 8px;

  font-size: 13px;
  cursor: pointer;

  backdrop-filter: blur(6px);
  z-index: 200;

  transition: 0.2s;
}

#resetGame:hover {
  background: rgba(239, 68, 68, 0.2);
  color: white;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);

  display: none;
  justify-content: center;
  align-items: center;

  z-index: 300;
}

.modal.active {
  display: flex;
}

.modal-box {
  background: #111a1f;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  width: 300px;
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
}

.modal-actions button {
  flex: 1;
  margin: 0 5px;
  padding: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#confirmReset {
  background: #ef4444;
  color: white;
}

#cancelReset {
  background: #1a262c;
  color: white;
}

#resetGame {
  opacity: 0.2;
}

#resetGame:hover {
  opacity: 1;
}

.game-container {
  display: flex;
  height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 220px;
  background: #111a1f;
  padding: 15px;
}

/* MAIN */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* SHOP */
.shop {
  width: 260px;
  background: #111a1f;
  padding: 15px;
}

.spek-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
}

#spekBtn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.15s ease;
}
#spekBtn:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

#spekBtn img {
  width: 180px;
  user-select: none;
  -webkit-user-drag: none;

  animation: baconGlow 2.5s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255, 120, 40, 0.35));
}

.orbit-bacon {
  width: 42px;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* orbit container */
.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
}

/* het draaiende spekje */
.orbit span {
  position: absolute;
  left: 80px; /* radius */
  top: 0;
  font-size: 28px;
}
.shop-item {
  background: linear-gradient(135deg, #1a262c, #22333b);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.shop-buy {
  background: #2dd4bf;
  border-radius: 8px;
  padding: 6px 10px;
}

.inventory-item {
  background: #1a262c;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  transition: 0.2s;
}

.inventory-item:hover {
  background: #22333b;
}

/* INVENTORY */
.inventory-item {
  background: #1a262c;
  padding: 8px;
  margin-bottom: 6px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
}

/* SHOP */
.shop-item {
  background: #1a262c;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
}

.shop-buy {
  background: #2dd4bf;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
}

/* MOBILE */
.mobile-ui {
  display: none;
}

.panel {
  box-sizing: border-box;
  padding:
    calc(20px + env(safe-area-inset-top))
    16px
    20px
    16px;
}

.inventory-item,
.shop-item {
  width: 100%;
}

.panel {
  transform: translateY(100%);
}

.panel.active {
  transform: translateY(0);
}

/* ❌ mobile UI standaard verbergen op desktop */
.mobile-ui,
.panel {
  display: none;
}

@media (max-width: 768px) {

  .sidebar,
  .shop {
    display: none;
  }

  .mobile-ui,
  .panel {
    display: block;
  }
}

body {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  touch-action: manipulation;
}

#spekBtn {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

@keyframes floatUp {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -120%) scale(1.2); opacity: 0; }
}

#spekBtn {
  touch-action: manipulation;
}

/* 📱 MOBILE */
@media (max-width: 768px) {

  .sidebar, .shop {
    display: none;
  }

  .main {
    position: relative;
    width: 100%;
    height: 100%;
  }

  .spek-wrapper {
    width: 300px;
    height: 300px;
  }

  #spekBtn {
    font-size: 160px;
  }

.mobile-ui {
  display: flex;

  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;

  transform: translateX(-50%);

  width: 224px;

  justify-content: space-between;
  align-items: center;

  pointer-events: none;

  z-index: 50;
}

  .panel {
  width: 100vw;
  max-width: 100vw;
  left: 0;
  right: 0;
}

.panel h2,
#inventoryPanelContent,
#shopPanelContent {
  width: 100%;
  max-width: 100%;
}

.mobile-ui button {
  width: 64px;
  height: 64px;

  border-radius: 18px;

  background: #2dd4bf;
  border: none;

  font-size: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  pointer-events: auto;
}

#openSkinsBtn {
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 64px;
  min-width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 18px;
  font-size: 0;
  z-index: 60;
}

#openSkinsBtn::before {
  content: "🎨";
  font-size: 22px;
}
  .panel {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;

    padding:
      calc(20px + env(safe-area-inset-top))
      20px
      calc(20px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;

    background: #0b1114;
    transform: translateY(100%);
    transition: 0.3s;
    z-index: 100;
  }

  .panel.active {
    transform: translateY(0);
  }

  .close {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    font-size: 20px;
    background: #1a262c;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
  }
}


@keyframes baconFloat {
  0% {
    transform: translate(-50%, -50%) translateY(0px);
  }

  50% {
    transform: translate(-50%, -50%) translateY(-8px);
  }

  100% {
    transform: translate(-50%, -50%) translateY(0px);
  }
}

#spekBtn {
  animation: baconFloat 3s ease-in-out infinite;
}

@keyframes baconGlow {
  0% {
    filter: drop-shadow(0 0 10px rgba(255, 120, 40, 0.25));
  }

  50% {
    filter: drop-shadow(0 0 24px rgba(255, 120, 40, 0.55));
  }

  100% {
    filter: drop-shadow(0 0 10px rgba(255, 120, 40, 0.25));
  }
}

.skins-menu {
  position: fixed;
  top: 50%;
  left: 50%;

  transform: translate(-50%, -50%) scale(0.9);

  width: 900px;
  max-width: 90vw;

  max-height: 80vh;
  overflow-y: auto;

  background: rgba(8, 15, 25, 0.97);

  border: 1px solid rgba(45,212,191,.2);
  border-radius: 24px;

  padding: 30px;

  z-index: 999;

  opacity: 0;
  pointer-events: none;

  transition: .25s;
}

.skins-menu.active {
  opacity: 1;
  pointer-events: auto;

  transform:
    translate(-50%, -50%)
    scale(1);
}

.skin-btn {
  background: #111827;

  border: 2px solid #1f2937;
  border-radius: 16px;

  padding: 14px;

  min-height: 110px;

  color: white;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  gap: 10px;

  transition: .2s;
}

.skin-btn img {
  width: 70px;
}

.skin-btn:hover {
  transform: translateY(-4px);
  border-color: #2dd4bf;
}

.skin-btn.active {
  border-color: #2dd4bf;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.4);
}

.skin-btn.locked {
  opacity: 0.4;
  filter: grayscale(1);
  cursor: not-allowed;
}

.skin-btn.locked:hover {
  transform: none;
}

.custom-alert {
  position: fixed;
  inset: 0;

  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);

  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0;
  pointer-events: none;

  transition: 0.25s;
  z-index: 999;
}

.custom-alert.active {
  opacity: 1;
  pointer-events: all;
}

.custom-alert-box {
  background: #111a1f;

  border: 1px solid rgba(45,212,191,0.2);

  border-radius: 18px;

  padding: 24px;

  width: 320px;

  text-align: center;

  box-shadow:
    0 0 30px rgba(45,212,191,0.12),
    0 20px 40px rgba(0,0,0,0.45);

  animation: popIn 0.25s ease;
}

.custom-alert-box h3 {
  margin-top: 0;
  color: #2dd4bf;
  font-size: 24px;
}

.custom-alert-box p {
  opacity: 0.8;
  line-height: 1.5;
}

@keyframes popIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.skins-section {
  margin-top: 40px;
  width: 100%;
  max-width: 900px;
}

.skins-section h2 {
  margin-bottom: 16px;
  opacity: 0.9;
}

.skins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.skin-card {
  background: #141d22;
  border-radius: 16px;
  padding: 14px;

  border: 2px solid rgba(255,255,255,0.06);

  transition: 0.2s;
}

.skin-card:hover {
  transform: translateY(-4px);
}

.skin-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.skin-name {
  font-weight: bold;
  margin-top: 10px;
}

.skin-rarity {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 4px;
}

.skin-btn2 {
  margin-top: 12px;
  width: 100%;

  border: none;
  border-radius: 10px;

  padding: 10px;

  background: #2dd4bf;
  color: black;
  font-weight: bold;
  cursor: pointer;
}

.skin-card.locked {
  opacity: 0.55;
}

.skins-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.skin-btn {
  background: #111827;
  border: 2px solid #1f2937;
  border-radius: 14px;
  padding: 12px;
  color: white;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;

  transition: 0.2s;
}

.skin-btn img {
  width: 70px;
}

.skin-btn:hover {
  transform: scale(1.04);
}

.skin-btn.active {
  border-color: #2dd4bf;
}

.skin-btn.locked {
  opacity: 0.5;
}

.skins-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);

  width: 900px;
  max-height: 80vh;

  overflow-y: auto;

  background: rgba(8, 15, 25, 0.96);

  border: 1px solid rgba(45,212,191,.2);

  border-radius: 24px;

  padding: 30px;

  z-index: 999;

  opacity: 0;
  pointer-events: none;

  transition: 0.25s;
}

.skins-menu.active {
  opacity: 1;
  pointer-events: auto;

  transform:
    translate(-50%, -50%)
    scale(1);
}

.skins-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 30px;
}

#closeSkinsBtn {
  width: 42px;
  height: 42px;

  border-radius: 12px;
  border: none;

  background: #1a262c;
  color: white;

  font-size: 20px;
  cursor: pointer;

  transition: .2s;
}

#closeSkinsBtn:hover {
  background: #24343d;
  transform: scale(1.08);
}

#normalSkins,
#memeSkins {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(160px, 1fr));

  gap: 16px;

  margin-bottom: 35px;
}

.skins-open-btn {
  position: fixed;

  bottom: 25px;
  left: 50%;

  transform: translateX(-50%);

  background: #2dd4bf;
  color: black;

  border: none;
  border-radius: 14px;

  padding: 14px 22px;

  font-size: 17px;
  font-weight: bold;

  cursor: pointer;

  box-shadow:
    0 0 20px rgba(45,212,191,.35);

  z-index: 50;

  transition: .2s;
}

.skins-open-btn:hover {
  transform:
    translateX(-50%)
    scale(1.05);
}

.skins-menu h3 {
  margin-bottom: 18px;
  font-size: 24px;
}
