/* ============================================================
   CHISELCRAFT STORE — store.css
   Purple / gold / dark gaming theme
   ============================================================ */

:root {
  --obsidian: #0a0a0f;
  --stone: #111118;
  --slate: #1a1a26;
  --ember: #e8621a;
  --gold: #d4a017;
  --rune: #5b9cf6;
  --violet: #9b59f5;
  --mist: #a0aec0;
  --red-accent: #ef4444;
}

/* ─── AMBIENT BACKGROUND ──────────────────────────────────── */
.store-ambient {
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(155,89,245,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 30%, rgba(212,160,23,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 50% 100%, rgba(91,156,246,0.04) 0%, transparent 60%);
}

/* ─── STORE HERO ──────────────────────────────────────────── */
.store-hero-bg {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(155,89,245,0.1) 0%, transparent 70%),
    var(--obsidian);
}
.store-hero-grid {
  background-image:
    linear-gradient(rgba(155,89,245,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155,89,245,0.08) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black, transparent 80%);
}
.store-title-accent {
  background: linear-gradient(135deg, var(--violet), var(--rune));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── NAVBAR (from styles.css reuse) ─────────────────────── */
#navbar { background: transparent; transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s; }
#navbar.scrolled { background: rgba(10,10,15,0.92); border-bottom: 1px solid rgba(155,89,245,0.15); backdrop-filter: blur(16px); }
.nav-link { position: relative; }
.nav-link::after { content: ''; position: absolute; bottom: 0; left: 50%; right: 50%; height: 1px; background: var(--gold); transition: left 0.3s, right 0.3s; }
.nav-link:hover::after { left: 16px; right: 16px; }
.mobile-menu { background: rgba(10,10,15,0.97); border-top: 1px solid rgba(155,89,245,0.1); backdrop-filter: blur(20px); }
.btn-discord { background: rgba(88,101,242,0.15); border: 1px solid rgba(88,101,242,0.4); color: #a5b4fc; letter-spacing: 0.1em; }
.btn-discord:hover { background: rgba(88,101,242,0.3); border-color: rgba(88,101,242,0.7); color: #fff; box-shadow: 0 0 16px rgba(88,101,242,0.3); }
.btn-ip { background: rgba(212,160,23,0.1); border: 1px solid rgba(212,160,23,0.35); color: var(--gold); letter-spacing: 0.1em; }
.btn-ip:hover { background: rgba(212,160,23,0.2); border-color: rgba(212,160,23,0.7); color: #fff; box-shadow: 0 0 16px rgba(212,160,23,0.25); }

/* ─── LOGIN CARD ──────────────────────────────────────────── */
.login-card {
  background: rgba(17,17,24,0.8);
  border: 1px solid rgba(155,89,245,0.2);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 60px rgba(155,89,245,0.08), 0 24px 48px rgba(0,0,0,0.5);
  animation: loginAppear 0.6s ease both;
}

/* ─── USERNAME CASE CLARITY ───────────────────────────────── */
.username-case {
  font-family: 'VT323', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-variant-ligatures: none;
  letter-spacing: 0.04em;
  text-transform: none;
  text-shadow: 0 0 2px rgba(0,0,0,0.45);
}

.login-input.username-case {
  font-size: 1.95rem;
  line-height: 1.1;
  font-weight: 400;
  caret-color: var(--gold);
}

.login-input.username-case::placeholder {
  font-family: 'VT323', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1.45rem;
  letter-spacing: 0.03em;
  text-transform: none;
  opacity: 0.45;
}

@keyframes loginAppear {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card-inner { position: relative; z-index: 1; }
.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(155,89,245,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.login-icon {
  filter: drop-shadow(0 0 12px rgba(155,89,245,0.4));
  animation: iconPulse 3s ease-in-out infinite;
}
@keyframes iconPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(155,89,245,0.3)); }
  50% { filter: drop-shadow(0 0 20px rgba(155,89,245,0.6)); }
}

.login-input {
  background: rgba(10,10,15,0.8);
  border: 1px solid rgba(155,89,245,0.25);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: none;
  text-shadow: 0 0 4px rgba(0,0,0,0.6);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.login-input:focus {
  border-color: rgba(155,89,245,0.6);
  box-shadow: 0 0 0 3px rgba(155,89,245,0.1), 0 0 20px rgba(155,89,245,0.15);
}

.login-btn {
  background: linear-gradient(135deg, rgba(155,89,245,0.3), rgba(91,156,246,0.3));
  border: 1px solid rgba(155,89,245,0.5);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.login-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(155,89,245,0.5), rgba(91,156,246,0.5));
  opacity: 0;
  transition: opacity 0.3s;
}
.login-btn:hover::before { opacity: 1; }
.login-btn:hover { box-shadow: 0 0 30px rgba(155,89,245,0.4); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }

.login-error { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ─── PLAYER BANNER ───────────────────────────────────────── */
.player-banner {
  background: rgba(17,17,24,0.7);
  border: 1px solid rgba(155,89,245,0.2);
  backdrop-filter: blur(16px);
  animation: slideDown 0.5s ease both;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
.player-banner-glow {
  background: radial-gradient(ellipse 60% 100% at 0% 50%, rgba(155,89,245,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.player-avatar { border: 2px solid rgba(155,89,245,0.3); }
.avatar-glow { background: radial-gradient(ellipse 100% 100% at 50% 100%, rgba(155,89,245,0.15) 0%, transparent 70%); }

.logout-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(160,174,192,0.5);
}
.logout-btn:hover { border-color: rgba(155,89,245,0.3); color: var(--violet); }

/* ─── STATS CARD ──────────────────────────────────────────── */
.stats-card {
  background: rgba(17,17,24,0.6);
  border: 1px solid rgba(155,89,245,0.15);
  backdrop-filter: blur(12px);
}
.stats-bg {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(155,89,245,0.05) 0%, transparent 60%);
}
.status-badge-alive {
  background: rgba(52,211,153,0.15);
  border: 1px solid rgba(52,211,153,0.3);
  color: #34d399;
}
.status-badge-eliminated {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
}
.status-badge-warning {
  background: rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.3);
  color: #fbbf24;
}

/* Lives Bar */
.lives-bar-track {
  height: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.05);
}
.lives-bar-fill {
  background: linear-gradient(90deg, #34d399, #059669);
  box-shadow: 0 0 12px rgba(52,211,153,0.4);
}
.lives-bar-fill.warning { background: linear-gradient(90deg, #fbbf24, #d97706); box-shadow: 0 0 12px rgba(251,191,36,0.4); }
.lives-bar-fill.critical { background: linear-gradient(90deg, #ef4444, #b91c1c); box-shadow: 0 0 12px rgba(239,68,68,0.4); }

/* Hearts */
.heart { font-size: 1rem; transition: transform 0.2s, opacity 0.2s; }
.heart:hover { transform: scale(1.3); }
.heart.empty { opacity: 0.2; filter: grayscale(1); }

/* Warning badge */
.warning-badge {
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.3);
  color: #fbbf24;
  animation: warningPulse 2s ease-in-out infinite;
}
@keyframes warningPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(251,191,36,0); }
  50% { box-shadow: 0 0 12px rgba(251,191,36,0.3); }
}

/* Eliminated Banner */
.eliminated-banner {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  animation: eliminatedPulse 2.5s ease-in-out infinite;
}
@keyframes eliminatedPulse {
  0%, 100% { border-color: rgba(239,68,68,0.2); }
  50% { border-color: rgba(239,68,68,0.5); box-shadow: 0 0 20px rgba(239,68,68,0.1); }
}

/* Stat chips */
.stat-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

/* ─── PRODUCT CARDS ───────────────────────────────────────── */
.product-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: default;
  transition: transform 0.3s, box-shadow 0.3s;
  animation: cardAppear 0.5s ease both;
}
.product-card:hover { transform: translateY(-6px); }

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.product-card-inner {
  padding: 1.75rem;
  background: rgba(17,17,24,0.7);
  border: 1px solid rgba(155,89,245,0.15);
  backdrop-filter: blur(12px);
  height: 100%;
  position: relative;
  z-index: 1;
  border-radius: 12px;
  transition: border-color 0.3s;
}
.product-card:hover .product-card-inner { border-color: rgba(155,89,245,0.35); }

.product-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(155,89,245,0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 0;
}
.product-card:hover .product-glow { opacity: 1; }
.product-glow-gold { background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(212,160,23,0.1) 0%, transparent 60%); }
.product-glow-red { background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(239,68,68,0.1) 0%, transparent 60%); }

.product-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
  filter: drop-shadow(0 0 8px rgba(155,89,245,0.3));
  transition: transform 0.3s, filter 0.3s;
}
.product-card:hover .product-icon {
  transform: scale(1.15) translateY(-3px);
  filter: drop-shadow(0 0 16px rgba(155,89,245,0.5));
}

/* Featured card */
.product-featured { box-shadow: 0 0 30px rgba(212,160,23,0.12); }
.product-featured .product-card-inner { border-color: rgba(212,160,23,0.25); }
.product-featured:hover .product-card-inner { border-color: rgba(212,160,23,0.5); }

.featured-badge {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%) translateY(-1px);
  background: linear-gradient(135deg, var(--gold), var(--ember));
  color: var(--obsidian);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  padding: 3px 14px 4px;
  border-radius: 0 0 8px 8px;
  z-index: 10;
  font-family: 'Cinzel', serif;
  font-weight: 700;
}

/* Revival card */
.product-revival .product-card-inner { border-color: rgba(239,68,68,0.15); }
.product-revival:hover .product-card-inner { border-color: rgba(239,68,68,0.4); box-shadow: 0 0 30px rgba(239,68,68,0.1); }
.product-revival.highlighted .product-card-inner {
  border-color: rgba(239,68,68,0.5);
  box-shadow: 0 0 40px rgba(239,68,68,0.2);
  animation: revivalPulse 2s ease-in-out infinite;
}
@keyframes revivalPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(239,68,68,0.15); }
  50% { box-shadow: 0 0 50px rgba(239,68,68,0.35); }
}

