:root {
  --paper: #090d13;
  --paper-2: #101923;
  --ink: #f6f7fb;
  --muted: #a9b4c7;
  --panel: rgba(16, 24, 35, 0.94);
  --panel-soft: #141f2b;
  --line: rgba(148, 163, 184, 0.14);
  --brand: #ffb347;
  --brand-2: #ff9d2b;
  --brand-deep: #ff8a1c;
  --shadow: 0 24px 55px rgba(0, 0, 0, 0.42);
  --dark-panel: rgba(11, 17, 25, 0.95);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 179, 71, 0.10), transparent 18%),
    radial-gradient(circle at bottom right, rgba(94, 163, 255, 0.10), transparent 18%),
    linear-gradient(180deg, #0b1016 0%, #0d1520 100%);
  color: var(--ink);
  font-family: "Tajawal", sans-serif;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.18;
  pointer-events: none;
}

.bg-shape-a {
  width: 380px;
  height: 380px;
  background: rgba(255, 179, 71, 0.24);
  top: -100px;
  left: -80px;
}

.bg-shape-b {
  width: 360px;
  height: 360px;
  background: rgba(80, 118, 255, 0.18);
  bottom: -120px;
  right: -100px;
}

.store-header,
.market-main {
  width: min(1180px, 92vw);
  margin: 0 auto;
}

.store-header {
  padding-top: 22px;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: rgba(12, 17, 24, 0.9);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffbe63 0%, #ff8a1d 100%);
  color: #111827;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(255, 153, 38, 0.35);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 1.1rem;
  color: var(--ink);
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-height: 52px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  padding: 0 16px;
}

.search-icon {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
}

.search-shell input {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  outline: none;
  font-size: 1rem;
}

.search-shell input::placeholder {
  color: rgba(169, 180, 199, 0.82);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-link,
.cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  padding: 0 16px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.offers-strip {
  width: min(1180px, 92vw);
  margin: 18px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.offer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 179, 71, 0.22);
  background: rgba(255, 179, 71, 0.08);
  color: #ffd99a;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 0.82rem;
}

.header-link.muted {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.header-link:hover,
.cart-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.18);
}

.cart-button {
  background: linear-gradient(180deg, #f7c46d 0%, #f2992d 100%);
  border-color: rgba(255, 177, 80, 0.25);
  color: #1f1200;
}

.cart-button span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.18);
  margin-right: 8px;
  font-size: 0.75rem;
}

.category-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(14, 20, 29, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  box-shadow: 0 16px 30px rgba(0,0,0,0.18);
}

.category-pill {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.88);
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-pill:hover,
.category-pill.active {
  background: linear-gradient(180deg, rgba(255, 179, 71, 0.14), rgba(255, 179, 71, 0.08));
  border-color: rgba(255, 179, 71, 0.24);
  color: #ffd99a;
  box-shadow: 0 10px 18px rgba(255, 146, 34, 0.12);
}

.market-main {
  padding: 26px 0 40px;
}

.market-hero {
  padding: 18px 0 12px;
}

.hero-kicker {
  margin: 0;
  color: var(--brand-deep);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.market-hero h1 {
  margin: 8px 0 6px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
  color: var(--ink);
}

.hero-subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.04rem;
}

.status {
  min-height: 28px;
  color: var(--muted);
  font-weight: 700;
  margin: 8px 0 18px;
}

.controls {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.hero-actions {
  margin-top: 12px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  height: 42px;
  padding: 0 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1495b;
  border-radius: 12px;
  height: 42px;
  padding: 0 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: #b21e35;
}

.btn-primary {
  background: linear-gradient(180deg, #e0b77a 0%, #c9975a 100%);
  color: #1d1410;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-color: var(--line);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-field span {
  font-weight: 700;
  color: var(--muted);
}

input,
select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--ink);
  font-size: 1rem;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus,
select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(0, 121, 140, 0.13);
}

.status {
  min-height: 28px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 16px;
}

.company-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  padding-bottom: 40px;
}

