:root {
  --primary: #C54B3C;
  --primary-hover: #A33D30;
  --primary-light: #D65C4D;
  --dark-bg: #121212;
  --mid-bg: #1e1e1e;
  --text-light: #eeeeee;
  --text-muted: #bbbbbb;
}

/* ------------------------------------------------------------- */
/* BASE */
/* ------------------------------------------------------------- */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------- */
/* HEADER */
/* ------------------------------------------------------------- */
.site-header {
  background-color: var(--mid-bg);
  border-bottom: 2px solid var(--primary);
  padding: 0.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 35%;
  flex-shrink: 1;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.header-center h1 {
  pointer-events: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  max-width: 35%;
  flex-shrink: 1;
  justify-content: flex-end;
}

.header-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.logo {
  width: 70px;
  height: auto;
  object-fit: contain;
}

.header-how-to-btn {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  height: auto;
  min-height: auto;
  border-radius: 6px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
}

.game-select {
  padding: 0.6rem;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid var(--primary);
  background-color: var(--mid-bg);
  color: var(--text-light);
}

h1 {
  color: var(--primary);
  font-size: 1.6rem;
  text-transform: uppercase;
  margin: 0;
  text-align: right;
  flex: 1;
}

/* ------------------------------------------------------------- */
/* MAIN LAYOUT */
/* ------------------------------------------------------------- */
.main-layout {
  display: flex;
  justify-content: space-between;
  flex: 1;
  padding: 1rem 2rem;
  gap: 2rem;
}

/* ------------------------------------------------------------- */
/* SEARCH SECTION */
/* ------------------------------------------------------------- */
.search-section {
  flex: 2;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.set-filter {
  flex-basis: 100%; /* always below */
}


.search-input-wrapper {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.search-box input {
  width: 280px;
  padding: 0.6rem;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid var(--primary);
  background-color: var(--mid-bg);
  color: var(--text-light);
}

.search-box input.game-selected {
  color: #ffffff;
}

.search-box input.game-selected::placeholder {
  color: #ffffff;
  opacity: 1;
}
.search-box input:focus {
  outline: none;
  border: 1px solid var(--primary);
}

.search-box button {
  background-color: var(--primary);
  color: var(--dark-bg);
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}
.search-box button:hover {
  background-color: var(--primary-hover);
}


/* ------------------------------------------------------------- */
/* SET FILTER (inline with search bar) */
/* ------------------------------------------------------------- */
.set-filter {
  width: auto;
  min-width: 220px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--primary);
  border-radius: 5px;
  font-size: 1rem;
  background-color: var(--mid-bg);
  color: var(--text-light);
  transition: border-color 0.2s ease;
  height: 42px; /* aligns with input + button */
}

.set-filter:focus {
  outline: none;
  border-color: var(--primary);
}

.set-filter:disabled {
  background-color: #2a2a2a;
  color: var(--text-muted);
  cursor: not-allowed;
  border: 1px solid var(--primary); /* always gold */
}


@media (max-width: 600px) {
  .search-box {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box input,
  .search-box button,
  .set-filter {
    width: 100%;
  }
}

/* ------------------------------------------------------------- */
/* RESULTS AREA */
/* ------------------------------------------------------------- */
.card-results {
  background-color: var(--mid-bg);
  border-radius: 10px;
  padding: 1rem 2rem;
  border: 1px solid var(--primary);
  min-height: 300px;
  margin-top: 1rem;
}

.card {
  padding: 1rem 0;
  border-bottom: 1px solid #333;
  cursor: pointer;
  transition: background 0.2s;
}

.card:last-child {
  border-bottom: none;
}

.card:hover {
  background-color: color-mix(in srgb, var(--primary) 8%, transparent);
}

/* --- Card content layout --- */
.card-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}

/* --- Card image container --- */
.card-img-container {
  width: 90px;
  height: 130px;
  background-color: #0e0e0e;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  cursor: zoom-in; /* Indicate image is zoomable */
  transition: transform 0.2s ease;
}

.card-img-container:hover {
  transform: scale(1.05);
}

/* --- Card image itself --- */
.card-img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none; /* Don't capture clicks, let container handle it */
}

/* When image loads, fade in */
.card-img[src] {
  opacity: 1;
}

/* --- Loading / error text placeholder --- */
.image-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  pointer-events: none;
}

/* --- Fallback image badge (corner badge for different rarity) --- */
.fallback-image-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255, 152, 0, 0.9);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
}

/* --- Card details (right side) --- */
.card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 130px;
}

.card h3 {
  margin-top: 0;
  color: var(--primary);
  font-size: 1.1rem;
}

