/* ═══════════════════════════════════════════
   Denail Store — style.css
   Black & Red Premium UI
═══════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --black:      #080808;
  --black-2:    #111111;
  --black-3:    #1a1a1a;
  --red:        #cc0000;
  --red-bright: #ff1a1a;
  --red-dim:    #7a0000;
  --white:      #f0ece4;
  --white-dim:  #9a9590;
  --border:     rgba(255,255,255,0.07);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --radius:     4px;
  --transition: 0.35s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Background Grid ── */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
}

/* ── Ambient Glow ── */
.glow-orb {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(180,0,0,0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: pulse-glow 6s ease-in-out infinite alternate;
}
@keyframes pulse-glow {
  from { opacity: 0.7; transform: translateX(-50%) scale(1); }
  to   { opacity: 1;   transform: translateX(-50%) scale(1.1); }
}

/* ── Header ── */
.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 60px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  background: rgba(8,8,8,0.6);
  animation: slide-down 0.6s ease both;
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
  display: block;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.12em;
  color: var(--white);
}

.logo-text .dot {
  color: var(--red);
}

.tagline {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white-dim);
}

/* Discord Button */
.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #5865F2;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 10px 24px;
  border-radius: 50px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}
.btn-discord:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
}
.btn-discord:active {
  transform: translateY(0);
}

/* How to Join Button (YouTube) */
.btn-howto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FF0000;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 10px 24px;
  border-radius: 50px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}
.btn-howto:hover {
  background: #CC0000;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.45);
}
.btn-howto:active {
  transform: translateY(0);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Refund Policy Button */
.btn-policy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--white-dim);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 10px 24px;
  border-radius: 50px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}
.btn-policy:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--white-dim);
  color: var(--white);
  transform: translateY(-2px);
}
.btn-policy:active {
  transform: translateY(0);
}

/* ── Container ── */
.container {
  position: relative;
  z-index: 10;
  max-width: 960px;
  margin: 0 auto;
  padding: 80px 24px 120px;
}

/* ── Products Grid ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Product Card ── */
.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  animation: fade-up 0.8s 0.2s ease both;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
  text-align: center;
}
.product-card:hover {
  border-color: var(--red-dim);
  box-shadow: 0 0 40px rgba(204,0,0,0.1);
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Badge */
.badge {
  position: absolute;
  top: -28px;
  left: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid var(--red-dim);
  padding: 4px 12px;
  border-radius: 2px;
  background: rgba(180,0,0,0.08);
}

/* ── Product Image ── */
.product-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 120px;
  margin-bottom: 8px;
}

.image-border-fx {
  display: none;
}

.product-image {
  position: relative;
  z-index: 1;
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
  filter: grayscale(15%) contrast(1.08);
  transition: filter var(--transition), transform var(--transition);
}
.product-image-wrap:hover .product-image {
  filter: grayscale(0%) contrast(1.12);
  transform: scale(1.1);
}

.image-shine {
  display: none;
}

/* ── Product Info ── */
.product-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.product-category {
  display: none;
}

.product-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: var(--white);
  margin-bottom: 4px;
}
.product-name em {
  font-style: italic;
  color: var(--red);
  font-family: var(--font-display);
}

.product-desc {
  display: none;
}

/* Price */
.price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 12px;
}
.price {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--white);
}
.price-note {
  display: none;
}

/* Feature List */
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feature-list li {
  font-size: 13px;
  color: var(--white-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}
.feat-icon {
  color: var(--red);
  font-size: 8px;
}

/* Username Field */
.username-wrap {
  display: none;
}

/* Buy Button */
.btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0066ff;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
  width: auto;
  min-width: 120px;
}
.btn-buy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.btn-buy:hover::before { transform: translateX(100%); }
.btn-buy:hover {
  background: #0052cc;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.45);
}
.btn-buy:active { transform: translateY(0); }
.btn-arrow {
  font-size: 0.9rem;
  transition: transform var(--transition);
}
.btn-buy:hover .btn-arrow { transform: translateX(4px); }

/* PayPal container */
.paypal-container {
  margin-top: 12px;
  width: 100%;
  animation: fade-up 0.4s ease both;
}

