/* ============================================================
   PrompTub — sticker/comic design system
   Derived from the logo: vivid purple, thick ink outlines,
   hard offset shadows, chunky display type.
   ============================================================ */

:root {
  /* --- brand --- */
  --purple:      #8B3FE8;
  --purple-hi:   #A46BF0;
  --purple-lo:   #6E24CC;
  --purple-deep: #4B1596;
  --purple-wash: #F1E6FF;

  --ink:         #0D0A14;
  --yellow:      #FFD23F;
  --yellow-deep: #C99500;

  /* --- light theme (default, matches the logo) --- */
  --bg:        #FBF7FF;
  --bg-band:   var(--purple);
  --surface:   #FFFFFF;
  --surface-2: #F6EFFF;
  --border:    var(--ink);
  --shadow-col:var(--ink);

  --text:      #120E1C;
  --text-mid:  #4A4159;
  --text-dim:  #7B7190;
  --on-band:   #FFFFFF;

  --bw:        3px;              /* border width */
  --radius:    18px;
  --radius-sm: 12px;
  --pop:       5px 5px 0 var(--shadow-col);
  --pop-sm:    3px 3px 0 var(--shadow-col);
  --pop-lg:    8px 8px 0 var(--shadow-col);

  --maxw:      1180px;
  --display:   'Luckiest Guy', 'Arial Black', sans-serif;
  --font:      'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:      'JetBrains Mono', ui-monospace, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg:        #17092B;
  --bg-band:   #2A0F4D;
  --surface:   #22103C;
  --surface-2: #2C1650;
  --border:    #0A0512;
  --shadow-col:#0A0512;

  --text:      #F6F0FF;
  --text-mid:  #C3B2DE;
  --text-dim:  #9184AC;
  --purple-wash: #33175C;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.05;
  text-wrap: balance;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 4px;
}

/* decorative dot grid instead of the old glow */
.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(var(--purple) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  opacity: .07;
}

/* ============================ HEADER ============================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: var(--bw) solid var(--border);
}
/* logo centred, nav links left, theme toggle right */
.nav { display: flex; align-items: center; gap: 16px; height: 86px; }
.nav-left  { flex: 1 1 0; display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-right { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

.logo { flex: 0 0 auto; display: block; line-height: 0; transition: transform .14s ease; }
.logo:hover { transform: rotate(-2deg) scale(1.04); }
.logo img { height: 60px; width: auto; }
.logo-foot img { height: 78px; }

/* logo.png not added yet — make the missing file obvious */
.logo-slot {
  display: grid; place-items: center; text-align: center;
  width: 150px; height: 56px; line-height: 1.2;
  border: 3px dashed var(--purple); border-radius: 12px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--purple);
}
.logo-foot .logo-slot { width: 170px; height: 68px; }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px;
  font-size: 15px; font-weight: 800; color: var(--text-mid);
  border: 2px solid transparent; transition: .12s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active {
  color: var(--ink); background: var(--yellow);
  border-color: var(--ink); box-shadow: var(--pop-sm);
}
:root[data-theme="dark"] .nav-links a.active { color: var(--ink); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  border: var(--bw) solid var(--border); background: var(--surface);
  color: var(--text); box-shadow: var(--pop-sm); transition: .12s;
}
.icon-btn:hover { background: var(--yellow); color: var(--ink); }
.icon-btn:active { transform: translate(3px, 3px); box-shadow: none; }

.menu-btn { display: none; }

@media (max-width: 940px) {
  .nav { height: 72px; }
  .nav-links {
    position: fixed; inset: 72px 0 auto 0; z-index: 90;
    flex-direction: column; gap: 4px; margin: 0; padding: 16px 22px 22px;
    background: var(--surface); border-bottom: var(--bw) solid var(--border);
    transform: translateY(-130%); transition: transform .25s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 13px 15px; font-size: 17px; }
  .menu-btn { display: grid; }
  .logo img { height: 46px; }
  .logo-foot img { height: 64px; }
}
@media (max-width: 400px) {
  .logo img { height: 40px; }
}

/* ============================ HERO ============================ */
.hero {
  position: relative; z-index: 1;
  padding: 62px 0 52px; text-align: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0 -50vw;
  background: var(--bg-band);
  border-bottom: var(--bw) solid var(--border);
  z-index: -1;
}
.hero > * { position: relative; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  background: var(--yellow); color: var(--ink);
  border: var(--bw) solid var(--ink); box-shadow: var(--pop-sm);
  font-size: 13.5px; font-weight: 800; margin-bottom: 26px;
  transform: rotate(-1.5deg);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); border: 1.5px solid var(--ink); }

