/* FatCat configurator: the home page's cream, ink and pixel borders. One screen, one card. */
:root {
  --cream: #F3EBDD;
  --ink: #2E1A10;
  --muted: #7A6656;
  --paper: #FFFBF2;
  --ginger: #E8913F;
  --line: rgba(46, 26, 16, 0.14);
  --pixel: "Pixelify Sans", system-ui, sans-serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --px3: 0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink);
  --px2: 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink);
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--cream); color: var(--ink);
  font: 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
canvas { image-rendering: pixelated; display: block; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* sign in, just under the menu bar */
.account { position: absolute; z-index: 10; top: calc(var(--bar-h, 28px) + 10px); right: max(20px, env(safe-area-inset-right, 0px)); }
.home { font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; }
.link { border: 0; background: none; padding: 6px 0; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:hover { text-decoration-thickness: 2px; }

/* layout */
.wrap {
  min-height: 100dvh; max-width: 1080px; margin: 0 auto; padding: 64px 24px 40px;
  display: grid; grid-template-columns: 1fr 420px; gap: 56px; align-items: center;
}
.show { display: flex; flex-direction: column; align-items: center; text-align: center; }
.title { margin: 0 0 8px; font-family: var(--pixel); font-weight: 600; font-size: 88px; line-height: 0.9; }
.perch { position: relative; margin-top: 64px; }
.shadow { display: block; height: 10px; margin: -6px 18% 0; background: rgba(46, 26, 16, 0.14); }
.spec { margin: 18px 0 0; font-size: 14px; color: var(--muted); min-height: 1.45em; }
.hint { margin: 4px 0 0; font-size: 12px; color: var(--muted); opacity: 0.8; }
#cat { cursor: grab; touch-action: pan-y; }
#cat.dragging { cursor: grabbing; }
.perch.hop canvas { animation: hop 0.42s steps(6) 1; }
@keyframes hop { 30% { transform: translateY(-14px); } 60% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .perch.hop canvas { animation: none; } }

/* the speech bubble, as on the home page */
.bubble {
  position: absolute; z-index: 2; left: 50%; bottom: calc(100% - 28px);
  width: max-content; max-width: min(300px, 80vw);
  padding: 8px 12px; background: var(--paper);
  font-weight: 600; font-size: 15px; line-height: 1.3; text-align: left;
  box-shadow: var(--px3); pointer-events: none;
  opacity: 0; transform: translate(-30%, 4px);
  transition: opacity 0.12s, transform 0.12s steps(2);
}
.bubble::after {
  content: ""; position: absolute; left: 26px; bottom: -12px; width: 9px; height: 9px;
  background: var(--ink); clip-path: polygon(0 0, 100% 0, 0 100%);
}
.bubble.on { opacity: 1; transform: translate(-30%, 0); }

/* the card */
.card { background: var(--paper); box-shadow: var(--px3), 6px 9px 0 rgba(46, 26, 16, 0.14); padding: 22px 24px 24px; }
.group { padding: 14px 0; border-top: 1px solid var(--line); }
.group:first-child { padding-top: 0; border-top: 0; }
.label {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 0 9px; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.label em { font-style: normal; letter-spacing: 0; text-transform: none; font-size: 13px; color: var(--ink); font-weight: 500; }

/* segmented choices: coat, attitude, plan */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 6px 8px; border: 0; background: transparent; cursor: pointer;
  font-weight: 600; font-size: 14px; box-shadow: inset 0 0 0 1px var(--line);
}
.seg button:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.seg button.on { background: var(--ink); color: var(--paper); box-shadow: none; }
.seg button[disabled] { opacity: 0.35; cursor: default; }
.sw { width: 14px; height: 14px; flex: none; box-shadow: var(--px2); }
.on .sw { box-shadow: 0 0 0 2px var(--paper); }
.seg button .xp { font-size: 11px; font-weight: 500; opacity: 0.75; white-space: nowrap; }
.seg button { flex-wrap: wrap; column-gap: 6px; row-gap: 0; }

/* the food: monthly or yearly, then the price, big and in the text face so the digits read */
.toggle { display: inline-grid; grid-auto-flow: column; padding: 3px; box-shadow: inset 0 0 0 1px var(--line); }
.toggle button { border: 0; background: none; padding: 7px 14px; font-weight: 600; font-size: 14px; cursor: pointer; }
.toggle button em { font-style: normal; font-weight: 500; font-size: 12px; color: var(--ginger); }
.toggle button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.toggle button[aria-checked="true"] em { color: var(--ginger); }
.price { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.price b { font-size: 34px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; margin-right: 4px; font-variant-numeric: tabular-nums; }
.field.city { margin-top: 8px; }

/* add-ons: one list */
.addons { display: grid; gap: 6px; }
.addon {
  display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; align-items: center; text-align: left;
  width: 100%; min-height: 48px; padding: 8px 12px; border: 0; background: transparent; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
}
.addon:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.addon .box { width: 18px; height: 18px; box-shadow: inset 0 0 0 2px var(--ink); display: grid; place-items: center; }
.addon.on .box { background: var(--ink); }
.addon.on .box::after {
  content: ""; width: 10px; height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 4' shape-rendering='crispEdges'%3E%3Cpath fill='%23FFFBF2' d='M4 0h1v1H4zM3 1h1v1H3zM0 2h1v1H0zM2 2h1v1H2zM1 3h1v1H1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.addon b { display: block; font-weight: 600; font-size: 14px; }
.addon small { display: block; font-size: 13px; color: var(--muted); }
.addon .p { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* fields */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { position: relative; display: block; }
.field input, .field select {
  width: 100%; height: 42px; padding: 0 12px; border: 0; border-radius: 0; background: #fff;
  box-shadow: inset 0 0 0 1px var(--line); font-size: 15px;
}
.field input:focus, .field select:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--ink); }
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' shape-rendering='crispEdges'%3E%3Cpath fill='%232E1A10' d='M0 0h2v1h1v1h1v1h2V2h1V1h1V0h2v2H9v1H8v1H7v1H6v1H4V5H3V4H2V3H1V2H0z'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.wx { position: absolute; right: 12px; top: 0; height: 42px; display: flex; align-items: center; font-size: 13px; color: var(--muted); pointer-events: none; }
.results { position: absolute; z-index: 3; left: 0; right: 0; top: 46px; background: var(--paper); box-shadow: var(--px2); }
.results:empty { display: none; }
.results button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 14px; }
.results button:hover { background: var(--cream); }
.results small { color: var(--muted); }
.results p { margin: 0; padding: 9px 12px; font-size: 14px; color: var(--muted); }

/* pay */
.pay { padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.buy {
  display: flex; align-items: baseline; justify-content: center; gap: 12px; width: 100%;
  padding: 13px 18px 15px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-weight: 600; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums;
  box-shadow: var(--px3), 0 9px 0 rgba(46, 26, 16, 0.18);
  transition: transform 0.08s steps(2);
}
.buy b { color: var(--ginger); font-weight: 600; }
.buy:hover { background: var(--ginger); color: var(--ink); }
.buy:hover b { color: var(--ink); }
.buy:active { transform: translateY(3px); }
.buy[disabled] { opacity: 0.6; cursor: default; }
.fine { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.links { display: flex; justify-content: center; gap: 18px; font-size: 14px; }

/* after paying */
.done h2 { margin: 0 0 6px; font-family: var(--pixel); font-weight: 600; font-size: 30px; line-height: 1; }
.done > p { margin: 0 0 18px; color: var(--muted); }
.done .buy + .buy { margin-top: 14px; }
.done .buy.light { background: var(--paper); color: var(--ink); }
.done .buy.light:hover { background: var(--ginger); }
.proto { display: inline-block; margin-bottom: 12px; padding: 2px 8px; background: var(--ginger); font-size: 12px; font-weight: 600; }

/* modal */
.sheet { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(46, 26, 16, 0.4); }
.sheet[hidden] { display: none; }
.sheet-card { width: min(400px, 100%); background: var(--paper); box-shadow: var(--px3); padding: 22px 24px; display: grid; gap: 14px; }
.sheet-card h3 { margin: 0; font-family: var(--pixel); font-weight: 600; font-size: 26px; line-height: 1; }
.sheet-card p { margin: 0; color: var(--muted); }
.loader { height: 8px; box-shadow: inset 0 0 0 2px var(--ink); }
.loader i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 1.6s steps(12); }

/* narrow screens: cat on top, card below */
@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; gap: 20px; padding: 52px 16px 32px; max-width: 520px; align-items: start; }
  .title { font-size: 56px; }
  .perch { margin-top: 40px; }
  .spec { margin-top: 10px; }
  .card { padding: 18px 16px 20px; }
}
@media (max-width: 380px) {
  .seg button { font-size: 13px; gap: 6px; padding: 6px 4px; }
  .row2 { grid-template-columns: 1fr; }
}
#city { padding-right: 40px; }
.sheet-card .proto { justify-self: start; margin: 0; }
