/* ============================================================
   CS2 CASE OPENER — FRONTEND STYLES
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Orbitron:wght@400;700;900&display=swap');

:root {
  --cs2-bg:          #06080f;
  --cs2-bg2:         #0b1020;
  --cs2-surface:     rgba(255,255,255,0.04);
  --cs2-border:      rgba(255,255,255,0.08);
  --cs2-cyan:        #00e5ff;
  --cs2-cyan-dim:    rgba(0,229,255,0.15);
  --cs2-purple:      #8b5cf6;
  --cs2-purple-dim:  rgba(139,92,246,0.15);
  --cs2-green:       #00ff88;
  --cs2-green-dim:   rgba(0,255,136,0.15);
  --cs2-gold:        #ffd700;
  --cs2-text:        #e2eaf4;
  --cs2-muted:       #6b7a96;

  /* Rarity colors */
  --rarity-consumer:   #b0b0b0;
  --rarity-industrial: #6c9ae8;
  --rarity-mil-spec:   #4b70e3;
  --rarity-restricted: #8846e3;
  --rarity-classified: #eb4b4b;
  --rarity-covert:     #e34b4b;
  --rarity-gold:       #ffd700;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ── BODY ── */
.cs2co-body {
  background: var(--cs2-bg);
  color: var(--cs2-text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── HEADER ── */
.cs2co-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(6,8,15,0.95);
  border-bottom: 1px solid var(--cs2-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.cs2co-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cs2-muted);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .05em;
  transition: color .2s;
}
.cs2co-back-btn:hover { color: var(--cs2-cyan); }

.cs2co-logo {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .2em;
  color: var(--cs2-cyan);
  text-shadow: 0 0 20px var(--cs2-cyan);
}

/* ── HERO ── */
.cs2co-case-hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cs2co-hero-banner {
  position: absolute;
  inset: -60px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(.22) saturate(.5);
  transform: scale(1.15);
}

.cs2co-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--cs2-bg) 100%);
}

.cs2co-hero-content {
  position: relative;
  text-align: center;
  z-index: 2;
  padding: 40px 20px;
}

.cs2co-case-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(24px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: .05em;
  color: #fff;
  text-shadow: 0 0 40px var(--cs2-cyan), 0 0 80px rgba(0,229,255,.3);
  margin-bottom: 12px;
}

.cs2co-case-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--cs2-cyan);
  letter-spacing: .1em;
  margin-bottom: 32px;
  text-shadow: 0 0 20px var(--cs2-cyan);
}

/* ── OPEN BUTTON ── */
.cs2co-open-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 52px;
  background: transparent;
  border: 2px solid var(--cs2-cyan);
  border-radius: 4px;
  color: var(--cs2-cyan);
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2em;
  cursor: pointer;
  overflow: hidden;
  transition: all .3s cubic-bezier(.25,.46,.45,.94);
  box-shadow: 0 0 20px var(--cs2-cyan-dim), inset 0 0 20px var(--cs2-cyan-dim);
}
.cs2co-open-btn:hover {
  background: var(--cs2-cyan-dim);
  box-shadow: 0 0 40px var(--cs2-cyan), inset 0 0 40px rgba(0,229,255,.2);
  transform: translateY(-2px);
  color: #fff;
}
.cs2co-open-btn:active { transform: translateY(0); }
.cs2co-open-btn .btn-glow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, transparent 40%, rgba(0,229,255,.2) 100%);
  pointer-events: none;
}
.cs2co-open-btn.spinning {
  pointer-events: none;
  opacity: .6;
}

/* ── ROULETTE ── */
.cs2co-roulette-section {
  padding: 0 0 40px;
  background: var(--cs2-bg);
}

.cs2co-roulette-wrap {
  position: relative;
  overflow: hidden;
  height: 200px;
  background: rgba(255,255,255,.03);
  border-top: 1px solid var(--cs2-border);
  border-bottom: 1px solid var(--cs2-border);
}

.cs2co-roulette-track-wrap {
  overflow: hidden;
  height: 100%;
}

.cs2co-roulette-track {
  display: flex;
  height: 100%;
  will-change: transform;
  user-select: none;
}

