@font-face {
  font-family: 'Fredoka';
  src: url('fonts/Fredoka.ttf') format('truetype');
  font-weight: 300 700;
  font-display: swap;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f7b267; }
body { font-family: Fredoka, system-ui, sans-serif; color: #3b2412; }
canvas { display: block; width: 100vw; height: 100vh; }
body.idle, body.idle * { cursor: none; }

.start {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: rgba(60, 30, 8, 0.45);
}
.start[hidden] { display: none; }
.card {
  width: min(560px, 92vw); padding: 32px 36px; border-radius: 24px;
  background: #fff6e3; box-shadow: 0 12px 40px rgba(60, 30, 8, 0.4); text-align: center;
}
.card h1 { margin: 0 0 8px; font-size: 64px; color: #b8431f; letter-spacing: 1px; }
.lead { font-size: 20px; margin: 0 0 20px; }
.card .row { justify-content: center; margin-bottom: 18px; }
button { font: inherit; cursor: pointer; border-radius: 12px; border: 0; padding: 8px 16px; background: #f77f00; color: #fff; font-weight: 600; }
button:hover { background: #e06d00; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #3d6fb5; outline-offset: 2px; }
button.big { font-size: 26px; padding: 14px 34px; display: block; margin: 0 auto 10px; }
button.link { background: none; color: #8a4a1a; text-decoration: underline; padding: 4px 8px; font-weight: 500; }
button.link:hover { color: #5a2d0c; }
select, input[type="number"] { font: inherit; padding: 6px 8px; border-radius: 8px; border: 2px solid #e9b45c; background: #fff; }
input[type="number"] { width: 90px; }
.error { color: #b3261e; font-weight: 600; }
.small { font-size: 14px; color: #6b4a2b; }

.gear {
  position: fixed; left: 14px; bottom: 14px; width: 48px; height: 48px; padding: 0;
  font-size: 28px; line-height: 48px; border-radius: 50%;
  background: rgba(255, 246, 227, 0.75); color: #5a2d0c; transition: opacity 0.4s;
}
.gear:hover { background: #fff6e3; }
body.idle .gear { opacity: 0; }

.panel {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(360px, 90vw); overflow-y: auto;
  padding: 20px 22px; background: #fff6e3; box-shadow: 4px 0 24px rgba(60, 30, 8, 0.35);
}
.panel[hidden] { display: none; }
.panel h2 { margin: 0 0 14px; color: #b8431f; }
.panel h3 { margin: 22px 0 4px; font-size: 18px; color: #b8431f; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: block; margin: 14px 0; font-weight: 500; }
.stack input { display: block; width: 100%; margin-top: 4px; accent-color: #f77f00; }
.stack output { font-weight: 700; }
.check { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.check input { width: 20px; height: 20px; accent-color: #f77f00; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
