/* SOWFIELD shared structure for play.html. Themes set the variables and the personality. */
:root {
  --bg: #f4efe3; --ink: #1f2a1c; --muted: #6b6b5a; --card: #fffaf0; --line: #d9cfb8; --accent: #2f6b3a; --accent-ink: #fff;
  --good: #2f8a4a; --warn: #c27a12; --bad: #b8402f; --radius: 14px; --font: system-ui, sans-serif; --display: var(--font);
  --r0: #9a9a8a; --r1: #4f9a5a; --r2: #3a78c8; --r3: #8b4fc8; --r4: #e0a020; --r5: #e0457a;
  --soil: #7a5534; --soil2: #6a4a2c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
button { font: inherit; cursor: pointer; }
.sf-app { min-height: 100vh; display: flex; flex-direction: column; }
.sf-top { display: flex; align-items: center; gap: 18px; padding: 12px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 20; background: var(--bg); }
.sf-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 22px; font-weight: 700; }
.sf-brand svg { width: 34px; height: 34px; }
.sf-nav { display: flex; gap: 4px; }
.sf-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.sf-nav a.on, .sf-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sf-clock { display: flex; gap: 8px; align-items: baseline; margin-left: auto; font-size: 14px; }
.sf-clock span { font-variant-numeric: tabular-nums; }
.sf-clock em { color: var(--muted); font-style: normal; font-size: 12px; }
.sf-speed { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.sf-speed button { border: 0; background: transparent; color: var(--muted); padding: 4px 10px; font-size: 12px; font-weight: 700; }
.sf-speed button.on { background: var(--accent); color: var(--accent-ink); }
.sf-wallet { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip svg { width: 16px; height: 16px; }
.addr { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); }
.sf-demo { text-align: center; font-size: 12px; padding: 6px 12px; background: color-mix(in srgb, var(--warn) 16%, var(--bg)); color: var(--ink); }
.sf-demo button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 6px; font-size: 11px; padding: 2px 8px; margin-left: 8px; }
.sf-main { display: grid; grid-template-columns: minmax(340px, 560px) minmax(360px, 1fr); gap: 22px; padding: 22px; align-items: start; max-width: 1400px; width: 100%; margin: 0 auto; }
@media (max-width: 980px) { .sf-main { grid-template-columns: 1fr; } .sf-clock { margin-left: 0; } }
.sf-farm-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.sf-farm-head h2 { margin: 0; font-family: var(--display); }
.sf-farm-head span { color: var(--muted); font-size: 13px; }
.sf-plot { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px; border-radius: calc(var(--radius) + 6px); background: var(--soil2); }
.slot { position: relative; aspect-ratio: 1; border: 0; border-radius: var(--radius); background: var(--soil); padding: 0; overflow: hidden; color: #fff; display: grid; place-items: center; transition: transform .12s; }
.slot:hover { transform: translateY(-2px); }
.slot > svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; }
.slot.empty i { position: relative; font-style: normal; font-size: 22px; opacity: .35; }
.slot.empty.can { outline: 2px dashed var(--accent-ink); outline-offset: -5px; }
.slot.empty.can i { opacity: .9; }
.slot.growing.can { outline: 2px solid var(--warn); outline-offset: -3px; }
.slot .art { position: relative; width: 78%; height: 78%; display: grid; place-items: center; }
.slot .art svg { width: 100%; height: 100%; }
.slot .bar { position: absolute; left: 8%; right: 8%; bottom: 7%; height: 5px; border-radius: 3px; background: rgba(0,0,0,.35); overflow: hidden; }
.slot .bar span { display: block; height: 100%; background: var(--accent-ink); }
.slot .left { position: absolute; top: 5%; left: 7%; font-size: 10px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.slot .ready { position: absolute; bottom: 5%; font-size: 10px; font-weight: 800; background: var(--accent); color: var(--accent-ink); padding: 1px 6px; border-radius: 999px; }
.slot.ripe { box-shadow: 0 0 0 2px var(--accent) inset; animation: bob 1.6s ease-in-out infinite; }
.slot .boosts { position: absolute; top: 3%; right: 8%; color: #ffe27a; font-size: 14px; letter-spacing: -2px; }
.slot .petmark { position: absolute; top: 4%; right: 8%; width: 14px; height: 14px; opacity: .9; }
.slot .boosts + .petmark { right: 30%; }
.slot .petmark svg { width: 14px; height: 14px; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.sf-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.sf-tools .sel { font-size: 13px; color: var(--muted); flex-basis: 100%; }
.sf-tools .sel a { color: var(--bad); cursor: pointer; text-decoration: underline; }
.btn { border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); padding: 9px 14px; font-weight: 700; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost.on { box-shadow: inset 0 0 0 2px var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn.big { padding: 13px 22px; font-size: 16px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.sf-panel { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); overflow: hidden; }
.sf-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.sf-tabs button { position: relative; border: 0; background: transparent; padding: 12px 14px; font-weight: 700; font-size: 13px; color: var(--muted); white-space: nowrap; }
.sf-tabs button.on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.sf-tabs .dot { position: absolute; top: 8px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.sf-tabs .n { font-style: normal; margin-left: 5px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 6px; font-size: 11px; }
.sf-body { padding: 18px 20px 24px; max-height: calc(100vh - 170px); overflow-y: auto; }
.sf-body h3 { margin: 0 0 6px; font-family: var(--display); font-size: 22px; }
.sf-body h4 { margin: 18px 0 8px; font-family: var(--display); }
.card h4 { margin: 0 0 4px; }
.muted { color: var(--muted); } .tiny { font-size: 12px; line-height: 1.45; } .big { font-size: 22px; font-weight: 800; margin: 4px 0; font-variant-numeric: tabular-nums; }
.up { color: var(--good); } .down { color: var(--bad); } b.warn, .warn { color: var(--warn); }
.grid { display: grid; gap: 10px; } .grid.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } .grid.packs { grid-template-columns: 1fr; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--bg); display: flex; gap: 12px; align-items: flex-start; }
.card.route { flex-direction: column; gap: 4px; }
.card.route > svg { width: 40px; height: 40px; }
.card.hl { margin-top: 14px; background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.card > svg { width: 72px; height: 72px; flex: none; }
.card.land > svg { width: 96px; height: 96px; border-radius: 10px; }
.card p { margin: 2px 0; }
.pack-art svg { width: 64px; height: 76px; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.pill.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 10px 0; }
.stats div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.stats b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11px; color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 6px 10px; text-align: left; color: var(--ink); }
.item svg { width: 36px; height: 36px; flex: none; }
.item span { flex: 1; font-weight: 700; font-size: 14px; }
.item small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.item.on { box-shadow: 0 0 0 2px var(--accent); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.tbl th, .tbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.r0.rdot, .rdot.r0 { background: var(--r0); } .rdot.r1 { background: var(--r1); } .rdot.r2 { background: var(--r2); } .rdot.r3 { background: var(--r3); } .rdot.r4 { background: var(--r4); } .rdot.r5 { background: var(--r5); }
.rdot.l0 { background: var(--r0); } .rdot.l1 { background: var(--r2); } .rdot.l2 { background: var(--r3); } .rdot.l3 { background: var(--r4); } .rdot.l4 { background: var(--r5); }
.item.r2 { border-left: 4px solid var(--r2); } .item.r3 { border-left: 4px solid var(--r3); } .item.r4 { border-left: 4px solid var(--r4); } .item.r5 { border-left: 4px solid var(--r5); }
.meter { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; margin: 6px 0; }
.meter span { display: block; height: 100%; background: var(--accent); }
.rules { font-size: 13px; padding-left: 18px; color: var(--muted); }
.flow { font-size: 13px; padding-left: 20px; line-height: 1.6; }
.log { list-style: none; padding: 0; margin: 0; font-size: 12px; }
.log li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.log span { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 80px; margin: 6px 0 10px; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); width: 100%; }
input { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }
.card:has(input) { flex-direction: column; }
.sf-toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 60; }
.sf-toast { background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; transition: opacity .4s, transform .4s; }
.sf-toast.bad { background: var(--bad); color: #fff; } .sf-toast.out { opacity: 0; transform: translateY(8px); }
.sf-connect { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); }
.sf-connect-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 30px; max-width: 420px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.2); }
.sf-connect-card svg { width: 140px; height: 140px; }
.sf-connect-card h3 { font-family: var(--display); font-size: 26px; margin: 8px 0; }
.sf-reveal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(0,0,0,.55); animation: fadein .25s; }
.sf-reveal-card { background: var(--card); border-radius: 22px; padding: 26px 30px; text-align: center; min-width: 300px; animation: pop .35s cubic-bezier(.2,1.6,.4,1); border: 3px solid var(--r0); }
.sf-reveal.r1 .sf-reveal-card { border-color: var(--r1); } .sf-reveal.r2 .sf-reveal-card { border-color: var(--r2); } .sf-reveal.r3 .sf-reveal-card { border-color: var(--r3); } .sf-reveal.r4 .sf-reveal-card { border-color: var(--r4); box-shadow: 0 0 60px var(--r4); } .sf-reveal.r5 .sf-reveal-card { border-color: var(--r5); box-shadow: 0 0 80px var(--r5); }
.sf-reveal-card .art svg { width: 150px; height: 150px; }
.sf-reveal-card .rar { font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; margin: 0; }
.sf-reveal-card h3 { margin: 4px 0; font-family: var(--display); font-size: 26px; }
.sf-reveal-card .row { justify-content: center; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes fadein { from { opacity: 0; } }

/* pixel isometric farm */
.sf-plot.iso { display: block; position: relative; padding: 0; background: none; box-shadow: none; border: 0; }
.sf-plot.iso::before { display: none; }
canvas.isofarm { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }
.iso-tip { position: absolute; display: none; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.35; padding: 6px 9px; border-radius: 4px; white-space: nowrap; z-index: 5; box-shadow: 3px 3px 0 rgba(0,0,0,.35); }
svg[shape-rendering="crispEdges"] { image-rendering: pixelated; }
.sf-app .sf-plot.iso { padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; }
.sf-app .sf-plot.iso::before { display: none; }
canvas.isofarm { border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); border-radius: var(--radius); background: var(--soil2); }
@media (max-width: 760px) { .sf-top { position: static; gap: 10px; padding: 10px 14px; } .sf-brand { font-size: 20px; } }