/* Center marker */
.cs2co-roulette-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  background: var(--cs2-cyan);
  box-shadow: 0 0 20px var(--cs2-cyan), 0 0 40px var(--cs2-cyan);
  z-index: 10;
  pointer-events: none;
}
.cs2co-roulette-marker::before,
.cs2co-roulette-marker::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
}
.cs2co-roulette-marker::before {
  top: 0;
  border-top-color: var(--cs2-cyan);
  border-bottom: none;
}
.cs2co-roulette-marker::after {
  bottom: 0;
  border-bottom-color: var(--cs2-cyan);
  border-top: none;
}

/* Fade edges */
.cs2co-roulette-fade-left,
.cs2co-roulette-fade-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 160px;
  z-index: 5;
  pointer-events: none;
}
.cs2co-roulette-fade-left {
  left: 0;
  background: linear-gradient(to right, var(--cs2-bg), transparent);
}
.cs2co-roulette-fade-right {
  right: 0;
  background: linear-gradient(to left, var(--cs2-bg), transparent);
}

/* Roulette skin items */
.cs2co-roulette-item {
  flex: 0 0 160px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-right: 1px solid rgba(255,255,255,.05);
  position: relative;
  gap: 8px;
}
.cs2co-roulette-item img {
  width: 90px;
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0,229,255,.3));
}
.cs2co-roulette-item .ri-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-align: center;
  color: var(--cs2-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.cs2co-roulette-item .ri-rarity-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
}

/* ── RARITY GLOW for roulette items ── */
.cs2co-roulette-item.rarity-consumer   { background: rgba(176,176,176,.04); }
.cs2co-roulette-item.rarity-industrial { background: rgba(108,154,232,.05); }
.cs2co-roulette-item.rarity-mil-spec   { background: rgba(75,112,227,.06); }
.cs2co-roulette-item.rarity-restricted { background: rgba(136,70,227,.07); }
.cs2co-roulette-item.rarity-classified { background: rgba(235,75,75,.07); }
.cs2co-roulette-item.rarity-covert     { background: rgba(227,75,75,.08); }
.cs2co-roulette-item.rarity-gold       { background: rgba(255,215,0,.08); }

.cs2co-roulette-item.rarity-consumer   .ri-rarity-bar { background: var(--rarity-consumer); }
.cs2co-roulette-item.rarity-industrial .ri-rarity-bar { background: var(--rarity-industrial); }
.cs2co-roulette-item.rarity-mil-spec   .ri-rarity-bar { background: var(--rarity-mil-spec); }
.cs2co-roulette-item.rarity-restricted .ri-rarity-bar { background: var(--rarity-restricted); }
.cs2co-roulette-item.rarity-classified .ri-rarity-bar { background: var(--rarity-classified); }
.cs2co-roulette-item.rarity-covert     .ri-rarity-bar { background: var(--rarity-covert); }
.cs2co-roulette-item.rarity-gold       .ri-rarity-bar { background: var(--rarity-gold); box-shadow: 0 0 10px var(--cs2-gold); }

/* ── SKINS GRID ── */
.cs2co-skins-section {
  padding: 48px 32px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.cs2co-skins-title {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--cs2-muted);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.cs2co-skins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.cs2co-skin-card {
  position: relative;
  background: var(--cs2-surface);
  border: 1px solid var(--cs2-border);
  border-radius: 8px;
  padding: 16px 12px 12px;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
}
.cs2co-skin-card:hover {
  transform: translateY(-4px);
}

.cs2co-skin-card img {
  width: 100%;
  max-height: 100px;
  object-fit: contain;
  margin-bottom: 10px;
}

.cs2co-skin-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs2co-skin-card .skin-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--cs2-text);
}