/* Error */
.error-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(180,0,0,0.1);
  border: 1px solid var(--red-dim);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--red-bright);
  animation: fade-up 0.3s ease both;
}
.err-icon { font-size: 16px; }

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,8,8,0.92);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
.spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.spinner {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(255,255,255,0.06);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-text {
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--white-dim);
}

/* ── Success Overlay ── */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,8,8,0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: fade-in 0.4s ease both;
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.success-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.checkmark-circle {
  width: 90px;
  height: 90px;
}
.checkmark {
  width: 90px;
  height: 90px;
}
.checkmark-circle-bg {
  stroke: var(--red-dim);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: stroke 0.6s ease forwards;
}
.checkmark-check {
  stroke: var(--red);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.4s 0.5s ease forwards;
}
@keyframes stroke {
  to { stroke-dashoffset: 0; }
}
.success-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 0.08em;
  color: var(--white);
}
.success-sub {
  font-size: 13px;
  color: var(--white-dim);
  letter-spacing: 0.1em;
}

/* ── Invoice ── */
.invoice-section {
  margin-top: 80px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--red);
  background: var(--black-2);
  border-radius: var(--radius);
  padding: 48px 56px;
  animation: fade-up 0.7s ease both;
  position: relative;
  overflow: hidden;
}
.invoice-section::before {
  content: 'PAID';
  position: absolute;
  top: 24px;
  right: 40px;
  font-family: var(--font-display);
  font-size: 5rem;
  color: rgba(204,0,0,0.04);
  letter-spacing: 0.2em;
  pointer-events: none;
  user-select: none;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.invoice-brand {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.12em;
}
.invoice-label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.3em;
  color: var(--white-dim);
}

.invoice-divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

.invoice-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.inv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.inv-key {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white-dim);
  font-weight: 400;
}
.inv-val {
  font-size: 14px;
  color: var(--white);
  font-weight: 400;
  text-align: right;
  max-width: 55%;
  word-break: break-all;
}
.inv-val.accent {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--red);
  letter-spacing: 0.05em;
}
.inv-val.mono {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--white-dim);
}
.status-paid {
  color: #22c55e;
  font-size: 12px;
  letter-spacing: 0.2em;
}

.invoice-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 16px;
}
.inv-thanks {
  font-size: 13px;
  color: var(--white-dim);
  font-style: italic;
}

/* PDF Button */
.btn-pdf {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--white);
  border: 1px solid var(--red-dim);
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.12em;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn-pdf:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 28px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--white-dim);
}

