/* Be Your Own Boss: a Startbarn game.
   Layout: one portrait "stage" (full screen on phones, a framed column on desktop),
   with a slim HUD on top and one screen at a time underneath. Colours and type follow startbarn.co.uk. */
:root {
  --cream: #F7F4ED;
  --cream-2: #EEE8DC;
  --paper: #FFFFFF;
  --ink: #111827;
  --head: #1E2939;
  --muted: #6A7282;
  --line: #E7E0D2;
  --red: #C8382D;
  --red-2: #A92D23;
  --red-tint: #FBE9E6;
  --barn: #2B2B2B;
  --good: #2F7D4F;
  --good-tint: #E7F3EC;
  --star: #E8A33D;
  --f-head: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  --f-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden;
  background: var(--cream-2); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(200, 56, 45, .45); outline-offset: 2px; }
a { color: var(--red); }

.wrap { height: 100%; display: grid; place-items: center; }
.stage {
  -webkit-user-select: none; user-select: none;
  position: relative; width: 100%; height: 100%; max-width: 460px;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--cream);
}
@media (min-width: 620px) and (min-height: 700px) {
  body { background: var(--cream-2) radial-gradient(circle at 1px 1px, rgba(43, 43, 43, .07) 1px, transparent 0) 0 0 / 18px 18px; }
  .stage { height: min(100% - 40px, 900px); border-radius: 30px; box-shadow: 0 30px 70px rgba(43, 33, 20, .18), 0 0 0 1px rgba(43, 33, 20, .06); }
}

