:root {
  --ink: #4a3040;
  --ink-soft: #7a5f6c;
  --wood-ink: #5c3a28;
  --wood-light: #f2cf98;
  --accent: #8a5cc9;
  --sky: #bfe4f6;
  --pixel: "Pixelify Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--sky); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
[hidden] { display: none !important; }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; z-index: 0; }

.title {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 18px 44px;
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 28px 40px;
  align-content: start;
}

/* ---- logo */
.logo { grid-column: 1 / -1; text-align: center; }
.logo h1 {
  margin: 0;
  color: #fffaf2;
  font: 700 clamp(44px, 7vw, 76px)/1 var(--pixel);
  letter-spacing: .02em;
  text-shadow: 0 4px 0 #8a5cc9, 4px 0 0 #8a5cc9, -4px 0 0 #8a5cc9, 0 -4px 0 #8a5cc9, 0 8px 0 rgba(74, 48, 64, .25);
}
.logo p { margin: 12px 0 0; color: var(--ink); font: 600 17px var(--pixel); text-shadow: 0 2px 0 rgba(255, 255, 255, .6); }

/* ---- floating signs: the button floats, the plank inside grows on hover, so both can move at once */
.signs { display: flex; flex-direction: column; align-items: center; gap: 26px; padding-top: 12px; }
.sign {
  appearance: none;
  position: relative;
  width: 240px;
  aspect-ratio: 2 / 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: float 3.4s ease-in-out infinite;
}
.sign:nth-child(2) { animation-delay: -0.9s; }
.sign:nth-child(3) { animation-delay: -1.8s; }
.sign:nth-child(4) { animation-delay: -2.6s; }
.sign::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -18px;
  height: 8px;
  border-radius: 50%;
  background: rgba(74, 48, 64, .18);
  animation: shadow 3.4s ease-in-out infinite;
  animation-delay: inherit;
}
.plank {
  display: flex;             /* a row, so the ✦ of the selected sign sits next to the word */
  align-items: center;
  justify-content: center;
  gap: .25em;
  width: 100%;
  height: 100%;
  padding: 6% 8% 2%;
  background: url("ui/sign.png") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  color: var(--wood-ink);
  font: 700 27px var(--pixel);
  text-shadow: 0 2px 0 var(--wood-light);
  white-space: nowrap;
  transition: transform .15s ease, filter .15s ease;
}
.sign:hover .plank, .sign:focus-visible .plank { transform: scale(1.07) rotate(-1deg); filter: brightness(1.06) drop-shadow(0 0 8px rgba(255, 246, 200, .9)); }
.sign:focus-visible { outline: none; }
.sign:focus-visible .plank { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 6px var(--accent)); }
.sign[aria-pressed="true"] .plank { transform: scale(1.04); filter: brightness(1.08) drop-shadow(0 0 10px rgba(255, 240, 160, .95)); }
.sign[aria-pressed="true"] .plank::before { content: "✦ "; color: var(--accent); }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1.4deg); }
  50% { transform: translateY(-9px) rotate(1.4deg); }
}
@keyframes shadow {
  0%, 100% { transform: scaleX(1); opacity: 1; }
  50% { transform: scaleX(.8); opacity: .6; }
}

/* ---- the big board */
.board {
  position: relative;
  min-height: 440px;
  padding: 26px 32px 30px;
  border: 15px solid transparent;
  border-image: url("ui/frame.png") 5 fill / 15px / 0 round;
  image-rendering: pixelated;
  box-shadow: 0 10px 0 rgba(74, 48, 64, .12);
}
.page { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; animation: open .25s ease-out; }
.page h2 { margin: 4px 0 0; color: var(--wood-ink); font: 700 32px var(--pixel); }
.page p { margin: 0; max-width: 560px; color: var(--ink); }
@keyframes open { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

#showcase { width: min(100%, 640px); height: auto; image-rendering: pixelated; border-radius: 4px; }
#views { width: 384px; max-width: 100%; height: auto; image-rendering: pixelated; margin: 4px 0; }

.button {
  display: inline-block;
  margin-top: 12px;
  padding: 11px 22px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: 700 18px var(--pixel);
  text-decoration: none;
  box-shadow: 0 4px 0 #5f3c97;
}
.button:hover { filter: brightness(1.08); }
.button:active { transform: translateY(2px); box-shadow: 0 2px 0 #5f3c97; }

.rules { margin: 6px 0 0; padding-left: 1.4em; max-width: 560px; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.rules b { color: var(--wood-ink); font-family: var(--pixel); font-weight: 600; }

.toggle { display: flex; align-items: center; gap: 10px; width: min(100%, 420px); padding: 10px 14px; border-radius: 8px; background: rgba(217, 160, 102, .16); font: 600 16px var(--pixel); text-align: left; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.toggle.off { opacity: .55; cursor: default; }
.toggle small { color: var(--ink-soft); font-weight: 400; }

/* ---- still mode: from the settings, or when the system asks for less motion */
body.still .sign, body.still .sign::after, body.still .page { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .sign, .sign::after, .page { animation: none; }
}

@media (max-width: 800px) {
  .title { grid-template-columns: 1fr; gap: 18px; padding: 20px 14px 32px; }
  .signs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; padding-top: 0; }
  .sign { width: 100%; max-width: 190px; justify-self: center; }
  .plank { font-size: 21px; }
  .board { min-height: 0; padding: 18px 16px 22px; }
}