.hot-buy-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.5rem;
  vertical-align: middle;
  box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
  }
  50% {
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.6);
  }
}

.card p {
  margin: 0.3rem 0;
  color: var(--text-muted);
  line-height: 1.3;
}

.card strong {
  color: var(--text-light);
}

.suggestion-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  transition: opacity 0.3s ease;
}

.image-loading-small {
  width: 40px;
  height: 40px;
  background: var(--mid-bg, #222);
  border: 1px solid var(--primary, #c9a33b);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #aaa);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}


.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  position: relative;
}

.suggestion-item:hover {
  background-color: #f5f5f5;
}



/* ------------------------------------------------------------- */
/* RIGHT PANEL: CART */
/* ------------------------------------------------------------- */
.cart {
  flex: 1;
  background-color: var(--mid-bg);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 1rem;
  height: fit-content;
  max-height: 85vh;
  overflow-y: auto;
}

.cart h2 {
  margin-top: 0;
  color: var(--primary);
  text-align: center;
  font-size: 1.3rem;
}


/* ------------------------------------------------------------- */
/* ENHANCED CART ITEM STYLING WITH QUANTITY CONTROLS - FIXED */
/* ------------------------------------------------------------- */
#cartList {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
}

.cart-item {
  border-bottom: 1px solid #333;
  padding: 0.8rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative; /* Add this for proper positioning context */
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.cart-item-name {
  flex: 1;
  min-width: 0;
}

.cart-item-name strong {
  display: block;
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 0.2rem;
  word-wrap: break-word;
}

.cart-item-details {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
  line-height: 1;
  position: static; /* Remove absolute positioning */
}

.cart-item-remove:hover {
  color: #ff6b6b;
  transform: scale(1.1);
}

.cart-item-pricing {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: color-mix(in srgb, var(--primary) 10%, transparent);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--primary);
  position: static; /* Remove absolute positioning */
}

.qty-btn {
  background-color: var(--primary);
  color: var(--dark-bg);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.1s;
  padding: 0;
  line-height: 1;
  position: static; /* Remove absolute positioning */
}

.qty-btn:hover {
  background-color: var(--primary-hover);
  transform: scale(1.05);
}

.qty-btn:active {
  transform: scale(0.95);
}

.quantity-display {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
}

.price-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
}

