:root {
  --ink: #191914;
  --paper: #f3efe7;
  --acid: #d9ff3f;
  --orange: #ff6435;
  --line: rgba(25, 25, 20, .18);
  --shadow: 0 18px 60px rgba(37, 32, 20, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 15%, rgba(217,255,63,.28), transparent 22rem),
    radial-gradient(circle at 90% 85%, rgba(255,100,53,.13), transparent 26rem),
    var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  z-index: 10;
}
button, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.shell { width: min(100%, 1120px); min-height: 100vh; margin: auto; padding: 0 28px; }
.topbar { height: 84px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; margin-right: 10px;
  background: var(--ink); color: var(--acid); border-radius: 50%; font-family: serif; font-weight: 800;
}
.brand-name { font-weight: 900; letter-spacing: .08em; }
.edition { margin-left: auto; padding: 6px 10px; border: 1px solid var(--ink); border-radius: 99px; font-size: 11px; font-weight: 700; }

.hero { position: relative; width: min(720px, 100%); margin: 0 auto; padding: 11vh 0 10vh; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow span { width: 34px; height: 3px; background: var(--orange); }
h1 { margin: 24px 0 18px; font-size: clamp(46px, 7.2vw, 82px); line-height: 1.04; letter-spacing: -.07em; }
h1 em { position: relative; font-family: serif; font-weight: 500; font-style: italic; }
h1 em::after { content: ""; position: absolute; left: 3%; right: -3%; bottom: -3px; height: 13px; background: var(--acid); z-index: -1; transform: rotate(-1deg); }
.lead { max-width: 520px; margin: 0 0 40px; color: #5f5d54; font-size: 16px; line-height: 1.8; }
.generator label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 800; }
.input-wrap { position: relative; background: rgba(255,255,255,.55); border: 1.5px solid var(--ink); border-radius: 3px; box-shadow: 7px 7px 0 var(--ink); transition: .2s ease; }
.input-wrap:focus-within { transform: translate(-2px,-2px); box-shadow: 10px 10px 0 var(--acid), 10px 10px 0 1px var(--ink); }
textarea { display: block; width: 100%; min-height: 118px; padding: 22px 24px 35px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 18px; line-height: 1.6; }
textarea::placeholder { color: #aaa69b; }
.counter { position: absolute; right: 16px; bottom: 13px; color: #98958b; font-size: 11px; }
.primary-button, .secondary-button {
  min-height: 56px; border: 1.5px solid var(--ink); border-radius: 2px; cursor: pointer; font-weight: 900; transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.primary-button { width: 100%; margin-top: 24px; padding: 0 10px 0 24px; display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: white; box-shadow: 6px 6px 0 var(--orange); }
.primary-button:hover { transform: translate(-2px,-2px); box-shadow: 9px 9px 0 var(--orange); }
.primary-button:active, .secondary-button:active { transform: translate(2px,2px); box-shadow: none; }
.primary-button:disabled { cursor: wait; opacity: .72; }
.button-arrow { display: grid; place-items: center; width: 40px; height: 40px; background: var(--acid); color: var(--ink); border-radius: 50%; font-size: 20px; }
.privacy-note, .share-tip { color: #8c897e; font-size: 11px; text-align: center; letter-spacing: .04em; }
.privacy-note span { color: #58a34d; }
.doodle { position: absolute; color: #767268; font-family: cursive; font-size: 12px; transform: rotate(-9deg); }
.doodle-left { left: -135px; top: 54%; }
.doodle-left::after { content: "↗"; margin-left: 5px; font-size: 22px; }
.stamp { position: absolute; right: -145px; bottom: 18%; width: 92px; height: 92px; display: grid; place-content: center; border: 2px solid var(--orange); border-radius: 50%; color: var(--orange); text-align: center; transform: rotate(8deg); }
.stamp::after { content: ""; position: absolute; inset: 5px; border: 1px dashed currentColor; border-radius: 50%; }
.stamp span { font-size: 10px; letter-spacing: .3em; }
.stamp strong { font-size: 13px; }

.result { width: min(680px, 100%); margin: 0 auto; padding: 42px 0 70px; animation: reveal .45s ease both; }
.back-button { border: 0; background: transparent; padding: 8px 0; cursor: pointer; color: #716e64; font-size: 13px; font-weight: 700; }
.result-kicker { margin: 18px 0 13px; text-align: center; font-size: 11px; font-weight: 900; letter-spacing: .35em; }
.truth-card { position: relative; overflow: hidden; padding: 22px; background: #fffdf7; border: 1.5px solid var(--ink); box-shadow: 12px 12px 0 var(--ink); }
.truth-card { --card-accent: var(--acid); --card-pop: var(--orange); }
.truth-card[data-theme="blue"] { --card-accent: #8de7ff; --card-pop: #2667ff; }
.truth-card[data-theme="orange"] { --card-accent: #ffb13b; --card-pop: #ef3b24; }
.truth-card[data-theme="violet"] { --card-accent: #cbb5ff; --card-pop: #6d39d8; }
.truth-card[data-theme="pink"] { --card-accent: #ffb8cf; --card-pop: #e74479; }
.truth-card[data-theme="yellow"] { --card-accent: #ffe45e; --card-pop: #d33a24; }
.card-topline, .card-footer { display: flex; justify-content: space-between; font: 700 9px/1.4 ui-monospace, monospace; letter-spacing: .1em; }
.meme-stage { position: relative; height: 240px; margin: 18px 0; overflow: hidden; display: grid; place-items: center; background: var(--card-accent); border: 1px solid var(--ink); transition: background .2s ease; }
.burst { position: absolute; width: 420px; height: 420px; background: repeating-conic-gradient(from 4deg, transparent 0 8deg, rgba(25,25,20,.1) 8deg 13deg); }
.meme-stage[data-layout="meeting"] .burst { width: 100%; height: 100%; background: linear-gradient(90deg, rgba(255,255,255,.45) 1px, transparent 1px), linear-gradient(rgba(255,255,255,.45) 1px, transparent 1px); background-size: 28px 28px; transform: rotate(4deg) scale(1.15); }
.meme-stage[data-layout="revision"] .burst { background: repeating-radial-gradient(circle, transparent 0 18px, rgba(25,25,20,.12) 19px 21px); }
.meme-stage[data-layout="loading"] .burst { width: 82%; height: 17px; border: 2px solid var(--ink); background: linear-gradient(90deg, var(--card-pop) 0 76%, transparent 76%); transform: translateY(82px); }
.meme-stage[data-layout="coffee"] .burst { background: repeating-linear-gradient(135deg, transparent 0 20px, rgba(255,255,255,.32) 20px 42px); }
.meme-stage[data-layout="fortune"] .burst { width: 300px; height: 300px; border: 2px dashed var(--ink); border-radius: 50%; background: repeating-conic-gradient(transparent 0 14deg, rgba(211,58,36,.13) 14deg 17deg); }
.corner-sticker { position: absolute; top: 12px; right: 12px; z-index: 2; min-width: 42px; height: 42px; padding: 0 7px; display: grid; place-items: center; background: var(--card-pop); color: white; border: 2px solid var(--ink); border-radius: 50%; font: 900 14px/1 ui-monospace, monospace; transform: rotate(9deg); box-shadow: 3px 3px 0 var(--ink); }
.meme-face { position: relative; width: 138px; height: 125px; background: #fffaf0; border: 4px solid var(--ink); border-radius: 48% 48% 42% 42%; transform: rotate(-3deg); box-shadow: 10px 10px 0 rgba(25,25,20,.18); }
.meme-face::before, .meme-face::after { content: ""; position: absolute; top: -26px; width: 53px; height: 50px; background: #fffaf0; border: 4px solid var(--ink); z-index: -1; transform: rotate(35deg); }
.meme-face::before { left: 4px; } .meme-face::after { right: 4px; transform: rotate(-35deg); }
.eye { position: absolute; top: 43px; width: 12px; height: 19px; background: var(--ink); border-radius: 50%; }
.eye-left { left: 35px; } .eye-right { right: 35px; }
.mouth { position: absolute; left: 48px; bottom: 23px; width: 38px; height: 18px; border-bottom: 5px solid var(--ink); border-radius: 50%; transform: rotate(7deg); }
.face-blank .eye { height: 5px; border-radius: 0; }
.face-blank .mouth { border-bottom: 0; height: 4px; bottom: 30px; background: var(--ink); transform: none; }
.face-dizzy .eye { width: 19px; height: 4px; border-radius: 0; transform: rotate(38deg); }
.face-dizzy .eye-right { transform: rotate(-38deg); }
.face-dizzy .mouth { height: 26px; border: 4px solid var(--ink); border-top-color: transparent; }
.face-loading .eye { width: 20px; height: 20px; background: transparent; border: 4px dotted var(--ink); }
.face-loading .mouth { width: 30px; border-radius: 0; transform: rotate(-12deg); }
.face-tired { transform: rotate(5deg) translateY(8px); }
.face-tired .eye { height: 4px; border-radius: 0; transform: rotate(8deg); }
.face-tired .eye-right { transform: rotate(-8deg); }
.face-tired .mouth { width: 27px; left: 53px; border-bottom: 0; border-top: 5px solid var(--ink); }
.face-smug { transform: rotate(-7deg); }
.face-smug .eye { height: 4px; border-radius: 0; transform: rotate(-12deg); }
.face-smug .eye-right { transform: rotate(12deg); }
.face-smug .mouth { width: 44px; left: 45px; transform: rotate(-9deg); }
.meme-caption { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%) rotate(-2deg); width: max-content; max-width: 90%; padding: 6px 10px; background: var(--ink); color: white; font-size: 13px; font-weight: 900; }
.source-line { display: flex; align-items: baseline; gap: 8px; padding: 8px 0 15px; border-bottom: 1px dashed var(--line); color: #77736a; font-size: 10px; }
.source-line strong { color: var(--ink); font-size: 13px; }
.translation { position: relative; padding: 28px 22px 25px 36px; }
.quote-mark { position: absolute; top: 15px; left: 0; color: var(--card-pop); font: 700 58px/1 Georgia, serif; }
.translation h2 { margin: 0; font-size: clamp(22px, 4.8vw, 32px); line-height: 1.45; letter-spacing: -.04em; }
.blessing-block { display: flex; gap: 14px; padding: 18px; background: #f0ece3; border-left: 4px solid var(--card-pop); }
.gift-icon { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto; border: 1px solid var(--ink); border-radius: 50%; background: var(--card-pop); color: white; }
.blessing-block small { color: #817d72; font-size: 10px; }
.blessing-block p { margin: 5px 0 0; font-size: 14px; font-weight: 800; line-height: 1.65; }
.card-footer { margin-top: 20px; color: #8e8a7f; }
.result-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; margin-top: 28px; }
.secondary-button { background: transparent; }
.secondary-button:hover { background: white; box-shadow: 5px 5px 0 var(--ink); transform: translate(-2px,-2px); }
.primary-button.compact { min-height: 56px; margin: 0; padding: 0 20px; }
.toast { position: fixed; left: 50%; bottom: 32px; z-index: 20; transform: translate(-50%, 20px); padding: 11px 18px; border-radius: 99px; background: var(--ink); color: white; font-size: 12px; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } }

@media (max-width: 900px) { .doodle, .stamp { display: none; } }
@media (max-width: 600px) {
  .shell { padding: 0 18px; }
  .topbar { height: 68px; }
  .hero { padding: 8vh 0 60px; }
  h1 { font-size: 48px; }
  .lead { margin-bottom: 30px; }
  .meme-stage { height: 210px; }
  .truth-card { padding: 14px; box-shadow: 7px 7px 0 var(--ink); }
  .translation { padding-right: 4px; }
  .result-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
