/* ================================================================
   TIERCRAFT – style.css
   ================================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d0e14;
  --bg2: #13151f;
  --bg3: #1b1e2e;
  --border: rgba(255, 255, 255, .07);
  --text: #e8eaf0;
  --text2: #8b90a8;
  --accent: #7c6df0;
  --accent2: #5b4de0;
  --glass: rgba(255, 255, 255, .03);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, .45);

  /* tier colours */
  --s: #ff4d6d;
  --a: #ff7c43;
  --b: #ffd166;
  --c: #06d6a0;
  --d: #4cc9f0;
  --f: #9b72cf;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--bg3);
  border-radius: 3px;
}

/* ── HEADER ────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 14, 20, .85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  font-size: 22px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.5px;
}

.logo-text strong {
  color: var(--accent);
}

.header-nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.header-nav a {
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s;
}

.header-nav a:hover {
  color: var(--text);
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
}

.btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.btn-secondary:hover {
  background: var(--glass);
}

.btn-danger {
  background: rgba(255, 77, 109, .15);
  color: #ff4d6d;
  border: 1px solid rgba(255, 77, 109, .3);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.btn-danger:hover {
  background: rgba(255, 77, 109, .25);
}

.btn-hero {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 0 30px rgba(124, 109, 240, .4);
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 45px rgba(124, 109, 240, .6);
}

.btn-icon {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}

.btn-icon:hover {
  color: var(--text);
  background: var(--glass);
  border-color: var(--accent);
}

.btn-add {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  align-self: flex-start;
}

.btn-add:hover {
  opacity: .9;
  transform: translateY(-1px);
}

/* ── HERO ──────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 36px 24px 32px;
  background: radial-gradient(ellipse 90% 60% at 50% 0%, rgba(124, 109, 240, .13) 0%, transparent 70%);
}

.hero-tag {
  display: inline-block;
  background: rgba(124, 109, 240, .15);
  color: var(--accent);
  border: 1px solid rgba(124, 109, 240, .3);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 68px);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 18px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), #c0aff7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 18px;
  color: var(--text2);
  margin-bottom: 36px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ── ADS ───────────────────────────────────────────────────── */
.ad-label {
  font-size: 10px;
  color: var(--text2);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  text-align: center;
  margin-bottom: 6px;
}

.ad-box {
  background: var(--bg3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  font-size: 11px;
  letter-spacing: .5px;
}

.ad-box::after {
  content: 'AD PLACEHOLDER';
}

.ad-vertical {
  width: 160px;
  height: 600px;
}

.ad-horizontal {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 0 auto;
}

.ad-medium-rect {
  width: 300px;
  height: 250px;
}

.ad-banner-wrapper {
  padding: 16px 24px;
  text-align: center;
}

/* ── BUILDER SECTION ───────────────────────────────────────── */
.builder-section {
  display: grid;
  grid-template-columns: 160px 1fr 340px;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 20px 40px;
  align-items: start;
}

.ad-sidebar {
  position: sticky;
  top: 80px;
  padding-top: 4px;
}

.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.builder-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 80px;
}

.ad-right-desktop {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── BUILDER MAIN ──────────────────────────────────────────── */
.builder-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding-bottom: 300px;
}

.builder-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.list-title-input {
  flex: 1;
  min-width: 180px;
  background: transparent;
  border: none;
  outline: none;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  font-family: inherit;
}

.list-title-input::placeholder {
  color: var(--text2);
}

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

/* ── TIER LIST ─────────────────────────────────────────────── */
.tier-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tier-row {
  display: flex;
  align-items: stretch;
  min-height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color .2s;
}

.tier-row.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 109, 240, .25);
}

.tier-label {
  width: auto;
  min-width: 68px;
  padding: 0 14px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
  transition: filter .2s;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.tier-label:hover {
  filter: brightness(1.15);
}

.tier-items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg2);
  min-height: 72px;
  align-content: flex-start;
}

.tier-item {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  overflow: hidden;
  position: relative;
}

.tier-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
  border-color: rgba(255, 255, 255, .2);
}

.tier-item.dragging {
  opacity: .4;
  transform: scale(.95);
  cursor: grabbing;
}

.tier-item.is-text {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 200px;
}

.tier-item.is-image {
  width: 68px;
  height: 68px;
}

.tier-item.is-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-del {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 10px;
  color: rgba(255, 255, 255, .4);
  cursor: pointer;
  display: none;
  line-height: 1;
}

.tier-item:hover .item-del {
  display: block;
}

/* ── TOOLBAR ───────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.toolbar-left {
  display: flex;
  gap: 8px;
}

.tool-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text2);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}

.tool-btn:hover {
  color: var(--text);
  background: var(--glass);
}

.tool-btn.active {
  color: var(--accent);
  background: rgba(124, 109, 240, .12);
  border-color: rgba(124, 109, 240, .3);
}

/* ── ADD PANEL ─────────────────────────────────────────────── */
.add-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

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