.unit-prices,
.line-totals {
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.unit-prices {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.line-totals {
  font-weight: 600;
}

.price-label {
  color: var(--primary);
  font-weight: 600;
}

.divider {
  color: var(--text-muted);
  opacity: 0.5;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .cart-item-pricing {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .quantity-controls {
    justify-content: center;
  }

  .price-info {
    font-size: 0.85rem;
  }
}

.totals {
  margin-top: 1rem;
  border-top: 1px solid var(--primary);
  padding-top: 1rem;
  text-align: right;
  color: var(--text-light);
  font-weight: bold;
}
.totals strong {
  color: var(--primary);
}

.cart-actions {
  display: flex;
  gap: 0.8rem;
  position: sticky;
  bottom: 0;
  background: var(--mid-bg);
  padding-top: 0.8rem;
  border-top: 1px solid var(--primary);
}

.cart-actions button {
  flex: 1;
}

.cart-prices {
  font-size: 0.9rem;
  color: var(--text-light);
}

.cart-prices strong {
  color: var(--primary);
}



/* ------------------------------------------------------------- */
/* AUTOCOMPLETE DROPDOWN */
/* ------------------------------------------------------------- */
.suggestions {
  position: absolute;
  top: 2.5rem;
  width: 100%;
  background: var(--mid-bg);
  border: 1px solid var(--primary);
  border-radius: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 10;
  max-height: 250px;
  overflow-y: auto;
}

.suggestions:empty {
  display: none;
  border: none;
}

.suggestions li {
  padding: 0.4rem 0.8rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.suggestions li:hover {
  background-color: rgba(255, 215, 0, 0.1);
}

.card-thumb {
  width: 28px;
  height: 40px;
  object-fit: cover;
  margin-right: 0.6rem;
  border-radius: 3px;
  border: 1px solid var(--primary);
}

.suggestion-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-name {
  color: var(--text-light);
  font-weight: 500;
}

.set-code {
  color: var(--primary);
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ------------------------------------------------------------- */
/* FOOTER */
/* ------------------------------------------------------------- */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  background-color: var(--mid-bg);
  border-top: 1px solid var(--primary);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

footer p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.footer-links {
  margin-bottom: 0.3rem;
}

.footer-link {
  color: var(--primary-light);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-separator {
  color: var(--text-muted);
  margin: 0 0.5rem;
}

/* Link and logo styling */
.nephbox-link {
  color: #8e63f3;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nephbox-link:hover {
  color: #8e63f3;
}

.nephbox-logo {
  width: 20px;
  height: auto;
  vertical-align: middle;
  filter: brightness(1.2);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.nephbox-link:hover .nephbox-logo {
  transform: scale(1.1);
  filter: brightness(1.5);
}

/* Mobile scaling */
@media (max-width: 480px) {
  .nephbox-logo {
    width: 18px;
  }

  footer {
    font-size: 0.85rem;
  }
}


/* ------------------------------------------------------------- */
/* SCROLLBAR STYLING */
/* ------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}


/* ------------------------------------------------------------- */
/* UPDATED GAME SELECT DROPDOWN */
/* ------------------------------------------------------------- */
.game-select {
  padding: 0.6rem 1rem;
  font-size: 1.1rem;
  border-radius: 6px;
  border: 1px solid #000000;
  background-color: var(--primary);
  color: #000000;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23000000' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7rem top 50%;
  background-size: 0.65rem auto;
  padding-right: 2rem;
  min-width: 200px;
}

.game-select:focus {
  outline: none;
  border-color: #000000;
}

.game-select:hover {
  border-color: #000000;
  background-color: var(--primary-light);
}

.game-select option {
  background-color: var(--primary);
  color: #000000;
  padding: 0.5rem;
}

.game-select option:hover {
  background-color: var(--primary-light);
}

/* ------------------------------------------------------------- */
/* GAME STATUS MESSAGE */
/* ------------------------------------------------------------- */
.game-status {
  background-color: rgba(196, 76, 76, 0.1);
  border: 1px solid #c44c4c;
  border-radius: 5px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
  color: #ff6b6b;
}

.game-status p {
  margin: 0;
  font-weight: 500;
}

/* ------------------------------------------------------------- */
/* CART ACTION BUTTONS  perfectly aligned side-by-side */
/* ------------------------------------------------------------- */
.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center; /* aligns buttons perfectly on the same baseline */
  gap: 0.8rem;
  position: sticky;
  bottom: 0;
  background: var(--mid-bg);
  padding-top: 0.8rem;
  border-top: 1px solid var(--primary);
}

/* Ensure both buttons share identical layout metrics */
.cart-actions button {
  flex: 1;
  height: 50px; /* identical height */
  box-sizing: border-box;
  padding: 0.8rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.15s ease;
}

/* --- Export Button --- */
.export-btn {
  background-color: var(--mid-bg);
  color: var(--text-light);
  border: 2px solid var(--primary);
}

.export-btn:hover {
  background-color: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
}

/* --- Clear Cart Button --- */
.clear-cart-btn {
  background-color: var(--primary);
  color: var(--dark-bg);
  border: 2px solid var(--primary);
}

.clear-cart-btn:hover {
  background-color: var(--primary-hover);
  transform: scale(1.02);
}

/* --- How To Use Button --- */
.how-to-use-btn {
  background-color: var(--mid-bg);
  color: var(--text-light);
  border: 2px solid #17a2b8;
}

.how-to-use-btn:hover {
  background-color: rgba(23, 162, 184, 0.1);
  color: #17a2b8;
}

/* --- Disclaimer --- */
.disclaimer {
  margin-top: 1rem;
  padding: 1rem;
  background-color: color-mix(in srgb, var(--primary) 10%, transparent);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

.disclaimer strong {
  color: var(--primary);
}

.disclaimer p {
  margin: 0;
}

/* Stack vertically on mobile */
@media (max-width: 600px) {
  .cart-actions {
    flex-direction: column;
  }
}


/* ------------------------------------------------------------- */
/* PRICE LINE STYLING */
/* ------------------------------------------------------------- */
.price-line {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #333;
}

.price-label {
  color: var(--primary);
  font-weight: 600;
}

.divider {
  color: var(--text-muted);
  margin: 0 0.5rem;
}

/* ------------------------------------------------------------- */
/* FOIL TOGGLE SWITCH */
/* ------------------------------------------------------------- */
.foil-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.foil-label {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Toggle switch container */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

/* Hide default checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider design */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #444;
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid var(--primary);
}

/* Knob */
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 2px;
  background-color: var(--primary);
  transition: 0.3s;
  border-radius: 50%;
}

/* Checked state */
.switch input:checked + .slider {
  background-color: var(--primary);
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
  background-color: var(--dark-bg);
}


/* ------------------------------------------------------------- */
/*  MOBILE LAYOUT ADJUSTMENT  FINAL REFINEMENT */
/* ------------------------------------------------------------- */
@media (max-width: 768px) {
  /* HEADER: logo + select side-by-side, title below */
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
  }

  .header-left {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .header-center {
    width: 100%;
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .header-center h1 {
    flex: 0 0 auto;
    font-size: 1.2rem;
  }

  /* Contact links styling on mobile */
  .contact-links {
    margin-left: 0.5rem !important;
  }

  /* Force horizontal layout on mobile regardless of configured layout */
  .contact-links,
  .contact-links > div,
  .contact-links > div > div {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.3rem !important;
    align-items: center !important;
  }

  /* Show only icons on mobile, hide text */
  .contact-links a span {
    display: none !important;
  }

  .contact-links a {
    gap: 0 !important;
    padding: 0.25rem;
    display: inline-flex !important;
  }

  .contact-links a img {
    width: 20px !important;
    height: 20px !important;
  }

  .header-how-to-btn {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
  }

  .game-select {
    width: auto;
    min-width: 150px;
    font-size: 0.95rem;
  }

  /* MAIN: stack vertically  search/results first, cart last */
  .main-layout {
    flex-direction: column;
    padding: 0.8rem;
    gap: 1rem;
  }

  /* SEARCH INPUTS  full width fit */
  .search-box {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .search-box input {
    width: 100%;
    box-sizing: border-box;
  }

  .search-box button {
    width: 100%;
  }

  .set-filter {
    width: 100%;
    box-sizing: border-box;
  }

  /* Card results area */
  .card-results {
    padding: 0.8rem 1rem;
    border-radius: 8px;
  }

  /* Cart (Selected Cards) section */
  .cart {
    order: 3;
    width: 100%;
    margin-top: 1rem;
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 1rem;
    box-sizing: border-box;
    background-color: var(--mid-bg);
  }

  .cart h2 {
    text-align: left;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
  }

  #cartList li {
    font-size: 0.95rem;
    padding: 0.5rem 0;
  }

  .totals {
    text-align: left;
    font-size: 0.95rem;
  }

  /* Buttons stack neatly */
  .cart-actions {
    flex-direction: column;
    gap: 0.6rem;
  }

  .cart-actions button {
    width: 100%;
    font-size: 1rem;
  }

  /* Keep footer readable and padded */
  footer {
    font-size: 0.85rem;
    padding: 0.8rem;
  }
}

/* ------------------------------------------------------------- */
/*  THEMED ALERTS & PROMPTS */
/* ------------------------------------------------------------- */

/* Alert Styles */
.theme-alert {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 300px;
  max-width: 500px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 2px solid;
  background-color: var(--mid-bg);
  color: var(--text-light);
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  animation: slideInRight 0.3s ease-out;
}

.theme-alert-message {
  flex: 1;
  white-space: pre-line;
  line-height: 1.4;
}

.theme-alert-close {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.theme-alert-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Alert Types */
.theme-alert-success {
  border-color: #4caf50;
  background: linear-gradient(135deg, var(--mid-bg) 0%, rgba(76, 175, 80, 0.1) 100%);
}

.theme-alert-error {
  border-color: #f44336;
  background: linear-gradient(135deg, var(--mid-bg) 0%, rgba(244, 67, 54, 0.1) 100%);
}

.theme-alert-warning {
  border-color: #ff9800;
  background: linear-gradient(135deg, var(--mid-bg) 0%, rgba(255, 152, 0, 0.1) 100%);
}

.theme-alert-info {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--mid-bg) 0%, color-mix(in srgb, var(--primary) 10%, transparent) 100%);
}

/* Prompt Styles */
.theme-prompt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  animation: fadeIn 0.2s ease-out;
}

.theme-prompt {
  background-color: var(--mid-bg);
  border: 2px solid var(--primary);
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: scaleIn 0.2s ease-out;
}

.theme-prompt-header {
  padding: 1.2rem 1.5rem 0.5rem;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.theme-prompt-header h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1.3rem;
}

.theme-prompt-close {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.theme-prompt-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.theme-prompt-body {
  padding: 1.5rem;
}

.theme-prompt-body p {
  margin: 0 0 1rem 0;
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.4;
}

.theme-prompt-input {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid var(--primary);
  background-color: var(--dark-bg);
  color: var(--text-light);
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.theme-prompt-input:focus {
  outline: none;
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent);
}

.theme-prompt-textarea {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid var(--primary);
  background-color: var(--dark-bg);
  color: var(--text-light);
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.theme-prompt-textarea:focus {
  outline: none;
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent);
}

.theme-prompt-textarea::placeholder {
  color: var(--text-muted);
}

.theme-prompt-footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  gap: 0.8rem;
  justify-content: center; /* Changed from flex-end to center */
  align-items: center;
}

.theme-prompt-btn {
  padding: 0.7rem 1.5rem;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid;
  min-width: 100px; /* Added for consistent button sizing */
}

.theme-prompt-cancel {
  background-color: transparent;
  color: var(--text-light);
  border-color: #666;
}

.theme-prompt-cancel:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}

.theme-prompt-confirm {
  background-color: var(--primary);
  color: var(--dark-bg);
  border-color: var(--primary);
}

.theme-prompt-confirm:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .theme-alert {
    top: 10px;
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: none;
  }

  .theme-prompt {
    width: 95%;
    margin: 1rem;
  }

  .theme-prompt-footer {
    flex-direction: column;
  }

  .theme-prompt-btn {
    width: 100%;
  }
}

/* ------------------------------------------------------------- */
/* ENHANCED FORM STYLES FOR EXPORT PROMPT - MAINTAINING GOLD THEME */
/* ------------------------------------------------------------- */

/* Enhanced form styles for email prompt */
.form-group {
  margin-bottom: 1.5rem; /* Increased spacing between form groups */
  text-align: left;
}

.form-label {
  display: block;
  margin-bottom: 0.75rem; /* Increased spacing between label and input */
  font-weight: 600;
  color: var(--text-light); /* Using your theme variable */
  font-size: 1rem;
}

.form-help {
  display: block;
  margin-top: 0.5rem; /* Increased spacing above help text */
  font-size: 0.8rem;
  color: var(--text-muted); /* Using your theme variable */
  font-style: italic;
  line-height: 1.4;
}

.theme-prompt-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--primary); /* Using your gold theme */
  border-radius: 5px; /* Matching your theme's border radius */
  font-size: 1rem;
  background-color: var(--dark-bg); /* Using your theme variable */
  color: var(--text-light); /* Using your theme variable */
  transition: border-color 0.3s ease;
  margin-top: 0.25rem; /* Extra spacing above input */
  box-sizing: border-box;
}

.theme-prompt-input:focus {
  outline: none;
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent);
}

