* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(245, 158, 11, 0.18), transparent 32%), #070a10;
  color: #f8fafc;
  font-family: Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #111827;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

button.discord {
  background: #5865f2;
  color: white;
}

button.danger {
  background: #ef4444;
  color: white;
}

button.small {
  padding: 10px 12px;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.75);
  color: #f8fafc;
  padding: 11px 12px;
}

label {
  display: grid;
  gap: 7px;
  color: #cbd5e1;
  font-size: 13px;
}

.app {
  width: calc(100% - 260px);
  margin-left: 260px;
  padding: 24px;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.muted {
  color: #94a3b8;
}

.topbar,
.section-head,
.opening-head,
.user-zone,
.inventory-actions,
.autosell-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar,
.section-head,
.opening-head {
  justify-content: space-between;
}

.topbar {
  margin-bottom: 20px;
}

.topbar h1,
.panel h2 {
  margin: 0;
}

.topbar p,
.opening-head p {
  margin: 6px 0 0;
  color: #94a3b8;
}

.panel,
.stat-card {
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 24px;
  box-shadow: 0 20px 65px rgba(0, 0, 0, 0.32);
}

.panel {
  padding: 20px;
}

.auth-panel {
  margin-bottom: 16px;
}

.auth-grid,
.stats-grid,
.layout,
.bottom-layout,
.admin-grid {
  display: grid;
  gap: 16px;
}

.auth-grid,
.admin-grid {
  grid-template-columns: repeat(2, 1fr);
}

.stats-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  display: block;
  color: #94a3b8;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 22px;
}

.layout {
  grid-template-columns: 330px 1fr;
  align-items: start;
  margin-bottom: 16px;
}

.bottom-layout {
  grid-template-columns: 380px 1fr;
}

.case-list,
.shop-list,
.roulette-stack,
.inventory,
.admin-list {
  display: grid;
  gap: 12px;
}

.case-card-select,
.shop-card,
.inventory-card,
.admin-row {
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 14px;
}

.case-card-select {
  cursor: pointer;
}

.case-card-select.active {
  border-color: #facc15;
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.18);
}

.case-card-select h3,
.shop-card h3,
.inventory-card h3 {
  margin: 0 0 8px;
}

.case-card-select p,
.shop-card p,
.inventory-card p {
  margin: 0;
  color: #94a3b8;
}

.open-controls {
  display: grid;
  grid-template-columns: 110px 120px 150px;
  gap: 10px;
}