/* ── Responsive ── */
@media (max-width: 720px) {
  /* Header Mobile */
  .site-header { 
    padding: 16px 20px;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .logo {
    gap: 8px;
  }
  
  .logo-img {
    height: 40px;
  }
  
  .logo-text {
    font-size: 1.4rem;
  }
  
  .header-actions {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  
  /* Compact player display on mobile */
  .header-player {
    padding: 4px 10px 4px 4px;
    margin-right: 8px;
  }
  
  .player-skin-wrap {
    width: 28px;
    height: 28px;
  }
  
  .player-skin-face {
    width: 28px;
    height: 28px;
  }
  
  .player-name {
    font-size: 12px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* Smaller buttons on mobile */
  .btn-discord,
  .btn-policy,
  .btn-howto {
    padding: 8px 16px;
    font-size: 12px;
  }
  
  /* Product Grid Mobile */
  .container {
    padding: 40px 16px 80px;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .product-card {
    padding: 20px;
    gap: 12px;
  }
  
  .product-image-wrap {
    height: 100px;
  }
  
  .product-image {
    width: 60px;
    height: 60px;
  }
  
  .product-name {
    font-size: 1.2rem;
  }
  
  .price {
    font-size: 1rem;
  }
  
  .btn-buy {
    padding: 12px 20px;
    font-size: 0.9rem;
    width: 100%;
  }
  
  /* Invoice Mobile */
  .invoice-section {
    padding: 24px 16px;
    margin-top: 40px;
  }
  
  .invoice-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .invoice-brand {
    font-size: 1.4rem;
  }
  
  .invoice-label {
    font-size: 0.9rem;
  }
  
  .invoice-grid {
    gap: 12px;
  }
  
  .inv-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 0;
  }
  
  .inv-key {
    font-size: 10px;
  }
  
  .inv-val {
    font-size: 13px;
    max-width: 100%;
    text-align: left;
  }
  
  .inv-val.accent {
    font-size: 1.2rem;
  }
  
  .invoice-footer {
    flex-direction: column;
    gap: 16px;
  }
  
  .btn-pdf {
    width: 100%;
    justify-content: center;
  }
  
  /* Modal Mobile */
  .modal-content {
    padding: 24px 20px;
    width: 95%;
    max-height: 90vh;
    border-radius: 12px;
  }
  
  .modal-title {
    font-size: 1.5rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }
  
  .modal-body p {
    font-size: 13px;
    line-height: 1.6;
  }
  
  .modal-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 24px;
  }
  
  /* Username Modal Mobile */
  .username-modal-content {
    max-width: 95%;
  }
  
  .modal-username-input {
    padding: 0 12px;
  }
  
  .modal-username-input .username-input {
    font-size: 16px;
    padding: 14px 0;
  }
  
  .btn-save-username {
    padding: 14px;
    font-size: 1rem;
  }
  
  /* Success Overlay Mobile */
  .success-title {
    font-size: 1.8rem;
  }
  
  .success-sub {
    font-size: 12px;
  }
  
  .checkmark-circle {
    width: 70px;
    height: 70px;
  }
  
  .checkmark {
    width: 70px;
    height: 70px;
  }
  
  /* Loading Overlay Mobile */
  .spinner {
    width: 48px;
    height: 48px;
  }
  
  .spinner-text {
    font-size: 11px;
  }
  
  /* Logout Menu Mobile */
  .logout-menu {
    right: -10px;
    min-width: 140px;
  }
  
  /* Footer Mobile */
  .site-footer {
    padding: 20px 16px;
    font-size: 10px;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .site-header {
    padding: 12px 16px;
  }
  
  .logo-img {
    height: 32px;
  }
  
  .logo-text {
    font-size: 1.2rem;
  }
  
  .player-name {
    display: none;
  }
  
  .header-player {
    padding: 4px;
  }
  
  .btn-discord,
  .btn-policy,
  .btn-howto {
    padding: 6px 12px;
    font-size: 11px;
  }
  
  .product-name {
    font-size: 1.1rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn-buy,
  .btn-discord,
  .btn-policy,
  .btn-howto,
  .btn-pdf,
  .btn-logout,
  .btn-save-username {
    min-height: 44px;
  }
  
  .modal-close {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,8,8,0.9);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: fade-in 0.3s ease;
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  position: relative;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--red);
  border-radius: var(--radius);
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 40px;
  animation: modal-slide-up 0.4s ease;
}
@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--white-dim);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  color: var(--red);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: var(--white);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-body p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--white-dim);
}

/* Username Modal Specific Styles */
.username-modal-content {
  max-width: 420px;
  padding: 40px;
  background: linear-gradient(145deg, var(--black-2) 0%, var(--black-3) 100%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5), 0 0 60px rgba(204,0,0,0.08);
}

.username-modal-content .modal-title {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 12px;
  background: linear-gradient(90deg, var(--white) 0%, var(--red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border: none;
  padding: 0;
}

.username-modal-content .modal-body {
  gap: 24px;
}

.username-modal-content .modal-body > p {
  text-align: center;
  font-size: 14px;
  color: var(--white-dim);
  margin: 0;
}

.modal-username-input {
  margin: 0;
  background: var(--black);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.modal-username-input::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(204,0,0,0.1) 0%, transparent 50%, rgba(204,0,0,0.1) 100%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.modal-username-input:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 20px rgba(204,0,0,0.2), inset 0 0 20px rgba(204,0,0,0.02);
  transform: translateY(-2px);
}

.modal-username-input:focus-within::before {
  opacity: 1;
}

.modal-username-input .username-icon {
  color: var(--red);
  font-size: 20px;
  margin-right: 16px;
  filter: drop-shadow(0 0 8px rgba(204,0,0,0.4));
}

.modal-username-input .username-input {
  color: var(--white);
  font-size: 16px;
  padding: 12px 0;
  line-height: 1.2;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.modal-username-input .username-input::placeholder {
  color: rgba(154,149,144,0.5);
  font-size: 15px;
  font-weight: 400;
}

.btn-save-username {
  width: 100%;
  margin-top: 8px;
  padding: 16px 28px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dim) 100%);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 25px rgba(204,0,0,0.35);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-save-username::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-save-username:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(204,0,0,0.5);
}

.btn-save-username:hover::before {
  left: 100%;
}

.btn-save-username:active {
  transform: translateY(-1px);
}

/* Username Modal Mobile */
@media (max-width: 720px) {
  .username-modal-content {
    max-width: 90%;
    padding: 32px 24px;
    border-radius: 12px;
  }
  
  .username-modal-content .modal-title {
    font-size: 1.4rem;
  }
  
  .modal-username-input {
    padding: 0 16px;
  }
  
  .modal-username-input .username-input {
    font-size: 15px;
    padding: 12px 0;
    line-height: 1.2;
  }
  
  .modal-username-input .username-icon {
    font-size: 18px;
    margin-right: 12px;
  }
  
  .btn-save-username {
    padding: 14px 24px;
    font-size: 15px;
  }
}

/* Display username + skin in header */
.header-player {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px 5px 6px;
}
.player-skin-wrap {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  image-rendering: pixelated;
  background: rgba(0,0,0,0.3);
}
.player-skin-face {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  display: block;
}
.player-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.03em;
}