/* Max lives banner */
.max-lives-banner {
  background: rgba(212,160,23,0.06);
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 10px;
}

/* Product buttons */
.product-btn {
  background: rgba(155,89,245,0.15);
  border: 1px solid rgba(155,89,245,0.35);
  color: rgba(155,89,245,0.9);
}
.product-btn:hover:not(:disabled) {
  background: rgba(155,89,245,0.3);
  border-color: rgba(155,89,245,0.7);
  color: #fff;
  box-shadow: 0 0 20px rgba(155,89,245,0.3);
  transform: translateY(-1px);
}
.product-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
}

.product-btn-revival {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.35);
  color: rgba(239,68,68,0.9);
}
.product-btn-revival:hover:not(:disabled) {
  background: rgba(239,68,68,0.3);
  border-color: rgba(239,68,68,0.7);
  color: #fff;
  box-shadow: 0 0 20px rgba(239,68,68,0.3);
}

/* Unavailable state */
.product-card.unavailable .product-card-inner {
  opacity: 0.45;
  filter: grayscale(0.6);
}
.product-card.unavailable:hover { transform: none; }
.product-card.unavailable .product-card-inner { border-color: rgba(255,255,255,0.05); }
.product-unavail { color: rgba(160,174,192,0.3); }

/* ─── RANK CARDS ──────────────────────────────────────────── */
.rank-card {
  position: relative;
  border-radius: 14px;
  overflow: visible;
  transition: transform 0.3s;
  animation: cardAppear 0.5s ease both;
}
.rank-card:hover { transform: translateY(-8px); }