/* Additional spacing improvements for the prompt body */
.theme-prompt-body {
  padding: 1.5rem;
}

.theme-prompt-body p {
  margin-bottom: 1.5rem; /* More space below the main instruction */
  line-height: 1.5;
  color: var(--text-light); /* Using your theme variable */
}

/* Ensure the form groups in the export prompt use these styles */
.theme-prompt .form-group {
  margin-bottom: 1.5rem;
}

.theme-prompt .form-label {
  margin-bottom: 0.75rem;
}

.theme-prompt .theme-prompt-input {
  margin-top: 0.25rem;
}
/* ------------------------------------------------------------- */
/* NO IMAGE PLACEHOLDER */
/* ------------------------------------------------------------- */
.no-image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border-radius: 6px;
  padding: 8px;
  box-sizing: border-box;
  animation: fadeIn 0.3s ease-in;
}

.no-image-placeholder svg {
  color: #666;
  margin-bottom: 6px;
  opacity: 0.8;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.no-image-placeholder span {
  color: #888;
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  word-wrap: break-word;
}

/* Responsive sizing for smaller containers */
@media (max-width: 768px) {
  .no-image-placeholder svg {
    width: 28px;
    height: 28px;
  }

  .no-image-placeholder span {
    font-size: 9px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
/* ========================================
   Search Guide Styles (Dark Theme)
   ======================================== */
.search-guide {
  margin-top: 1rem;
  border-top: 1px solid #333;
  padding-top: 1rem;
}

.search-guide-toggle {
  width: 100%;
  background: var(--mid-bg);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 12px 15px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-guide-toggle:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-color: var(--primary-hover);
}

#searchGuideIcon {
  font-size: 10px;
  color: var(--primary);
  transition: transform 0.2s ease;
}

.search-guide-content {
  padding: 15px;
  background: var(--dark-bg);
  border: 1px solid #333;
  border-radius: 8px;
  margin-top: 10px;
  font-size: 13px;
}

.search-guide-content h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 8px;
}

.search-example {
  margin: 12px 0;
  padding: 8px 12px;
  background: var(--mid-bg);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
}

.search-example strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-light);
  font-size: 12px;
}

