:root {
  --bg: #eef3fb;
  --bg-deep: #e3ebf8;
  --panel: #ffffff;
  --panel-soft: #f6f9ff;
  --text: #16233b;
  --muted: #60738e;
  --line: #cfdbec;
  --primary: #0d6d62;
  --primary-strong: #0a584f;
  --accent: #1d6fd8;
  --danger: #b43b3b;
  --shadow: 0 18px 44px rgba(30, 58, 102, 0.14);
}

* {
  box-sizing: border-box;
}

a {
  color: inherit;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", "Yu Gothic UI", sans-serif;
  background:
    radial-gradient(1200px 500px at 0% -10%, #ffffff 0%, transparent 60%),
    radial-gradient(1200px 500px at 100% -20%, #eaf4ff 0%, transparent 60%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(7px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
}

.site-nav nav {
  display: flex;
  gap: 12px;
}

.site-nav nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

.site-nav nav a[aria-current='page'] {
  color: var(--text);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
}

.brand h1 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.top-links {
  margin-top: 8px;
  display: flex;
  gap: 10px;
}

.top-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.detail-actions button,
.tile-btn {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.detail-actions button,
.tile-btn {
  cursor: pointer;
  background: var(--panel);
}

.detail-actions button:hover,
.tile-btn:hover {
  border-color: var(--primary);
}

main {
  padding: 18px;
}

.store-main {
  max-width: 1360px;
  margin: 0 auto;
}

.landing-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 18px 34px;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

.landing-hero h1 {
  white-space: pre-line;
  margin: 8px 0 10px;
  font-size: clamp(1.35rem, 3.5vw, 2rem);
}

.landing-hero p {
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eaf3ff;
  border: 1px solid #c8dbf7;
  color: #2a4f80;
  font-size: 0.8rem;
}

.landing-feature-card {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(160deg, #ffffff 0%, #f3f8ff 100%);
  border: 1px solid #c9d9f1;
  box-shadow: 0 14px 30px rgba(32, 68, 123, 0.12);
}

.feature-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.landing-feature-card h2 {
  margin: 8px 0;
}

.landing-feature-card ul {
  margin: 0 0 14px;
  padding-left: 18px;
  color: var(--muted);
}

.landing-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.landing-grid h3 {
  margin: 0 0 6px;
}

.landing-grid p {
  margin: 0;
  color: var(--muted);
}

.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  font-weight: 600;
}

.cta.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.guide-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.guide-main section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 12px;
}

.guide-main h1 {
  margin-top: 0;
}

.guide-main h2 {
  margin-top: 0;
}

.site-footer {
  margin: 18px auto 30px;
  max-width: 1360px;
  padding: 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-footer a {
  text-decoration: none;
  color: var(--muted);
}

.hero {
  display: grid;
  gap: 14px;
  margin: 0 0 16px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #ccd9ee;
  box-shadow: var(--shadow);
  background:
    linear-gradient(140deg, #ffffff 0%, #f3f8ff 50%, #edf5ff 100%);
}

.hero h2 {
  margin: 0;
  font-size: clamp(1.05rem, 3vw, 1.42rem);
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-trust span {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #c5d8f5;
  color: #254774;
  background: #f4f9ff;
  font-size: 0.82rem;
}

.commerce-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f2f7ff 100%);
  box-shadow: 0 10px 24px rgba(22, 47, 91, 0.08);
}

.commerce-head h2 {
  margin: 0;
  font-size: 1rem;
}

.checkout-status {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.checkout-status.error {
  color: var(--danger);
}

.checkout-status.success {
  color: var(--primary);
}

.selected-product {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.selected-product.empty {
  color: var(--muted);
  background: var(--panel-soft);
}

.paypal-buttons {
  min-height: 44px;
}

.marketplace-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.marketplace-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
}

.marketplace-link.marketplace-cults {
  border-color: #c9d7f2;
  background: #f2f6ff;
}

.marketplace-link.marketplace-booth {
  border-color: #b8e0d8;
  background: #e6f5f1;
}

.marketplace-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-panel {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed #9db9dd;
  border-radius: 10px;
  background: #f8fbff;
  display: grid;
  gap: 8px;
}

.admin-panel h3 {
  margin: 0;
  font-size: 0.95rem;
}

.admin-label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.admin-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

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

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  font-weight: 600;
}

.status {
  margin: 0 0 12px;
  color: var(--muted);
}

.filters {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.filter-row {
  display: grid;
  gap: 6px;
}

.filter-row strong {
  font-size: 0.82rem;
  color: var(--muted);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip,
.filter-clear {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  color: #294769;
  font: inherit;
  font-size: 0.8rem;
  padding: 6px 10px;
  cursor: pointer;
}

.filter-chip.active {
  border-color: #9db9dd;
  background: #e9f2ff;
  color: #193a63;
}

.filter-clear {
  justify-self: start;
  border-radius: 8px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}

.pagination button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font: inherit;
  cursor: pointer;
}

.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-info {
  color: var(--muted);
  font-size: 0.95rem;
}

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

.tile {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  box-shadow: 0 12px 26px rgba(18, 45, 82, 0.08);
}

.tile-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #b8d1f2;
  background: rgba(255, 255, 255, 0.94);
  color: #264975;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: lowercase;
}

.preview {
  width: 100%;
  height: clamp(220px, 20vw, 280px);
  display: block;
  background: linear-gradient(180deg, #ffffff, #edf3fb);
}

.caption {
  padding: 10px;
  display: grid;
  gap: 7px;
}

.caption-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.caption-meta {
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-word;
}

.caption-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.price {
  font-weight: 700;
  color: #1f355f;
}

.tile-actions {
  display: flex;
  gap: 6px;
}

.tile-btn.preview-open {
  border-color: #bfd5ef;
  background: #f1f6fd;
}

.tile-btn.buy-open {
  border-color: #b8e0d8;
  background: #e6f5f1;
}

.detail-modal {
  width: min(980px, 96vw);
  height: min(86vh, 900px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
}

.detail-modal::backdrop {
  background: rgba(8, 17, 28, 0.5);
}

.purchase-modal {
  width: min(860px, 94vw);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: #fff;
}

.purchase-modal::backdrop {
  background: rgba(13, 24, 42, 0.5);
  backdrop-filter: blur(2px);
}

.purchase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 0;
}

.purchase-actions {
  padding: 0 14px 14px;
}

.purchase-market-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.purchase-market-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f9fbff;
  display: grid;
  gap: 8px;
}

.purchase-market-btn {
  width: 100%;
}

@media (max-width: 720px) {
  .purchase-market-grid {
    grid-template-columns: 1fr;
  }
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

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

.detail-status {
  margin: 0;
  min-height: 22px;
  padding: 6px 10px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.detail-canvas {
  width: 100%;
  height: calc(100% - 80px);
  display: block;
  background: #eef4fb;
}

@media (max-width: 760px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .landing-grid {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .caption-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .tile-actions {
    width: 100%;
  }

  .tile-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-actions {
    justify-content: space-between;
  }
}

.pagination-bottom { margin-top: 14px; }