.roulette-box {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  background: rgba(2, 6, 23, 0.72);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.roulette-marker {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 4;
  width: 4px;
  height: 100%;
  background: #facc15;
  box-shadow: 0 0 24px #facc15;
  transform: translateX(-50%);
}

.roulette-track {
  display: flex;
  gap: 12px;
  padding: 18px;
  will-change: transform;
}

.skin-card {
  flex: 0 0 150px;
  width: 150px;
  min-height: 154px;
  border-radius: 16px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: grid;
  gap: 8px;
}

.skin-image {
  height: 74px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.skin-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.weapon-fallback {
  font-size: 34px;
}

.skin-name {
  font-size: 12px;
  font-weight: 900;
}

.skin-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #cbd5e1;
  font-size: 12px;
}

.skin-price {
  color: #22c55e;
  font-weight: 900;
}

.consumer { border-color: #9ca3af }
.industrial { border-color: #60a5fa }
.milspec { border-color: #2563eb }
.restricted { border-color: #9333ea }
.classified { border-color: #db2777 }
.covert { border-color: #ef4444 }
.rare { border-color: #f59e0b }
.contraband { border-color: #facc15; box-shadow: 0 0 30px rgba(250, 204, 21, 0.25) }

.result-line {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.autosold {
  color: #facc15;
}

.inventory {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  margin-top: 14px;
}

.inventory.empty {
  display: block;
  padding: 16px;
  color: #94a3b8;
}

.inventory-actions,
.autosell-box {
  flex-wrap: wrap;
  margin-top: 12px;
}

.inventory-actions > *,
.autosell-box > * {
  width: auto;
}

.autosell-box input[type="number"] {
  width: 120px;
}

.live-feed {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  padding: 18px;
  background: rgba(2, 6, 23, 0.88);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.live-feed::-webkit-scrollbar { display: none; }

.live-feed h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.live-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-item {
  display: grid;
  grid-template-columns: 34px 48px 1fr;
  gap: 8px;
  align-items: center;
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  animation: feedIn 0.25s ease;
}

.feed-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #1f2937;
}

.feed-skin-img {
  width: 48px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
}

.feed-skin-placeholder {
  width: 48px;
  height: 36px;
}

.feed-item strong {
  display: block;
  font-size: 12px;
}

.feed-item span {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
}

.modal-card {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  position: relative;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 22px;
}

.modal-card.large {
  width: min(1040px, 100%);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.profile-preview img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: #1f2937;
}

.modal-card label {
  margin-bottom: 12px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr) auto;
  gap: 10px;
  align-items: end;
}

@keyframes feedIn {
  from { opacity: 0; transform: translateX(-12px) }
  to { opacity: 1; transform: translateX(0) }
}

@media (max-width: 1100px) {
  .live-feed {
    display: none;
  }

  .app {
    width: 100%;
    margin: 0;
  }

  .layout,
  .bottom-layout,
  .stats-grid,
  .auth-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .opening-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .open-controls {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.52);
  position: sticky;
  top: 12px;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.nav-tab {
  flex: 1 1 150px;
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.nav-tab.active {
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #111827;
  box-shadow: 0 0 28px rgba(250, 204, 21, 0.18);
}

.game-shell {
  display: block;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
  animation: pageIn 0.18s ease both;
}

.page-section .shop-panel,
.page-section .inventory-panel,
.admin-inline-panel {
  min-height: 520px;
}

.auth-panel {
  max-width: 780px;
  margin: 80px auto 24px;
  text-align: center;
  padding: 34px;
}

.auth-panel h2 {
  font-size: 34px;
}

.auth-panel::before {
  content: 'CONNEXION';
  display: inline-grid;
  place-items: center;
  margin: 0 auto 16px;
  width: 92px;
  height: 92px;
  border-radius: 28px;
  background: linear-gradient(135deg, #5865f2, #111827);
  color: white;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 0 45px rgba(88, 101, 242, 0.42);
}

.auth-grid {
  margin-top: 18px;
  text-align: left;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .main-nav {
    position: static;
  }

  .nav-tab {
    flex-basis: calc(50% - 8px);
  }

  .auth-panel {
    margin-top: 20px;
    padding: 22px;
  }
}

/* v19 gameplay polish */
.stats-grid {
  grid-template-columns: repeat(5, 1fr);
}

.case-card-select {
  position: relative;
  overflow: hidden;
}

.case-visual {
  height: 96px;
  margin-bottom: 12px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background:
    radial-gradient(circle at 65% 20%, rgba(250, 204, 21, 0.42), transparent 28%),
    linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.case-visual::before {
  content: '';
  width: 118px;
  height: 64px;
  border-radius: 13px;
  background: linear-gradient(145deg, #f59e0b, #78350f);
  border: 3px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28), inset 0 0 20px rgba(255, 255, 255, 0.10);
  transform: perspective(360px) rotateX(10deg) rotateY(-10deg);
}

.case-visual.starter::before { background: linear-gradient(145deg, #64748b, #0f172a) }
.case-visual.kilowatt::before { background: linear-gradient(145deg, #facc15, #f97316) }
.case-visual.dreams::before { background: linear-gradient(145deg, #8b5cf6, #db2777) }
.case-visual.revolution::before { background: linear-gradient(145deg, #ef4444, #7f1d1d) }
.case-visual.dragon::before { background: linear-gradient(145deg, #facc15, #14532d) }

.case-badge {
  position: absolute;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.case-mini-drops {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}

.mini-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.mini-dot.consumer { background: #9ca3af }
.mini-dot.industrial { background: #60a5fa }
.mini-dot.milspec { background: #2563eb }
.mini-dot.restricted { background: #9333ea }
.mini-dot.classified { background: #db2777 }
.mini-dot.covert { background: #ef4444 }
.mini-dot.rare { background: #f59e0b }
.mini-dot.contraband { background: #facc15 }

.case-preview-panel {
  margin-top: 16px;
}

.case-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.preview-card {
  border-radius: 18px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.preview-card .skin-card {
  width: 100%;
  min-height: 164px;
}

.chance-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.55);
}

.chance-line span {
  font-weight: 900;
  color: #facc15;
}

.chance-line small {
  color: #94a3b8;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.26);
  color: #fde68a;
  font-weight: 900;
}

.inventory-toolbar {
  display: grid;
  grid-template-columns: 1.2fr 220px 220px;
  gap: 12px;
  margin-top: 14px;
}

.visual-autosell {
  display: grid;
  grid-template-columns: 1.2fr repeat(5, minmax(120px, auto));
  align-items: end;
  padding: 14px;
  border-radius: 18px;
  background: rgba(88, 101, 242, 0.08);
  border: 1px solid rgba(88, 101, 242, 0.18);
}

.visual-autosell h3 {
  margin: 0 0 4px;
}

.visual-autosell p {
  margin: 0;
}

.toggle-line {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  width: auto;
}

.toggle-line input[type="checkbox"] {
  width: auto;
}

.shop-card {
  position: relative;
  overflow: hidden;
}

.shop-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.32), rgba(250, 204, 21, 0.18));
  color: #facc15;
  font-size: 22px;
  font-weight: 900;
}

.level-bar {
  display: flex;
  gap: 5px;
  margin: 12px 0;
}

.level-bar span {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
}

.level-bar span.filled {
  background: linear-gradient(135deg, #f97316, #facc15);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.25);
}

.weapon-fallback {
  font-size: 32px;
  color: #facc15;
  font-weight: 900;
}

.feed-item .contraband,
.feed-item .covert {
  color: #facc15;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .inventory-toolbar,
  .visual-autosell {
    grid-template-columns: 1fr;
  }
}

.rarity-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 520px;
}

.rarity-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
}

.rarity-check input {
  width: auto;
  margin: 0;
}

.rarity-check.consumer { border-color: rgba(148, 163, 184, 0.55); }
.rarity-check.industrial { border-color: rgba(96, 165, 250, 0.55); }
.rarity-check.milspec { border-color: rgba(37, 99, 235, 0.65); }
.rarity-check.restricted { border-color: rgba(147, 51, 234, 0.65); }
.rarity-check.classified { border-color: rgba(219, 39, 119, 0.65); }
.rarity-check.covert { border-color: rgba(220, 38, 38, 0.70); }
.rarity-check.rare { border-color: rgba(250, 204, 21, 0.75); }
.rarity-check.contraband { border-color: rgba(245, 158, 11, 0.80); }

.weapon-fallback.weapon-text {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #e5e7eb;
  background:
    radial-gradient(circle at 50% 40%, rgba(250, 204, 21, 0.20), transparent 42%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.92));
}

.admin-upgrade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.admin-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1200px) {
  .visual-autosell {
    grid-template-columns: 1fr;
  }
}

.gold-box {
  border-color: rgba(250, 204, 21, 0.32);
  background:
    radial-gradient(circle at 50% 0%, rgba(250, 204, 21, 0.18), transparent 42%),
    rgba(2, 6, 23, 0.55);
}

.gold-special-icon {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 48px;
  color: #facc15;
  background:
    radial-gradient(circle, rgba(250, 204, 21, 0.40), transparent 44%),
    linear-gradient(135deg, rgba(120, 53, 15, 0.90), rgba(15, 23, 42, 0.95));
  text-shadow: 0 0 18px rgba(250, 204, 21, 0.85);
  animation: goldPulse 1s infinite alternate;
}

.gold-reveal {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 18px;
  background:
    radial-gradient(circle at center, rgba(250, 204, 21, 0.16), transparent 48%),
    rgba(15, 23, 42, 0.88);
  animation: goldAppear 0.35s ease both;
}

.gold-title {
  text-align: center;
  font-weight: 1000;
  letter-spacing: 0.12em;
  color: #facc15;
  text-shadow: 0 0 20px rgba(250, 204, 21, 0.65);
}

.gold-reveal p {
  margin: 6px 0 10px;
  color: #fde68a;
  text-align: center;
}

.knife-roll {
  min-height: 205px;
}

.gold-result {
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.10);
}

@keyframes goldPulse {
  from { transform: scale(0.96); filter: brightness(1); }
  to { transform: scale(1.04); filter: brightness(1.3); }
}

@keyframes goldAppear {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}


/* v25 fixes */
.roulette-track .skin-price,
.roulette-track .skin-card.no-price .skin-price {
  display: none !important;
}

.roulette-track .skin-card.no-price .skin-meta {
  justify-content: flex-start;
}

/* v27 hard fixes */
.roulette-box .skin-price,
.roulette-box .skin-meta .skin-price,
.roulette-box .skin-meta span:nth-child(2),
.roulette-track .skin-price,
.roulette-track .skin-meta span:nth-child(2) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.roulette-box .skin-meta,
.roulette-track .skin-meta {
  justify-content: flex-start !important;
}

/* v27 absolute roulette anti-spoil */
.roulette-box .skin-price,
.roulette-track .skin-price,
.roulette-box .skin-meta span:nth-child(n+2),
.roulette-track .skin-meta span:nth-child(n+2) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}