.search-example code {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  padding: 3px 8px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--primary-light);
  margin-right: 8px;
}

.search-tip {
  margin-top: 15px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  font-size: 12px;
}

.search-tip strong {
  color: var(--primary);
}

.search-tip code {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--primary-light);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-guide {
    margin-top: 15px;
  }

  .search-guide-content {
    font-size: 12px;
  }

  .search-example {
    padding: 6px 10px;
  }
}

/* -----------------------------------------
   Filter Info Message (Admin Filters)
   ----------------------------------------- */
.filter-info-message {
  background: var(--mid-bg);
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  color: var(--text-light);
}

.filter-info-message p {
  margin: 0 0 10px 0;
  line-height: 1.6;
}

.filter-info-message p:last-of-type {
  margin-bottom: 15px;
}

.filter-info-message ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.filter-info-message li {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-left: 3px solid var(--primary);
  padding: 10px 15px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.filter-info-message li:last-child {
  margin-bottom: 0;
}

.filter-info-message strong {
  color: var(--primary);
}

/* -----------------------------------------
   Hotbuys Carousel
   ----------------------------------------- */
.hotbuys-carousel {
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  background: var(--dark-bg);
  padding: 0.5rem 0.75rem 0.75rem 0.75rem;
  margin: 0 auto;
  border-bottom: 2px solid var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  box-sizing: border-box;
}

.carousel-dismiss {
  position: absolute;
  top: 0.75rem;
  right: 3rem;
  background: var(--mid-bg);
  border: 1px solid var(--primary);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  z-index: 10;
}

.carousel-dismiss:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.carousel-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.carousel-title {
  font-size: 1rem;
  color: var(--primary);
  margin: 0 0 0.15rem 0;
  font-weight: 700;
}

.carousel-subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin: 0;
}