/* ---------- HUD ---------- */
.hud { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px 10px; padding-top: max(12px, env(safe-area-inset-top, 0px)); }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; text-decoration: none; color: var(--head); }
.brand img { width: 30px; height: 33px; flex: none; }
.brand b { font-family: var(--f-head); font-weight: 800; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.1; }
.stats { display: flex; gap: 6px; flex: none; }
.stat { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .st { color: var(--star); }
.stat.money { color: var(--good); }

/* ---------- screens ---------- */
.screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 16px 18px; padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.screen.enter { animation: enter .32s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.grow { flex: 1; }
.eyebrow { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--red-tint); color: var(--red); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 800; color: var(--head); margin: 0; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(34px, 10vw, 44px); line-height: 1.02; }
h2 { font-size: 27px; line-height: 1.08; }
h3 { font-size: 18px; line-height: 1.2; }
h1 em, h2 em { font-style: normal; color: var(--red); }
.lede { font-size: 17px; color: var(--muted); font-weight: 500; margin: 0; }
.p { margin: 0; color: var(--muted); font-size: 15px; }
.fine { margin: 0; color: var(--muted); font-size: 12.5px; text-align: center; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 12px 18px; border: 0; border-radius: var(--radius); background: var(--red); color: #FFFAF5; font-weight: 800; font-size: 17px; text-decoration: none; box-shadow: 0 6px 16px rgba(200, 56, 45, .25); transition: transform .12s, background .15s; }
.btn:hover { background: var(--red-2); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: var(--paper); color: var(--head); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: #FFFCF6; border-color: #D9D0BE; }
.btn.small { min-height: 42px; font-size: 15px; width: auto; padding: 8px 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.link { background: none; border: 0; padding: 8px; color: var(--muted); font-weight: 700; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; align-self: center; }
.actions { display: grid; gap: 10px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: 0 2px 0 rgba(43, 33, 20, .03); }
.card.tint { background: var(--good-tint); border-color: #CFE6D8; }
.card.warn { background: var(--red-tint); border-color: #F2CFC9; }

/* ---------- title ---------- */
.hero-art { position: relative; height: 170px; margin: 4px 0 2px; }
.hero-art .tile { position: absolute; width: 104px; height: 118px; border-radius: 22px; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: 0 10px 24px rgba(43, 33, 20, .08); }
.hero-art .tile svg { width: 62px; height: 62px; }
.hero-art .t1 { left: 4%; top: 30px; transform: rotate(-7deg); }
.hero-art .t2 { left: calc(50% - 52px); top: 0; z-index: 1; }
.hero-art .t3 { right: 4%; top: 34px; transform: rotate(6deg); }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick { display: grid; justify-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: 16px; background: var(--paper); border: 1.5px solid var(--line); font-weight: 700; font-size: 13.5px; line-height: 1.15; text-align: center; color: var(--head); }
.pick svg { width: 34px; height: 34px; }
.pick:hover { border-color: var(--red); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.or::before, .or::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.made-by { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.made-by a { font-weight: 700; }

/* ---------- spin ---------- */
.reel { position: relative; height: 230px; border-radius: 26px; background: var(--paper); border: 1.5px solid var(--line); overflow: hidden; display: grid; place-items: center; box-shadow: inset 0 -30px 40px -30px rgba(43, 33, 20, .12), inset 0 30px 40px -30px rgba(43, 33, 20, .12); }
.reel .slot { display: grid; justify-items: center; gap: 10px; }
.reel .slot svg { width: 96px; height: 96px; }
.reel .slot b { font-family: var(--f-head); font-weight: 800; font-size: 28px; color: var(--head); letter-spacing: -.02em; }
.reel.spinning .slot { animation: blur .09s linear infinite; }
@keyframes blur { 0% { transform: translateY(-18px); opacity: .4; } 50% { opacity: 1; } 100% { transform: translateY(18px); opacity: .4; } }
.reel.landed { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-tint); }
.reel.landed .slot { animation: pop .4s ease-out; }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ---------- name ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 800; font-size: 14px; color: var(--head); }
.field input { -webkit-user-select: text; user-select: text; width: 100%; min-height: 54px; padding: 12px 14px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--paper); font: 600 18px/1.2 var(--f-body); color: var(--ink); }
.field input:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 4px var(--red-tint); }
.field .hint { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 700; font-size: 14px; color: var(--head); }
.chip:hover { border-color: var(--red); color: var(--red); }

/* ---------- week ---------- */
.week-no { font-family: var(--f-head); font-weight: 800; font-size: 15px; color: var(--red); letter-spacing: .02em; text-transform: uppercase; }
.funnel { display: grid; gap: 10px; }
.frow { display: grid; grid-template-columns: 128px 1fr 30px; gap: 10px; align-items: center; font-size: 14px; font-weight: 700; color: var(--head); }
.frow .bar { height: 12px; border-radius: 99px; background: var(--cream-2); overflow: hidden; }
.frow .bar i { display: block; height: 100%; border-radius: 99px; background: var(--head); transform-origin: left; animation: fill .6s ease-out both; }
.frow.web .bar i { background: var(--red); }
.frow.miss .bar i { background: repeating-linear-gradient(135deg, #D3CABA 0 5px, #E6DFD0 5px 10px); }
.frow.miss { color: var(--muted); }
.frow b { text-align: right; font-variant-numeric: tabular-nums; }
@keyframes fill { from { transform: scaleX(0); } }
.booked { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-top: 12px; margin-top: 4px; border-top: 1px dashed var(--line); font-weight: 700; }
.booked b { font-family: var(--f-head); font-size: 22px; color: var(--head); }
.note { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; }
.note.red { color: var(--red); font-weight: 700; }

/* ---------- job ---------- */
.job-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--f-head); font-weight: 800; color: #fff; font-size: 18px; }
.job-head .who { flex: 1; min-width: 0; }
.job-head .who b { display: block; font-size: 16px; color: var(--head); }
.job-head .who span { font-size: 13.5px; color: var(--muted); }
.price { font-family: var(--f-head); font-weight: 800; font-size: 22px; color: var(--good); }
.tag { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 6px; background: var(--cream-2); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--head); vertical-align: 1px; }
.tag.web { background: var(--red-tint); color: var(--red); }
.play { position: relative; border-radius: 20px; overflow: hidden; background: #ddd; box-shadow: 0 0 0 1px var(--line); aspect-ratio: 360 / 420; width: 100%; max-height: 52vh; align-self: center; touch-action: none; }
.play canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: none; }
.meter { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; font-weight: 800; color: var(--head); font-variant-numeric: tabular-nums; }
.meter .track { height: 10px; border-radius: 99px; background: var(--cream-2); overflow: hidden; }
.meter .track i { display: block; height: 100%; width: 100%; border-radius: 99px; background: var(--good); transform-origin: left; }
.meter.time .track i { background: var(--head); }
.meter.time.low .track i { background: var(--red); }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(247, 244, 237, .86); backdrop-filter: blur(2px); }
.overlay .card { width: 100%; text-align: center; display: grid; gap: 10px; }
.request { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; color: var(--head); }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bottle { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; border: 2px solid var(--line); background: var(--paper); font-size: 12px; font-weight: 700; color: var(--head); }
.bottle i { width: 22px; height: 30px; border-radius: 7px 7px 9px 9px; position: relative; box-shadow: inset -4px 0 0 rgba(0, 0, 0, .12); }
.bottle i::before { content: ""; position: absolute; left: 6px; right: 6px; top: -9px; height: 10px; border-radius: 3px 3px 0 0; background: #2B2B2B; }
.bottle[aria-pressed="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }

/* ---------- result ---------- */
.stars { display: flex; justify-content: center; gap: 4px; font-size: 34px; line-height: 1; color: #E4DCCB; }
.stars .on { color: var(--star); animation: star .35s ease-out both; }
@keyframes star { from { transform: scale(.3) rotate(-30deg); opacity: 0; } }
.quote { font-size: 16px; font-weight: 600; color: var(--head); margin: 0; }
.quote::before { content: "\201C"; } .quote::after { content: "\201D"; }
.paid { font-family: var(--f-head); font-weight: 800; font-size: 30px; color: var(--good); }
.rows { display: grid; gap: 8px; margin: 0; }
.rows div { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.rows dt { color: var(--muted); font-weight: 600; }
.rows dd { margin: 0; font-weight: 800; color: var(--head); font-variant-numeric: tabular-nums; text-align: right; }
.rows .total { padding-top: 8px; border-top: 1px dashed var(--line); }
.rows .total dd { color: var(--good); font-size: 17px; }

.shop { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--paper); border: 1.5px solid var(--line); }
.item b { color: var(--head); font-size: 15px; }
.item p { grid-column: 1; margin: 0; font-size: 13px; color: var(--muted); }
.item .buy { grid-row: 1 / span 2; grid-column: 2; }
.item.owned { background: var(--good-tint); border-color: #CFE6D8; }
.item.owned .buy { color: var(--good); font-weight: 800; font-size: 13px; }

/* ---------- messages ---------- */
.msgs { display: grid; gap: 8px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 18px 18px 18px 6px; background: var(--paper); border: 1px solid var(--line); font-size: 15px; color: var(--ink); animation: enter .3s ease-out both; }
.msg small { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.msg.lost { background: var(--red-tint); border-color: #F2CFC9; }

/* ---------- builder ---------- */
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); }
.steps i.on { background: var(--red); }
.templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tpl { padding: 6px; border-radius: 16px; border: 2px solid var(--line); background: var(--paper); display: grid; gap: 6px; font-weight: 800; font-size: 13px; color: var(--head); }
.tpl[aria-pressed="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.tpl .mini { height: 150px; border-radius: 10px; overflow: hidden; pointer-events: none; }
.tpl .mini .site { transform: scale(.45); transform-origin: top left; width: 222%; }

/* mock website (used in template cards and the phone) */
.site { --h: #1E2939; --hi: #fff; --a: #C8382D; --bg: #fff; --hf: var(--f-head); background: var(--bg); color: #1f2937; font-family: var(--f-body); min-height: 100%; }
.s-nav { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--h); color: var(--hi); font-family: var(--hf); font-weight: 800; font-size: 15px; }
.s-nav i { width: 18px; height: 2px; background: currentColor; box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor; }
.s-hero { padding: 18px 14px 16px; background: var(--h); color: var(--hi); display: grid; gap: 8px; }
.s-hero small { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.s-hero b { font-family: var(--hf); font-size: 22px; line-height: 1.1; }
.s-btn { justify-self: start; padding: 9px 14px; border-radius: 10px; background: var(--a); color: #fff; font-weight: 800; font-size: 13px; }
.s-list { list-style: none; margin: 0; padding: 14px; display: grid; gap: 8px; }
.s-list li { padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .04); font-weight: 700; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.s-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--a); flex: none; }
.s-badges { display: flex; gap: 8px; padding: 0 14px 16px; flex-wrap: wrap; }
.s-badges span { font-size: 11.5px; font-weight: 800; padding: 5px 9px; border-radius: 99px; border: 1.5px solid rgba(0, 0, 0, .1); }
.site.t-classic .s-nav, .site.t-classic .s-hero { border-bottom: 0; }
.site.t-classic .s-hero b { font-weight: 700; }

.phone { position: relative; width: min(250px, 72%); align-self: center; aspect-ratio: 9 / 17; border-radius: 34px; padding: 10px; background: #1d1d1f; box-shadow: 0 24px 50px rgba(43, 33, 20, .25); }
.phone .scr { height: 100%; border-radius: 26px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.phone .bar { flex: none; padding: 7px 10px 6px; background: #F2F2F4; font-size: 10.5px; font-weight: 700; color: #555; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone .site { flex: 1; overflow: hidden; }
.urlchip { align-self: center; display: inline-flex; gap: 6px; align-items: center; max-width: 100%; padding: 7px 12px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; color: var(--head); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.urlchip i { width: 8px; height: 8px; border-radius: 50%; background: #22A35A; flex: none; box-shadow: 0 0 0 3px #D6F0E0; }
.ping { position: absolute; left: -14%; right: -14%; top: 54%; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 14px 30px rgba(43, 33, 20, .18); animation: ping .5s .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.ping .dot { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; background: var(--red); display: grid; place-items: center; color: #fff; font-weight: 900; }
.ping small { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--red); }
.ping b { font-size: 14px; color: var(--head); }
@keyframes ping { from { opacity: 0; transform: translateY(16px) scale(.95); } }
.publishing { height: 10px; border-radius: 99px; background: var(--cream-2); overflow: hidden; }
.publishing i { display: block; height: 100%; width: 100%; background: var(--red); transform-origin: left; animation: fill 1.3s ease-in-out both; }

/* ---------- end ---------- */
.verdict { font-family: var(--f-head); font-weight: 800; font-size: 15px; color: var(--red); text-transform: uppercase; letter-spacing: .03em; }
.big-num { font-family: var(--f-head); font-weight: 800; font-size: 46px; line-height: 1; color: var(--good); letter-spacing: -.02em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.kpi b { display: block; font-family: var(--f-head); font-size: 22px; color: var(--head); font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cta-card { background: var(--head); color: #fff; border-radius: 22px; padding: 18px; display: grid; gap: 12px; }
.cta-card h3 { color: #fff; font-size: 22px; }
.cta-card p { margin: 0; color: #C9CED8; font-size: 14.5px; }
.cta-card .clock { color: #fff; font-weight: 800; }
.toast { position: absolute; left: 16px; right: 16px; bottom: max(18px, env(safe-area-inset-bottom, 0px)); padding: 12px 14px; border-radius: 14px; background: var(--head); color: #fff; font-weight: 700; font-size: 14.5px; text-align: center; animation: enter .25s ease-out; z-index: 5; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition: none !important; }
}
