@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../../fonts/nunito-latin-800-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: #3a2418;
  --cream: #fffaf3;
  --moss: #2f6b4f;
  --amber: #f2c14e;
  font-family: Nunito, ui-rounded, "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #8fb56a;
  color: var(--ink);
}

button, a { font: inherit; font-weight: 800; }
button { cursor: pointer; border: none; }

button:focus-visible, a:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

#wald {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.top, .hint, .sheet, .lobby {
  position: relative;
  z-index: 1;
}

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding:
    max(10px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    0
    max(12px, env(safe-area-inset-left));
  pointer-events: none;
}

.top > * { pointer-events: auto; }

h1 {
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.94);
  font-size: 1.15rem;
}

.icon, .code {
  min-width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--moss);
  color: var(--cream);
  display: grid;
  place-items: center;
  text-decoration: none;
  box-shadow: 0 4px 0 #1e4634;
}

.code {
  padding: 0 14px;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.icon svg { width: 24px; height: 24px; fill: currentColor; }

.hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  margin: 0 auto;
  max-width: 40rem;
  padding: 12px 16px;
  border-radius: 20px;
  background: rgba(255, 250, 243, 0.94);
  font-size: 1.15rem;
  text-align: center;
}

.sheet, .lobby {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(58, 36, 24, 0.28);
}

.sheet[hidden], .lobby[hidden] { display: none; }

.paper {
  width: min(640px, 100%);
  max-height: min(86dvh, 720px);
  overflow: auto;
  padding: 22px 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.75), transparent 42%),
    linear-gradient(180deg, #fffaf3, #f3e6d4);
  box-shadow: 0 16px 40px rgba(58, 36, 24, 0.2);
  text-align: center;
}

.paper h2 { margin: 0 0 8px; font-size: 1.8rem; color: #8b5a34; }
.paper p { margin: 0 0 14px; font-size: 1.2rem; line-height: 1.35; }

.who { font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.7; }

.roles, .coats, .bees, .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}

.role, .coat, .bee, .go {
  min-height: 56px;
  border-radius: 18px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(90, 60, 40, 0.2);
  padding: 8px 14px;
}

.role[aria-checked="true"], .coat[aria-checked="true"] {
  outline: 4px solid var(--amber);
}

.go {
  background: var(--moss);
  color: var(--cream);
  min-width: 140px;
  font-size: 1.15rem;
}

.go:disabled, .bee:disabled { opacity: 0.45; }

.join { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.join input {
  width: 7em;
  min-height: 56px;
  border-radius: 18px;
  border: 3px solid #d9c3a0;
  font: inherit;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.bee { width: 92px; height: 92px; font-size: 2rem; }
.bee.now { outline: 4px solid var(--amber); }

.error { min-height: 1.3em; color: #c4521a; }
