/* Cozy plush: bright soft palette, generous radii, no hard edges.
   Deliberately small — the village itself is canvas, not DOM. */

:root {
  --paper: #FFF8EE;
  --ink: #3E3228;
  --muted: #8A7A6A;
  --leaf: #7BC47F;
  --leaf-dark: #5EA863;
  --clay: #E8A33D;
  --berry: #D96B7B;
  --card: #FFFFFF;
  --shadow: 0 6px 0 rgba(62, 50, 40, 0.10), 0 12px 28px rgba(62, 50, 40, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }

/* An author `display` rule beats the UA stylesheet's [hidden] rule, so
   .panel/.hud (display:flex) would stay visible while marked hidden.
   Restore the attribute's meaning for every element. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-rounded, "Nunito", "Quicksand", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

body.page-centered {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, #FFEFD6 0%, transparent 60%),
    var(--paper);
}

.card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand { margin: 0; font-size: 2rem; letter-spacing: -0.02em; }
.tagline { margin: 0 0 8px; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }
.error { color: var(--berry); font-weight: 600; }

label { font-weight: 600; font-size: 0.9rem; margin-top: 8px; }

input[type="text"], input[type="email"], select, input[type="color"] {
  font: inherit;
  padding: 12px 14px;
  border: 2px solid #EFE3D3;
  border-radius: 12px;
  background: #FFFDF9;
  color: inherit;
}
input[type="color"] { padding: 4px; height: 44px; }

input:focus-visible, select:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 2px;
}

.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  padding: 13px 18px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.06s ease;
}
.btn:active { transform: translateY(2px); }

.btn-primary { background: var(--leaf); color: #14320F; box-shadow: 0 4px 0 var(--leaf-dark); }
.btn-secondary { background: #F2E7D6; color: var(--ink); box-shadow: 0 4px 0 #DBCBB4; }

/* --- app shell --- */
body.app { overflow: hidden; }
#village { position: relative; width: 100vw; height: 100vh; }
#scene { display: block; width: 100%; height: 100%; }

.panel {
  position: absolute;
  top: 24px;
  right: 24px;
  width: min(320px, calc(100vw - 48px));
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.panel h2 { margin: 0; font-size: 1.25rem; }

.hud {
  position: absolute;
  left: 24px;
  bottom: 24px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.hud [data-testid="hud-name"] { font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
