/* =========================
   Fonts & root variables
   ========================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root{
  --bg-dark-1: #0b0b0b;
  --bg-dark-2: #121212;
  --panel-bg: rgba(0,0,0,0.35);
  --panel-border: rgba(255,255,255,0.08);
  --muted: rgba(255,255,255,0.7);
  --accent: #0096ff;
  --gold: #ffd700;
  --card-radius: 12px;
  --card-padding: 14px;
  --transition-fast: 0.18s ease;
  --font-sans: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* =========================
   Reset & base
   ========================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html,body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg,var(--bg-dark-1),var(--bg-dark-2));
  color: #e6e6e6;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* subtle patterned background */
body::before {
  content: '';
  position: fixed;
  width: 200%;
  height: 200%;
  top: 50%;
  left: 50%;
  background: url('https://blacket.org/content/background.webp') repeat;
  background-size: 28.646vw;
  opacity: 0.06;
  transform: translate(-50%, -50%) rotate(15deg);
  z-index: -1;
  pointer-events: none;
}

/* container */
.container { max-width: 90%; margin: 0 auto; }

/* =========================
   Header / title
   ========================= */
header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px;
  background: var(--panel-bg);
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.08);
}

h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.4rem, 2.292vw, 2.4rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0.5rem 0;
}

/* =========================
   Buttons (normalized)
   ========================= */
button, .action-btn, .btn-primary, .btn-secondary, .back-button {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  line-height: 1;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  border: 2px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.42);
  color: #fff;
}

/* hover / focus */
.action-btn:hover, .btn-primary:hover, .btn-secondary:hover, .back-button:hover { transform: translateY(-2px); }
button:focus, .action-btn:focus, .btn-primary:focus, .btn-secondary:focus, .back-button:focus {
  outline: 3px solid rgba(0,150,255,0.18);
  outline-offset: 2px;
}

/* variants */
.btn-primary {
  background: rgba(0,150,255,0.6);
  border-color: rgba(0,150,255,0.8);
}
.btn-primary:hover { background: rgba(0,150,255,0.8); }

.btn-secondary {
  background: rgba(100,100,100,0.4);
  border-color: rgba(255,255,255,0.12);
}
.btn-secondary:hover { background: rgba(100,100,100,0.6); }

.action-btn {
  background: rgba(0,150,255,0.3);
  border-color: rgba(0,150,255,0.6);
}

.back-button {
  background: rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.12);
}

/* compact / icon */
.btn-compact, .action-btn.compact { min-height: 36px; padding: 6px 10px; font-size: 0.85rem; }
.btn-icon { padding: 8px; width: 40px; height: 40px; min-height: 40px; justify-content: center; }

/* action buttons container */
.action-buttons { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; align-items:center; }

/* =========================
   Packs grid & cards
   ========================= */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.pack-card {
  background: var(--panel-bg);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease, border-color 0.28s ease;
  border: 3px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}

.pack-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  border-color: var(rgba(255,255,255,0.08));
  background: rgba(0,0,0,0.5);
}

.pack-image {
  width: 100%;
  height: 150px;
  object-fit: contain;
  margin-bottom: 15px;
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
  padding: 10px;
}

.pack-info { text-align: center; }
.pack-name { font-size: 1.3em; font-weight: 700; margin-bottom: 10px; }

/* =========================
   Blooks grid & cards
   ========================= */
.blooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.blook-card {
  box-sizing: border-box;
  background: var(--panel-bg);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
  border: 3px solid var(--rarity-color, rgba(255,255,255,0.06));
  position: relative;
}

.blook-card:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  background: rgba(0,0,0,0.5);
}

.blook-image {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 10px auto;
  display: block;
}

.blook-name { font-size: 1.1em; font-weight: 700; margin-bottom: 8px; }
.blook-rarity {
  padding: 6px 12px;
  border-radius: 15px;
  display: inline-block;
  font-size: 0.85em;
  margin-bottom: 8px;
  background: var(--rarity-color, rgba(255,255,255,0.06));
  color: white;
  font-weight: 700;
}