.add-panel-text {
  flex-direction: column;
  gap: 10px;
}

.text-item-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.text-input-single {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s;
}

.text-input-single:focus {
  border-color: var(--accent);
}

.text-input-single::placeholder {
  color: var(--text2);
}

.text-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(124, 109, 240, .18);
  border: 1px solid rgba(124, 109, 240, .35);
  color: var(--text);
  border-radius: 50px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  animation: chipIn .15s ease;
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: scale(.85);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chip-del {
  cursor: pointer;
  color: var(--text2);
  font-size: 11px;
  line-height: 1;
  transition: color .15s;
  padding: 1px;
}

.chip-del:hover {
  color: #ff4d6d;
}

.btn-add-all {
  background: linear-gradient(135deg, #06d6a0, #2ec4b6);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity .2s, transform .15s;
}

.btn-add-all:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.upload-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: rgba(124, 109, 240, .06);
}

.upload-icon {
  font-size: 32px;
}

.upload-hint {
  font-size: 12px;
  color: var(--text2);
}

/* ── POOL ──────────────────────────────────────────────────── */
.pool-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.pool-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pool-count {
  background: var(--bg3);
  color: var(--text2);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 500;
}

.pool {
  min-height: 90px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  transition: background .2s;
  border-radius: var(--radius-sm);
  padding: 4px;
}

.pool.drag-over {
  background: rgba(124, 109, 240, .07);
}

.pool-empty {
  color: var(--text2);
  font-size: 13px;
  width: 100%;
  text-align: center;
  padding: 20px 0;
}

/* ── UPLOAD TEMPLATE BUTTON ────────────────────────────── */
.btn-upload-template {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #7c6df0, #5b4de0);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, opacity .2s;
  box-shadow: 0 0 18px rgba(124, 109, 240, .35);
  letter-spacing: .2px;
}

.btn-upload-template:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(124, 109, 240, .6);
  opacity: .95;
}

/* ── TEMPLATE TABS ─────────────────────────────────────── */
.template-tabs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 30px;
}

.template-tabs-header h2 {
  margin-bottom: 6px;
}

.template-tabs-header .section-sub {
  margin-bottom: 0;
}

.template-tabs {
  display: flex;
  gap: 6px;
  align-self: flex-start;
  margin-top: 4px;
}

.tmpl-tab {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.tmpl-tab:hover {
  color: var(--text);
}

.tmpl-tab.active {
  background: rgba(124, 109, 240, .15);
  color: var(--accent);
  border-color: rgba(124, 109, 240, .4);
}

/* community card distinct style */
.template-card.community {
  border-color: rgba(124, 109, 240, .25);
  background: linear-gradient(135deg, var(--bg2), rgba(124, 109, 240, .06));
}

.template-card.community:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(124, 109, 240, .2);
}

.community-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(124, 109, 240, .15);
  border-radius: 50px;
  padding: 2px 8px;
  letter-spacing: .5px;
  text-transform: uppercase;
  align-self: flex-start;
}

.community-loading {
  grid-column: 1/-1;
  text-align: center;
  color: var(--text2);
  padding: 40px;
  font-size: 14px;
}

/* share items preview inside modal */
.share-items-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: 4px;
  border: 1px solid var(--border);
}

.share-chip {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 50px;
  padding: 3px 10px;
  font-size: 12px;
}

/* ── TEMPLATES ─────────────────────────────────────────── */
.templates-section {
  max-width: 1060px;
  margin: 0 auto;
  padding: 60px 24px;
}

.templates-section h2,
.how-section h2,
.faq-section h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
}

.section-sub {
  color: var(--text2);
  margin-bottom: 30px;
  font-size: 15px;
}

/* ── MAIN TABS (Categories / Templates Switch) ── */
.main-tabs {
  display: flex;
  justify-content: center;
  gap: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}

.main-tab {
  background: transparent;
  color: var(--text2);
  border: none;
  font-size: 18px;
  font-weight: 700;
  padding: 0 0 12px;
  cursor: pointer;
  position: relative;
  transition: color .2s;
}

.main-tab:hover {
  color: var(--text);
}

.main-tab.active {
  color: var(--text);
}

.main-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

/* ── SEARCH ── */
.search-wrapper {
  max-width: 600px;
  margin: 0 auto 30px;
  position: relative;
}

#mainSearch {
  width: 100%;
  padding: 14px 20px 14px 44px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg3) url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b90a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='8'%3e%3c/circle%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'%3e%3c/line%3e%3c/svg%3e") no-repeat 16px center;
  background-size: 18px;
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

#mainSearch:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 109, 240, 0.2);
}

/* ── CATEGORIES GRID ── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.category-card {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg3);
  transition: transform .2s, box-shadow .2s;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

.cat-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform .3s;
}

/* default pattern/colors if no background image */
.category-card:nth-child(even) .cat-bg {
  background-image: linear-gradient(135deg, rgba(124, 109, 240, 0.1), transparent);
}