/* Logout Dropdown Menu */
.header-player {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.logout-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  min-width: 120px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
  animation: fade-up 0.2s ease both;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--red);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-logout:hover {
  background: rgba(204,0,0,0.1);
}

/* ═══ Cart Icon ═══ */
.cart-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  color: var(--white);
  padding: 8px;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
  margin-right: 8px;
}

.cart-icon:hover {
  background: rgba(255,255,255,0.08);
  color: var(--red);
}

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ═══ Cart Modal ═══ */
.cart-modal-content {
  max-width: 500px;
  width: 90%;
  padding: 0;
  overflow: hidden;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
}

.cart-header .modal-title {
  margin: 0;
  padding: 0;
  border: none;
}

.cart-body {
  padding: 24px 32px;
  max-height: 50vh;
  overflow-y: auto;
}

.cart-empty {
  text-align: center;
  padding: 40px 20px;
}

.cart-empty p {
  color: var(--white-dim);
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--black-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
}

.cart-item-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 500;
  color: var(--white);
  margin-bottom: 4px;
}

.cart-item-price {
  color: var(--white-dim);
  font-size: 14px;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black-2);
  border: 1px solid var(--border);
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  border-radius: 4px;
  transition: background var(--transition), border-color var(--transition);
}

.cart-item-qty-btn:hover {
  background: var(--red);
  border-color: var(--red);
}

.cart-item-qty {
  min-width: 32px;
  text-align: center;
  font-weight: 500;
}

.cart-item-remove {
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--red-dim);
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background var(--transition);
}

.cart-item-remove:hover {
  background: var(--red);
  color: var(--white);
}

.cart-footer {
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  background: var(--black-3);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.cart-total-label {
  font-size: 16px;
  color: var(--white-dim);
}

.cart-total-price {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--white);
}

.btn-checkout {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
}

/* ═══ Discount Code Section ═══ */
.discount-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.discount-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.discount-input {
  flex: 1;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--white);
  font-size: 16px; /* ≥16px prevents iOS auto-zoom */
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.discount-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(204,0,0,0.1);
}

.discount-input::placeholder {
  color: var(--white-dim);
}