.blook-stats { font-size: 0.85em; color: rgba(255,255,255,0.72); }
.blook-chance { margin-top: 8px; }

/* =========================
   Current pack header & loading
   ========================= */
.current-pack-header {
  background: var(--panel-bg);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  text-align: center;
  border: 2px solid rgba(255,255,255,0.08);
}
.current-pack-name { font-size: 2em; font-weight: 700; margin-bottom: 10px; }
.loading { text-align:center; padding:50px; font-size:1.1rem; color:var(--muted); }

/* =========================
   Modal
   ========================= */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
}
.modal.active { display:flex; align-items:center; justify-content:center; }

.modal-content {
  background: rgba(0,0,0,0.6);
  border: 3px solid rgba(255,255,255,0.12);
  border-radius: 15px;
  padding: 30px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute; top: 15px; right: 20px;
  font-size: 30px; font-weight: 700; color: #fff;
  cursor: pointer; border: none; background: none; padding: 0; line-height: 1;
}
.modal-close:hover { color: #ff6b6b; }

/* =========================
   Forms & controls
   ========================= */
.control-group { margin: 20px 0; padding: 15px; background: rgba(0,0,0,0.3); border-radius: 8px; }
.control-group label { display:block; margin-bottom:8px; font-weight:700; color:#fff; }
.control-group input, .control-group select {
  width:100%; padding:10px; background: rgba(0,0,0,0.42); border:2px solid rgba(255,255,255,0.08);
  border-radius:5px; color:#fff; font-size:16px;
}
.control-group input:focus, .control-group select:focus { outline:none; border-color: var(--accent); }

/* =========================
   Modal / blook detail helpers
   ========================= */
.blook-modal-header { display:flex; align-items:center; gap:30px; margin-bottom:30px; padding-bottom:20px; border-bottom:2px solid rgba(255,255,255,0.06); }
.blook-modal-image { width:150px; height:150px; object-fit:contain; }
.blook-modal-info h2 { font-size:2em; margin-bottom:10px; color:#fff; }

/* recommendation box */
.recommendation-box { background: rgba(0,150,255,0.12); border:2px solid rgba(0,150,255,0.35); padding:18px; border-radius:10px; margin:20px 0; }
.recommendation-box.warning { background: rgba(255,150,0,0.12); border-color: rgba(255,150,0,0.35); }
.recommendation-box h3 { margin-bottom:10px; }

/* =========================
   Accessibility & helpers
   ========================= */
.breadcrumb { margin-bottom: 20px; }
.breadcrumb a { color: var(--accent); text-decoration:none; font-size:1.05em; transition: transform 0.28s ease, color 0.18s ease; display:inline-block; }
.breadcrumb a:hover { color:#fff; transform: translateX(-5px); }

/* =========================
   Responsive
   ========================= */
@media (max-width: 768px) {
  .packs-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .blooks-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .blook-image { width: 100px; height: 100px; }
  .pack-image { height: 120px; }
  h1 { font-size: 1.6rem; }
}

.rgb-glow {
  background: linear-gradient(270deg,
    red, orange, yellow, lime, cyan, blue, magenta,
    red, orange, yellow, lime, cyan, blue, magenta);
  background-size: 200% 200%;
  animation: rgbSmooth 10s linear infinite;
  color: white;
  font-weight: 900;
}

.rgb-text-glow {
  background: linear-gradient(270deg,
    red, orange, yellow, lime, cyan, blue, magenta,
    red, orange, yellow, lime, cyan, blue, magenta);
  background-size: 200% 200%;
  animation: rgbSmooth 10s linear infinite;
  display: inline-block;               /* helps background-clip behave */
  -webkit-background-clip: text;       /* WebKit/Blink */
  background-clip: text;               /* standard */
  -webkit-text-fill-color: transparent;/* WebKit/Blink: make glyphs transparent so bg shows through */
  color: transparent;                  /* fallback for other engines */
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rgb-text-glow {
    animation: none;
    background-position: 0 0;
  }
}


@keyframes rgbSmooth {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
