:root {
  --bg-color: #1a1a2e;
  --gap: 20px;
  --min-button-width: 160px;
  --text-color: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

#fullscreen-btn {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  cursor: pointer;
  line-height: 1;
}

#button-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--min-button-width), 1fr));
  gap: var(--gap);
  padding: 0 20px 20px;
  align-content: stretch;
}

.word-button {
  border: none;
  border-radius: 24px;
  color: #fff;
  font-size: clamp(2rem, 8vw, 4.5rem);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.08s ease;
  touch-action: manipulation;
}

.word-button.pressed {
  transform: scale(0.93);
  filter: brightness(1.7) saturate(1.3);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 0 6px rgba(255, 255, 255, 0.9);
  outline: none;
}

.word-button:focus-visible {
  outline: 4px solid #ffffff;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .word-button {
    transition: none;
  }
  .word-button.pressed {
    transform: none;
  }
}
