/* Knife Duels: lobby menu (home/play/knives/shop/quests/leaderboard/settings). */

@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@700;800;900&display=swap");

.kd-menu-root {
  position: absolute;
  inset: 0;
  font-family: "Nunito", "Inter", system-ui, -apple-system, sans-serif;
  color: #fff;
  overflow: hidden;
}

.kd-menu-root * {
  box-sizing: border-box;
}

.kd-menu-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(61, 220, 132, 0.18), transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(168, 85, 247, 0.16), transparent 55%),
    linear-gradient(180deg, #0c0f16 0%, #10131c 60%, #0a0c12 100%);
  filter: blur(0px);
}

.kd-menu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.kd-menu-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px 16px;
}

/* ---- top bar ---- */
/* Small centred HUD pills (coins/gems) + LVL badge and thin XP bar, matching
   the always-on Roblox HUD that floats above the menu panel. */

.kd-topbar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px 6px;
}

.kd-topbar-pills {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kd-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 15px;
}

.kd-stat-coins {
  color: #ffd166;
  background: rgba(10, 12, 18, 0.72);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.kd-icon {
  color: #ffd166;
}

.kd-stat-gems {
  color: #c084fc;
  background: rgba(10, 12, 18, 0.72);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.kd-icon-gem {
  color: #c084fc;
}

.kd-stat-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 220px;
  max-width: 60vw;
}

.kd-level-badge {
  background: rgba(10, 12, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.kd-xpbar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  overflow: hidden;
}

.kd-xpbar-fill {
  height: 100%;
  background: #3ddc84;
}

.kd-back {
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* ---- middle row: quests aside + panel ---- */

.kd-menu-mid {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  padding: 10px 16px;
  min-height: 0;
}

.kd-quests-aside {
  flex: 0 0 220px;
  max-width: 30vw;
}

.kd-quests-aside .kd-panel {
  height: 100%;
  overflow-y: auto;
}

.kd-panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.kd-panel-title-row .kd-panel-title {
  margin-bottom: 0;
}

.kd-icon-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 209, 102, 0.16);
  color: #ffd166;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.kd-menu-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.kd-menu-content-home {
  align-items: stretch;
}

.kd-menu-panel {
  background: rgba(8, 10, 15, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.kd-panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kd-panel-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 900;
}

.kd-panel-header-title svg {
  color: #ffd166;
}

.kd-panel-close {
  width: 30px;
  height: 30px;
  min-height: 0;
  border: none;
  border-radius: 6px;
  background: #ff4d4d;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
}

/* ---- bottom nav ---- */

.kd-nav {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: transparent;
}

.kd-nav-btn {
  position: static;
  flex: 0 1 84px;
  min-width: 52px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 10px;
  background: rgba(8, 10, 15, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
  font-size: 10px;
  cursor: pointer;
}

.kd-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.kd-nav-label {
  line-height: 1;
}

.kd-nav-btn.kd-active {
  color: #3ddc84;
  border-color: rgba(61, 220, 132, 0.5);
  background: rgba(61, 220, 132, 0.12);
}

/* ---- buttons ---- */

.kd-btn {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.kd-btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.kd-btn-green {
  background: #3ddc84;
  color: #06210f;
}

.kd-btn-orange {
  background: #f2a83c;
  color: #241300;
}

.kd-btn-danger {
  background: #ff4d4d;
}

.kd-btn-disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
}

/* ---- home ---- */

.kd-home {
  display: flex;
  gap: 16px;
  height: 100%;
  min-height: 100%;
}

.kd-home-side {
  flex: 0 0 260px;
  max-width: 40vw;
}

.kd-home-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.kd-play-big {
  min-width: 220px;
  min-height: 84px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(180deg, #4be495, #2fc46c);
  color: #06210f;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(61, 220, 132, 0.35);
}

.kd-tutorial-btn {
  min-height: 40px;
  padding: 0 16px;
  font-size: 13px;
  animation: kd-pulse 1.6s ease-in-out infinite;
}

@keyframes kd-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 168, 60, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(242, 168, 60, 0); }
}

.kd-panel {
  background: rgba(10, 14, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.kd-panel-title {
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 10px;
}

.kd-quest-row {
  margin-bottom: 12px;
}

.kd-quest-row:last-child {
  margin-bottom: 0;
}

.kd-quest-done {
  opacity: 0.6;
}

.kd-quest-text {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.kd-quest-prog {
  color: rgba(255, 255, 255, 0.6);
}

.kd-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 6px;
}

.kd-bar-fill {
  height: 100%;
  background: #3ddc84;
}

.kd-quest-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kd-quest-reward {
  font-size: 12px;
  color: #ffd166;
  font-weight: 700;
}

.kd-tag {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(61, 220, 132, 0.18);
  color: #3ddc84;
  font-weight: 700;
}

.kd-empty {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  padding: 8px 0;
}

.kd-toast {
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 26, 0.95);
  border: 1px solid rgba(255, 77, 77, 0.5);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  z-index: 40;
}

/* ---- play screen ---- */

.kd-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
  margin: 4px 0 8px;
}

.kd-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kd-mode-card {
  position: relative;
  min-height: 84px;
  border-radius: 12px;
  border: none;
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}

.kd-grad-1v1 { background: linear-gradient(135deg, #3ddc84, #1c8f52); }
.kd-grad-2v2 { background: linear-gradient(135deg, #3b82f6, #1c4fa8); }
.kd-grad-3v3 { background: linear-gradient(135deg, #a855f7, #6a2fa0); }
.kd-grad-4v4 { background: linear-gradient(135deg, #f2a83c, #b3701c); }
.kd-grad-ranked { background: linear-gradient(135deg, #ff4d4d, #a11c1c); }

.kd-mode-card.kd-locked {
  filter: grayscale(0.6) brightness(0.55);
  cursor: not-allowed;
}

.kd-mode-card-lock {
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 8px;
  border-radius: 999px;
}

.kd-picker-row {
  margin-bottom: 12px;
}

.kd-picker-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}

.kd-picker-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kd-chip-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-transform: capitalize;
  cursor: pointer;
}

.kd-chip-btn.kd-active {
  background: #3ddc84;
  border-color: #3ddc84;
  color: #06210f;
}

.kd-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kd-step-btn {
  width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 18px;
}

.kd-step-val {
  font-size: 18px;
  font-weight: 800;
  min-width: 20px;
  text-align: center;
}

.kd-start-bots {
  width: 100%;
  margin-top: 6px;
}

.kd-room-panel {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kd-input {
  flex: 1 1 120px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0 14px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ---- knives screen ---- */

.kd-trade-note {
  margin-bottom: 12px;
}

/* ---- trade window ---- */

.kd-trade-root {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.kd-trade-root > * {
  pointer-events: auto;
}

.kd-trade-toast {
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 26, 0.95);
  border: 1px solid rgba(61, 220, 132, 0.5);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.kd-trade-toast-text {
  white-space: nowrap;
}

.kd-trade-panel {
  width: min(560px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
}

.kd-trade-error {
  color: #ff4d4d;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.kd-trade-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.kd-trade-col {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px;
  min-width: 0;
}

.kd-trade-col-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.kd-trade-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.kd-trade-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 6px;
  min-height: 40px;
  cursor: pointer;
}

.kd-trade-item-selected {
  border-color: #3ddc84;
  background: rgba(61, 220, 132, 0.2);
}

.kd-trade-item-readonly {
  cursor: default;
}

.kd-trade-coins-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
}

.kd-trade-coins-input {
  min-height: 36px;
  flex: 1 1 auto;
}

.kd-trade-offer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.kd-trade-status {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.kd-trade-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.kd-trade-countdown {
  font-size: 12px;
  font-weight: 800;
  color: #3ddc84;
}

.kd-trade-result {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

@media (max-width: 420px) {
  .kd-trade-cols {
    grid-template-columns: 1fr;
  }

  .kd-trade-toast {
    width: 92vw;
    flex-wrap: wrap;
    justify-content: center;
    bottom: 56px;
  }
}

.kd-knife-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.kd-knife-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kd-knife-count {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 6px;
  border-radius: 999px;
}

.kd-knife-sell {
  width: 100%;
  min-height: 44px;
}

.kd-knife-locklabel {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.kd-knife-card {
  position: relative;
  min-height: 96px;
  border-radius: 12px;
  border: 2px solid var(--kd-rarity, #b0b7c3);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
}

.kd-knife-locked {
  filter: grayscale(1) brightness(0.5);
}

.kd-knife-thumb {
  font-size: 26px;
  color: var(--kd-rarity, #b0b7c3);
}

.kd-knife-name {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.kd-tag-equipped {
  position: absolute;
  top: 6px;
  right: 6px;
}

.kd-inspect-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.kd-inspect-panel {
  position: relative;
  width: min(320px, 84vw);
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    rgba(12, 15, 22, 0.95);
  background-size: 20px 20px, 20px 20px, auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.kd-inspect-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.kd-inspect-tab {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.5);
}

.kd-inspect-tab.kd-active {
  color: #06210f;
  background: #3ddc84;
}

.kd-inspect-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.kd-inspect-canvas {
  width: 100%;
  height: 200px;
  border-radius: 10px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 70%);
}

.kd-inspect-name {
  font-weight: 900;
  font-size: 15px;
}

.kd-inspect-rarity {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---- shop screen ---- */

.kd-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.kd-case-card {
  background: rgba(10, 14, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
}

.kd-case-thumb {
  color: #6ec3ff;
}

/* ---- shop: case detail view ---- */

.kd-shop-case {
  position: relative;
}

.kd-case-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 77, 77, 0.85);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.kd-case-name {
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 6px;
}

.kd-case-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  color: #6ec3ff;
}

.kd-case-hero svg {
  width: 84px;
  height: 84px;
}

.kd-case-contents-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  margin-bottom: 10px;
}

.kd-case-fx {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
}

.kd-case-contents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.kd-content-tile {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.kd-content-pct {
  align-self: flex-end;
  font-size: 10px;
  font-weight: 800;
  color: var(--kd-rarity, #b0b7c3);
}

.kd-content-icon {
  color: var(--kd-rarity, #b0b7c3);
}

.kd-content-name {
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
}

.kd-content-model {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.kd-content-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--kd-rarity, #b0b7c3);
}

.kd-case-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kd-case-foot-price {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  cursor: default;
}

.kd-case-foot-gem {
  cursor: pointer;
}

.kd-case-open-btn {
  flex: 1 1 auto;
  min-width: 140px;
}

.kd-bulk-btn {
  min-height: 44px;
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  cursor: pointer;
}

.kd-bulk-btn span {
  font-size: 14px;
  font-weight: 900;
}

.kd-case-title {
  font-weight: 900;
  font-size: 16px;
}

.kd-case-pool {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
}

.kd-pool-seg {
  flex: 1 1 0;
}

.kd-case-price {
  font-weight: 800;
  color: #ffd166;
}

.kd-reel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 60;
}

.kd-reel-wrap {
  position: relative;
  width: min(90vw, 640px);
  height: 150px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
}

.kd-reel-pointer {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #ff4d4d;
  transform: translateX(-50%);
  z-index: 2;
}

.kd-reel-track {
  position: absolute;
  top: 0;
  left: 50%;
  display: flex;
  height: 100%;
  will-change: transform;
}

.kd-reel-card {
  width: 112px;
  height: 100%;
  margin-right: 16px;
  border: 2px solid var(--kd-rarity, #b0b7c3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
}

.kd-reel-diamond {
  width: 24px;
  height: 24px;
  background: var(--kd-rarity, #b0b7c3);
  transform: rotate(45deg);
  border-radius: 4px;
}

.kd-reel-name {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  padding: 0 6px;
}

.kd-skip-btn {
  min-width: 120px;
}

.kd-reel-result {
  position: relative;
  background: rgba(12, 15, 22, 0.95);
  border: 2px solid var(--kd-rarity, #b0b7c3);
  border-radius: 16px;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 40px var(--kd-rarity, #b0b7c3);
}

.kd-reel-result-name {
  font-weight: 900;
  font-size: 18px;
}

.kd-reel-result-rarity {
  color: var(--kd-rarity, #b0b7c3);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
}

.kd-reel-dup {
  color: #ffd166;
  font-weight: 700;
  font-size: 13px;
}

/* ---- gem case ---- */

.kd-case-card-gem {
  border-color: rgba(168, 85, 247, 0.4);
}

/* ---- battle pass ---- */

.kd-pass-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kd-pass-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kd-pass-title {
  font-size: 18px;
  font-weight: 900;
}

.kd-pass-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.kd-pass-tier {
  font-size: 13px;
  font-weight: 800;
  color: #a855f7;
}

.kd-pass-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 10px;
}

.kd-pass-tiercol {
  flex: 0 0 90px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0.55;
}

.kd-pass-tiercol.kd-pass-reached {
  opacity: 1;
}

.kd-pass-tiernum {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
}

.kd-pass-cell {
  min-height: 84px;
  border-radius: 10px;
  background: rgba(10, 14, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  text-align: center;
}

.kd-pass-cell-empty {
  background: transparent;
  border-color: transparent;
  min-height: 40px;
}

.kd-pass-cell-premium {
  border-color: rgba(168, 85, 247, 0.35);
}

.kd-pass-reward {
  font-size: 11px;
  font-weight: 700;
}

.kd-pass-locked {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
}

.kd-pass-claim {
  min-height: 44px;
  width: 100%;
}

/* ---- quests screen ---- */

.kd-quest-card .kd-quest-text {
  display: block;
  margin-bottom: 8px;
}

/* ---- leaderboard ---- */

.kd-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kd-stat-card {
  background: rgba(10, 14, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
}

.kd-stat-card-val {
  font-size: 22px;
  font-weight: 900;
  color: #3ddc84;
}

.kd-stat-card-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ---- settings ---- */

.kd-setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kd-setting-row:last-child {
  border-bottom: none;
}

.kd-setting-row span:first-child {
  flex: 0 0 110px;
  font-weight: 700;
  font-size: 13px;
}

.kd-setting-row input[type="range"] {
  flex: 1 1 auto;
  min-height: 44px;
}

.kd-setting-row select {
  flex: 1 1 auto;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0 8px;
}

.kd-setting-val {
  flex: 0 0 50px;
  text-align: right;
  font-weight: 700;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.kd-setting-row-check input[type="checkbox"] {
  width: 22px;
  height: 22px;
}

/* ---- mobile landscape (844x390 etc) ---- */

@media (max-height: 420px) {
  .kd-topbar {
    padding: 6px 12px 4px;
  }

  .kd-nav-btn {
    min-height: 40px;
    min-width: 44px;
    font-size: 9px;
  }

  .kd-home {
    flex-direction: row;
  }

  .kd-home-side {
    flex-basis: 200px;
    overflow-y: auto;
  }

  .kd-play-big {
    min-width: 160px;
    min-height: 64px;
    font-size: 22px;
  }

  .kd-menu-mid {
    padding: 6px 10px;
    gap: 8px;
  }

  .kd-quests-aside {
    flex-basis: 170px;
  }

  .kd-menu-body {
    padding: 8px 10px 10px;
  }

  .kd-case-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kd-case-contents-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .kd-home {
    flex-direction: column;
  }

  .kd-home-side {
    flex: 0 0 auto;
    max-width: none;
  }

  .kd-topbar {
    gap: 4px;
    padding: 8px 10px 4px;
  }

  .kd-stat {
    font-size: 12px;
    gap: 4px;
  }

  .kd-stat-coins,
  .kd-stat-gems {
    padding: 4px 8px;
    flex: 0 0 auto;
  }

  .kd-stat-level {
    width: 160px;
  }

  .kd-level-badge {
    padding: 3px 7px;
    font-size: 10px;
  }

  .kd-back {
    padding: 0 10px;
    font-size: 12px;
    min-width: 0;
  }

  .kd-menu-mid {
    flex-direction: column;
    padding: 6px 10px;
    overflow-y: auto;
  }

  .kd-quests-aside {
    flex: 0 0 auto;
    max-width: none;
  }

  .kd-quests-aside .kd-panel {
    height: auto;
    max-height: 160px;
  }

  .kd-menu-panel {
    max-width: none;
  }

  .kd-nav-btn {
    flex: 1 1 0;
    min-width: 0;
    font-size: 9px;
  }

  .kd-case-contents-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .kd-pass-tiercol {
    flex: 0 0 78px;
  }

  .kd-pass-cell {
    min-height: 72px;
    padding: 4px;
  }
}

/* Lobby overlay: the live 3D lobby shows through, blurred, like the clips. */
.kd-menu-root.kd-menu-overlay .kd-menu-bg {
  background: rgba(8, 10, 16, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---- always-on lobby HUD (no panel, 3D world shows through) ---- */

.kd-menu-root.kd-hud-mode {
  pointer-events: none;
  background: transparent;
}

.kd-menu-root.kd-hud-mode .kd-menu-bg {
  display: none;
}

.kd-hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.kd-hud .kd-topbar,
.kd-hud .kd-queue-pill,
.kd-hud .kd-quests-aside,
.kd-hud .kd-hud-bottom {
  pointer-events: auto;
}

.kd-hud-mid {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  padding: 10px 16px;
  min-height: 0;
}

.kd-hud-mid .kd-quests-aside {
  flex: 0 0 240px;
  max-width: 60vw;
}

.kd-hud-mid .kd-quests-aside .kd-panel {
  max-height: 220px;
  overflow-y: auto;
}

.kd-hud-bottom {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
}

.kd-hud-play-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.kd-hud-friends-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kd-hud-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.72);
  border: 2px solid #3ddc84;
}

.kd-hud-add-btn {
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(10, 12, 18, 0.72);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.kd-cancel-btn {
  min-width: 220px;
  min-height: 84px;
  border-radius: 18px;
  font-size: 22px;
  letter-spacing: 2px;
}

/* ---- matchmaking queue pill ---- */

.kd-queue-pill {
  align-self: center;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8, 10, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 12px;
  color: #fff;
}

.kd-queue-icon {
  display: flex;
  align-items: center;
  color: #ffd166;
}

.kd-queue-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.kd-queue-label {
  font-weight: 800;
  font-size: 13px;
}

.kd-queue-mode {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  font-weight: 700;
}

.kd-queue-timer {
  font-weight: 900;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.kd-queue-cancel {
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: #ff4d4d;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

/* ---- quick play mode picker ---- */

.kd-mode-picker-overlay {
  position: fixed;
  inset: 0;
  pointer-events: auto;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 8, 0.72);
  padding: 16px;
}

.kd-mode-picker {
  width: 100%;
  max-width: 420px;
  background: rgba(10, 14, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
}

.kd-mode-picker-title {
  font-weight: 900;
  font-size: 16px;
  text-align: center;
  margin-bottom: 12px;
}

.kd-mode-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kd-mode-pick-btn {
  min-height: 64px;
  border-radius: 12px;
  border: none;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  touch-action: manipulation;
}

.kd-grad-bots { background: linear-gradient(135deg, #6b7280, #33363f); }

.kd-mode-pick-btn.kd-locked {
  filter: grayscale(0.6) brightness(0.55);
  cursor: not-allowed;
}

/* ---- map vote overlay ---- */

.kd-mapvote-overlay {
  position: fixed;
  inset: 0;
  pointer-events: auto;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: rgba(6, 7, 10, 0.82);
}

.kd-mapvote-header {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.kd-mapvote-side {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kd-mapvote-avatars {
  display: flex;
  gap: 4px;
}

.kd-mapvote-avatar {
  width: 26px;
  height: 26px;
  border-radius: 3px;
  background: #b8bcc3 center / cover no-repeat;
  border-bottom: 3px solid rgba(255, 255, 255, 0.3);
}

.kd-mapvote-avatar-a { border-bottom-color: #3ddc84; }
.kd-mapvote-avatar-b { border-bottom-color: #ff4d4d; }

.kd-mapvote-score {
  font-weight: 900;
  font-size: 15px;
  min-width: 18px;
  text-align: center;
}

.kd-mapvote-score-a { color: #3ddc84; }
.kd-mapvote-score-b { color: #ff4d4d; }

.kd-mapvote-vs {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.kd-mapvote-count {
  font-size: 64px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.kd-mapvote-cards {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 16px;
}

.kd-mapvote-card {
  position: relative;
  width: 200px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: none;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  color: #fff;
  touch-action: manipulation;
}

.kd-mapvote-card.kd-active {
  border-color: #3ddc84;
  box-shadow: 0 0 0 2px rgba(61, 220, 132, 0.4);
}

.kd-mapvote-thumb {
  width: 100%;
  height: 112px;
  background-color: #2a2d34;
  background-size: cover;
  background-position: center;
}

.kd-mapvote-card-warehouse .kd-mapvote-thumb { background-color: #8a7a5c; }
.kd-mapvote-card-skyscraper .kd-mapvote-thumb { background-color: #5c6b7a; }
.kd-mapvote-card-cargo .kd-mapvote-thumb { background-color: #3a6b8a; }
.kd-mapvote-card-prototype .kd-mapvote-thumb { background-color: #6b5c8a; }

.kd-mapvote-name {
  padding: 8px 4px;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.55);
}

.kd-mapvote-votes {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffd166;
  font-weight: 800;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}

@media (max-width: 480px) {
  .kd-hud-mid .kd-quests-aside {
    flex-basis: 170px;
    max-width: 55vw;
  }

  .kd-mode-picker-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kd-mapvote-card {
    width: 140px;
  }

  .kd-mapvote-count {
    font-size: 44px;
  }
}

/* ---- lobby HUD sizing: matches the real Roblox HUD (smaller and flatter
   than the full-screen menu chrome above uses). ---- */

.kd-gem-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.kd-gem-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #a855f7;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  padding: 0;
}

.kd-hud .kd-topbar {
  padding: 8px 12px 4px;
  gap: 3px;
}

.kd-hud .kd-stat {
  font-size: 13px;
}

.kd-hud .kd-stat-coins,
.kd-hud .kd-stat-gems {
  padding: 4px 10px;
}

.kd-hud .kd-stat-level {
  width: 170px;
}

.kd-hud .kd-level-badge {
  font-size: 10px;
  padding: 2px 8px;
}

.kd-hud .kd-xpbar {
  height: 4px;
}

.kd-hud .kd-quests-panel {
  background: transparent;
  border: none;
  padding: 0;
}

.kd-hud .kd-panel-title-row {
  margin-bottom: 6px;
}

.kd-hud .kd-panel-title {
  font-size: 12px;
  color: #ffffff;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

.kd-quest-timer {
  font-weight: 600;
  opacity: 0.85;
}

.kd-hud .kd-quest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(8, 10, 15, 0.62);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
}

.kd-hud .kd-quest-row .kd-quest-text {
  margin-bottom: 0;
  font-size: 11px;
  gap: 4px;
}

.kd-hud .kd-quest-row .kd-bar {
  display: none;
}

.kd-hud .kd-quest-row .kd-quest-foot {
  gap: 0;
}

.kd-hud .kd-quest-row .kd-quest-foot .kd-btn {
  display: none;
}

.kd-hud .kd-quest-row .kd-quest-reward {
  font-size: 11px;
}

.kd-hud .kd-play-big,
.kd-hud .kd-cancel-btn {
  min-width: 130px;
  min-height: 46px;
  font-size: 17px;
  letter-spacing: 1px;
  border-radius: 12px;
}

.kd-hud .kd-play-big {
  min-width: 110px;
  padding: 0 22px;
  background: #2fbf4a;
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(47, 191, 74, 0.4);
}

.kd-hud .kd-nav-btn {
  flex: 0 1 52px;
  min-width: 40px;
  min-height: 40px;
  font-size: 8px;
  gap: 2px;
  border-radius: 8px;
  background: rgba(8, 10, 15, 0.72);
}

.kd-hud .kd-hud-avatar {
  width: 24px;
  height: 24px;
}

.kd-hud .kd-hud-add-btn {
  width: 20px;
  height: 20px;
  font-size: 12px;
}

/* Map reveal: black screen with the map card before the countdown (1:1 with the clips). */
.kd-mapreveal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.kd-mapreveal.kd-out { opacity: 0; }
.kd-mapreveal-card {
  width: min(300px, 60vw);
  aspect-ratio: 16 / 9;
  background: #333 center / cover no-repeat;
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.kd-mapreveal-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8%;
  text-align: center;
  color: #fff;
  font: 800 22px "Builder Sans", "Gotham", "Segoe UI", sans-serif;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}
