:root {
  --bg-1: #06030f;
  --bg-2: #10071d;
  --panel: rgba(14, 10, 28, 0.86);
  --panel-strong: rgba(17, 11, 34, 0.94);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5edff;
  --muted: #b9aacb;
  --accent: #ff39b8;
  --accent-2: #a12dff;
  --success: #5dffbd;
  --error: #ff7b9f;
  --shadow: 0 30px 60px rgba(2, 0, 10, 0.45);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Tajawal", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(161, 45, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 57, 184, 0.16), transparent 20%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
  color: var(--text);
}

body {
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.space-bg {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px),
    radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px),
    radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px);
  background-size: 220px 220px;
  opacity: 0.4;
  pointer-events: none;
}

.site-header,
.dashboard-header {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand strong,
.dashboard-header h1,
.hero h1,
.auth-card h1,
.panel h2,
.game-overview h2 {
  margin: 0;
  font-weight: 800;
}

.brand small,
.hero-copy,
.status-message,
.card-meta,
.eyebrow,
.auth-form span,
.stack-form span {
  color: var(--muted);
}

.brand-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 57, 184, 0.26), rgba(161, 45, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.brand-logo-wrap {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-icon svg {
  width: 34px;
  height: 34px;
}

button,
.price-card a,
.ghost-button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

button,
.price-card a {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 16px 30px rgba(161, 45, 255, 0.35);
}

.ghost-button,
button,
.price-card a {
  padding: 12px 22px;
  font-weight: 700;
}

.ghost-button:hover,
button:hover,
.price-card a:hover {
  transform: translateY(-2px);
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.hero,
.auth-layout,
.dashboard-grid {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto 40px;
}

.hero {
  display: grid;
  gap: 26px;
  padding: 40px 0 60px;
}

.hero-card,
.loading-state,
.game-overview,
.price-card,
.auth-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  padding: clamp(28px, 4vw, 48px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.hero h1,
.auth-card h1 {
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1.1;
}

.hero-copy {
  max-width: 780px;
  margin: 18px auto 0;
  font-size: 1.06rem;
  line-height: 1.8;
}

.notice-copy {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.free-game-alert {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(93, 255, 189, 0.12);
  border: 1px solid rgba(93, 255, 189, 0.25);
  color: #d7fff1;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
}

.notice-copy p {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: #fff5fd;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.8;
  box-shadow: none;
  text-align: center;
}

.search-shell {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  background: rgba(7, 4, 17, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 10px;
}

.search-shell input,
.auth-form input,
.stack-form input,
table input {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 16px 18px;
  outline: none;
}

.search-shell input {
  background: transparent;
  padding-inline: 22px;
  border-radius: 999px;
}

.search-shell input:focus,
.auth-form input:focus,
.stack-form input:focus,
table input:focus {
  border-color: rgba(255, 57, 184, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 57, 184, 0.08);
}

.status-message {
  min-height: 28px;
  margin: 18px 0 0;
}

.error-text {
  color: var(--error);
}

.loading-state {
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 36px;
}

.flower-spinner {
  position: relative;
  width: 112px;
  height: 112px;
  animation: spin 2.2s linear infinite;
}

.flower-spinner span {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 24px;
  height: 24px;
  margin: -12px;
  border-radius: 999px 999px 10px 999px;
  background: linear-gradient(135deg, var(--accent), #ff8ce6);
  box-shadow: 0 0 22px rgba(255, 57, 184, 0.4);
  transform-origin: 0 40px;
}

.flower-spinner span:nth-child(1) { transform: rotate(0deg) translateY(-40px); }
.flower-spinner span:nth-child(2) { transform: rotate(45deg) translateY(-40px); }
.flower-spinner span:nth-child(3) { transform: rotate(90deg) translateY(-40px); }
.flower-spinner span:nth-child(4) { transform: rotate(135deg) translateY(-40px); }
.flower-spinner span:nth-child(5) { transform: rotate(180deg) translateY(-40px); }
.flower-spinner span:nth-child(6) { transform: rotate(225deg) translateY(-40px); }
.flower-spinner span:nth-child(7) { transform: rotate(270deg) translateY(-40px); }
.flower-spinner span:nth-child(8) { transform: rotate(315deg) translateY(-40px); }

.hidden {
  display: none !important;
}

.results {
  display: grid;
  gap: 22px;
}

.game-overview {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: center;
  padding: 22px;
}

.game-overview img {
  width: 100%;
  display: block;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.price-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.card-glow {
  position: absolute;
  inset: auto -40px -60px auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 57, 184, 0.3), transparent 70%);
  pointer-events: none;
}

.card-region {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.card-price {
  margin: 18px 0 12px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 800;
}

.price-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.price-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.card-price.secondary {
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  margin-bottom: 0;
}

.card-meta {
  margin: 8px 0;
  line-height: 1.7;
}

.price-card a {
  display: inline-block;
  margin-top: 18px;
}

.auth-layout {
  min-height: calc(100vh - 110px);
  display: grid;
  place-items: center;
}

.auth-card,
.panel {
  padding: 30px;
}

.auth-card {
  width: min(540px, 100%);
}

.auth-form,
.stack-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.auth-form label,
.stack-form label {
  display: grid;
  gap: 8px;
}

.form-alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-top: 18px;
}

.form-alert.error {
  background: rgba(255, 123, 159, 0.12);
  color: var(--error);
}

.form-alert.success {
  background: rgba(93, 255, 189, 0.1);
  color: var(--success);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  padding-bottom: 48px;
}

.panel-wide {
  min-width: 0;
}

.panel-full {
  grid-column: 1 / -1;
}

.panel-head {
  margin-bottom: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: right;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 700;
}

.pricing-form {
  display: grid;
  gap: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  font-weight: 800;
}

.faq-section {
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.faq-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.faq-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
}

.faq-item summary {
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 700;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.9;
}

.faq-admin-list {
  display: grid;
  gap: 18px;
}

.faq-admin-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.faq-admin-card label,
.faq-create-form label {
  display: grid;
  gap: 8px;
}

.faq-admin-card textarea,
.faq-create-form textarea {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 16px 18px;
  outline: none;
  resize: vertical;
  font: inherit;
}

.faq-admin-card textarea:focus,
.faq-create-form textarea:focus {
  border-color: rgba(255, 57, 184, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 57, 184, 0.08);
}

.faq-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.faq-admin-actions {
  display: flex;
  justify-content: flex-end;
}

.site-footer {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto 32px;
  padding: 20px 24px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(10, 7, 22, 0.82);
  text-align: center;
  color: var(--muted);
}

.site-footer p {
  margin: 6px 0;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .pricing-grid,
  .dashboard-grid,
  .game-overview {
    grid-template-columns: 1fr;
  }

  .search-shell {
    grid-template-columns: 1fr;
    border-radius: 26px;
  }

  .search-shell input,
  .search-shell button {
    border-radius: 16px;
  }
}

@media (max-width: 640px) {
  .site-header,
  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    justify-content: center;
  }

  .ghost-button,
  button,
  .price-card a {
    width: 100%;
    text-align: center;
  }

  .hero-card,
  .loading-state,
  .auth-card,
  .panel {
    border-radius: 22px;
  }
}