.btn-discount {
  padding: 12px 20px;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn-discount:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.discount-message {
  font-size: 13px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.discount-message.error {
  background: rgba(204, 0, 0, 0.1);
  color: var(--red);
}

.discount-applied {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 6px;
  margin-top: 12px;
}

.discount-label {
  font-size: 14px;
  color: var(--white-dim);
}

.discount-amount {
  font-size: 14px;
  font-weight: 500;
  color: #22c55e;
}

/* PayPal Container - allow scrolling for card form */
.paypal-container {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Cart Mobile */
@media (max-width: 720px) {
  /* Full-screen cart modal on mobile */
  .modal-overlay:has(.cart-modal-content) {
    align-items: flex-end;
  }

  .cart-modal-content {
    width: 100%;
    max-width: 100%;
    height: 95dvh;
    max-height: 95dvh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
  }

  .cart-header {
    padding: 20px 20px 16px;
    flex-shrink: 0;
  }

  /* drag handle hint */
  .cart-header::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
  }

  .cart-body {
    padding: 12px 20px;
    flex: 1;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cart-footer {
    padding: 16px 20px;
    flex-shrink: 0;
    /* push above iOS home bar */
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .cart-item {
    flex-wrap: wrap;
    gap: 10px;
  }

  .cart-item-image {
    width: 48px;
    height: 48px;
  }

  .cart-total-price {
    font-size: 1.4rem;
  }

  .cart-icon svg {
    width: 22px;
    height: 22px;
  }

  /* PayPal card form — fixed height and scrollable */
  .paypal-container {
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 12px;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }

  /* Make PayPal iframe fit better */
  .paypal-container iframe {
    max-height: 360px !important;
    width: 100% !important;
  }

  /* Discount Code Mobile */
  .discount-section {
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .discount-input-row {
    flex-direction: row;
    gap: 8px;
  }

  .discount-input {
    font-size: 16px; /* prevents iOS zoom on focus */
    padding: 14px 14px;
  }

  .btn-discount {
    padding: 14px 16px;
    font-size: 14px;
    white-space: nowrap;
  }

  .discount-applied {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  /* Checkout button full-width, taller tap target */
  .btn-checkout {
    padding: 18px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .cart-total-row {
    margin-bottom: 14px;
  }
}

/* ═══ Server Info Box ═══ */
.server-info-box {
  position: fixed;
  bottom: 100px;
  right: 24px;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(204,0,0,0.1);
  z-index: 100;
  animation: slide-in-right 0.5s ease both;
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.server-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.server-info-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.server-info-close {
  background: transparent;
  border: none;
  color: var(--white-dim);
  font-size: 18px;
  font-weight: 300;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition), transform var(--transition);
  opacity: 0.6;
}

.server-info-close:hover {
  color: var(--red);
  opacity: 1;
  transform: scale(1.1);
}

.server-status {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.server-info-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
}

.server-info-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.server-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-info-label {
  font-size: 12px;
  color: var(--white-dim);
  min-width: 40px;
}

.server-info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.02em;
}

.server-copy-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity var(--transition), background var(--transition);
}

.server-copy-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.1);
}

/* Server Info Box Mobile */
@media (max-width: 720px) {
  .server-info-box {
    bottom: 80px;
    right: 16px;
    padding: 12px 16px;
    min-width: 170px;
  }
  
  .server-info-title {
    font-size: 12px;
  }
  
  .server-info-value {
    font-size: 13px;
  }
  
  .server-info-label {
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .server-info-box {
    display: none;
  }
}

/* ═══ Checkout Page ═══ */
.checkout-page {
  padding: 100px 20px 40px;
  min-height: 100vh;
}

.checkout-container {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.checkout-summary,
.checkout-payment {
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.checkout-title {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--white);
}

.checkout-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

.checkout-item img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.checkout-item-info {
  flex: 1;
}

.checkout-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
}

.checkout-item-qty {
  font-size: 12px;
  color: var(--white-dim);
}

.checkout-item-price {
  font-weight: 600;
  color: var(--accent);
}

.checkout-discount {
  margin: 20px 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 2px solid var(--border);
  font-size: 1.2rem;
  font-weight: 600;
}

.checkout-total span:last-child {
  color: var(--accent);
  font-size: 1.4rem;
}

.checkout-username {
  font-size: 14px;
  color: var(--white-dim);
  margin-bottom: 20px;
}

.checkout-username strong {
  color: var(--white);
}

.checkout-paypal {
  min-height: 200px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white-dim);
  font-size: 14px;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-back:hover {
  background: rgba(255,255,255,0.05);
  color: var(--white);
  border-color: var(--white-dim);
}

.btn-back-mobile {
  display: none;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
}

.checkout-invoice {
  max-width: 600px;
  margin: 40px auto;
}

.btn-back-home {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  transition: all var(--transition);
}

.btn-back-home:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--white-dim);
}

/* Checkout Page Mobile */
@media (max-width: 720px) {
  .checkout-page {
    padding: 80px 16px 20px;
  }
  
  .checkout-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .checkout-summary,
  .checkout-payment {
    padding: 16px;
  }
  
  .btn-back {
    display: none;
  }
  
  .btn-back-mobile {
    display: block;
  }
  
  .checkout-items {
    max-height: 250px;
  }
}

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 28px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--white-dim);
}