.cs2co-skin-card .skin-rarity {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.rarity-label-consumer   { color: var(--rarity-consumer); }
.rarity-label-industrial { color: var(--rarity-industrial); }
.rarity-label-mil-spec   { color: var(--rarity-mil-spec); }
.rarity-label-restricted { color: var(--rarity-restricted); }
.rarity-label-classified { color: var(--rarity-classified); }
.rarity-label-covert     { color: var(--rarity-covert); }
.rarity-label-gold       { color: var(--rarity-gold); }

.cs2co-skin-card .skin-chance {
  font-size: 10px;
  color: var(--cs2-muted);
}

.cs2co-skin-card-glow {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 40px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.cs2co-skin-card:hover .cs2co-skin-card-glow { opacity: 1; }

/* Rarity border glow on cards */
.rarity-consumer   { border-color: rgba(176,176,176,.25); }
.rarity-industrial { border-color: rgba(108,154,232,.3); }
.rarity-mil-spec   { border-color: rgba(75,112,227,.35); }
.rarity-restricted { border-color: rgba(136,70,227,.4); box-shadow: 0 0 20px rgba(136,70,227,.1); }
.rarity-classified { border-color: rgba(235,75,75,.4); box-shadow: 0 0 20px rgba(235,75,75,.1); }
.rarity-covert     { border-color: rgba(227,75,75,.5); box-shadow: 0 0 30px rgba(227,75,75,.15); }
.rarity-gold       { border-color: rgba(255,215,0,.5); box-shadow: 0 0 30px rgba(255,215,0,.15); }

/* ── POPUP ── */
.cs2co-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: popupFadeIn .3s ease;
}

@keyframes popupFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.cs2co-popup {
  position: relative;
  background: linear-gradient(145deg, #0d1628, #111827);
  border: 1px solid rgba(0,229,255,.2);
  border-radius: 16px;
  padding: 40px 32px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 80px rgba(0,229,255,.1), 0 40px 80px rgba(0,0,0,.6);
  animation: popupSlideIn .4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes popupSlideIn {
  from { opacity: 0; transform: scale(.8) translateY(40px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.cs2co-popup-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 20px;
  color: var(--cs2-muted);
  cursor: pointer;
  transition: color .2s, transform .2s;
  line-height: 1;
}
.cs2co-popup-close:hover { color: #fff; transform: scale(1.2); }

.cs2co-popup-header {
  margin-bottom: 20px;
}

.cs2co-popup-label {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3em;
  color: var(--cs2-cyan);
  text-shadow: 0 0 20px var(--cs2-cyan);
}

.cs2co-popup-skin-wrap {
  position: relative;
  display: inline-block;
  margin: 0 auto 20px;
}

.cs2co-popup-skin-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  filter: blur(24px);
  opacity: .6;
  z-index: 0;
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: .4; transform: scale(1); }
  50%       { opacity: .8; transform: scale(1.1); }
}

.cs2co-popup-skin-img {
  position: relative;
  z-index: 1;
  width: 200px;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(0,229,255,.5));
  animation: skinFloat 3s ease-in-out infinite;
}

@keyframes skinFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.cs2co-popup-skin-name {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: .05em;
}

.cs2co-popup-skin-rarity {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.cs2co-popup-text {
  font-size: 14px;
  color: var(--cs2-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.cs2co-popup-trade-text {
  font-size: 13px;
  color: var(--cs2-muted);
  margin-bottom: 16px;
}

.cs2co-popup-trade input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--cs2-border);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--cs2-text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  letter-spacing: .05em;
  outline: none;
  transition: border-color .2s;
  margin-bottom: 20px;
}
.cs2co-popup-trade input:focus {
  border-color: var(--cs2-cyan);
  box-shadow: 0 0 12px var(--cs2-cyan-dim);
}
.cs2co-popup-trade input::placeholder { color: var(--cs2-muted); }

.cs2co-popup-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.cs2co-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 4px;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .15em;
  cursor: pointer;
  border: none;
  transition: all .25s;
  text-decoration: none;
}

.cs2co-btn-task {
  background: var(--cs2-purple-dim);
  border: 1px solid var(--cs2-purple);
  color: var(--cs2-purple);
}
.cs2co-btn-task:hover {
  background: rgba(139,92,246,.25);
  box-shadow: 0 0 20px rgba(139,92,246,.4);
  color: #fff;
}

.cs2co-btn-claim {
  background: rgba(0,255,136,.08);
  border: 1px solid rgba(0,255,136,.3);
  color: rgba(0,255,136,.4);
  cursor: not-allowed;
  transition: all .35s;
}
.cs2co-btn-claim.active {
  color: var(--cs2-green);
  border-color: var(--cs2-green);
  background: var(--cs2-green-dim);
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0,255,136,.3);
}
.cs2co-btn-claim.active:hover {
  box-shadow: 0 0 40px rgba(0,255,136,.5);
  background: rgba(0,255,136,.2);
}

/* ── SHORTCODE GRID ── */
.cs2co-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.cs2co-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--cs2-surface);
  border: 1px solid var(--cs2-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--cs2-text);
  transition: transform .25s cubic-bezier(.25,.46,.45,.94), box-shadow .25s;
}
.cs2co-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0,229,255,.1), 0 0 0 1px rgba(0,229,255,.2);
}