.category-card:nth-child(odd) .cat-bg {
  background-image: linear-gradient(135deg, rgba(231, 111, 81, 0.1), transparent);
}

.category-card:hover .cat-bg {
  transform: scale(1.05);
}

.cat-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, 0) 65%);
}

.cat-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px 20px;
  z-index: 2;
}

.cat-title {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.cat-count {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
}

/* ── ACTIVE FILTER BANNER ── */
.active-category-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(124, 109, 240, .1);
  border: 1px solid rgba(124, 109, 240, .3);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  margin-bottom: 24px;
  animation: modalIn .2s ease;
}

#activeCatText {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.btn-clear-cat {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.btn-clear-cat:hover {
  color: #fff;
  border-color: #fff;
}

select.modal-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b90a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

select.modal-input option {
  background: var(--bg2);
  color: var(--text);
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.template-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.template-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.tmpl-card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tmpl-name {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.tmpl-author {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text2);
  font-size: 13px;
}

.tmpl-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
}

.tmpl-preview-list {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.tmpl-preview-item {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text2);
  overflow: hidden;
}

.tmpl-preview-item.img {
  background-size: cover;
  background-position: center;
}

.tmpl-preview-item.more {
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  width: auto;
  padding: 0 4px;
}

.tmpl-card-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
}

.tmpl-card-footer span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tmpl-card-footer svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* ── HOW IT WORKS ──────────────────────────────────────────── */
.how-section {
  max-width: 1060px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.step-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}

.step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.step-num {
  font-size: 48px;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
  display: block;
  margin-bottom: 12px;
}

.step-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
}

/* ── FAQ ───────────────────────────────────────────────────── */
.faq-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.faq-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-q {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background .2s;
  gap: 12px;
}

.faq-q:hover {
  background: var(--glass);
}

.faq-arrow {
  color: var(--text2);
  font-size: 12px;
  transition: transform .25s;
  flex-shrink: 0;
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
}

.faq-a.open {
  max-height: 400px;
  padding: 0 20px 16px;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

/* ── FOOTER ────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 28px 24px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.footer-inner p {
  font-size: 13px;
  color: var(--text2);
}

.footer-inner nav {
  display: flex;
  gap: 18px;
}

.footer-inner nav a {
  font-size: 13px;
  color: var(--text2);
  text-decoration: none;
  transition: color .2s;
}

.footer-inner nav a:hover {
  color: var(--text);
}

/* ── MODALS ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
  padding: 24px;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: modalIn .2s ease;
}

.modal-wide {
  max-width: 680px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.modal h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}

.modal label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
  margin-top: 16px;
}

.modal-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s;
}

.modal-input:focus {
  border-color: var(--accent);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.selected {
  border-color: #fff;
  transform: scale(1.1);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .2s;
}

.modal-close:hover {
  color: var(--text);
  background: var(--glass);
}

#exportCanvas {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 20px;
  display: block;
}

/* ── TOAST ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 50px;
  z-index: 9999;
  box-shadow: var(--shadow);
  transition: opacity .3s;
}

.toast.hidden {
  display: none;
}

/* ── UTIL ──────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
/* mobile ad above builder – hidden on desktop */
.ad-mobile-top {
  display: none;
}

@media (max-width: 1100px) {
  .builder-section {
    grid-template-columns: 1fr;
  }

  .builder-main {
    padding-bottom: 0;
  }

  .ad-sidebar {
    display: none;
  }

  .ad-right-desktop {
    display: none;
  }

  .mobile-drawer-btn {
    display: none !important;
  }

  .builder-sidebar-right {
    position: static !important;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    transform: none;
    width: 100%;
    height: auto;
  }

  .mobile-close-btn {
    display: none !important;
  }

  .pool-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    max-height: 75vh;
    z-index: 1000;
    margin: 0;
    background: #1b1e2e;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
    border-radius: 24px 24px 0 0;
    border: none;
    border-top: 1px solid var(--border);
    transform: translateY(calc(100% - 64px));
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .pool-section.open {
    transform: translateY(0);
  }

  .pool-section .pool-title {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    margin: 0;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
  }

  .pool-section .pool-title::after {
    content: "▲";
    margin-left: auto;
    font-size: 16px;
    color: var(--text2);
    transition: transform 0.3s;
  }

  .pool-section.open .pool-title::after {
    transform: rotate(180deg);
  }

  .pool-section .pool {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    border-radius: 0;
  }

  .ad-mobile-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 0 4px;
  }

  .ad-mobile-top .ad-horizontal {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 36px;
  }

  .header-nav {
    display: none;
  }

  .header-inner #exportBtn {
    margin-left: auto;
  }

  .builder-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .list-title-input {
    font-size: 16px;
  }
}

/* ── PREVIEW SHOW MORE ─────────────────────────────────────── */
.show-more-wrapper {
  margin-top: 36px;
  display: flex;
  justify-content: center;
}

.show-more-wrapper .btn-secondary {
  padding: 12px 32px;
  font-size: 15px;
}