.rank-card-inner {
  padding: 2rem 1.75rem;
  background: rgba(17,17,24,0.75);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  position: relative;
  z-index: 1;
  transition: border-color 0.3s, box-shadow 0.3s;
  height: 100%;
}

.rank-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  border-radius: 14px;
}
.rank-card:hover .rank-glow { opacity: 1; }
.rank-glow-gold { background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212,160,23,0.1) 0%, transparent 60%); }
.rank-glow-diamond { background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(91,156,246,0.1) 0%, transparent 60%); }
.rank-glow-netherite { background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(155,89,245,0.1) 0%, transparent 60%); }

/* Gold rank */
.rank-gold .rank-card-inner { border-color: rgba(212,160,23,0.2); }
.rank-gold:hover .rank-card-inner { border-color: rgba(212,160,23,0.45); box-shadow: 0 0 30px rgba(212,160,23,0.1); }
.rank-badge-gold { color: var(--gold); text-shadow: 0 0 20px rgba(212,160,23,0.4); }

/* Diamond rank */
.rank-diamond .rank-card-inner { border-color: rgba(91,156,246,0.25); }
.rank-diamond:hover .rank-card-inner { border-color: rgba(91,156,246,0.5); box-shadow: 0 0 30px rgba(91,156,246,0.12); }
.rank-badge-diamond { color: var(--rune); text-shadow: 0 0 20px rgba(91,156,246,0.4); }
.rank-featured { box-shadow: 0 0 40px rgba(91,156,246,0.1); }

/* Netherite rank */
.rank-netherite .rank-card-inner { border-color: rgba(155,89,245,0.2); }
.rank-netherite:hover .rank-card-inner { border-color: rgba(155,89,245,0.5); box-shadow: 0 0 30px rgba(155,89,245,0.12); }
.rank-badge-netherite { color: var(--violet); text-shadow: 0 0 20px rgba(155,89,245,0.4); }

.rank-popular-badge {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--rune), #818cf8);
  color: white;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  padding: 3px 14px 4px;
  border-radius: 20px;
  z-index: 10;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(91,156,246,0.4);
}

.rank-crown {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
  display: block;
  transition: transform 0.3s;
}
.rank-card:hover .rank-crown { transform: scale(1.2) rotate(-5deg); }