.cs2co-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cs2-cyan), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.cs2co-card:hover .cs2co-card-glow { opacity: 1; }

.cs2co-card-banner {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #0d1628, #1a2040);
  background-size: cover;
  background-position: center;
}
.cs2co-card-banner--placeholder {
  background: linear-gradient(135deg, #0d1628 0%, #1a2040 50%, #0d2040 100%);
}

.cs2co-card-info {
  padding: 14px 16px 10px;
  flex: 1;
}
.cs2co-card-name {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  color: #fff;
  margin-bottom: 4px;
}
.cs2co-card-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--cs2-cyan);
  letter-spacing: .08em;
}

.cs2co-card-open {
  margin: 0 16px 16px;
  padding: 10px;
  border: 1px solid rgba(0,229,255,.25);
  border-radius: 4px;
  text-align: center;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--cs2-cyan);
  transition: all .2s;
}
.cs2co-card:hover .cs2co-card-open {
  background: var(--cs2-cyan-dim);
  box-shadow: 0 0 20px var(--cs2-cyan-dim);
}

.cs2co-no-cases {
  color: var(--cs2-muted);
  text-align: center;
  padding: 40px;
  font-family: 'Rajdhani', sans-serif;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .cs2co-header { padding: 12px 16px; }
  .cs2co-skins-section { padding: 32px 16px 60px; }
  .cs2co-skins-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .cs2co-popup { padding: 28px 20px 24px; }
  .cs2co-popup-skin-img { width: 140px; height: 110px; }
  .cs2co-roulette-wrap { height: 160px; }
  .cs2co-roulette-item { flex: 0 0 120px; }
  .cs2co-roulette-item img { width: 70px; height: 55px; }
  .cs2co-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}

/* ── WIN ANIMATION ── */
.cs2co-win-flash {
  animation: winFlash .6s ease;
}
@keyframes winFlash {
  0%   { box-shadow: 0 0 0px transparent; }
  50%  { box-shadow: 0 0 100px var(--cs2-cyan), 0 0 200px rgba(0,229,255,.3); }
  100% { box-shadow: 0 0 0px transparent; }
}

/* ── ALREADY OPENED NOTICE ── */
.cs2co-already-opened {
  background: rgba(255,90,50,.06);
  border: 1px solid rgba(255,100,50,.3);
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  animation: popupSlideIn .4s cubic-bezier(.34,1.56,.64,1);
}

.cs2co-already-icon {
  font-size: 40px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(255,100,50,.5));
}

.cs2co-already-title {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #ff7a50;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(255,100,50,.5);
}

.cs2co-already-text {
  font-size: 14px;
  color: var(--cs2-muted);
  line-height: 1.6;
}

/* ── TRADE URL HELPER ── */
.cs2co-trade-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.cs2co-trade-input-wrap input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--cs2-border);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--cs2-text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  letter-spacing: .05em;
  outline: none;
  transition: border-color .2s;
  margin-bottom: 0;
}
.cs2co-trade-input-wrap input:focus {
  border-color: var(--cs2-cyan);
  box-shadow: 0 0 12px var(--cs2-cyan-dim);
}
.cs2co-trade-input-wrap input::placeholder { color: var(--cs2-muted); }

.cs2co-trade-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cs2-muted);
  text-decoration: none;
  letter-spacing: .05em;
  transition: color .2s;
  padding: 4px 0;
  align-self: flex-start;
}
.cs2co-trade-help:hover {
  color: var(--cs2-cyan);
}
.cs2co-trade-help svg {
  flex-shrink: 0;
}
