/* The game fills its frame. One canvas draws the kitchen, jar and HUD art;
   accessible HTML controls sit on top at positions computed by the layout. */
:root {
  --wall: #fbd9c4;
  --ink: #5a2e22;
  --enamel: #fffaf1;
  --rim: #b9824f;
  --accent: #ff4f7b;
  --paper: #fff9ee;
  --font: Fredoka, ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  color-scheme: light;
}
/* Fredoka, bundled (SIL OFL 1.1; see licenses/Fredoka-OFL.txt). One variable file covers 500–700. */
@font-face {
  font-family: "Fredoka";
  src: url("fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--wall); }
body { font-family: var(--font); color: var(--ink); -webkit-tap-highlight-color: transparent; }
#app { position: fixed; inset: 0; outline: none; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
/* Aim line off: the cursor hides over the jar below the steering strip. */
#app.nopeek.low #game { cursor: none; }

.tools { position: absolute; display: grid; }
.tool, .dev-toggle {
  appearance: none; width: var(--btn, 40px); height: var(--btn, 40px); padding: 0; border-radius: 50%;
  border: 2px solid var(--rim); background: radial-gradient(circle at 35% 30%, #ffffff, var(--enamel) 60%, #f3e6d3);
  color: var(--ink); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 3px 0 rgba(140, 80, 40, 0.35), 0 6px 12px rgba(140, 70, 50, 0.18);
  transition: transform 0.08s, box-shadow 0.08s;
}
.tool svg { width: 52%; height: 52%; fill: currentColor; }
.tool[data-display-action] svg { width: 44%; height: 44%; }
.tool:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(140, 80, 40, 0.35), 0 3px 6px rgba(140, 70, 50, 0.18); }
.tool[aria-pressed="false"]:not(.display-control) { color: #a07a6a; background: #f1e3d2; }
.tool:focus-visible, .dlg-actions button:focus-visible, .dev-toggle:focus-visible, .dev-box :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.dialog-layer { position: absolute; inset: 0; background: rgba(90, 40, 30, 0.18); }
.dialog {
  position: absolute; transform: translate(-50%, -50%); width: min(300px, calc(100% - 32px));
  background: var(--paper); border: 2px solid var(--rim); border-radius: 18px; padding: 18px 20px 16px; text-align: center;
  box-shadow: 0 5px 0 rgba(140, 80, 40, 0.3), 0 18px 40px rgba(120, 50, 40, 0.25);
}
.dialog h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; text-wrap: balance; }
.dialog p { margin: 0 0 14px; font-size: 15px; color: #8a5a4a; font-variant-numeric: tabular-nums; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dlg-actions button {
  appearance: none; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--rim);
  background: var(--enamel); color: var(--ink); font: 600 16px var(--font); cursor: pointer;
}
.dlg-actions button.primary { background: var(--accent); border-color: #d93a63; color: #fff; }
.dlg-art { display: block; width: 120px; height: 120px; margin: -64px auto 2px; } /* the fruit pops up out of the card */
.dlg-art[hidden] { display: none; }
.dialog.celebrate { border-color: #7cc85a; box-shadow: 0 5px 0 rgba(60, 130, 50, 0.35), 0 0 0 6px rgba(255, 224, 120, 0.45), 0 18px 40px rgba(120, 50, 40, 0.25); }
.dialog.celebrate h2 { color: #2f7d3a; }
/* brand drafts: a = head button in the toolbar, b = signature pill on the wall */
.brand-tool { display: grid; place-items: center; }
.brand-tool img { width: 66%; height: 66%; }
.brand-sig { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 4px; border-radius: 11px;
  background: rgba(255, 250, 242, 0.75); border: 1px solid rgba(160, 110, 80, 0.25); color: #8a5a4a; font: 700 14px/1 var(--font); text-decoration: none; }
.brand-sig img { width: 26px; height: 26px; }
.brand-sig.compact { height: 28px; font-size: 12px; padding-right: 9px; gap: 5px; }
.brand-sig.compact img { width: 21px; height: 21px; }
.brand-sig:hover, .brand-sig:focus-visible { background: rgba(255, 250, 242, 0.95); }
/* the publisher signature under every dialog, matching the andkon.net header */
.dlg-sig { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 3px 9px 3px 4px; border-radius: 9px;
  color: #a07a6a; font: 700 12px/1 var(--font); text-decoration: none; opacity: 0.85; }
.dlg-sig img { width: 20px; height: 20px; }
.dlg-sig:hover, .dlg-sig:focus-visible { background: rgba(160, 110, 80, 0.12); opacity: 1; }

.toast { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(60, 30, 25, 0.88); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 24px); }

/* ---- developer box (removed when DEV = false) */
.dev-toggle { position: absolute; top: 4px; right: 4px; --btn: 26px; border-width: 1px; opacity: 0.4; box-shadow: none; }
.dev-toggle:hover, .dev-toggle[aria-expanded="true"] { opacity: 0.9; }
.dev-toggle svg { width: 60%; height: 60%; }
.auto-badge {
  position: absolute; top: 5px; right: 36px; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid #d93a63;
  background: rgba(255, 79, 123, 0.92); color: #fff; font: 600 12px var(--font); cursor: pointer; box-shadow: 0 2px 8px rgba(120, 30, 50, 0.25);
}
.dev-box {
  position: absolute; top: 34px; right: 6px; width: 250px; max-height: calc(100% - 44px); overflow: auto; overscroll-behavior: contain;
  background: rgba(35, 28, 30, 0.92); color: #f4ece6; border-radius: 10px; padding: 10px 12px; font: 500 12.5px var(--font);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); touch-action: pan-y; user-select: text;
}
.dev-box h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: #ffb3c6; }
.dev-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.dev-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0; }
.dev-group span { width: 100%; color: #c9b8b0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.dev-hint { width: 100%; margin: 0 0 4px; color: #c9b8b0; font-size: 11px; }
.dev-box button, .dev-box select { font: 500 12px var(--font); border-radius: 6px; border: 1px solid #6b5a5a; background: #3d3236; color: #f4ece6; padding: 4px 8px; cursor: pointer; }
.dev-box pre { margin: 8px 0 0; font: 11px/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; color: #d9cfc9; }

/* Fruit lab (lab.html) */
.lab-panel {
  position: absolute; top: 6px; left: 6px; width: 290px; background: rgba(35, 28, 30, 0.92); color: #f4ece6; border-radius: 10px;
  padding: 10px 12px; font: 500 12.5px var(--font); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); z-index: 5;
}
.lab-panel h2, .lab-board h2 { margin: 0 0 6px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: #ffb3c6; }
.lab-panel p { margin: 0 0 8px; color: #d9cfc9; font-size: 12px; line-height: 1.4; }
.lab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.lab-panel button, .lab-board button { font: 500 12px var(--font); border-radius: 6px; border: 1px solid #6b5a5a; background: #3d3236; color: #f4ece6; padding: 5px 9px; cursor: pointer; }
.lab-panel :focus-visible, .lab-board :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lab-board {
  position: absolute; inset: 12px; z-index: 6; overflow: auto; overscroll-behavior: contain; background: #fbf3ea; border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); padding: 0 0 12px;
}
.lab-board[hidden] { display: none; }
.lab-board-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: rgba(53, 42, 45, 0.95); }
.lab-board canvas { display: block; margin: 0 auto; }