.perk-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.perk-icon { color: var(--gold); font-size: 0.6rem; }
.perk-icon-diamond { color: var(--rune); }
.perk-icon-netherite { color: var(--violet); }
.perk-includes-lower { margin-top: 4px; }

/* Rank buttons */
.rank-btn { border: 1px solid; }
.rank-btn-gold {
  background: rgba(212,160,23,0.1);
  border-color: rgba(212,160,23,0.35);
  color: var(--gold);
}
.rank-btn-gold:hover {
  background: rgba(212,160,23,0.25);
  border-color: rgba(212,160,23,0.7);
  color: #fff;
  box-shadow: 0 0 20px rgba(212,160,23,0.3);
}
.rank-btn-diamond {
  background: rgba(91,156,246,0.1);
  border-color: rgba(91,156,246,0.35);
  color: var(--rune);
}
.rank-btn-diamond:hover {
  background: rgba(91,156,246,0.25);
  border-color: rgba(91,156,246,0.7);
  color: #fff;
  box-shadow: 0 0 20px rgba(91,156,246,0.3);
}
.rank-btn-netherite {
  background: rgba(155,89,245,0.1);
  border-color: rgba(155,89,245,0.35);
  color: var(--violet);
}
.rank-btn-netherite:hover {
  background: rgba(155,89,245,0.25);
  border-color: rgba(155,89,245,0.7);
  color: #fff;
  box-shadow: 0 0 20px rgba(155,89,245,0.3);
}

/* ─── MODALS ──────────────────────────────────────────────── */
.modal-overlay { display: flex !important; }
.modal-overlay.hidden { visibility: hidden; opacity: 0; pointer-events: none; }
.modal-overlay:not(.hidden) { visibility: visible; opacity: 1; animation: modalFadeIn 0.3s ease; }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-backdrop { background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); }

.modal-box {
  background: rgba(17,17,24,0.97);
  border: 1px solid rgba(155,89,245,0.25);
  border-radius: 14px;
  box-shadow: 0 0 60px rgba(155,89,245,0.15), 0 40px 80px rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  animation: modalSlideUp 0.3s ease both;
  position: relative;
  z-index: 1;
}
@keyframes modalSlideUp {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.success-modal-box { border-color: rgba(52,211,153,0.25); box-shadow: 0 0 60px rgba(52,211,153,0.1), 0 40px 80px rgba(0,0,0,0.6); }

.modal-corner-tl, .modal-corner-tr, .modal-corner-bl, .modal-corner-br {
  position: absolute;
  width: 20px; height: 20px;
  border-color: rgba(155,89,245,0.4);
  border-style: solid;
}
.modal-corner-tl { top: 0; left: 0; border-width: 2px 0 0 2px; border-radius: 2px 0 0 0; }
.modal-corner-tr { top: 0; right: 0; border-width: 2px 2px 0 0; border-radius: 0 2px 0 0; }
.modal-corner-bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; border-radius: 0 0 0 2px; }
.modal-corner-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; border-radius: 0 0 2px 0; }

.modal-detail-box {
  background: rgba(10,10,15,0.8);
  border: 1px solid rgba(255,255,255,0.06);
}

.modal-cancel-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(160,174,192,0.6);
}
.modal-cancel-btn:hover { border-color: rgba(255,255,255,0.15); color: var(--mist); }

.modal-confirm-btn {
  background: linear-gradient(135deg, rgba(155,89,245,0.4), rgba(91,156,246,0.4));
  border: 1px solid rgba(155,89,245,0.5);
  color: #fff;
}
.modal-confirm-btn:hover {
  background: linear-gradient(135deg, rgba(155,89,245,0.6), rgba(91,156,246,0.6));
  box-shadow: 0 0 20px rgba(155,89,245,0.3);
}

/* ─── TOAST ───────────────────────────────────────────────── */
.toast {
  background: rgba(26,26,38,0.97);
  border: 1px solid rgba(155,89,245,0.4);
  color: var(--violet);
  backdrop-filter: blur(16px);
  transform: translateX(-50%) translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
}
.toast.show {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
  pointer-events: auto;
}
.toast.toast-success { border-color: rgba(52,211,153,0.4); color: #34d399; }
.toast.toast-error { border-color: rgba(239,68,68,0.4); color: #ef4444; }
.toast.toast-info { border-color: rgba(212,160,23,0.4); color: var(--gold); }

/* ─── SECTION HEADER ──────────────────────────────────────── */
.section-header { position: relative; }

/* ─── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--obsidian); }
::-webkit-scrollbar-thumb { background: var(--violet); border-radius: 3px; opacity: 0.5; }
::selection { background: rgba(155,89,245,0.2); color: #fff; }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .stats-card .grid { grid-template-columns: 1fr; }
  .player-banner { text-align: center; justify-content: center; }
}
