/* Palette, reset, page chrome. */

:root {
  --grass: #57ab4c;
  --grass-dark: #3f7d3a;
  --grass-deep: #2f5f2c;
  --dirt: #6b4a2f;
  --dirt-dark: #352315;
  --sky-top: #9fd7f5;
  --sky-bottom: #d9f0dd;

  --ink: #2b1b12;
  --ink-soft: #5b4636;
  --paper: #fffaf2;

  --accent: #e8873a;
  --accent-dark: #c96a22;
  --danger: #d94f4f;

  --radius: 16px;
  --shadow: 0 10px 30px rgba(43, 27, 18, 0.22);

  /* A mallet, so the pointer reads as a whacking tool. Hotspot sits on the head. */
  --mallet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38' height='38' viewBox='0 0 38 38'%3E%3Cg transform='rotate(-35 19 19)'%3E%3Crect x='17' y='15' width='5' height='21' rx='2.5' fill='%238b5e3c' stroke='%235e3d24' stroke-width='1.5'/%3E%3Crect x='7' y='3' width='24' height='13' rx='4' fill='%23d95757' stroke='%238f2f2f' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E")
    12 10, pointer;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
  background-attachment: fixed;
}

/* The inline sprite sheet must not take up space. */
.sprite-sheet {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(12px, 4vw, 32px);
  background: var(--grass-deep);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: clamp(1.1rem, 3.4vw, 1.6rem);
  letter-spacing: 0.5px;
}

.brand-mole {
  width: 1.6em;
  height: 1.6em;
  flex: none;
}

.repo-link {
  color: var(--paper);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.repo-link:hover,
.repo-link:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--paper);
}

.game {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2.5vh, 24px);
  padding: clamp(12px, 3vh, 28px) clamp(10px, 3vw, 24px) clamp(20px, 4vh, 40px);
}

.btn {
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--paper);
  background: var(--accent);
  border: 0;
  border-bottom: 4px solid var(--accent-dark);
  border-radius: 999px;
  padding: 12px 30px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.2s ease;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