.hero h1 {
  font-size: clamp(38px, 7vw, 72px);
  color: #fff; margin-bottom: 20px;
  text-shadow: 4px 4px 0 var(--purple-deep), 7px 7px 0 rgba(0,0,0,.22);
}
.hero h1 .grad { color: var(--yellow); }
.hero p {
  color: rgba(255,255,255,.93); font-size: clamp(15.5px, 2vw, 18.5px);
  font-weight: 600; max-width: 640px; margin: 0 auto 32px;
}

.stats { display: flex; justify-content: center; gap: 14px; margin-top: 38px; flex-wrap: wrap; }
.stat {
  background: var(--surface); color: var(--text);
  border: var(--bw) solid var(--ink); border-radius: var(--radius-sm);
  box-shadow: var(--pop); padding: 12px 22px; min-width: 128px;
}
.stat:nth-child(2) { transform: rotate(-1.5deg); }
.stat:nth-child(3) { transform: rotate(1.5deg); }
.stat b { display: block; font-family: var(--display); font-size: 27px; color: var(--purple); }
:root[data-theme="dark"] .stat b { color: var(--purple-hi); }
.stat span { font-size: 12.5px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- search ---------- */
.search-box { position: relative; max-width: 580px; margin: 0 auto; }
.search-box svg { position: absolute; left: 19px; top: 50%; transform: translateY(-50%); color: var(--text-dim); z-index: 1; }
.search-box input {
  width: 100%; padding: 16px 18px 16px 52px;
  background: var(--surface); color: var(--text);
  border: var(--bw) solid var(--ink); border-radius: 14px;
  box-shadow: var(--pop); font-size: 16px; font-family: inherit; font-weight: 600;
  outline: none; transition: .12s;
}
.search-box input::placeholder { color: var(--text-dim); font-weight: 600; }
.search-box input:focus { box-shadow: var(--pop-lg); outline: none; }

/* ============================ FILTERS ============================ */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin: 38px 0 32px; position: relative; z-index: 1;
}
.chip {
  padding: 9px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 800; color: var(--text);
  background: var(--surface); border: var(--bw) solid var(--ink);
  box-shadow: var(--pop-sm); transition: .12s;
}
.chip:hover { background: var(--purple-wash); }
.chip:active { transform: translate(3px, 3px); box-shadow: none; }
.chip.active { background: var(--purple); color: #fff; }

select.chip { font-family: inherit; cursor: pointer; }

/* ============================ SECTION HEAD ============================ */
.section-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; position: relative; z-index: 1;
}
.section-head h2 { font-size: 30px; color: var(--text); }
.section-head p { color: var(--text-dim); font-size: 14.5px; font-weight: 700; }

/* ============================ CARDS ============================ */
.grid {
  display: grid; gap: 22px; position: relative; z-index: 1;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: var(--bw) solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--pop); padding: 20px;
  display: flex; flex-direction: column; gap: 11px;
  transition: transform .14s ease, box-shadow .14s ease;
  position: relative; overflow: hidden;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: var(--pop-lg); }
.card:active { transform: translate(2px, 2px); box-shadow: var(--pop-sm); }

.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat {
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--purple);
  border: 2px solid var(--ink); padding: 3px 10px; border-radius: 999px;
}
.hot {
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink); background: var(--yellow);
  border: 2px solid var(--ink); padding: 3px 10px; border-radius: 999px;
}
.card h3 { font-size: 21px; line-height: 1.18; color: var(--text); }
.card p { color: var(--text-mid); font-size: 14.5px; font-weight: 600; flex: 1; }

.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tool {
  font-size: 12px; font-weight: 800; color: var(--text-mid);
  border: 2px solid var(--border); border-radius: 7px; padding: 2px 8px;
  background: var(--surface-2);
}

.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 2px dashed var(--border); gap: 10px;
}
.card-foot .go {
  color: var(--purple); font-size: 14px; font-weight: 800;
  display: flex; align-items: center; gap: 5px;
}
:root[data-theme="dark"] .card-foot .go { color: var(--purple-hi); }
.card:hover .go svg { transform: translateX(4px); }
.card-foot .go svg { transition: transform .14s; }
.lock { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--text-dim); }

.empty {
  text-align: center; padding: 60px 24px; grid-column: 1/-1;
  background: var(--surface); border: var(--bw) dashed var(--border);
  border-radius: var(--radius); color: var(--text-mid); font-weight: 600;
}
.empty b { display: block; font-family: var(--display); font-weight: 400; color: var(--text); font-size: 24px; margin-bottom: 8px; }