.carousel-wrapper {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carousel-container {
  flex: 1;
  overflow: hidden;
  border-radius: 12px;
}

.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  padding: 0.5rem;
}

.carousel-track::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

.carousel-slide {
  scroll-snap-align: start;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

.carousel-card {
  background: var(--mid-bg);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  min-height: auto;
  width: 100%;
  max-width: 150px;
  margin: 0 auto;
}

.carousel-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(197, 75, 60, 0.4);
  border-color: color-mix(in srgb, var(--primary) 80%, white);
}

.carousel-card-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  border-radius: 4px;
  overflow: hidden;
}

.carousel-card-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: var(--primary);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.carousel-card-image {
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  object-fit: cover;
  display: block;
  background: var(--dark-bg);
}

.carousel-card-no-image {
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-bg);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.carousel-card-price-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 0.2rem;
  padding: 0.3rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7), transparent);
  z-index: 1;
}

.carousel-price-badge {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.2rem 0.3rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  border: 1px solid var(--primary);
  border-radius: 3px;
}

.carousel-price-badge .price-label {
  font-size: 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.05rem;
  font-weight: 600;
  line-height: 1;
}

.carousel-price-badge .price-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.carousel-card-footer {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: center;
}

.carousel-card-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-light);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
  min-height: 1.6em;
}

.carousel-card-details {
  font-size: 0.55rem;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-card-game {
  display: inline-block;
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--primary);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-size: 0.6rem;
  font-weight: 600;
  margin: 0 auto;
}

.carousel-nav {
  background: var(--mid-bg);
  border: 1px solid var(--primary);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.carousel-nav svg {
  width: 16px;
  height: 16px;
}

.carousel-nav:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.carousel-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}


/* Responsive Breakpoints */
@media (min-width: 600px) {
  .carousel-track {
    grid-auto-columns: calc(50% - 0.375rem);
  }
}

@media (min-width: 900px) {
  .carousel-track {
    grid-auto-columns: calc(33.333% - 0.5rem);
  }
}

@media (min-width: 1200px) {
  .carousel-track {
    grid-auto-columns: calc(25% - 0.56rem);
  }
}

@media (min-width: 1500px) {
  .carousel-track {
    grid-auto-columns: calc(20% - 0.6rem);
  }
}

@media (max-width: 599px) {
  .hotbuys-carousel {
    padding: 0.4rem 0.4rem 0.6rem 0.4rem;
  }

  .carousel-title {
    font-size: 0.9rem;
  }

  .carousel-subtitle {
    font-size: 0.6rem;
  }

  .carousel-dismiss {
    width: 24px;
    height: 24px;
    top: 0.4rem;
    right: 1.5rem;
  }

  .carousel-dismiss svg {
    width: 12px;
    height: 12px;
  }

  .carousel-wrapper {
    gap: 0.4rem;
  }

  .carousel-nav {
    width: 26px;
    height: 26px;
  }

  .carousel-nav svg {
    width: 12px;
    height: 12px;
  }

  .carousel-card {
    max-width: 130px;
  }

  .carousel-card-name {
    font-size: 0.6rem;
  }

  .carousel-price-badge .price-value {
    font-size: 0.65rem;
  }

  .carousel-price-badge .price-label {
    font-size: 0.4rem;
  }

  .carousel-card-game {
    font-size: 0.52rem;
  }

  .carousel-card-details {
    font-size: 0.48rem;
  }
}

