/* "Build your page" — the mini-game (js/builder.js, index.html #builder) plus its entry points (the hero's gold button and
   the "Watch the clips" text link under the hero buttons). The stage is the game's: a 16:10 canvas with the ink frame; the
   box under it is the game's message box (paper, ink border, the speaker's name in Luckiest Guy) holding the input. */

/* ---- entry points ---- */
button.build { background: linear-gradient(135deg, #ffd23f, #ff9f1a); border-color: #ffe9a3; color: #1b1b2a; }
button.build:hover { border-color: #fff; filter: brightness(1.04); }
button.build small { color: #3a2a00; opacity: .9; }
.hero-watch-line { margin: 4px 0 0; }
#hero .hero-watch { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-size: 15px; font-weight: 700; color: #cfe2ff; text-decoration: underline; text-decoration-color: rgba(207,226,255,.45); text-underline-offset: 3px; }
#hero .hero-watch:hover { color: #fff; text-decoration-color: #fff; }

/* ---- the screen ---- */
#builder { --bld-w: min(100vw - 20px, max(480px, calc((100vh - 236px) * 1.6)), 1040px); padding: 10px 10px 24px; display: flex; flex-direction: column; align-items: center; gap: 0; color: #f4f2ff; font-family: var(--ui); }
#builder.hidden { display: none !important; }
.bld-head { width: var(--bld-w); display: flex; justify-content: space-between; align-items: center; gap: 10px; background: linear-gradient(180deg, #2b2c4e, #1d1e38); border: 2px solid var(--ink); border-radius: 14px 14px 0 0; padding: 6px 8px 6px 12px; }
.bld-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.bld-title b { font-family: var(--sign); font-weight: 400; font-size: 22px; letter-spacing: .03em; color: var(--gold); text-shadow: 2px 2px 0 var(--ink); line-height: 1.1; }
.bld-title span { color: #bdb8dc; font-size: 13px; font-weight: 700; }
.bld-head-btns { display: flex; gap: 6px; flex: 0 0 auto; }
.bld-head-btns .ghost { min-height: 36px; }
.bld-play { position: relative; width: var(--bld-w); }
.bld-stage { position: relative; width: 100%; aspect-ratio: 16/10; background: #000; border: 2px solid var(--ink); border-top: 0; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#bld-cv { display: block; width: 100%; height: 100%; cursor: pointer; }

/* the message box under the stage */
.bld-box { position: relative; margin-top: 8px; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 8px 0 rgba(0,0,0,.35); padding: 10px 14px 12px; font-weight: 700; min-height: 96px; }
.bld-box .who { display: block; font-family: var(--sign); font-weight: 400; font-size: 17px; letter-spacing: .04em; color: #2f7de1; margin-bottom: 2px; min-height: 0; }
.bld-box .who:empty { display: none; }
.bld-box .say { margin: 0; font-size: clamp(16px, 1.9vw, 21px); line-height: 1.25; min-height: 1.25em; }
.bld-box.narr { background: #fffdf7; }
.bld-box.narr .say { font-style: italic; font-weight: 600; padding-right: 92px; }
.bld-box.view { background: #fff; border-color: var(--ink); }
.bld-box.view .who { color: #6b3fa0; }
.bld-box.view .say { font-family: var(--brand); font-weight: 600; font-size: clamp(15px, 1.6vw, 18px); color: #374151; }
.bld-form { display: flex; gap: 8px; margin-top: 10px; }
.bld-form input { flex: 1 1 auto; min-width: 0; height: 52px; border: 2px solid var(--ink); border-radius: 10px; padding: 0 14px; font: 700 18px/1 var(--brand); color: var(--ink); background: #fff; }
.bld-form input:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.bld-form input::placeholder { color: #a7a3c2; font-weight: 600; }
.bld-ok, .bld-go { flex: 0 0 auto; min-height: 52px; min-width: 96px; padding: 0 18px; border: 2px solid var(--ink) !important; border-radius: 10px; background: linear-gradient(135deg, var(--atlas), var(--atlas2)); color: #fff; font: 800 17px/1 var(--brand); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.bld-hint { margin: 6px 0 0; min-height: 1em; font-size: 13px; font-weight: 700; color: #8f8bb0; }
.bld-hint:empty { display: none; }
.bld-hint.err { color: #c0392b; }
.bld-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bld-chips button { min-height: 48px; padding: 0 18px; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 24px; font: 800 16px/1 var(--brand); box-shadow: 0 3px 0 rgba(0,0,0,.2); }
@media (hover: hover) { .bld-chips button:hover { background: var(--gold); } }
.bld-chips button.on { background: linear-gradient(135deg, var(--atlas), var(--atlas2)); color: #fff; }
.bld-views { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; flex-wrap: wrap; }
.bld-ghost { min-height: 52px; padding: 0 16px; background: #fff; color: var(--ink); border: 2px solid var(--ink) !important; border-radius: 10px; font: 800 16px/1 var(--brand); }
.bld-ghost[aria-pressed="true"] { background: var(--gold); }
.bld-skip { position: absolute; right: 10px; bottom: 10px; min-height: 44px; padding: 0 14px; background: transparent; color: #6b6890; border: 2px solid rgba(27,27,42,.25) !important; border-radius: 10px; font: 800 14px/1 var(--brand); }
.bld-box.shake { animation: bldshake .35s; }
@keyframes bldshake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* the end card: a polaroid over the stage (desktop), under it (phones) */
.bld-end { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 16/10; display: grid; place-items: center; padding: 3%; z-index: 3; }
.bld-end.hidden { display: none !important; }
.bld-card { width: min(92%, 600px); max-height: 100%; overflow: auto; background: #fbf7ee; color: var(--ink); border: 3px solid var(--ink); border-radius: 8px; box-shadow: 8px 10px 0 rgba(0,0,0,.45); padding: 20px 22px 16px; transform: rotate(-1deg); font-family: var(--brand); }
.bld-card h3 { margin: 0; font-family: var(--sign); font-weight: 400; font-size: clamp(24px, 3vw, 34px); line-height: 1.05; letter-spacing: .02em; color: var(--ink); }
.bld-card > p { margin: 6px 0 14px; font-size: clamp(16px, 1.8vw, 19px); font-weight: 700; color: #374151; line-height: 1.3; }
.bld-end-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bld-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 12px; border: 2px solid var(--ink) !important; border-radius: 10px; background: #fff; color: var(--ink); font: 800 16px/1.1 var(--brand); text-align: center; text-decoration: none; box-shadow: 0 4px 0 rgba(0,0,0,.2); cursor: pointer; }
.bld-btn.primary { background: linear-gradient(135deg, var(--atlas), var(--atlas2)); color: #fff; }
.bld-btn:hover { filter: brightness(1.05); }
.bld-email { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(27,27,42,.3); position: relative; }
.bld-email .hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.bld-email label { display: block; font-size: 14px; font-weight: 800; color: #374151; margin-bottom: 6px; }
.bld-email label small { font-weight: 600; color: #8a8fa0; margin-left: 4px; }
.bld-email-row { display: flex; gap: 8px; }
.bld-email-row input { flex: 1 1 auto; min-width: 0; height: 48px; border: 2px solid #cfd4df; border-radius: 10px; padding: 0 12px; font: 600 16px/1 var(--brand); color: var(--ink); background: #fff; }
.bld-email-row input:focus { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--ink); }
.bld-email-row button { flex: 0 0 auto; min-height: 48px; min-width: 84px; padding: 0 14px; background: #fff; color: var(--ink); border: 2px solid var(--ink) !important; border-radius: 10px; font: 800 15px/1 var(--brand); }
.bld-msg { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: #374151; min-height: 0; }
.bld-msg:empty { display: none; }
.bld-msg.ok { color: #1d7a3e; } .bld-msg.err { color: #c0392b; }
#builder .bld-again { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; padding: 0; font-size: 15px; color: #2f7de1; }

/* ---- phones: the box and the end card sit under the stage; everything ≥ 44 px; inputs 16 px+ (no iOS zoom) ---- */
@media (max-width: 760px) {
  #builder { --bld-w: calc(100vw - 20px); padding: 8px 10px 20px; }
  .bld-head { border-radius: 10px 10px 0 0; padding: 4px 6px 4px 10px; }
  .bld-title b { font-size: 19px; }
  .bld-title span { display: none; }
  .bld-head-btns .ghost { min-height: 44px; font-size: 13px; padding: 0 10px; }
  .bld-box { padding: 9px 11px 11px; min-height: 0; }
  .bld-box .who { font-size: 15px; }
  .bld-box .say { font-size: 17px; }
  .bld-box.narr .say { font-size: 15px; padding-right: 0; }
  .bld-box.view .say { font-size: 15px; }
  .bld-skip { position: static; margin-top: 8px; width: 100%; min-height: 44px; }
  .bld-form input { font-size: 17px; }
  .bld-ok { min-width: 76px; padding: 0 12px; }
  .bld-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .bld-chips button { min-height: 48px; padding: 0 8px; font-size: 15px; }
  .bld-chips button:last-child { grid-column: 1 / -1; }
  .bld-views { justify-content: stretch; }
  .bld-views button { flex: 1 1 0; min-width: 0; padding: 0 10px; font-size: 15px; white-space: nowrap; }
  .bld-views .bld-ghost { flex: 0 1 auto; }
  .bld-end { position: static; aspect-ratio: auto; padding: 0; margin-top: 10px; display: block; }
  .bld-card { width: 100%; transform: none; padding: 16px 14px 12px; box-shadow: 0 8px 0 rgba(0,0,0,.35); max-height: none; }
  .bld-card h3 { font-size: 26px; }
  .bld-end-btns { grid-template-columns: 1fr; }
}

/* ---- #clip=builder: the stage alone, as big as the window allows (16:10, for the recorder) ---- */
body.clip.bld-clip #builder:not(.hidden) { display: flex !important; padding: 0; min-height: 100vh; justify-content: center; }
body.clip.bld-clip #builder { --bld-w: min(100vw - 20px, calc((100vh - 20px) * 1.6), 1280px); }
body.clip.bld-clip .bld-head, body.clip.bld-clip .bld-box, body.clip.bld-clip .bld-end { display: none !important; }
body.clip.bld-clip .bld-stage { border: 0; }
body.clip.bld-clip #bld-cv { cursor: default; }
body.clip.bld-clip #story, body.clip.bld-clip .sticky-cta { display: none !important; }
body.building #story { display: none; }

/* page: the problem and what Atlas adds, under each Buyer's Advantage clip (kept here so style.css needn't change) */
.reel-why { font-family: var(--brand); font-size: 13px; line-height: 1.5; color: #a9a5c6; margin: 6px 0 0; }