/* ---------- preview image ---------- */
.shot {
  position: relative; width: calc(100% + 40px); overflow: hidden;
  margin: -20px -20px 4px;
  max-height: 330px;               /* stop tall ratios stretching the card */
  background: var(--purple-wash);
  border-bottom: var(--bw) solid var(--ink);
}
.shot img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
  transition: transform .45s cubic-bezier(.2,.7,.3,1);
}
.card:hover .shot img { transform: scale(1.05); }
.shot-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-size: 17px; letter-spacing: .06em;
  color: var(--purple); opacity: .55;
  background-image: radial-gradient(var(--purple) 1.6px, transparent 1.6px);
  background-size: 18px 18px;
}
:root[data-theme="dark"] .shot-fallback { color: var(--purple-hi); }

.shot-hero {
  width: 100%; margin: 0 0 14px; max-height: 560px;
  border-radius: var(--radius);
  border: var(--bw) solid var(--ink); box-shadow: var(--pop);
}
.shot-hero .shot-fallback { font-size: 22px; }

.shot-note {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text-dim); margin-bottom: 26px;
}

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: 13px;
  font-family: var(--display); font-size: 17px; letter-spacing: .02em;
  border: var(--bw) solid var(--ink); box-shadow: var(--pop);
  transition: transform .1s, box-shadow .1s, background .12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--pop-lg); }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }

.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-lo); }
.btn-primary:disabled {
  background: var(--surface-2); color: var(--text-dim); cursor: not-allowed;
  transform: none; box-shadow: var(--pop-sm);
}
.btn-ghost { background: var(--surface); color: var(--text); }
.btn-ghost:hover { background: var(--yellow); color: var(--ink); }
.btn-block { width: 100%; }

/* ============================ AD SLOTS ============================ */
.ad {
  margin: 30px 0; position: relative; z-index: 1;
  min-height: 108px;
  display: flex; align-items: center; justify-content: center;
  border: var(--bw) dashed var(--border); border-radius: var(--radius);
  background: var(--surface-2); overflow: hidden;
}
.ad::after {
  content: 'Advertisement'; position: absolute; top: 8px; left: 14px;
  font-size: 10px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dim);
}
.ad ins { display: block; width: 100%; }
.ad-placeholder { color: var(--text-dim); font-size: 13.5px; font-weight: 700; }
.ad-inline { min-height: 270px; }

/* ============================ PROMPT PAGE ============================ */
.detail { position: relative; z-index: 1; padding: 36px 0 64px; }
.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 34px; align-items: start; }
@media (max-width: 1000px) { .detail-layout { grid-template-columns: 1fr; } .sidebar { display: none; } }

.crumbs { font-size: 13.5px; font-weight: 700; color: var(--text-dim); margin-bottom: 14px; }
.crumbs a:hover { color: var(--purple); }

.detail h1 { font-size: clamp(30px, 5vw, 46px); margin: 8px 0 16px; color: var(--text); }
.detail-meta { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.detail-desc { color: var(--text-mid); font-size: 17px; font-weight: 600; margin-bottom: 26px; max-width: 680px; }

/* ---------- prompt box ---------- */
.prompt-shell {
  border: var(--bw) solid var(--ink); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--pop); overflow: hidden;
}
.prompt-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 20px; border-bottom: var(--bw) solid var(--ink);
  background: var(--purple); color: #fff;
}
.prompt-head span { font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.prompt-body {
  position: relative; padding: 22px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.8; font-weight: 400;
  white-space: pre-wrap; word-break: break-word; color: var(--text);
  max-height: 620px; overflow-y: auto;
}
.prompt-body.blurred {
  filter: blur(6px); user-select: none; pointer-events: none;
  max-height: 250px; overflow: hidden;
}

.unlock-panel {
  border-top: var(--bw) solid var(--ink); padding: 28px 22px; text-align: center;
  background: var(--purple-wash);
}
.unlock-panel h4 { font-family: var(--display); font-size: 23px; font-weight: 400; margin-bottom: 8px; color: var(--text); }
.unlock-panel p { color: var(--text-mid); font-size: 14.5px; font-weight: 600; margin-bottom: 20px; }

.timer-ring { width: 82px; height: 82px; margin: 0 auto 18px; position: relative; }
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.timer-ring .track { stroke: var(--surface); }
.timer-ring .bar   { stroke: var(--purple); transition: stroke-dashoffset 1s linear; }
.timer-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-size: 27px; color: var(--text);
  font-variant-numeric: tabular-nums;
}