.company-card {
  background: linear-gradient(180deg, rgba(15, 23, 33, 0.96), rgba(11, 17, 24, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 24px;
  padding: 18px 18px 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.company-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

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

.company-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #ffbf69, rgba(255,255,255,0.06));
  box-shadow: 0 12px 24px rgba(255, 159, 28, 0.24);
}

.company-meta {
  min-width: 0;
}

.company-name {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  color: var(--ink);
  font-weight: 800;
}

.company-slug {
  margin: 3px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.company-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 7px 12px;
  border: 1px solid rgba(255, 179, 71, 0.2);
  background: rgba(255, 179, 71, 0.08);
  color: #ffc570;
}

/* Admin: make price input a bit wider for readability */
.admin-card input#gamePrice {
  min-width: 260px;
  padding: 0 16px;
}

.games-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.game-card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(18, 27, 38, 0.98), rgba(11, 17, 25, 0.98));
  overflow: hidden;
  box-shadow: 0 16px 28px rgba(0,0,0,0.18);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 35px rgba(0,0,0,0.22);
  border-color: rgba(255, 179, 71, 0.28);
}

.game-cover {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: linear-gradient(135deg, #1f2c3d, #0b1117);
}

.game-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 14px;
}

.game-name {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.game-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-to-cart {
  border: 0;
  background: rgba(134, 239, 172, 0.12);
  color: #baf7d0;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.game-price {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 179, 71, 0.08);
  border: 1px solid rgba(255, 179, 71, 0.18);
  color: #ffc570;
  font-weight: 800;
  font-size: 0.76rem;
}

.details-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 94px;
  height: 34px;
  border-radius: 10px;
  font-weight: 800;
  color: #160f09;
  background: linear-gradient(180deg, #ffbf69 0%, #f28b1d 100%);
  text-decoration: none;
  font-size: 0.78rem;
  box-shadow: 0 10px 18px rgba(242, 139, 29, 0.22);
}

.cart-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(360px, calc(100vw - 24px));
  padding: 16px;
  border-radius: 18px;
  background: rgba(12, 17, 24, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: var(--shadow);
  z-index: 50;
}

.cart-panel.hidden {
  display: none;
}

.cart-panel h3 {
  margin: 0 0 12px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.details-link:hover {
  text-decoration: none;
  filter: brightness(0.98);
}

.empty-state {
  padding: 26px 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

.hidden {
  display: none;
}

.detail-wrap,
.admin-wrap {
  width: min(1140px, 92vw);
  margin: 0 auto;
  padding: 26px 0 34px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  width: min(1140px, 92vw);
  margin: 0 auto;
}

.login-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(34, 41, 49, 0.96), rgba(20, 25, 31, 0.96));
  box-shadow: var(--shadow);
  padding: 22px;
}

.login-card h1 {
  margin: 0;
  color: var(--ink);
}

.login-card p {
  color: var(--muted);
}

.detail-topbar,
.admin-topbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-card {
  display: grid;
  grid-template-columns: minmax(300px, 520px) 1fr;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(18, 31, 49, 0.97), rgba(13, 20, 30, 0.97));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-height: 320px;
  background: linear-gradient(135deg, #18283d, #0b1220);
  background-position: center;
}

.detail-content {
  padding: 24px 20px;
}

.detail-content h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.7vw, 2.5rem);
  color: var(--ink);
}

.detail-company,
.detail-meta,
.detail-description {
  color: var(--muted);
  margin: 12px 0 0;
}

.detail-description {
  color: var(--ink);
  line-height: 1.8;
}

.detail-price {
  display: inline-flex;
  margin-top: 18px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.18);
  color: var(--brand);
  font-weight: 800;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 28, 43, 0.96), rgba(12, 19, 29, 0.96));
  padding: 16px;
  box-shadow: var(--shadow);
}

.admin-card h2 {
  margin: 0 0 10px;
  color: var(--ink);
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-grid label span {
  color: var(--muted);
  font-weight: 700;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(15, 23, 36, 0.9);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.12);
}

.form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hint-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-catalog {
  display: grid;
  gap: 10px;
}

.admin-company-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(15, 23, 36, 0.9);
}

.admin-company-header h3 {
  margin: 0;
  color: var(--ink);
}

.admin-company-header p {
  margin: 4px 0 8px;
  color: var(--muted);
}

.admin-games-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.admin-game-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(17, 28, 43, 0.7);
}

.admin-game-item span {
  color: var(--muted);
}

@keyframes rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 820px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 28px;
  }

  .game-card {
    grid-template-columns: 1fr;
  }

  .game-cover {
    width: 100%;
    height: 160px;
  }

  .detail-card {
    grid-template-columns: 1fr;
  }
}

/* Contact manager floating button */

.contact-manager {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #1d1410;
  padding: 8px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.32);
  font-weight: 800;
  text-decoration: none;
  font-size: 0.95rem;
}

.contact-manager img {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.contact-manager:focus, .contact-manager:hover {
  transform: translateY(-3px);
}
