:root {
  --cream: #fff6e3;
  --paper: #fffdf7;
  --ink: #3b2414;
  --ink2: #6b4a30;
  --muted: #8a6f55;
  --yolk: #ffc93c;
  --yolk2: #ffdd73;
  --yolk-deep: #f0a000;
  --comb: #e8392b;
  --comb-soft: #ffd6cf;
  --grass: #6cbf4a;
  --grass-deep: #3f8f2a;
  --sky: #8fd3ff;
  --sky2: #cdeeff;
  --carton: #c9a574;
  --carton-deep: #a8814f;
  --radius: 18px;
  --shadow: 4px 4px 0 var(--ink);
  --display: "Lilita One", "Arial Black", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--cream); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; }
a { color: var(--comb); font-weight: 700; }
img.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.hidden { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.5px; margin: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- sticker primitives */
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.btn {
  appearance: none; cursor: pointer; font-family: var(--display); font-size: 17px; letter-spacing: 0.5px;
  color: var(--ink); background: var(--yolk); border: 3px solid var(--ink); border-radius: 14px;
  padding: 10px 18px; box-shadow: 3px 3px 0 var(--ink); transition: transform 0.06s, box-shadow 0.06s, background 0.15s;
  white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:hover { background: var(--yolk2); text-decoration: none; }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.red { background: var(--comb); color: #fff; }
.btn.red:hover { background: #ff5446; }
.btn.white { background: #fff; }
.btn.green { background: var(--grass); color: #fff; }
.btn.big { font-size: 24px; padding: 14px 26px; border-radius: 18px; box-shadow: 5px 5px 0 var(--ink); width: 100%; }
.btn.big:active { transform: translate(5px, 5px); }
.pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: 13px; }
.pill.yolk { background: var(--yolk); }
.pill.red { background: var(--comb); color: #fff; }
.pill.green { background: var(--grass); color: #fff; }
input[type=text], input[type=number], select {
  font-family: var(--body); font-weight: 700; font-size: 14px; color: var(--ink); background: #fff;
  border: 2.5px solid var(--ink); border-radius: 12px; padding: 8px 12px; width: 100%;
}
input:focus, select:focus { outline: 3px solid var(--yolk); outline-offset: 1px; }

/* ---------------------------------------------------------- top bar */
.topbar { background: var(--paper); border-bottom: 3px solid var(--ink); position: sticky; top: 0; z-index: 50; }
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 70px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo img { width: 46px; height: 46px; }
.logo span { font-family: var(--display); font-size: 26px; line-height: 1; }
.logo span b { color: var(--comb); font-weight: 400; }
.nav { display: flex; gap: 6px; margin-left: 10px; flex: 1; }
.nav a { font-family: var(--display); font-weight: 400; font-size: 17px; color: var(--ink); text-decoration: none; padding: 6px 14px; border-radius: 12px; border: 2.5px solid transparent; }
.nav a:hover { border-color: var(--ink); background: #fff; }
.nav a.active { background: var(--yolk); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.netdot { font-weight: 800; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.netdot i { width: 10px; height: 10px; border-radius: 50%; background: var(--grass); border: 2px solid var(--ink); }
.netdot.bad { color: var(--comb); cursor: pointer; }
.netdot.bad i { background: var(--comb); }

/* ---------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; border-bottom: 3px solid var(--ink); background: linear-gradient(180deg, var(--sky) 0%, var(--sky2) 62%, #eaf8ff 100%); }
.hero .wrap { position: relative; z-index: 2; padding-top: 52px; padding-bottom: 150px; text-align: center; }
.hero h1 { font-size: clamp(46px, 9vw, 104px); line-height: 0.95; color: #fff; text-shadow: 4px 4px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 0 6px 0 var(--ink); }
.hero h1 b { color: var(--yolk); font-weight: 400; }
.hero p.lead { font-size: 19px; font-weight: 700; max-width: 640px; margin: 18px auto 22px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .badge { display: inline-block; transform: rotate(-4deg); background: var(--comb); color: #fff; font-family: var(--display); font-size: 20px; border: 3px solid var(--ink); border-radius: 14px; padding: 6px 14px; box-shadow: 3px 3px 0 var(--ink); margin-bottom: 18px; }
.cloud { position: absolute; z-index: 1; width: 150px; opacity: 0.95; animation: drift linear infinite; }
@keyframes drift { from { transform: translateX(-200px); } to { transform: translateX(110vw); } }
.sun { position: absolute; right: 8%; top: 36px; width: 86px; height: 86px; border-radius: 50%; background: var(--yolk); border: 3px solid var(--ink); box-shadow: 0 0 0 10px rgba(255, 201, 60, 0.35); z-index: 1; }
.hill { position: absolute; left: -5%; right: -5%; bottom: -40px; height: 170px; background: var(--grass); border-top: 3px solid var(--ink); border-radius: 50% 50% 0 0 / 60% 60% 0 0; z-index: 1; }
.fence { position: absolute; left: 0; right: 0; bottom: 36px; height: 44px; z-index: 2;
  background:
    linear-gradient(var(--paper), var(--paper)) 0 10px / 100% 7px no-repeat,
    linear-gradient(var(--paper), var(--paper)) 0 28px / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 34px, var(--paper) 34px 44px);
  filter: drop-shadow(0 3px 0 var(--ink)); opacity: 0.95; }
.walkers { position: absolute; left: 0; right: 0; bottom: 18px; height: 96px; z-index: 3; pointer-events: none; }
.walker { position: absolute; bottom: 0; width: 84px; animation: walk linear infinite; }
.walker img { width: 84px; height: 84px; border: 3px solid var(--ink); border-radius: 14px; animation: bob 0.5s ease-in-out infinite alternate; background: #fff; }
@keyframes walk { from { left: -100px; } to { left: 105%; } }
@keyframes bob { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-8px) rotate(3deg); } }

/* ---------------------------------------------------------- sections */
section.page { display: none; }
section.page.active { display: block; }
.sect { padding: 38px 0; }
.sect-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.sect-title h2 { font-size: 36px; }
.banner { background: var(--yolk2); border: 3px solid var(--ink); border-radius: 14px; padding: 12px 16px; font-weight: 700; margin: 22px 0 0; box-shadow: 3px 3px 0 var(--ink); }
.banner.red { background: var(--comb-soft); }

/* ---------------------------------------------------------- egg carton (epochs) */
.carton { background: var(--carton); border: 3px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); padding: 16px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.03) 0 6px, transparent 6px 12px); }
.cup { background: var(--carton-deep); border: 2.5px solid var(--ink); border-radius: 50% 50% 18px 18px / 30% 30% 18px 18px; padding: 10px 6px 8px; text-align: center; position: relative; box-shadow: inset 0 6px 0 rgba(0,0,0,0.12); }
.egg { width: 58px; height: 72px; margin: 0 auto 6px; border: 3px solid var(--ink); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #fffaf0; position: relative; overflow: hidden; }
.egg .fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--yolk); transition: height 0.8s; }
.egg .lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 17px; }
.cup.done .egg { background: #fff; }
.cup.done .egg::after { content: ""; position: absolute; left: -2px; right: -2px; top: 18px; height: 14px; background: var(--carton-deep);
  clip-path: polygon(0 0, 10% 100%, 20% 0, 30% 100%, 40% 0, 50% 100%, 60% 0, 70% 100%, 80% 0, 90% 100%, 100% 0, 100% 0); }
.cup.done .egg .lbl { padding-top: 18px; font-size: 13px; }
.cup.now { background: var(--yolk-deep); }
.cup.now .egg { animation: wobble 1.2s ease-in-out infinite; }
.cup .price { font-family: var(--display); font-size: 16px; line-height: 1.1; }
.cup .sub { font-size: 11px; font-weight: 800; color: var(--ink2); }
.cup.free .price { color: var(--grass-deep); }
.cup.now .sub, .cup.now .price { color: var(--ink); }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-6deg); } 40% { transform: rotate(5deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }

/* ---------------------------------------------------------- hatchery */
.hatchery { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 24px; margin-top: 26px; align-items: start; }
.incubator { text-align: center; position: relative; }
.incubator .dome { position: relative; margin: 6px auto 16px; width: 250px; height: 250px; border-radius: 50%; border: 3px solid var(--ink);
  background: radial-gradient(circle at 50% 60%, #fff3c8 0%, #ffe39a 45%, #ffcf6a 100%); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -10px 0 rgba(0,0,0,0.08); }
.incubator.on .dome { background: radial-gradient(circle at 50% 60%, #fff6d6 0%, #ffd46b 40%, #ff9f43 100%); }
.incubator .dome img.egg-img { width: 150px; height: auto; transition: transform 0.2s; }
.incubator.on .dome img.egg-img { animation: wobble 0.9s ease-in-out infinite; }
.incubator .dome img.hen { width: 190px; height: 190px; border: 3px solid var(--ink); border-radius: 18px; animation: pop 0.5s ease-out; }
@keyframes pop { from { transform: scale(0.3) rotate(-10deg); } to { transform: scale(1) rotate(0); } }
.heat { position: absolute; bottom: 30px; left: 50%; width: 160px; margin-left: -80px; height: 40px; pointer-events: none; opacity: 0; }
.incubator.on .heat { opacity: 1; }
.heat i { position: absolute; bottom: 0; width: 6px; height: 16px; border-radius: 3px; background: rgba(232, 57, 43, 0.45); animation: rise 1.4s ease-in infinite; }
@keyframes rise { from { transform: translateY(0); opacity: 0.9; } to { transform: translateY(-120px); opacity: 0; } }
.status { font-family: var(--display); font-size: 22px; min-height: 30px; }
.status small { display: block; font-family: var(--body); font-weight: 700; font-size: 14px; color: var(--muted); }
.devices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; text-align: left; }
.dev { border: 3px solid var(--ink); border-radius: 14px; padding: 12px; background: #fff; cursor: pointer; user-select: none; position: relative; }
.dev.on { background: #e9f8df; box-shadow: 3px 3px 0 var(--grass-deep); }
.dev.na { opacity: 0.5; cursor: not-allowed; }
.dev .t { font-family: var(--display); font-size: 20px; display: flex; align-items: center; gap: 8px; }
.dev .t .chk { margin-left: auto; width: 26px; height: 26px; border: 3px solid var(--ink); border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.dev.on .t .chk { background: var(--grass); color: #fff; }
.dev .d { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.stepper { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.stepper button { width: 30px; height: 30px; border: 2.5px solid var(--ink); border-radius: 8px; background: var(--yolk); font-weight: 900; font-size: 16px; cursor: pointer; line-height: 1; }
.stepper b { min-width: 26px; text-align: center; font-size: 18px; }
.meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; text-align: left; }
.meter { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 12px; }
.meter .k { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.meter .v { font-family: var(--display); font-size: 24px; line-height: 1.15; }
.opts { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; text-align: left; }
.opts label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; cursor: pointer; }
.opts input { width: 18px; height: 18px; accent-color: var(--comb); }
.found { margin-top: 14px; background: #e9f8df; border: 3px solid var(--grass-deep); border-radius: 14px; padding: 12px; text-align: left; }
.found b { font-family: var(--display); font-size: 20px; color: var(--grass-deep); font-weight: 400; }
.found code { display: block; font-size: 11px; word-break: break-all; margin: 6px 0 10px; color: var(--ink2); }
.freebox { margin-top: 12px; font-weight: 800; }

.board { display: flex; flex-direction: column; gap: 18px; }
.signs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sign { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px; box-shadow: 3px 3px 0 var(--ink); }
.sign .k { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.sign .v { font-family: var(--display); font-size: 26px; line-height: 1.1; }
.sign .s { font-size: 12px; font-weight: 700; color: var(--muted); }
.progress { height: 16px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(45deg, var(--yolk) 0 10px, var(--yolk-deep) 10px 20px); transition: width 0.8s; }
.log { height: 330px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.msg { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; }
.msg .ic { flex: 0 0 34px; height: 34px; border: 2.5px solid var(--ink); border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 15px; overflow: hidden; }
.msg .ic img { width: 100%; height: 100%; }
.msg .bub { background: #fff; border: 2.5px solid var(--ink); border-radius: 4px 14px 14px 14px; padding: 6px 10px; min-width: 0; word-break: break-word; }
.msg .bub time { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.msg.ok .bub { background: #e9f8df; }
.msg.warn .bub { background: #fff1c2; }
.msg.err .bub { background: var(--comb-soft); }
.msg.you .bub { background: var(--yolk2); }

/* ---------------------------------------------------------- flock */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.filters label { font-size: 12px; font-weight: 800; color: var(--muted); display: flex; flex-direction: column; gap: 3px; min-width: 132px; flex: 1 1 132px; }
.seg { display: inline-flex; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; font-family: var(--display); font-size: 15px; padding: 7px 14px; cursor: pointer; color: var(--ink); }
.seg button + button { border-left: 3px solid var(--ink); }
.seg button.on { background: var(--yolk); }
.tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.tools .count { font-weight: 800; margin-left: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 16px; }
.polaroid { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 8px 8px 6px; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); transition: transform 0.12s; position: relative; }
.polaroid:nth-child(3n) { transform: rotate(0.8deg); }
.polaroid:nth-child(3n+1) { transform: rotate(-0.8deg); }
.polaroid:hover { transform: rotate(0) translateY(-3px); }
.polaroid img { width: 100%; aspect-ratio: 1; display: block; border: 2px solid var(--ink); border-radius: 8px; }
.polaroid .cap { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-family: var(--display); font-size: 16px; }
.polaroid .rk { font-family: var(--body); font-size: 11px; font-weight: 800; color: var(--muted); }
.polaroid .tag { position: absolute; top: 0; right: 10px; transform: translateY(-50%); font-size: 11px; }
.sentinel { height: 40px; }
.empty { text-align: center; padding: 50px 20px; }
.empty img { width: 120px; }

/* ---------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(59, 36, 20, 0.55); display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal .box { background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); max-width: 880px; width: 100%; max-height: calc(100vh - 36px); overflow-y: auto; position: relative; }
.modal .x { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; font-size: 20px; font-weight: 900; cursor: pointer; line-height: 1; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; padding: 24px; }
.detail img.big { width: 100%; border: 3px solid var(--ink); border-radius: 16px; }
.detail h2 { font-size: 34px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip { border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; padding: 5px 10px; }
.chip .k { font-size: 10px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.chip .v { font-weight: 800; font-size: 14px; }
.chip .p { font-size: 11px; color: var(--muted); font-weight: 700; }
.hatch { text-align: center; padding: 30px 24px; }
.hatch img { width: 260px; max-width: 80%; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--ink); animation: pop 0.5s ease-out; }
.hatch h2 { font-size: 40px; margin-top: 16px; color: var(--comb); }
.picker { padding: 24px; }
.picker .btn { width: 100%; margin-bottom: 10px; justify-content: flex-start; font-family: var(--body); font-weight: 800; }
.picker img { width: 26px; height: 26px; }

/* ---------------------------------------------------------- faq */
.faq { max-width: 860px; }
.faq details { background: #fff; border: 3px solid var(--ink); border-radius: 16px; margin-bottom: 12px; box-shadow: 3px 3px 0 var(--ink); }
.faq summary { font-family: var(--display); font-size: 21px; padding: 14px 18px; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; width: 28px; height: 28px; flex: 0 0 28px; border: 2.5px solid var(--ink); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--yolk); font-size: 18px; }
.faq details[open] summary::before { content: "−"; }
.faq details > div { padding: 0 18px 16px 56px; font-weight: 600; }
table.prices { border-collapse: collapse; width: 100%; font-weight: 700; margin-top: 6px; }
table.prices td, table.prices th { border-bottom: 2px dashed var(--carton); padding: 6px 8px; text-align: left; }
table.prices th { font-size: 12px; color: var(--muted); text-transform: uppercase; }
code { background: var(--yolk2); border: 2px solid var(--ink); border-radius: 6px; padding: 0 5px; font-size: 0.9em; word-break: break-all; }

footer { background: var(--grass); border-top: 3px solid var(--ink); color: #fff; font-weight: 800; padding: 22px 0 28px; margin-top: 30px; }
footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
footer a { color: #fff; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .hatchery { grid-template-columns: minmax(0, 1fr); }
  .carton { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .egg { width: 44px; height: 56px; }
  .cup .price { font-size: 13px; }
  .detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .topbar .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .nav { order: 3; flex: 1 1 100%; overflow-x: auto; margin-left: 0; }
  .nav a { font-size: 15px; padding: 5px 10px; }
  .logo span { font-size: 20px; }
  .logo img { width: 36px; height: 36px; }
  #connectBtn { font-size: 14px; padding: 7px 11px; box-shadow: 2px 2px 0 var(--ink); }
  .netdot { display: none; }
  #connectBtn { margin-left: auto; }
  .wrap { padding: 0 16px; }
  .hero .wrap { padding-top: 34px; padding-bottom: 130px; }
  .sun { width: 56px; height: 56px; right: 5%; }
  .carton { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; padding: 8px; border-radius: 16px; }
  .cup { padding: 6px 2px; border-radius: 40% 40% 12px 12px / 25% 25% 12px 12px; }
  .egg { width: 34px; height: 44px; border-width: 2.5px; }
  .egg .lbl { font-size: 13px; }
  .cup .price { font-size: 11px; }
  .cup .sub { font-size: 9px; }
  .signs, .meters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sign .v, .meter .v { font-size: 20px; }
  .incubator .dome { width: 210px; height: 210px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
  .sect-title h2 { font-size: 30px; }
}