.copy-row { display: flex; gap: 12px; flex-wrap: wrap; }
.copy-row .btn { flex: 1; min-width: 160px; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 100px);
  background: var(--yellow); color: var(--ink);
  border: var(--bw) solid var(--ink); box-shadow: var(--pop);
  padding: 13px 24px; border-radius: 13px;
  font-family: var(--display); font-size: 17px;
  z-index: 300; opacity: 0;
  transition: transform .26s cubic-bezier(.2,.9,.3,1), opacity .26s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- how to use ---------- */
.howto { margin-top: 38px; }
.howto h3 { font-size: 26px; margin-bottom: 16px; color: var(--text); }
.steps { display: grid; gap: 14px; }
.step {
  display: flex; gap: 15px; padding: 17px 19px;
  background: var(--surface); border: var(--bw) solid var(--ink);
  border-radius: var(--radius-sm); box-shadow: var(--pop-sm);
}
.step b {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  background: var(--yellow); color: var(--ink);
  border: 2px solid var(--ink);
  display: grid; place-items: center;
  font-family: var(--display); font-size: 17px; font-weight: 400;
}
.step div { font-size: 15px; font-weight: 600; color: var(--text-mid); }
.step div strong { color: var(--text); display: block; margin-bottom: 2px; font-size: 15.5px; font-weight: 800; }

/* ---------- sidebar ---------- */
.sidebar { position: sticky; top: 98px; display: grid; gap: 20px; }
.side-card {
  background: var(--surface); border: var(--bw) solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--pop); padding: 20px;
}
.side-card h4 {
  font-family: var(--display); font-weight: 400; font-size: 19px;
  color: var(--text); margin-bottom: 15px;
}
.side-list { display: grid; gap: 13px; }
.side-item { display: block; padding-bottom: 13px; border-bottom: 2px dashed var(--border); }
.side-list .side-item:last-child { border: none; padding-bottom: 0; }
.side-item strong { font-size: 14.5px; font-weight: 800; display: block; line-height: 1.35; transition: color .12s; }
.side-item:hover strong { color: var(--purple); }
.side-item span { font-size: 12px; font-weight: 700; color: var(--text-dim); }

/* ============================ STATIC PAGES ============================ */
.page { position: relative; z-index: 1; padding: 48px 0 72px; max-width: 800px; }
.page h1 { font-size: clamp(34px, 5.5vw, 50px); margin-bottom: 10px; color: var(--text); }
.page .updated { color: var(--text-dim); font-size: 14px; font-weight: 700; margin-bottom: 34px; }
.page h2 { font-size: 26px; margin: 36px 0 12px; color: var(--text); }
.page p, .page li { color: var(--text-mid); font-size: 16.5px; font-weight: 500; margin-bottom: 13px; }
.page ul, .page ol { padding-left: 24px; }
.page li::marker { color: var(--purple); font-weight: 800; }
.page a { color: var(--purple); font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
:root[data-theme="dark"] .page a { color: var(--purple-hi); }
.page strong { color: var(--text); font-weight: 800; }

/* ============================ FOOTER ============================ */
.site-footer {
  border-top: var(--bw) solid var(--border); margin-top: 68px;
  padding: 50px 0 32px; position: relative; z-index: 1;
  background: var(--surface);
}
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 36px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-brand p { color: var(--text-mid); font-size: 14.5px; font-weight: 600; margin-top: 14px; max-width: 290px; }
.foot-col h5 {
  font-family: var(--display); font-weight: 400; font-size: 17px;
  color: var(--text); margin-bottom: 14px;
}
.foot-col a { display: block; color: var(--text-mid); font-size: 14.5px; font-weight: 700; margin-bottom: 10px; transition: color .12s; }
.foot-col a:hover { color: var(--purple); }
.foot-bottom {
  border-top: 2px dashed var(--border); padding-top: 24px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--text-dim); font-size: 13.5px; font-weight: 700;
}

/* ---------- skeleton ---------- */
.skel {
  background: var(--surface); border: var(--bw) solid var(--border);
  border-radius: var(--radius); box-shadow: var(--pop);
  height: 300px; position: relative; overflow: hidden;
}
.skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--purple-wash), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- entrance ---------- */
.reveal { opacity: 0; transform: translateY(16px); animation: rise .45s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .card:hover, .btn:hover { transform: none; }
}