/* ------------------------------------------------------------- */
/* USER NAVIGATION */
/* ------------------------------------------------------------- */
.user-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-greeting {
  color: var(--text-light);
  font-size: 0.9rem;
  white-space: nowrap;
}

.user-nav .btn-link {
  color: var(--primary);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  border: 2px solid var(--primary);
  white-space: nowrap;
  height: auto;
  min-height: auto;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
}

.user-nav .btn-link:hover {
  background-color: var(--primary);
  color: var(--dark-bg);
  transform: translateY(-1px);
}

/* Narrow desktop / zoomed-out desktop header fix (not mobile — mobile has its own rules below) */
@media (min-width: 769px) and (max-width: 1300px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
  }

  .header-left,
  .header-center,
  .header-right {
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }

  .header-center {
    order: 1;
    text-align: center;
  }

  .header-left {
    order: 2;
    justify-content: center;
    gap: 1rem;
  }

  .header-right {
    order: 3;
    margin-left: 0;
    justify-content: center;
  }

  h1 {
    font-size: 1.4rem;
    text-align: center;
  }

  .logo {
    width: 60px;
  }
}

@media (max-width: 768px) {
  /* Mobile layout: 3 rows
     Row 1: Logo + Game Selector
     Row 2: Store Name + Contact Icons
     Row 3: How to Use + Account/Logout buttons
  */
  .site-header {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    flex-direction: column;
    align-items: stretch;
  }

  /* Row 1: Logo + Game Selector */
  .header-left {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    order: 1;
  }

  .logo {
    width: 50px;
    flex-shrink: 0;
  }

  .game-select {
    flex: 1;
    font-size: 0.9rem;
    min-width: auto;
  }

  /* Row 2: Store Name + Contact Icons */
  .header-center {
    width: 100%;
    max-width: 100%;
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    order: 2;
    z-index: 5;
  }

  .header-center h1 {
    font-size: 1.3rem;
    margin: 0;
    flex: 0 1 auto;
  }

  .contact-links {
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    pointer-events: auto;
  }

  .contact-links a {
    pointer-events: auto;
    cursor: pointer;
    position: relative;
    z-index: 11;
  }

  /* Row 3: How to Use (full width) */
  .header-right {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    order: 3;
    margin-left: 0;
  }

  .header-how-to-btn {
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* Row 4: Login OR Account/Logout (full width, split if logged in) */
  .user-nav {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .user-greeting {
    display: none;
  }

  .user-nav .btn-link {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0.6rem 0.8rem;
    gap: 0.6rem;
  }

  .logo {
    width: 45px;
  }

  .game-select {
    font-size: 0.85rem;
    padding: 0.5rem;
  }

  .header-center h1 {
    font-size: 1.1rem;
  }

  .header-how-to-btn {
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .user-nav .btn-link {
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .user-greeting {
    display: none;
  }

  .user-nav {
    gap: 0.4rem;
  }

  .header-left {
    gap: 0.75rem;
  }

  .header-right {
    gap: 0.5rem;
  }
}

/* ------------------------------------------------------------- */
/* REVIEW SUBMISSION MODAL                                       */
/* ------------------------------------------------------------- */
.review-modal {
  width: 800px;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.review-modal-body {
  flex: 1;
  overflow: hidden;
  padding: 1.25rem 1.75rem;
}

.review-table-wrapper {
  overflow-y: auto;
  max-height: 420px;
  border: 1px solid #333;
  border-radius: 6px;
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.review-table thead th {
  position: sticky;
  top: 0;
  background: var(--dark-bg);
  color: var(--text-light);
  padding: 0.85rem 1rem;
  text-align: center;
  font-weight: 600;
  border-bottom: 2px solid var(--primary);
  white-space: nowrap;
}

.review-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: background 0.15s;
}

.review-table tbody tr:last-child {
  border-bottom: none;
}

.review-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.review-table td {
  padding: 0.85rem 1rem;
  color: var(--text-light);
  vertical-align: middle;
}

.review-card-name {
  display: block;
  font-weight: 600;
}

.review-set-info {
  display: block;
  font-size: 0.8rem;
  color: var(--primary);
  margin-top: 0.25rem;
}

.review-center {
  text-align: center;
}

.review-right {
  text-align: right;
}

.review-total-cell {
  font-weight: 600;
  color: var(--primary);
}

.review-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem 1.75rem;
  gap: 1.25rem;
  border-top: 1px solid #333;
  flex-wrap: wrap;
}

.review-footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.review-grand-total {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-light);
}

.review-coupon-note {
  font-size: 0.84rem;
  color: var(--primary);
  margin: 0;
}

.review-footer-actions {
  display: flex;
  gap: 0.9rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .review-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .review-footer-actions {
    flex-direction: column;
  }

  .review-footer-actions .theme-prompt-btn {
    width: 100%;
  }

  .review-table {
    font-size: 0.8rem;
  }

  .review-table td,
  .review-table thead th {
    padding: 0.5rem 0.5rem;
  }

  .review-condition-select {
    min-width: 0;
    font-size: 0.75rem;
  }

  .review-qty-input {
    width: 44px;
  }
}

.review-condition-select {
  background: var(--dark-bg);
  color: var(--text-light);
  border: 1px solid #444;
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 155px;
  width: 100%;
}

.review-condition-select:focus {
  outline: none;
  border-color: var(--primary);
}

.review-qty-input {
  background: var(--dark-bg);
  color: var(--text-light);
  border: 1px solid #444;
  border-radius: 4px;
  padding: 0.45rem 0.4rem;
  font-size: 0.9rem;
  width: 62px;
  text-align: center;
}

.review-qty-input:focus {
  outline: none;
  border-color: var(--primary);
}

.review-qty-input::-webkit-outer-spin-button,
.review-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.review-qty-input[type=number] {
  -moz-appearance: textfield;
}

/* ------------------------------------------------------------- */
/* IMAGE ZOOM MODAL */
/* ------------------------------------------------------------- */
.image-modal {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  cursor: pointer;
  animation: fadeIn 0.2s ease-out;
  /* Ensure modal is always on top and centered */
  overflow: hidden;
}

.image-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  /* Ensure content stays centered */
  margin: auto;
}

.image-modal-img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  animation: zoomIn 0.2s ease-out;
  /* Prevent image from causing scroll */
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Close button for modal */
.image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10000;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 0;
}

.image-modal-close:hover {
  background: white;
  transform: scale(1.1);
}

.image-modal-close:active {
  transform: scale(0.95);
}

/* Mobile adjustments for image modal */
@media (max-width: 768px) {
  .image-modal.show {
    padding: 0.5rem;
    /* Ensure modal fills entire screen on mobile */
    align-items: center;
    justify-content: center;
  }

  .image-modal-content {
    max-width: 95vw;
    max-height: 95vh;
    /* Force centering on mobile */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .image-modal-img {
    max-width: 95vw;
    max-height: 95vh;
    /* Better fit for mobile with reduced max height to account for browser UI */
    border-radius: 4px;
  }

  .image-modal-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 48px;
    height: 48px;
    font-size: 2.5rem;
    /* Larger touch target for mobile */
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .image-modal.show {
    padding: 0.25rem;
  }

  .image-modal-content {
    max-width: 98vw;
    max-height: 98vh;
  }

  .image-modal-img {
    max-width: 98vw;
    max-height: 98vh;
  }

  .image-modal-close {
    width: 44px;
    height: 44px;
  }
}

/* ===========================
   🎟️ COUPON SECTION STYLES
   =========================== */

.coupon-section {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.coupon-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.coupon-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.coupon-input {
  flex: 1;
  padding: 0.6rem;
  background: var(--mid-bg);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.coupon-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.coupon-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.coupon-apply-btn {
  padding: 0.6rem 1.2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.coupon-apply-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.coupon-apply-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.coupon-help {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.25rem;
  transition: color 0.3s ease;
}

.coupon-help a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.coupon-help a:hover {
  text-decoration: underline;
}

.applied-coupon-display {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(76, 175, 80, 0.1);
  border-left: 3px solid #4CAF50;
  border-radius: 4px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.applied-coupon-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.applied-coupon-text {
  font-weight: 600;
  color: #4CAF50;
  font-size: 0.9rem;
  flex: 1;
}

.remove-coupon-btn {
  background: none;
  border: none;
  color: #f44336;
  cursor: pointer;
  font-size: 20px;
  padding: 0 0.5rem;
  line-height: 1;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.remove-coupon-btn:hover {
  background: rgba(244, 67, 54, 0.1);
  transform: scale(1.1);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .coupon-section {
    padding: 0.75rem;
  }

  .coupon-input-group {
    flex-direction: column;
  }

  .coupon-apply-btn {
    width: 100%;
  }
}
